Admin Production ni-theme
Current Publication

PseudoInverse

LabWindows/CVI

PseudoInverse

Advanced Analysis Library Only

AnalysisLibErrType PseudoInverse (void *inputMatrix, ssize_t numberOfRows, ssize_t numberOfColumns, double tolerance, void *matrixPseudoInverse);

Purpose

Calculates the generalized inverse of the real input matrix A. The input matrix can be square or rectangular. The dimensions of the input matrix A are numberOfRows-by-numberOfColumns. The dimensions of the output matrix (inverse) are numberOfColumns-by-numberOfRows.

PseudoInverse uses the Singular Value Decomposition (SVD) technique. Define the pseudoinverse of a scalar s to be 1/s if s does not equal zero, and zero otherwise. Similarly, define the pseudoinverse of a diagonal matrix by transposing the matrix and then taking the scalar pseudoinverse of each entry. If A+ denotes the pseudoinverse of a matrix A whose singular value decomposition is given by

A = USVT

then:

A+ = US+VT

where S+ is the pseudoinverse of the diagonal matrix S that contains the singular values of A

The pseudoinverse exists for both square and rectangular matrices. If the input matrix is square and nonsingular, the pseudoinverse is the same as the general matrix inverse.

Note    Do not use PseudoInverse to calculate the inverse of a square matrix because it takes more time. Use GenInvMatrix instead.

The tolerance parameter must be a small positive number close to machine precision. PseudoInverse sets all singular values of the input matrix smaller than tolerance equal to zero.

Parameters

Input
Name Type Description
inputMatrix void * Input real matrix. The input matrix can be either square or rectangular. 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. All the singular values below this tolerance value are set equal to zero. The value of tolerance determines the level of accuracy in your final solution. Set tolerance close to eps, which is the smallest possible double-precision, floating-point number.
Output
Name Type Description
matrixPseudoInverse void * Calculated pseudoinverse matrix, as an array of doubles. This value is numberOfColumns-by-numberOfRows.

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