MFsym_sqrt MDsym_sqrt MEsym_sqrt
FunctionSquare root of a symmetric, positive definite matrix
Syntax C/C++#include <MFstd.h>
int MFsym_sqrt( fMatrix MB, fMatrix MA, ui len );
C++ MatObj#include <OptiVec.h>
void matrix<T>::sqrt( const matrix<T>& MA );
Pascal/Delphiuses MFstd;
function MFsym_sqrt( MB, MA:fMatrix; len:UIntSize ):IntBool;
DescriptionThe square-root of a symmetric, positive definite matrix is calculated, so that MB * MB = MA is satisfied. Please note that non-symmetric matrices or matrices which are not positive definite may or may not have existing square-roots, too. The present algorithm, however, is restricted to the most simple case where a square-root always exists. It uses eigenvalues and eigenvectors and fails whenever a negative eigenvalue is encountered, indicating an input matrix which is not positive definite. In the latter case, an error message is displayed and the result is calculated with zero substituted for the negative eigenvalue. This result may still be useful, namely if the negative eigenvalue is very small.

A return value of FALSE or 0 indicates success, whereas a non-zero return value indicates that the input matrix did not meet the condition of being symmetric and positive definite.

Return valueFALSE (0), if the matrix square-root could be calculated; otherwise TRUE (1)
See alsoMF_eigenvalues,   chapter 11

MatrixLib Table of Contents  OptiVec home