MF_solveBySVD MD_solveBySVD ME_solveBySVD
Functionsolve a possibly over- or underdetermined linear system by singular value decomposition
Syntax C/C++#include <MFstd.h>
int MF_solveBySVD( fVector X, fMatrix MA, fVector B, ui htA, ui lenA );
int MF_solveBySVDwEdit( fVector X, fMatrix MA, fVector B, ui htA, ui lenA, float thresh );
C++ MatObj#include <OptiVec.h>
void vector<T>::solveBySVD( const matrix<T>& MA, const vector<T>& B );
void vector<T>::solveBySVDwEdit( const matrix<T>& MA, const vector<T>& B, T thresh );
Pascal/Delphiuses MFstd;
function MF_solveBySVD( X:fVector; MA:fMatrix; B:fVector; htA, lenA:UIntSize ): IntBool;
function MF_solveBySVDwEdit( X:fVector; MA:fMatrix; B:fVector; htA, lenA:UIntSize; thresh:Single ): IntBool;
DescriptionThe system MA * X = B of simultaneous linear equations is solved for X, using Singular Value Decomposition. Here, under-determined systems do not lead to an error. Rather, you get one particular solution out of the solution space. If you have more equations than unknowns, i.e., in the case of an overdetermined system, the solution vector contains a least-square "compromise" between the equations.

The function should always return FALSE (0). Only in the very rare case of SVD failure, TRUE (1) is returned. The length of the desired solution vector, sizX must be equal to the width of the input matrix, lenA, whereas the length of the right-hand-side vector, sizB must be equal to htA.

The default threshold for singular-value editing may be changed by calling MF_SVDsetEdit. As MF_SVDsetEdit is not thread-safe, this function should not be used to set different editing thresholds for different calls to MF_solveBySVD etc. Rather than repeatedly changing the default value, use the "wEdit" variant of MF_solveBySVD etc., namely MF_solveBySVDwEdit, MF_SVsolvewEdit and MF_safeSolvewEdit.

Return valueusually FALSE (0); only in the very rare case of failure, TRUE (1)
See alsoMF_SVdecompose,   MF_solve,   chapter 10

MatrixLib Table of Contents  OptiVec home