Math::MatrixDecomposition::LU - LU decomposition
Object-oriented interface.
use Math::MatrixDecomposition::LU; $LU = Math::MatrixDecomposition::LU->new; $LU->decompose ($A = [...]); $LU->solve ($b = [...]); # Decomposition is the default action for 'new'. # This one-liner is equivalent to the command sequence above. Math::MatrixDecomposition::LU->new ($A = [...])->solve ($b = [...]);
The procedural form is even shorter.
use Math::MatrixDecomposition qw(lu); lu ($A = [...])->solve ($b = [...]);
lu
(...)The lu
function is the short form of Math::MatrixDecomposition::LU->new
(which see). The lu
function has to be used as a subroutine. It is not exported by default.
new
(...)Create a new object. Any arguments are forwarded to the decompose
method (which see). The new
constructor can be used as a class or instance method.
decompose
(a, m, n, ...)Perform a LU decomposition with partial pivoting of a real matrix.
capture
flagWhether or not to decompose the matrix a in-place. Default is false.
Return value is the LU object.
solve
(b, x)Solve a system of linear equations 'A X = B'.
The LU object represents the coefficients of the left-hand side of the system, that is the matrix 'A'.
Return value is the solution x.
det
Return the value of the determinant.
Math::MatrixDecomposition
Ralph Schleicher <ralph@cpan.org>