Admin Production ni-theme
Current Publication

SVD

LabWindows/CVI

SVD

Advanced Analysis Library Only

AnalysisLibErrType SVD (void *inputMatrix, ssize_t numberOfRows, ssize_t numberOfColumns, void *uMatrix, double singularValuesVector[], void *vMatrix);

Purpose

Note Note  The function has been superseded by SVDEx.

Calculates the singular value decomposition (SVD) factorization of the real input matrix. The input matrix can be square or rectangular.

The following formula defines the SVD factorization of an n-by-m matrix A:

A = USVT

where uMatrix is an orthogonal matrix of dimensions n-by-min(n, m)
vMatrix is an orthogonal matrix of dimensions m-by-min(n, m)
singularValuesVector is a diagonal matrix of dimensions min(n, m)-by-min(n, m)
n is number of rows
m is the number of columns

The diagonal elements of singularValuesVector are called the singular values of inputMatrix and are arranged in descending order. The columns of the output matrices UMatrix and VMatrix are the corresponding singular vectors.

The SVD is an eigenvalue-like decomposition for rectangular matrices. You can use it to calculate the condition number of a matrix or to solve linear, least square problems. SVD is useful for ill-conditioned or rank-deficient problems because it can detect small singular values.

Parameters

Input
Name Type Description
inputMatrix void * The input matrix to decompose. The input matrix can be either square or rectangular.
numberOfRows ssize_t The number of rows in inputMatrix.
numberOfColumns ssize_t The number of columns in inputMatrix.
Output
Name Type Description
uMatrix void * The result orthogonal matrix U that SVD factorization generates, whose size is n*min(n,m).
singularValuesVector double [] Array that contains the singular values of inputMatrix, in descending order.
vMatrix void * The result orthogonal matrix V that matrix SVD factorization generates, whose size if m*min(n,m).

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