Contents
Main
Site map
Links
Site and author
News
Contact

Determinant

LU decomposition has many applications, for example, the determinant calculation. If the square matrix A is represented as A = PLU, we can easily calculate the determinant of matrix A, since det L = 1, det P = +1 or det P = -1 (depending on the permutation), and the determinant of matrix U is equal to the product of its diagonal elements.

The subroutine RMatrixLUDet calculates the determinant of a matrix whose LU decomposition has already been performed. The output of LUDecomposition subroutine is used as the input: matrices L and U in compact form and the permutation matrix. The subroutine returns the determinant of the matrix. It is recommended to use this subroutine if you have already performed the LU decomposition and want to use it to calculate the matrix determinant.

The subroutine RMatrixDet calculates the determinant of a matrix whose LU-decomposition hasn't been performed yet. The subroutine uses matrix A as the input, and returns the determinant. All operations regarding LU decomposition are hidden in the subroutine.

Manual entries

C++ det.h   
C# det.cs   
MPFR det.h   
Delphi det.pas   
FreePascal det.pas   
VBA det.bas   

This article is intended for personal use only.

Download ALGLIB

C#

C# source.

alglib-2.4.0.csharp.zip

 

C++

C++ source.

alglib-2.4.0.cpp.zip

 

C++, multiple precision arithmetic

C++ source. MPFR/GMP is used.

GMP source is available from gmplib.org. MPFR source is available from www.mpfr.org.

alglib-2.4.0.mpfr.zip

 

FreePascal

FreePascal source.

alglib-2.4.0.freepascal.zip

 

Delphi

Delphi source.

alglib-2.4.0.delphi.zip

 

Visual Basic

VBA source.

alglib-2.4.0.vb6.zip

 


 
 
Sergey Bochkanov, Vladimir Bystritsky
Copyright © 1999-2010