MF_SVsolve MD_SVsolve ME_SVsolve
Functionsolve a system of linear equations, given its Singular Value decomposed form
Syntax C/C++#include <MFstd.h>
void MF_SVsolve( fVector X, fMatrix MU, fMatrix MV, fVector W, fVector B, ui htA, ui lenA );
void MF_SVsolvewEdit( fVector X, fMatrix MU, fMatrix MV, fVector W, fVector B, ui htA, ui lenA, float thresh );
C++ MatObj#include <OptiVec.h>
void vector<T>::SVsolve( const matrix<T>& MU, const matrix<T>& MV, const vector<T>& W, const vector<T>& B );
void vector<T>::SVsolvewEdit( const matrix<T>& MU, const matrix<T>& MV, const vector<T>& W, const vector<T>& B, T thresh );
Pascal/Delphiuses MFstd;
procedure MF_SVsolve( X:fVector; MU, MV:fMatrix; W, B:fVector; htA, lenA:UIntSize );
procedure MF_SVsolvewEdit( X:fVector; MU, MV:fMatrix; W, B:fVector; htA, lenA:UIntSize; thresh:Single );
DescriptionMF_SVsolve solves an SV-decomposed set of linear equations; sometimes this process is also called Singular Value Backsubstitution. In this function, at first W is edited such that elements smaller than a threshold are set to zero. Then, in the backsubstitution process, which involves divisions by the elements of W, any divisions by Wi = 0 are replaced by setting the result to 0.

You can change the default editing threshold by calling MF_SVDsetEdit. If you prefer to inspect and edit W yourself before calling MF_SVsolve, you can call MF_SVDsetEdit with the argument 0.0, thereby switching off the automatic SV editing. As MF_SVDsetEdit is not thread-safe, this function should not be used to set different editing thresholds for different calls to MF_SVsolve etc. Rather than repeatedly changing the default value then, use the "wEdit" variant of MF_SVsolve etc., namely MF_SVsolvewEdit, MF_solveBySVDwEdit and MF_safeSolvewEdit.

The parameters htA and lenA refer to the original matrix MA as fed into MF_SVdecompose. The actual dimensions of the vectors and matrices entered into MF_SVsolve are:
sizeB = htA;
sizeX = htU = max( lenA, htA );
sizeW = lenU = htV = lenV = lenA;

See alsoMF_SVdecompose,   MF_solveBySVD,   chapter 10

MatrixLib Table of Contents  OptiVec home