Class Matrices
java.lang.Object
org.apache.commons.geometry.euclidean.internal.Matrices
-
Method Summary
Modifier and TypeMethodDescriptionstatic doublecheckDeterminantForInverse(double det) Check that the given determinant is valid for use in calculating a matrix inverse.static doublecheckElementForInverse(double element) Check that the given matrix element is valid for use in calculation of a matrix inverse, throwing anIllegalStateExceptionif not.static doubledeterminant(double a00, double a01, double a10, double a11) Compute the determinant of the 2x2 matrix represented by the given values.static doubledeterminant(double a00, double a01, double a02, double a10, double a11, double a12, double a20, double a21, double a22) Compute the determinant of the 3x3 matrix represented by the given values.
-
Method Details
-
determinant
Compute the determinant of the 2x2 matrix represented by the given values. The values are listed in row-major order.- Parameters:
a00- matrix entrya0,0a01- matrix entrya0,1a10- matrix entrya1,0a11- matrix entrya1,1- Returns:
- computed 2x2 matrix determinant
-
determinant
public static double determinant(double a00, double a01, double a02, double a10, double a11, double a12, double a20, double a21, double a22) Compute the determinant of the 3x3 matrix represented by the given values. The values are listed in row-major order.- Parameters:
a00- matrix entrya0,0a01- matrix entrya0,1a02- matrix entrya0,2a10- matrix entrya1,0a11- matrix entrya1,1a12- matrix entrya1,2a20- matrix entrya2,0a21- matrix entrya2,1a22- matrix entrya2,2- Returns:
- computed 3x3 matrix determinant
-
checkDeterminantForInverse
Check that the given determinant is valid for use in calculating a matrix inverse. AnIllegalStateExceptionis thrown if the determinant is NaN, infinite, or zero.- Parameters:
det- the determinant to check- Returns:
- the checked determinant
- Throws:
IllegalStateException- if the matrix determinant value is NaN, infinite, or zero
-
checkElementForInverse
Check that the given matrix element is valid for use in calculation of a matrix inverse, throwing anIllegalStateExceptionif not.- Parameters:
element- matrix entry to check- Returns:
- the checked element
- Throws:
IllegalStateException- if the element is not valid for use in calculating a matrix inverse, ie if it is NaN or infinite.
-