MF_det MD_det ME_det
MCF_det MCD_det MCE_det
Functiondeterminant of a square matrix
Syntax C/C++#include <MFstd.h>
float MF_det( fMatrix MA, ui len );
float MFb_det( fMatrix MA, ui len, fVector Buf );
fComplex MCF_det( cfMatrix MA, ui len );
fComplex MCFb_det( cfMatrix MA, ui len, cfVector Buf );
ui MFb_det_sizeBuf( ui len );
float MFsym_det( fMatrix MA, ui len );
C++ MatObj#include <OptiVec.h>
T matrix<T>::det();
T matrix<T>::b_det( vector<T>& Buf );
complex<T> matrix<complex<T>>::det();
complex<T> matrix<complex<T>>::b_det( vector<complex<T>>& Buf );
ui matrix<T>::b_det_sizeBuf( const ui len );
T matrix<T>::sym_det();
Pascal/Delphiuses MFstd;
function MF_det( MA:fMatrix; len:UIntSize ):Single;
function MFb_det( MA:fMatrix; len:UIntSize; Buf:fVector ):Single;
function MCF_det( MA:cfMatrix; len:UIntSize ):fComplex;
function MCFb_det( MA:cfMatrix; len:UIntSize; Buf:cfVector ):fComplex;
function MFb_det_sizeBuf( len:UIntSize ):UIntSize;
function MFsym_det( MA:fMatrix; len:UIntSize ):Single;
DescriptionThe determinant of MA is calculated. For large matrices, this is done via LU decomposition. For small matrices, individual formulae are applied. For the special case of symmetric matrices, MFsym_det provides a roughly two times faster way.

MF_det needs buffer memory. The "normal" versions (prefixes MF_, MCF_ etc.) allocate it themselves, whereas the version with the prefixes MFb_, MCFb_ etc. take a vector Buf as an additional argument. The required size of Buf can be obtained by calling MFb_det_sizeBuf() etc., whereby the size is given as the number of elements of Buf in the respective data type (rather than in bytes).

As noted above, the determinant of a symmetric matrix can potentially be obtained faster by MFsym_det. The syntax is the same as for MF_det. Internally, this function first attempts Cholesky decomposition. Only if that fails (i.e. the input matrix is not positive-definite), the way via LUD is used.

Return valuedeterminant of the matrix
See alsoMF_LUdecompose,   MF_CholeskyLdecompose,   MF_solve,   chapter 10

MatrixLib Table of Contents  OptiVec home