Class Matrix::LUPDecomposition
In: lib/backports/1.9.2/stdlib/matrix/lup_decomposition.rb
Parent: Object

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 m-by-m permutation matrix P so that L*U = P*A. If m < n, then L is m-by-m and U is m-by-n.

The LUP 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 singular? returns true.

Methods

det   determinant   l   new   p   singular?   solve   to_a   to_ary   u  

Included Modules

Matrix::ConversionHelper

Attributes

pivots  [R]  Returns the pivoting indices

Public Class methods

Public Instance methods

Returns the determinant of A, calculated efficiently from the factorization.

determinant()

Alias for det

Returns the permutation matrix P

Returns true if U, and hence A, is singular.

Returns m so that A*m = b, or equivalently so that L*U*m = P*b b can be a Matrix or a Vector

to_a()

Alias for to_ary

Returns L, U, P in an array

Returns the upper triangular factor U

[Validate]