XLPack 7.0
XLPack Numerical Library (Excel Worksheet Functions) Reference Manual
Loading...
Searching...
No Matches

◆ WDgesvd()

Function WDgesvd ( Jobu As  String,
JobVt As  String,
M As  Long,
N As  Long,
A As  Variant 
)

Singular value decomposition (SVD)

Purpose
WDgesvd computes the singular value decomposition (SVD) of a real M x N matrix A, optionally computing the left and/or right singular vectors. The SVD is written
A = U * Σ * V^T
where Σ is an M x N matrix which is zero except for its min(M, N) diagonal elements, U is an M x M orthogonal matrix, and V is an N x N orthogonal matrix. The diagonal elements of Σ are the singular values of A. They are real and non-negative, and are returned in descending order. The first min(M, N) columns of U and V are the left and right singular vectors of A.

Note that the routine returns V^T, not V.
Returns
min(M, N)+1 x 1 (Jobu = "N", Jobvt = "N")
Column 1
Rows 1 to min(M, N)Singular values (in descending order)
Row min(M, N)+1Return code
M+1 x M+1 (Jobu = "A", Jobvt = "N")
Column 1Columns 2 to M+1
Rows 1 to MSingular values (in descending order) (Rows 1 to min(M, N))Left orthogonal matrix U
Row M+1Return code0
N+1 x N+1 (Jobu = "N", Jobvt = "A")
Column 1Columns 2 to N+1
Rows 1 to NSingular values (in descending order) (Rows 1 to min(M, N))Transpose of right orthogonal matrix V (V^T)
Row N+1Return code0
max(M,N)+1 x M+N+1 (Jobu = "A", Jobvt = "A")
Column 1Columns 2 to M+1Columns M+2 to M+N+1
Rows 1 to max(M,N)Singular values (in descending order) (Rows 1 to min(M, N))Left orthogonal matrix U (Rows 1 to M)Transpose of right orthogonal matrix V (V^T) (Rows 1 to N)
Row max(M,N)+1Return code00

Return code.
= 0: Successful exit.
= i > 0: i super-diagonals of an intermediate bidiagonal form did not converge to zero.
Parameters
[in]Jobu= "N": Do not compute left orthogonal matrix U.
= "A": Compute left orthogonal matrix U.
[in]Jobvt= "N": Do not compute transpose of right orthogonal matrix V (V^T).
= "A": Compute transpose of right orthogonal matrix V (V^T).
[in]MNumber of rows of the input matrix A. (M >= 1)
[in]NNumber of columns of the input matrix A. (N >= 1)
[in]A(M x N) M x N matrix A.
Reference
LAPACK
Example
Compute singular values and left and right singular vectors of matrix A, where
( 1 6 11 )
( 2 7 12 )
A = ( 3 8 13 )
( 4 9 14 )
( 5 10 15 )

WDgesvd