SVD

Advanced Analysis Library Only

AnalysisLibErrType SVD (void *inputMatrix, int numberOfRows, int numberOfColumns, void *UMatrix, double singularValuesVector[], void *VMatrix);

Purpose

Note  This function is obsolete. National Instruments recommends that you use SVDEx instead.

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 U is an orthogonal matrix of dimensions n-by-min(n, m)
V is an orthogonal matrix of dimensions m-by-min(n, m)
S 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 numeric array Input real matrix. The input matrix can be either square or rectangular. This matrix must be an array of doubles.
numberOfRows integer Number of rows in inputMatrix.
numberOfColumns integer Number of columns in inputMatrix.
Output
Name Type Description
UMatrix numeric array The result orthogonal matrix SVD factorization generates, as an array of doubles.
singularValuesVector double-precision array Array that contains the singular values of inputMatrix, in descending order.
VMatrix numeric array The result orthogonal matrix SVD factorization generates, as an array of doubles.

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.