Admin Production ni-theme
Current Publication

SVDEx

LabWindows/CVI

SVDEx

Advanced Analysis Library Only

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

Purpose

Computes the singular value decomposition (SVD) of a real matrix, as follows: A = USVH. U is a column orthogonal matrix. That is, UHU = I, where I is the identity matrix and UH is the transpose of U. S is a diagonal matrix whose diagonal elements are the singular values of A. V is also a column orthogonal matrix. That is, VHV = I, where VH is the transpose of V.

National Instruments recommends you use SVDEx for SVD operation instead of SVD or SVDS. SVDEx can do full-size decomposition.

Parameters

Input
Name Type Description
inputMatrix void * The matrix to decompose.
numberOfRows ssize_t The number of rows of inputMatrix.
numberOfColumns ssize_t The number of columns of inputMatrix.
sizeOption int The size option of SVD. sizeOption must one of the following values:
  • FULL_SIZE (0): The size of U is numberOfRows * numberOfRows. The size of V is numberOfColumns * numberOfColumns.
  • ECONOMY_SIZE (1): The size of U is numberOfRows * min(numberOfRows, numberOfColumns). The size of V is numberOfColumns * min(numberOfRows, numberOfColumns).
Output
Name Type Description
uMatrix void * The orthogonal matrix U. If uMatrix = NULL, this function computes only singular values.
singularValuesVector double [] The singular values in descending order, whose size is min(numberOfRows, numberOfColumns). If you want to compute only singular values, call the function with either uMatrix = NULL or vMatrix = NULL. In this case, uMatrix and vMatrix are not referenced.
vMatrix void * The orthogonal matrix V. If vMatrix = NULL, only singular values are computed.

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 8.0 and later