cern.colt.matrix.tfloat.algo.decomposition
Class DenseFloatLUDecomposition
- java.lang.Object
-
- cern.colt.matrix.tfloat.algo.decomposition.DenseFloatLUDecomposition
-
- All Implemented Interfaces:
- java.io.Serializable
public class DenseFloatLUDecomposition extends java.lang.Object implements java.io.SerializableFor an m x n matrix A with m >= n, the LU decomposition is an m x n unit lower triangular matrix L, an n x n upper triangular matrix U, and a permutation vector piv of length m so that A(piv,:) = L*U; If m < n, then L is m x m and U is m x n.The LU decomposition with pivoting always exists, even if the matrix is singular, so the constructor will never fail. 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.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DenseFloatLUDecomposition(FloatMatrix2D A)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 floatdet()Returns the determinant, det(A).FloatMatrix2DgetL()Returns the lower triangular factor, L.int[]getPivot()Returns a copy of the pivot permutation vector.FloatMatrix2DgetU()Returns the upper triangular factor, U.booleanisNonsingular()Returns whether the matrix is nonsingular (has an inverse).FloatMatrix1Dsolve(FloatMatrix1D b)Solves A*x = b.FloatMatrix2Dsolve(FloatMatrix2D B)Solves A*X = B.java.lang.StringtoString()Returns a String with (propertyName, propertyValue) pairs.
-
-
-
Constructor Detail
-
DenseFloatLUDecomposition
public DenseFloatLUDecomposition(FloatMatrix2D A)
Constructs and returns a new LU Decomposition object; The decomposed matrices can be retrieved via instance methods of the returned decomposition object.- Parameters:
A- Rectangular matrix
-
-
Method Detail
-
det
public float det()
Returns the determinant, det(A).- Throws:
java.lang.IllegalArgumentException- Matrix must be square
-
getL
public FloatMatrix2D 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 FloatMatrix2D getU()
Returns the upper triangular factor, U.- Returns:
- U
-
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 FloatMatrix2D solve(FloatMatrix2D B)
Solves A*X = B.- Parameters:
B- A matrix with as many rows as A and any number of columns.- Returns:
- X so that L*U*X = B(piv).
- Throws:
java.lang.IllegalArgumentException- if B.rows() != A.rows().java.lang.IllegalArgumentException- if A is singular, that is, if !this.isNonsingular().java.lang.IllegalArgumentException- if A.rows() < A.columns().
-
solve
public FloatMatrix1D solve(FloatMatrix1D b)
Solves A*x = b.- Parameters:
b- A vector of size A.rows()- Returns:
- x so that L*U*x = b(piv).
- Throws:
java.lang.IllegalArgumentException- if b.size() != A.rows().java.lang.IllegalArgumentException- if A is singular, that is, if !this.isNonsingular().java.lang.IllegalArgumentException- if A.rows() < A.columns().
-
toString
public java.lang.String toString()
Returns a String with (propertyName, propertyValue) pairs. Useful for debugging or to quickly get the rough picture. For example,rank : 3 trace : 0- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG