Matrix.LU Method

TMtx LU(TMtx Dst, TVecInt P, TMtxType MtxType)

General LU, Cholesky or Bunch-Kaufmann factorization.

#NameTypeDescription
1DstTMtxsource TMtx
2PTVecIntsource TVecInt
3MtxTypeTMtxType

Result: stored in self (calling object), returns self for chaining

Remarks:

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. The P parameter stores the row permutations in the IValues. 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 Dew.Math.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 Dew.Math.Matrix.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 : Dew.Math.Matrix.LowerTriangle or Dew.Math.Matrix.UpperTriangle method.
  • mtGeneral, mtBandGeneral : general m x n matrix LU factorization.

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

Examples
Matrix LU;
Matrix A;
TVec P;
A.SetIt(3,2,false,[1,2,
3,4]);
A.LU(LU,P);
See Also: Matrix.LUSolve