enum

LA::MatrixFlags

Inherits Enum / Comparable / Value / Object

MatrixFlags represent properties of matrix (symmetric, positive definite etc) They are used to automatically select faster algorithms from LAPACK. Flags are partially enforced by runtime checks, with the possibility of user override. Examples:

a.detect(MatrixFlags::Symmetric) # will perform a check and if matrix is symmetric, corresponding flag will be set
a.detect # perform check for all flags
a.assume!(MatrixFlags::Symmetric) # we know that matrix is symmetric, so we use `assume!` to set flag without check
a.transpose # will return clone of matrix, as for symmetrix matrices `a == a.transpose`
Simple operations correctly update flags:
(a + Mat.diag(*a.size)).flags.symmetric # => True
But direct access reset flags
a[1,1] = 1
a.flags.symmetric? # => False

Note that simple flag access doesn't perform check, so a.flags.symmetric? can be false for symmetric matrix, unless you called detect before.

Constants

Symmetric = 1

This flag shows that matrix is symmetric (equal to its transpose)

Hermitian = 2

This flag shows that matrix is hermitian (equal to its conjtranspose))

PositiveDefinite = 4

This flag shows that matrix is positive definite

Orthogonal = 8

This flag shows that matrix is orthogonal (its columns and rows are orthonormal vectors)

UpperTriangular = 16

This flag shows that matrix is upper triangular (all the entries below the main diagonal are zero)

LowerTriangular = 32

This flag shows that matrix is lower triangular (all the entries above the main diagonal are zero)

Triangular = 48

Combination of UpperTriangular | LowerTriangular for internal use

None = 0
All = 63

Instance methods

diagonal?

returns true if matrix is diagonal (both UpperTriangular and LowerTriangular)

Source
hermitian?

Returns true if this enum value contains Hermitian

Source
lower_triangular?

Returns true if this enum value contains LowerTriangular

Source
none?
Source
orthogonal?

Returns true if this enum value contains Orthogonal

Source
positive_definite?

Returns true if this enum value contains PositiveDefinite

Source
symmetric?

Returns true if this enum value contains Symmetric

Source
triangular?

returns true if matrix is either UpperTriangular or LowerTriangular

Source
upper_triangular?

Returns true if this enum value contains UpperTriangular

Source