- MatrixInfo
- IsSymmetric
- IsHermitian
- IsUpperTriangular
- IsLowerTriangular
- IsUpperTrapezoidal
- IsLowerTrapezoidal
- IsUpperHessenberg
- IsLowerHessenberg
- IsTridiagonal
- IsUpperBidiagonal
- IsLowerBidiagonal
- IsDiagonal
- IsScalar
MatrixInfo
The method analyzes the matrix contents, determines its structural type (symmetric, Hermitian, triangular, banded, and so on), and fills the MqlMatrixInfo structure.
bool matrix::MatrixInfo(
|
Parameters
info
[out] An object of the MqlMatrixInfo type where matrix information is placed.
Return Value
Returns true if the matrix is initialized and has a nonzero size. Otherwise, false is returned.
Note
The MqlMatrixInfo structure object contains more information than individual matrix classification methods can provide (IsSymmetric, IsHermitian, IsUpperTriangular, and so on).
struct MqlMatrixInfo
|
Information from the MqlMatrixInfo structure is used when writing a matrix to a file (the Write method will be added later) and when reading a matrix from a file.
An enumeration containing the type of the recognized matrix.
ID |
Description |
|---|---|
BLASTYPE_GE |
'GE': general matrix |
BLASTYPE_BD |
'BD': bidiagonal matrix |
BLASTYPE_DI |
'DI': diagonal matrix |
BLASTYPE_GB |
'GB': general band matrix |
BLASTYPE_GT |
'GT': general tridiagonal matrix |
BLASTYPE_HB |
'HB': Hermitian band matrix |
BLASTYPE_HE |
'HE': Hermitian matrix |
BLASTYPE_HT |
'HT': Hermitian tridiagonal matrix |
BLASTYPE_HS |
'HS': Hessenberg matrix |
BLASTYPE_SB |
'SB': symmetric band matrix |
BLASTYPE_ST |
'ST': symmetric tridiagonal matrix |
BLASTYPE_SY |
'SY': symmetric matrix |
BLASTYPE_TB |
'TB': triangular band matrix |
BLASTYPE_TR |
'TR': triangular matrix |
BLASTYPE_TZ |
'TZ': trapezoidal matrix |
BLASTYPE_VE |
'VE': vector (not used yet) |
The enumeration item names correspond to the abbreviations used in LAPACK to denote various matrix classes. The HT type is an exception: Hermitian tridiagonal. HT is not present in standard LAPACK terminology and is introduced by analogy with ST (symmetric tridiagonal) to denote a Hermitian tridiagonal matrix, which also allows the corresponding matrix to be stored compactly.
Flags that refine the recognized matrix type.
ID |
Value |
Description |
|---|---|---|
MATRIX_UPPER |
0x0001 |
upper part above main diagonal |
MATRIX_LOWER |
0x0002 |
lower part below main diagonal |
MATRIX_UNITDIAG |
0x0004 |
main diagonal contains ones (1) only |
MATRIX_DIAGSCALAR |
0x0008 |
main diagonal contains the same values |
MATRIX_QUASI_TRIANGULAR |
0x0010 |
possible quasi-triangular matrix |
MATRIX_TRIANGLE_RIGHT_ALIGNED |
0x0020 |
upper triangular part aligned to right bound of wide matrix |
MATRIX_TRIANGLE_BOTTOM_ALIGNED |
0x0040 |
lower triangular part aligned to bottom bound of tall matrix |
The listed flags (except MATRIX_QUASI_TRIANGULAR) allow matrices to be stored more compactly.
Example
ulong n=10;
|