Package software.bluelib.utils.math
Class MatrixUtils
java.lang.Object
software.bluelib.utils.math.MatrixUtils
A
class providing utility methods for matrix operations.
Key Methods:
multiplyMatrices(double[][], double[][])- Performs matrix multiplication on two matrices.transposeMatrix(double[][])- Computes the transpose of a matrix.calculate2x2MatrixDeterminant(double[][])- Calculates the determinant of a 2x2 matrix.invert2x2Matrix(double[][])- Calculates the inverse of a 2x2 matrix.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic doublecalculate2x2MatrixDeterminant(double[][] pMatrix) ADouble[][]that calculates the determinant of a 2x2 matrix.static double[][]invert2x2Matrix(double[][] pMatrix) ADouble[][]that calculates the inverse of a 2x2 matrix.static double[][]multiplyMatrices(double[][] pMatrixA, double[][] pMatrixB) ADouble[][]that performs matrix multiplication on two matrices.static double[][]transposeMatrix(double[][] pMatrix) ADouble[][]that computes the transpose of a matrix.
-
Method Details
-
multiplyMatrices
public static double[][] multiplyMatrices(double[][] pMatrixA, double[][] pMatrixB) ADouble[][]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) ADouble[][]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) ADouble[][]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) ADouble[][]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
-