LU class

For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n unit lower triangular matrix L, an n-by-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-by-m and U is m-by-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.

References

  1. "Jama". https://math.nist.gov/javanumerics/jama/. Retrieved 2019-07-17.
  2. "LU Decomposition in Python and NumPy". https://www.quantstart.com/articles/LU-Decomposition-in-Python-and-NumPy. Retrieved 2019-07-18.

Examples

var lu = LU(Array2d([
  Array([4.0, 2.0, 1.0]),
  Array([16.0, 4.0, 1.0]),
   Array([64.0, 8.0, 1.0])
]));
var l = lu.L();
print(l);
var u = lu.U();
print(u);

Constructors

LU(Array2d A)
LU Decomposition Structure to access L, U and piv.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

det() double
Determinant return det(A) exception FormatException Matrix must be square
doublePivot() Array
Return pivot permutation vector as a one-dimensional double array return (double) piv
isNonsingular() bool
Is the matrix nonsingular? return true if U, and hence A, is nonsingular.
L() Array2d
Return lower triangular factor return L
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pivot() Array
Return pivot permutation vector return piv
solve(Array2d B) Array2d
Solve A*X = B
toString() String
A string representation of this object.
inherited
U() Array2d
Return upper triangular factor return U

Operators

operator ==(Object other) bool
The equality operator.
inherited