org.spaceroots.mantissa.linalg
Class SquareMatrix
- java.lang.Object
-
- org.spaceroots.mantissa.linalg.Matrix
-
- org.spaceroots.mantissa.linalg.SquareMatrix
-
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- DiagonalMatrix, GeneralSquareMatrix, LowerTriangularMatrix, UpperTriangularMatrix
public abstract class SquareMatrix extends Matrix
This class factor all services common to square matrices of linear algebra.This class is the base class of all square matrix implementations. It extends the
Matrixclass with methods specific to square matrices.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract doublegetDeterminant(double epsilon)Get the determinant of the matrix.SquareMatrixgetInverse(double epsilon)Invert the instance.abstract Matrixsolve(Matrix b, double epsilon)Solve the A.X = B equation.SquareMatrixsolve(SquareMatrix b, double epsilon)Solve the A.X = B equation.-
Methods inherited from class org.spaceroots.mantissa.linalg.Matrix
add, duplicate, getColumns, getElement, getRows, getTranspose, mul, mul, selfMul, setElement, sub, toString
-
-
-
-
Method Detail
-
getDeterminant
public abstract double getDeterminant(double epsilon)
Get the determinant of the matrix.- Parameters:
epsilon- threshold on matrix elements below which the matrix is considered singular (this is used by the derived classes that use a factorization to compute the determinant)- Returns:
- the determinant of the matrix
-
getInverse
public SquareMatrix getInverse(double epsilon) throws SingularMatrixException
Invert the instance.- Parameters:
epsilon- threshold on matrix elements below which the matrix is considered singular- Returns:
- the inverse matrix of the instance
- Throws:
SingularMatrixException- if the matrix is singular
-
solve
public abstract Matrix solve(Matrix b, double epsilon) throws SingularMatrixException
Solve the A.X = B equation.- Parameters:
b- second term of the equationepsilon- threshold on matrix elements below which the matrix is considered singular- Returns:
- a matrix X such that A.X = B, where A is the instance
- Throws:
SingularMatrixException- if the matrix is singular
-
solve
public SquareMatrix solve(SquareMatrix b, double epsilon) throws SingularMatrixException
Solve the A.X = B equation.- Parameters:
b- second term of the equationepsilon- threshold on matrix elements below which the matrix is considered singular- Returns:
- a matrix X such that A.X = B, where A is the instance
- Throws:
SingularMatrixException- if the matrix is singular
-
-
DataMelt 3.0 © DataMelt by jWork.ORG