Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Test Matrix Type (Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Tests whether Input Matrix is a matrix of special type. The data type you wire to the Input Matrix input determines the polymorphic instance to use.

Details  Example

Use the pull-down menu to select an instance of this VI.

Test Real Matrix Type

Input Matrix is the matrix which you want to test for special type.
matrix type specifies which type you want to test for Input Matrix.

10Symmetric Positive Definite (default)
11Symmetric Positive Semi-Definite
relative tolerance specifies the relative tolerance used to test whether Input Matrix is a matrix of special type. The default value is –1. If relative tolerance is less than 0, this VI sets tolerance based on Input Matrix.
is type? is TRUE if Input Matrix is a matrix of special type. Otherwise, is type? is FALSE.
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

Test Complex Matrix Type

Input Matrix is the matrix which you want to test for special type.
matrix type specifies which type you want to test for Input Matrix.

10Hermitian Positive Definite (default)
11Hermitian Positive Semi-Definite
relative tolerance specifies the relative tolerance used to test whether Input Matrix is a matrix of special type. The default value is –1. If relative tolerance is less than 0, this VI sets tolerance based on Input Matrix.
is type? is TRUE if Input Matrix is a matrix of special type. Otherwise, is type? is FALSE.
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

Test Matrix Type Details

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 used in Cholesky factorization is

2.22e–16*n*maxdiag

where 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*maxdiag

Example

Refer to the Linear Algebra Calculator VI in the labview\examples\analysis\linaxmpl.llb for an example of using the Test Matrix Type VI.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit