LU decomposition has many applications, for example, the determinant calculation. If the complex square matrix *A* is represented as *PA = LU*, 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 **CMatrixLU** calculates the determinant of a complex matrix, whose LU decomposition has already been performed. The output of the subroutine CMatrixLU is given at 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 **CMatrixDet** calculates the determinant of a complex matrix whose LU decomposition hasn't been performed yet. The subroutine gets matrix *A* as an input, and returns the determinant. All operations regarding LU decomposition are hidden in the subroutine.

*This article is licensed for personal use only.*

ALGLIB Project offers you two editions of ALGLIB:

**ALGLIB Free Edition**:

delivered for free

offers full set of numerical functionality

extensive algorithmic optimizations

no low level optimizations

non-commercial license

**ALGLIB Commercial Edition**:

flexible pricing

offers full set of numerical functionality

extensive algorithmic optimizations

high performance (SMP, SIMD)

commercial license with support plan

Links to download sections for Free and Commercial editions can be found below:

C++ library.

Delivered with sources.

Monolithic design.

Extreme portability.

Delivered with sources.

Monolithic design.

Extreme portability.

C# library with native kernels.

Delivered with sources.

VB.NET and IronPython wrappers.

Extreme portability.

Delivered with sources.

VB.NET and IronPython wrappers.

Extreme portability.

Delphi wrapper around C core.

Delivered as precompiled binary.

Compatible with FreePascal.

Delivered as precompiled binary.

Compatible with FreePascal.

CPython wrapper around C core.

Delivered as precompiled binary.

Delivered as precompiled binary.