Package org.jblas
Class Decompose
- java.lang.Object
-
- org.jblas.Decompose
-
public class Decompose extends java.lang.ObjectMatrix which collects all kinds of decompositions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDecompose.LUDecomposition<T>Class to hold an LU decomposition result.static classDecompose.QRDecomposition<T>Class to represent a QR decomposition.
-
Constructor Summary
Constructors Constructor Description Decompose()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DoubleMatrixcholesky(DoubleMatrix A)Compute Cholesky decomposition of Astatic FloatMatrixcholesky(FloatMatrix A)if (info ) Compute Cholesky decomposition of Aprivate static voidclearLower(DoubleMatrix A)private static voidclearLower(FloatMatrix A)private static voiddecomposeLowerUpper(DoubleMatrix A, DoubleMatrix L, DoubleMatrix U)private static voiddecomposeLowerUpper(FloatMatrix A, FloatMatrix L, FloatMatrix U)static Decompose.LUDecomposition<DoubleMatrix>lu(DoubleMatrix A)Compute LU Decomposition of a general matrix.static Decompose.LUDecomposition<FloatMatrix>lu(FloatMatrix A)Compute LU Decomposition of a general matrix.static Decompose.QRDecomposition<DoubleMatrix>qr(DoubleMatrix A)QR decomposition.static Decompose.QRDecomposition<FloatMatrix>qr(FloatMatrix A)QR decomposition.
-
-
-
Method Detail
-
lu
public static Decompose.LUDecomposition<DoubleMatrix> lu(DoubleMatrix A)
Compute LU Decomposition of a general matrix. Computes the LU decomposition using GETRF. Returns three matrices L, U, P, where L is lower diagonal, U is upper diagonal, and P is a permutation matrix such that A = P * L * U.- Parameters:
A- general matrix- Returns:
- An LUDecomposition object.
-
decomposeLowerUpper
private static void decomposeLowerUpper(DoubleMatrix A, DoubleMatrix L, DoubleMatrix U)
-
cholesky
public static FloatMatrix cholesky(FloatMatrix A)
if (info ) Compute Cholesky decomposition of A- Parameters:
A- symmetric, positive definite matrix (only upper half is used)- Returns:
- upper triangular matrix U such that A = U' * U
-
clearLower
private static void clearLower(FloatMatrix A)
-
lu
public static Decompose.LUDecomposition<FloatMatrix> lu(FloatMatrix A)
Compute LU Decomposition of a general matrix. Computes the LU decomposition using GETRF. Returns three matrices L, U, P, where L is lower diagonal, U is upper diagonal, and P is a permutation matrix such that A = P * L * U.- Parameters:
A- general matrix- Returns:
- An LUDecomposition object.
-
decomposeLowerUpper
private static void decomposeLowerUpper(FloatMatrix A, FloatMatrix L, FloatMatrix U)
-
cholesky
public static DoubleMatrix cholesky(DoubleMatrix A)
Compute Cholesky decomposition of A- Parameters:
A- symmetric, positive definite matrix (only upper half is used)- Returns:
- upper triangular matrix U such that A = U' * U
-
clearLower
private static void clearLower(DoubleMatrix A)
-
qr
public static Decompose.QRDecomposition<DoubleMatrix> qr(DoubleMatrix A)
QR decomposition. Decomposes (m,n) matrix A into a (m,m) matrix Q and an (m,n) matrix R such that Q is orthogonal, R is upper triangular and Q * R = A Note that if A has more rows than columns, then the lower rows of R will contain only zeros, such that the corresponding later columns of Q do not enter the computation at all. For some reason, LAPACK does not properly normalize those columns.- Parameters:
A- matrix- Returns:
- QR decomposition
-
qr
public static Decompose.QRDecomposition<FloatMatrix> qr(FloatMatrix A)
QR decomposition. Decomposes (m,n) matrix A into a (m,m) matrix Q and an (m,n) matrix R such that Q is orthogonal, R is upper triangular and Q * R = A- Parameters:
A- matrix- Returns:
- QR decomposition
-
-