Purpose
=======
DGESDD computes the singular value decomposition (SVD) of a real
M-by-N matrix A, optionally computing the left and right singular
vectors. If singular vectors are desired, it uses a
divide-and-conquer algorithm.
The SVD is written
A = U * SIGMA * transpose(V)
where SIGMA is an M-by-N matrix which is zero except for its
min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and
V is an N-by-N orthogonal matrix. The diagonal elements of SIGMA
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 VT = V**T, not V.
The divide and conquer algorithm makes very mild assumptions about
floating point arithmetic. It will work on machines with a guard
digit in add/subtract, or on those binary machines without guard
digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or
Cray-2. It could conceivably fail on hexadecimal or decimal machines
without guard digits, but we know of none.
Namespace: DotNumerics.LinearAlgebra.CSLapackAssembly: DWSIM.MathOps.DotNumerics (in DWSIM.MathOps.DotNumerics.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax public void Run(
string JOBZ,
int M,
int N,
ref double[] A,
int offset_a,
int LDA,
ref double[] S,
int offset_s,
ref double[] U,
int offset_u,
int LDU,
ref double[] VT,
int offset_vt,
int LDVT,
ref double[] WORK,
int offset_work,
int LWORK,
ref int[] IWORK,
int offset_iwork,
ref int INFO
)
Public Sub Run (
JOBZ As String,
M As Integer,
N As Integer,
ByRef A As Double(),
offset_a As Integer,
LDA As Integer,
ByRef S As Double(),
offset_s As Integer,
ByRef U As Double(),
offset_u As Integer,
LDU As Integer,
ByRef VT As Double(),
offset_vt As Integer,
LDVT As Integer,
ByRef WORK As Double(),
offset_work As Integer,
LWORK As Integer,
ByRef IWORK As Integer(),
offset_iwork As Integer,
ByRef INFO As Integer
)
Request Example
View SourceParameters
- JOBZ String
-
(input) CHARACTER*1
Specifies options for computing all or part of the matrix U:
= 'A': all M columns of U and all N rows of V**T are
returned in the arrays U and VT;
= 'S': the first min(M,N) columns of U and the first
min(M,N) rows of V**T are returned in the arrays U
and VT;
= 'O': If M .GE. N, the first N columns of U are overwritten
on the array A and all rows of V**T are returned in
the array VT;
otherwise, all columns of U are returned in the
array U and the first M rows of V**T are overwritten
in the array A;
= 'N': no columns of U or rows of V**T are computed.
- M Int32
-
(input) INTEGER
The number of rows of the input matrix A. M .GE. 0.
- N Int32
-
(input) INTEGER
The number of columns of the input matrix A. N .GE. 0.
- A Double
-
= U * SIGMA * transpose(V)
- offset_a Int32
-
- LDA Int32
-
(input) INTEGER
The leading dimension of the array A. LDA .GE. max(1,M).
- S Double
-
(output) DOUBLE PRECISION array, dimension (min(M,N))
The singular values of A, sorted so that S(i) .GE. S(i+1).
- offset_s Int32
-
- U Double
-
(output) DOUBLE PRECISION array, dimension (LDU,UCOL)
UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M .LT. N;
UCOL = min(M,N) if JOBZ = 'S'.
If JOBZ = 'A' or JOBZ = 'O' and M .LT. N, U contains the M-by-M
orthogonal matrix U;
if JOBZ = 'S', U contains the first min(M,N) columns of U
(the left singular vectors, stored columnwise);
if JOBZ = 'O' and M .GE. N, or JOBZ = 'N', U is not referenced.
- offset_u Int32
-
- LDU Int32
-
(input) INTEGER
The leading dimension of the array U. LDU .GE. 1; if
JOBZ = 'S' or 'A' or JOBZ = 'O' and M .LT. N, LDU .GE. M.
- VT Double
-
(output) DOUBLE PRECISION array, dimension (LDVT,N)
If JOBZ = 'A' or JOBZ = 'O' and M .GE. N, VT contains the
N-by-N orthogonal matrix V**T;
if JOBZ = 'S', VT contains the first min(M,N) rows of
V**T (the right singular vectors, stored rowwise);
if JOBZ = 'O' and M .LT. N, or JOBZ = 'N', VT is not referenced.
- offset_vt Int32
-
- LDVT Int32
-
(input) INTEGER
The leading dimension of the array VT. LDVT .GE. 1; if
JOBZ = 'A' or JOBZ = 'O' and M .GE. N, LDVT .GE. N;
if JOBZ = 'S', LDVT .GE. min(M,N).
- WORK Double
-
(workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK))
On exit, if INFO = 0, WORK(1) returns the optimal LWORK;
- offset_work Int32
-
- LWORK Int32
-
(input) INTEGER
The dimension of the array WORK. LWORK .GE. 1.
If JOBZ = 'N',
LWORK .GE. 3*min(M,N) + max(max(M,N),7*min(M,N)).
If JOBZ = 'O',
LWORK .GE. 3*min(M,N)*min(M,N) +
max(max(M,N),5*min(M,N)*min(M,N)+4*min(M,N)).
If JOBZ = 'S' or 'A'
LWORK .GE. 3*min(M,N)*min(M,N) +
max(max(M,N),4*min(M,N)*min(M,N)+4*min(M,N)).
For good performance, LWORK should generally be larger.
If LWORK = -1 but other input arguments are legal, WORK(1)
returns the optimal LWORK.
- IWORK Int32
-
(workspace) INTEGER array, dimension (8*min(M,N))
- offset_iwork Int32
-
- INFO Int32
-
(output) INTEGER
= 0: successful exit.
.LT. 0: if INFO = -i, the i-th argument had an illegal value.
.GT. 0: DBDSDC did not converge, updating process failed.
See Also