Test Matrix Type VI
- Updated2025-07-30
- 3 minute(s) read
Tests whether Input Matrix is a matrix of special type. Wire data to the Input Matrix input to determine the polymorphic instance to use or manually select the instance.

Positive Definite and Positive Semi-Definite
In real cases, a symmetric matrix A is positive definite if
for any non-zero vector x. A symmetric matrix A is positive semi-definite if
for any non-zero vector x. In complex cases, a Hermitian matrix A is positive definite if
for any non-zero vector x. A Hermitian matrix A is positive semi-definite if
for any non-zero vector x.
This VI first tests whether Input Matrix is symmetric (or Hermitian). If the test fails, is type? returns FALSE. Then, this VI tests whether the symmetric (or Hermitian) matrix is positive definite (or positive semi-definite) by Cholesky factorization. If a symmetric matrix is not positive definite (or positive semi-definite), the algorithm for Cholesky factorization fails when it attempts to calculate the square root of a negative number or divide by zero.
This VI uses relative tolerance to determine whether a number is small enough that you consider it as zero when performing Cholesky factorization. If relative tolerance is less than zero, the tolerance in Cholesky factorization is
2.22e–16*n*maxdiagwhere n is the order of Input Matrix and maxdiag is the maximum value of diagonal elements of Input Matrix. Otherwise, the tolerance is
relative tolerance*n*maxdiagSymmetric and Hermitian
A real or complex square matrix is symmetric if
aij = ajiA complex square matrix is Hermitian if
aij = conj(aji)where conj is the complex conjugate function.
This VI uses relative tolerance to determine whether the difference between two elements in Input Matrix is small enough to consider them equal. If relative tolerance is less than zero, the tolerance is
2.22e–16*n*maxwhere n is the order of Input Matrix and max is the maximum absolute value of elements in Input Matrix. For a complex element, max is the maximum absolute value of its real and imaginary parts. Otherwise, the tolerance is
relative tolerance*n*maxExamples
Refer to the following example files included with LabVIEW.
- labview\examples\Mathematics\Linear Algebra\Linear Algebra Calculator.vi