C4 Engine Terathon Software C4 Engine API Documentation

• Math Library

API Links
Developer Links

Math::LURefineSolution

Defined in:  C4Computation.h
Refines the numerical solution to a linear system previously calculated by LU decomposition.
Prototype

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

Parameters
n The size of the coefficient matrix M.
m A pointer to the n2 entries of the coefficient matrx M, stored in column-major order.
d A pointer to the entries of the LU decomposition of M. 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 was originally solved.
x A pointer to the array containing the n solutions representing the vector x. These solutions are refined in place by this function.
Description
The LURefineSolution function improves the numerical solution x to the linear system Mx = r. This solution must have been previously calculated using the Math::LUDecompose and Math::LUBacksubstitute functions.
See Also

Math::LUDecompose

Math::LUBacksubstitute