C4 Engine Terathon Software C4 Engine API Documentation

• Math Library

API Links
Developer Links

Math::LUBacksubstitute

Defined in:  C4Computation.h
Uses an LU-decomposed matrix to solve a linear system.
Prototype

void LUBacksubstitute(int32 n, const float *d, const unsigned_int16 *index, const float *r, float *x);

Parameters
n The size of the LU-decomposed matrix.
d A pointer to the entries of the LU-decomposed matrix. This should be the same pointer that was previously passed to the m parameter of the Math::LUDecompose function.
index A pointer to the array of row permutation indexes returned by the Math::LUDecompose function.
r A pointer to an array of n constant values representing the vector r for which the linear system Mx = r is to be solved.
x A pointer to the array in which the n solutions representing the vector x are to be returned. This may not be the same pointer passed as the r parameter.
Description
The LUBacksubstitute function is used in conjunction with the Math::LUDecompose function to solve a linear system of n equations Mx = r. The Math::LUDecompose function is called once to calculate the LU decomposition of the coefficient matrix M, and the results are passed to the LUBacksubstitute function any number of times with different constant vectors r to solve multiple linear systems.
See Also

Math::LUDecompose

Math::LURefineSolution