You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > Matrix Structure > Matrix Methods > Matrix.DetectMtxType Method
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
Matrix.DetectMtxType Method

Determines type of the matrix.

Syntax
C#
Visual Basic
public TMtxType DetectMtxType(bool CheckPosDef);

Tests the calling matrix and returns the TMtxType of the calling of matrix. The following types are supported: 

 

  • mtSymmPosDef = symmetric positive definite matrix
  • mtSymmetric = symmetric matrix
  • mtHermPosDef = Hermitian positive definite matrix
  • mtHermitian = Hermitian matrix
  • mtTriangle = triangular matrix, with unit or non unit main diagonal
  • mtGeneral = general matrix (none of the above)

 

Checking for positive definite matrix can be very expensive (O(n) = 1/3*n^3). Therefore the ChekPosDef parameter is False by default, unless the user specifies otherwise. The method will not detect banded matrix storage.

var X,B: Vector; A: Matrix; at: TMtxType; begin B.SetIt(false,[0,2]); A.SetIt(2,2,false,[1,2, 2,4]); // 2x2 real matrix at := A.DetectMtxType; A.LUSolve(B,X,at); // This is the same for this example (except slower) A.LUSolve(B,X,mtSymmetric); // You could also specify A.AutoMtxType := True A.LUSolve(B,X); // the type is autodetected end;
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!