Dew MtxVec NET
TMtx.DetectMtxType Method
Summary
Determines type of the matrix.

Class
TMtx

Declaration
Function DetectMtxType(CheckPosDef: boolean = False): TMtxType;

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

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.

Example 1

var X,B: TVec; A: TMtx; at: TMtxType; begin CreateIt(X,B); CreateIt(A); try 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 finally FreeIt(B,X); FreeIt(A); end; end;

Copyright 2008 Dew Research
http://www.dewresearch.com