cern.colt.matrix.tdouble.algo.decomposition
Class SparseDoubleLUDecomposition
- java.lang.Object
-
- cern.colt.matrix.tdouble.algo.decomposition.SparseDoubleLUDecomposition
-
public class SparseDoubleLUDecomposition extends java.lang.ObjectFor a square matrix A, the LU decomposition is an unit lower triangular matrix L, an upper triangular matrix U, and a permutation vector piv so that A(piv,:) = L*UThe LU decomposition with pivoting always exists, even if the matrix is singular. The primary use of the LU decomposition is in the solution of square systems of simultaneous linear equations. This will fail if isNonsingular() returns false.
-
-
Constructor Summary
Constructors Constructor and Description SparseDoubleLUDecomposition(DoubleMatrix2D A, int order, boolean checkIfSingular)Constructs and returns a new LU Decomposition object; The decomposed matrices can be retrieved via instance methods of the returned decomposition object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubledet()Returns the determinant, det(A).DoubleMatrix2DgetL()Returns the lower triangular factor, L.int[]getPivot()Returns a copy of the pivot permutation vector.Dcs_common.DcssgetSymbolicAnalysis()Returns a copy of the symbolic LU analysis objectDoubleMatrix2DgetU()Returns the upper triangular factor, U.booleanisNonsingular()Returns whether the matrix is nonsingular (has an inverse).voidsolve(DoubleMatrix1D b)Solves A*x = b(in-place).
-
-
-
Constructor Detail
-
SparseDoubleLUDecomposition
public SparseDoubleLUDecomposition(DoubleMatrix2D A, int order, boolean checkIfSingular)
Constructs and returns a new LU Decomposition object; The decomposed matrices can be retrieved via instance methods of the returned decomposition object.- Parameters:
A- Square matrixorder- ordering option (0 to 3); 0: natural ordering, 1: amd(A+A'), 2: amd(S'*S), 3: amd(A'*A)checkIfSingular- if true, then the singularity test (based on Dulmage-Mendelsohn decomposition) is performed.- Throws:
java.lang.IllegalArgumentException- if A is not square or is not sparse.java.lang.IllegalArgumentException- if order is not in [0,3]
-
-
Method Detail
-
det
public double det()
Returns the determinant, det(A).
-
getL
public DoubleMatrix2D getL()
Returns the lower triangular factor, L.- Returns:
- L
-
getPivot
public int[] getPivot()
Returns a copy of the pivot permutation vector.- Returns:
- piv
-
getU
public DoubleMatrix2D getU()
Returns the upper triangular factor, U.- Returns:
- U
-
getSymbolicAnalysis
public Dcs_common.Dcss getSymbolicAnalysis()
Returns a copy of the symbolic LU analysis object- Returns:
- symbolic LU analysis
-
isNonsingular
public boolean isNonsingular()
Returns whether the matrix is nonsingular (has an inverse).- Returns:
- true if U, and hence A, is nonsingular; false otherwise.
-
solve
public void solve(DoubleMatrix1D b)
Solves A*x = b(in-place). Upon return b is overridden with the result x.- Parameters:
b- A vector with of size A.rows();- Throws:
java.lang.IllegalArgumentException- if b.size() != A.rows() or if A is singular.
-
-
DMelt 3.0 © DataMelt by jWork.ORG