org.apache.ignite.ml.math.primitives.matrix

Class LUDecomposition

• All Implemented Interfaces:
AutoCloseable

public class LUDecomposition
extends Object
implements AutoCloseable
Calculates the LU-decomposition of a square matrix.

This class is inspired by class from Apache Common Math with similar name.

MathWorld, Wikipedia

TODO: IGNITE-11192, remove after resolve this issue.

• Constructor Detail

• LUDecomposition

public LUDecomposition(Matrix matrix)
Calculates the LU-decomposition of the given matrix. This constructor uses 1e-11 as default value for the singularity threshold.
Parameters:
matrix - Matrix to decompose.
Throws:
CardinalityException - if matrix is not square.
• LUDecomposition

public LUDecomposition(Matrix matrix,
double singularityThreshold)
Calculates the LUP-decomposition of the given matrix.
Parameters:
matrix - Matrix to decompose.
singularityThreshold - threshold (based on partial row norm).
Throws:
CardinalityException - if matrix is not square.
• Method Detail

• close

public void close()
Destroys decomposition components and other internal components of decomposition.
Specified by:
close in interface AutoCloseable
• getL

public Matrix getL()
Returns the matrix L of the decomposition.

L is a lower-triangular matrix

Returns:
the L matrix (or null if decomposed matrix is singular).
• getU

public Matrix getU()
Returns the matrix U of the decomposition.

U is an upper-triangular matrix

Returns:
the U matrix (or null if decomposed matrix is singular).
• getP

public Matrix getP()
Returns the P rows permutation matrix.

P is a sparse matrix with exactly one element set to 1.0 in each row and each column, all other elements being set to 0.0.

The positions of the 1 elements are given by the pivot permutation vector.

Returns:
the P rows permutation matrix (or null if decomposed matrix is singular).
getPivot()
• getPivot

public Vector getPivot()
Returns the pivot permutation vector.
Returns:
the pivot permutation vector.
getP()
• determinant

public double determinant()
Return the determinant of the matrix.
Returns:
determinant of the matrix.
• solve

public Vector solve(Vector b)
Parameters:
b - Vector to solve using this decomposition.
Returns:
Solution vector.
• solve

public Matrix solve(Matrix b)
Parameters:
b - Matrix to solve using this decomposition.
Returns:
Solution matrix.

 Ignite Database and Caching Platform :   ver. 2.8.0 Release Date :   February 27 2020