Student[NumericalAnalysis] - Maple Programming Help

Home : Support : Online Help : Education : Student Package : Numerical Analysis : Computation : Student/NumericalAnalysis/IsMatrixShape

Student[NumericalAnalysis]

 IsMatrixShape
 Check whether a matrix is a certain shape or not

 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<\Re \left({v}^{\mathrm{%H}}·A·v\right)$, where $\Re$ 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<{v}^{T}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}A\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}v$.
 • To check another "shape" that is not available with the Student[NumericalAnalysis][IsMatrixShape] command see the general IsMatrixShape command.

Examples

 > $\mathrm{with}\left(\mathrm{Student}[\mathrm{NumericalAnalysis}]\right):$
 > $A≔\mathrm{Matrix}\left(\left[\left[2,-1,0,0\right],\left[-1,2,-1,0\right],\left[0,-1,2,-1\right],\left[0,0,-1,2\right]\right]\right)$
 ${A}{:=}\left[\begin{array}{rrrr}{2}& {-}{1}& {0}& {0}\\ {-}{1}& {2}& {-}{1}& {0}\\ {0}& {-}{1}& {2}& {-}{1}\\ {0}& {0}& {-}{1}& {2}\end{array}\right]$ (1)
 > $B≔\mathrm{Matrix}\left(\left[\left[-1,0,0,0\right],\left[-1,2,0,0\right],\left[1,-1,-3,0\right],\left[-1,1,-1,4\right]\right]\right)$
 ${B}{:=}\left[\begin{array}{rrrr}{-}{1}& {0}& {0}& {0}\\ {-}{1}& {2}& {0}& {0}\\ {1}& {-}{1}& {-}{3}& {0}\\ {-}{1}& {1}& {-}{1}& {4}\end{array}\right]$ (2)
 > $C≔\mathrm{Matrix}\left(\left[\left[3,-I,1,0\right],\left[I,4,2I,0\right],\left[1,-2I,5,1\right],\left[0,0,1,4\right]\right]\right)$
 ${C}{:=}\left[\begin{array}{cccc}{3}& {-}{I}& {1}& {0}\\ {I}& {4}& {2}{}{I}& {0}\\ {1}& {-}{2}{}{I}& {5}& {1}\\ {0}& {0}& {1}& {4}\end{array}\right]$ (3)
 > $\mathrm{IsMatrixShape}\left(A,'\mathrm{diagonal}'\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{IsMatrixShape}\left(A,'\mathrm{strictlydiagonallydominant}'\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{IsMatrixShape}\left(A,'\mathrm{diagonallydominant}'\right)$
 ${\mathrm{true}}$ (6)
 > $\mathrm{IsMatrixShape}\left(C,'\mathrm{hermitian}'\right)$
 ${\mathrm{true}}$ (7)
 > $\mathrm{IsMatrixShape}\left(A,'\mathrm{positivedefinite}'\right)$
 ${\mathrm{true}}$ (8)
 > $\mathrm{IsMatrixShape}\left(B,'\mathrm{positivedefinite}'\right)$
 ${\mathrm{false}}$ (9)
 > $\mathrm{IsMatrixShape}\left(C,'\mathrm{positivedefinite}'\right)$
 ${\mathrm{true}}$ (10)
 > $\mathrm{IsMatrixShape}\left(A,'\mathrm{symmetric}'\right)$
 ${\mathrm{true}}$ (11)
 > $\mathrm{IsMatrixShape}\left(B,{'\mathrm{triangular}'}_{'\mathrm{upper}'}\right)$
 ${\mathrm{false}}$ (12)
 > $\mathrm{IsMatrixShape}\left(B,'\mathrm{triangular}'\right)$
 ${\mathrm{false}}$ (13)
 > $\mathrm{IsMatrixShape}\left(\mathrm{LinearAlgebra}:-\mathrm{Transpose}\left(B\right),'\mathrm{triangular}'\right)$
 ${\mathrm{true}}$ (14)
 > $\mathrm{IsMatrixShape}\left(B,{'\mathrm{triangular}'}_{'\mathrm{lower}'}\right)$
 ${\mathrm{true}}$ (15)
 > $\mathrm{IsMatrixShape}\left(A,'\mathrm{tridiagonal}'\right)$
 ${\mathrm{true}}$ (16)