You are here: Symbol Reference > MtxVec Namespace > Classes > TMtx Class > public > TMtx.LU Method
MtxVec VCL
ContentsIndex
PreviousUpNext
TMtx.LU Method

LU, Cholesky or Bunch-Kaufmann factorization.

Pascal
function LU(const Dst: TMtx; const P: TVecInt; MtxType: TMtxType = mtGeneral): TMtx;

Performs a general LU, Cholesky or Bunch-Kaufmann factorization on the calling matrix and stores the results in lower triangular matrix L and upper triangular matrix U. The MtxType parameter defines which optimized method will be used to calculate the LU factorization. Depending on the type of the calling matrix the LU method will use specific optimized algorithm to perform the factorization. If you don't know the TMtxType of the calling matrix, you can omit the MtxType parameter (the default value mtGeneral will be used) or determine the type of matrix with the DetectMtxType method. The following methods can be used to calculate the LU factorization:

  • Matrix type is mtSymmPosDef, mtHermPosDef, mtBandSymmPosDef, mtBandHermPosDef : Cholesky factorization.
  • mtSymmetric : Bunch-Kaufmann factorization.
  • mtHermitian : Bunch-Kaufmann factorization (only for complex calling matrix).
  • mtTriangle : or UpperTriangle method.
  • mtGeneral, mtBandGeneral : general m x n matrix LU factorization.

An exception will be raised if the calling matrix Quadratic property is not true and matrix storage format is not banded.

var LU,A: TMtx; P: TVecInt; begin CreateIt(LU,A); CreateIt(P); try A.SetIt(3,2,False,[1,2, 3,4]); A.LU(LU,P); finally FreeIt(LU,A); FreeIt(P); end; end;
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!