source files: xmth.[ch]
(XMTH-LUDCMP :MATRIX <float-array>)
This function performs Lower/Upper DeCoMPosition on a square float matrix. This is the standard first step to solving a set of linear equations. The return value will be NIL if the given matrix was pathologically singular (unsolvable). (The algorithm appears able to produce usable solutions for some sorts of singular matrices, and to return non-NIL in those cases.)
The usual next step is to call
xmth-lubksb on the
decomposed matrix to produce actual solution vectors
by back-substitution. See section XMTH-LUBKSB.
Note that calling
xmth-ludcmp overwrites the original
value of the matrix with the decomposition: Save the original
matrix in a separate array if you can't afford to lose it.
Note also that
xmth-ludcmp also produces a permutation
vector which is invisibly handed to
xmth-lubksb as a
necessary part of the solution process. I've made this invisible
as a convenience, but if simultaneous backsubstitution using
several different decomposed matrices is required, this will
backfire. If this happens, someone should add an optional
:permutation-vector argument to both calls to allow
explicitly specifying storage for this vector.
xmthtest.lsp for an extended example of using
These documentation pages don't really belong in this section. Perhaps both they and the code should be moved into the xg.3d module with the other array operations.
The operations should probably be recast as messages to arrays, rather than as functions. This would be a simple change.
Would be better if the names were more self-explanatory: the current names are more in the numerical analysis tradition than the lisp tradition.
These functions currently only work on single-precision float arrays. Prolly should support double at some point.