IsMatrixShape - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


Student[NumericalAnalysis]

  

IsMatrixShape

  

Check whether a matrix is a certain shape or not

 

Calling Sequence

Parameters

Description

Notes

Examples

Calling Sequence

IsMatrixShape(A, shape)

Parameters

A

-

Matrix

shape

-

name; must be one of diagonal, strictlydiagonallydominant, diagonallydominant, hermitian, positivedefinite, symmetric, triangular[upper], triangular[lower], or tridiagonal

Description

• 

The IsMatrixShape command verifies whether the matrix A is a certain "shape".

• 

The only types of "shapes" that the IsMatrixShape command can verify are:

– 

Diagonal : shape = diagonal

– 

Strictly diagonally dominant : shape = strictlydiagonallydominant

– 

Diagonally dominant : shape = diagonallydominant

– 

Hermitian : shape = hermitian

– 

Positive definite : shape = positivedefinite

– 

Symmetric : shape = symmetric

– 

Upper or lower triangular : shape = triangular[upper] or shape = triangular[lower], respectively

– 

Tridiagonal : shape = tridiagonal

Notes

• 

If neither upper nor lower is specified, the triangular option defaults to triangular[upper].

• 

The Student[NumericalAnalysis] subpackage's definition of positive definiteness is as follows.

– 

A complex n-by-n matrix A is positive definite if and only if A is Hermitian and for all n-dimensional complex vectors v, we have 0<ℜ⁡vH·A·v, where ℜ denotes the real part of a complex number.

– 

A real n-by-n matrix A is positive definite if and only if A is symmetric and for all n-dimensional real vectors v, we have 0<vT·A·v.

• 

To check another "shape" that is not available with the Student[NumericalAnalysis][IsMatrixShape] command see the general IsMatrixShape command.

Examples

> 

with⁡StudentNumericalAnalysis&colon;

> 

A≔Matrix⁡2&comma;−1&comma;0&comma;0&comma;−1&comma;2&comma;−1&comma;0&comma;0&comma;−1&comma;2&comma;−1&comma;0&comma;0&comma;−1&comma;2

A≔2−100−12−100−12−100−12

(1)
> 

B≔Matrix⁡−1&comma;0&comma;0&comma;0&comma;−1&comma;2&comma;0&comma;0&comma;1&comma;−1&comma;−3&comma;0&comma;−1&comma;1&comma;−1&comma;4

B≔−1000−12001−1−30−11−14

(2)
> 

C≔Matrix⁡3&comma;−I&comma;1&comma;0&comma;I&comma;4&comma;2⁢I&comma;0&comma;1&comma;−2⁢I&comma;5&comma;1&comma;0&comma;0&comma;1&comma;4

C≔3−I10I42⁢I01−2⁢I510014

(3)
> 

IsMatrixShape⁡A&comma;diagonal

false

(4)
> 

IsMatrixShape⁡A&comma;strictlydiagonallydominant

false

(5)
> 

IsMatrixShape⁡A&comma;diagonallydominant

true

(6)
> 

IsMatrixShape⁡C&comma;hermitian

true

(7)
> 

IsMatrixShape⁡A&comma;positivedefinite

true

(8)
> 

IsMatrixShape⁡B&comma;positivedefinite

false

(9)
> 

IsMatrixShape⁡C&comma;positivedefinite

true

(10)
> 

IsMatrixShape⁡A&comma;symmetric

true

(11)
> 

IsMatrixShape⁡B&comma;triangularupper

false

(12)
> 

IsMatrixShape⁡B&comma;triangular

false

(13)
> 

IsMatrixShape⁡LinearAlgebra:-Transpose⁡B&comma;triangular

true

(14)
> 

IsMatrixShape⁡B&comma;triangularlower

true

(15)
> 

IsMatrixShape⁡A&comma;tridiagonal

true

(16)

See Also

Student[NumericalAnalysis]

Student[NumericalAnalysis][ComputationOverview]