Table of Contents
QccMatrixSVD - singular value decomposition
#include "libQccPack.h"
int QccMatrixSVD(const QccMatrix A, int num_rows, int num_cols, QccMatrix
U, QccVector S, QccMatrix V);
QccMatrixSVD() performs the
singular value decomposition (SVD) of matrix A which has size num_rows
x num_cols. The SVD is returned in the form of matrix U (size num_rows
x num_cols), vector S (length num_cols), and matrix V (size num_cols x
num_cols), such that A = U * diag(S) * V^T, where diag(S) is the num_cols
x num_cols matrix with S on the diagonal.
Any of U, V, or S can be NULL,
in which case the corresponding value is calculated but not returned.
The QccPack implementation of SVD is essentially a call
to gsl_linalg_SV_decomp(3)
, part of the GNU Scientific Library (GSL). As
a consequence, if GSL is not available, QccMatrixSVD() will not work. In
the case that num_rows is less than num_cols, gsl_linalg_SV_decomp(3)
cannot be employed directly. In this case, num_cols - num_rows rows of zeros
are concatenated onto A before calling gsl_linalg_SV_decomp(3)
, and the
output quantities
gsl_linalg_SV_decomp(3)
, QccMatrix(3)
, QccPack(3)
Copyright (C) 1997-2021 James E. Fowler
Table of Contents