Admin Production ni-theme
Current Publication

MatrixRank

LabWindows/CVI

MatrixRank

Advanced Analysis Library Only

AnalysisLibErrType MatrixRank (void *inputMatrix, ssize_t numberOfRows, ssize_t numberOfColumns, double tolerance, ssize_t *rank);

Purpose

Calculates the rank of the real input matrix. The input matrix can be square or rectangular.

The maximum number of linearly independent rows or columns of the matrix defines the rank of a matrix. The rank is always less than or equal to the minimum of the number of rows and columns of the matrix. If the rank equals this minimum value, the matrix is a full-rank matrix. Otherwise, it is a rank-deficient matrix.

The rank of a matrix can be calculated in a number of ways. MatrixRank first calculates the singular values of the input matrix and then calculates the rank as the number of singular values of the input matrix that are larger than the input tolerance.

You must specify the input tolerance as a positive number close to machine precision. If the matrix in your application is a full-rank matrix, any small value of tolerance gives the same rank. If the matrix in your application is a rank-deficient matrix, different values of tolerance can result in different values of rank.

Parameters

Input
Name Type Description
inputMatrix void * Input matrix. This matrix must be an array of doubles.
numberOfRows ssize_t The number of rows in inputMatrix.
numberOfColumns ssize_t The number of columns in inputMatrix.
tolerance double Tolerance value. Matrix rank is the number of singular values in the input matrix that are larger than the tolerance. Set tolerance close to eps, which is the smallest possible double-precision, floating-point number.
Output
Name Type Description
rank ssize_t The rank of inputMatrix.

Return Value

Name Type Description
status AnalysisLibErrType A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants.

Additional Information

Library: Advanced Analysis Library

Include file: analysis.h

LabWindows/CVI compatibility: LabWindows/CVI 5.0 and later