Class MatrixUtils

java.lang.Object
software.bluelib.utils.math.MatrixUtils

public class MatrixUtils extends Object
A class providing utility methods for matrix operations.

Key Methods:

Since:
1.0.0
  • Method Details

    • multiplyMatrices

      public static double[][] multiplyMatrices(double[][] pMatrixA, double[][] pMatrixB)
      A Double[][] that performs matrix multiplication on two matrices.
      Parameters:
      pMatrixA - Double[][] - The first matrix to be multiplied.
      pMatrixB - Double[][] - The second matrix to be multiplied.
      Returns:
      The product of the two matrices.
      Throws:
      IllegalArgumentException - if the number of columns in the first matrix does not match the number of rows in the second matrix.
      Since:
      1.0.0
    • transposeMatrix

      public static double[][] transposeMatrix(double[][] pMatrix)
      A Double[][] that computes the transpose of a matrix.
      Parameters:
      pMatrix - Double[][] - The matrix to be transposed.
      Returns:
      The transposed matrix.
      Since:
      1.0.0
    • calculate2x2MatrixDeterminant

      public static double calculate2x2MatrixDeterminant(double[][] pMatrix)
      A Double[][] that calculates the determinant of a 2x2 matrix.
      Parameters:
      pMatrix - Double[][] - The 2x2 matrix.
      Returns:
      The determinant of the matrix.
      Throws:
      IllegalArgumentException - if the matrix is not 2x2.
      Since:
      1.0.0
    • invert2x2Matrix

      public static double[][] invert2x2Matrix(double[][] pMatrix)
      A Double[][] that calculates the inverse of a 2x2 matrix.
      Parameters:
      pMatrix - Double[][] - The 2x2 matrix.
      Returns:
      The inverse of the matrix.
      Throws:
      IllegalArgumentException - if the matrix is not invertible or not 2x2.
      Since:
      1.0.0