LUsolve
|
LUsolve(a, b)
or LUsolve(a, b, which=which)
or a_inverse= LUsolve(a)
returns the solution x of the matrix equation:
A(,+)*x(+) = B
If A is an n-by-n matrix then B must have length n, and the returned
x will also have length n.
B may have additional dimensions, in which case the returned x
will have the same additional dimensions. The WHICH dimension of B,
and of the returned x is the one of length n which participates
in the matrix solve. By default, WHICH=1, so that the equations
being solved are:
A(,+)*x(+,..) = B
Non-positive WHICH counts from the final dimension (as for the
sort and transpose functions), so that WHICH=0 solves:
x(..,+)*A(,+) = B
Other examples:
A_ij X_jklm = B_iklm (WHICH=1)
A_ij X_kjlm = B_kilm (WHICH=2)
A_ij X_klmj = B_klmi (WHICH=4 or WHICH=0)
If the B argument is omitted, the inverse of A is returned:
A(,+)*x(+,) and A(,+)*x(,+) will be unit matrices.
LUsolve works by LU decomposition using Gaussian elimination with
pivoting. It is the fastest way to solve square matrices. QRsolve
handles non-square matrices, as does SVsolve. SVsolve is slowest,
but can deal with highly singular matrices sensibly.
interpreted function, defined at i0/matrix.i line 106
|