|
NAG[f02xec] NAG[nag_complex_svd] - SVD of complex matrix
|
|
Calling Sequence
f02xec(a, wantq, sv, wantp, iter, e, failinfo, 'm'=m, 'n'=n, 'tda'=tda, 'ncolb'=ncolb, 'b'=b, 'tdb'=tdb, 'q'=q, 'tdq'=tdq, 'ph'=ph, 'tdph'=tdph, 'fail'=fail)
nag_complex_svd(. . .)
Parameters
|
a - Matrix(1..m, 1..tda, datatype=complex[8], order=C_order);
|
|
|
Otherwise the contents of the leading by part of a are indeterminate.
|
|
|
wantq - boolean;
|
|
|
On entry: wantq must be true if the left-hand singular vectors are required. If then the array q is not referenced.
|
|
|
sv - Vector(1.. , datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array sv must be at least .
|
|
On exit: the diagonal elements of the matrix .
|
|
|
wantp - boolean;
|
|
|
On entry: wantp must be true if the right-hand singular vectors are required. If wantp = false then the array ph is not referenced.
|
|
|
iter - assignable;
|
|
|
Note: On exit the variable iter will have a value of type integer.
|
|
On exit: the total number of iterations taken by the algorithm.
|
|
|
e - Vector(1.. , datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array e must be at least .
|
|
|
failinfo - assignable;
|
|
|
Note: On exit the variable failinfo will have a value of type integer.
|
|
On exit: if the error NE_QR_NOT_CONV occurs failinfo contains the number of singular values which may not have been found correctly. See Section [Error Indicators and Warnings] for details.
|
|
|
'm'=m - integer; (optional)
|
|
|
Default value: the first dimension of the arrays a, b, q.
|
|
On entry: the number of rows, , of the matrix .
|
|
Constraint: ..
|
|
When then an immediate return is effected.
|
|
|
'n'=n - integer; (optional)
|
|
|
Default value: the first dimension of the array ph and the second dimension of the array phthe array a.
|
|
On entry: the number of columns, , of the matrix .
|
|
Constraint: ..
|
|
When then an immediate return is effected.
|
|
|
'tda'=tda - integer; (optional)
|
|
|
On entry: the second dimension of the array a as declared in the function from which nag_complex_svd (f02xec) is called.
|
|
Constraint: . .
|
|
|
'ncolb'=ncolb - integer; (optional)
|
|
|
Default value: the second dimension of the array b.
|
|
Constraint: . .
|
|
|
'b'=b - Matrix(1..m, 1..tdb, datatype=complex[8], order=C_order); (optional)
|
|
|
If the array b is not referenced and may be set to the null pointer, i.e., (Complex *)0.
|
|
|
'tdb'=tdb - integer; (optional)
|
|
|
On entry: the second dimension of the array b as declared in the function from which nag_complex_svd (f02xec) is called.
|
|
Constraint: if then . .
|
|
|
'q'=q - Matrix(1..m, 1..tdq, datatype=complex[8], order=C_order); (optional)
|
|
|
|
'tdq'=tdq - integer; (optional)
|
|
|
On entry: the second dimension of the array q as declared in the function from which nag_complex_svd (f02xec) is called.
|
|
|
'ph'=ph - Matrix(1..n, 1..tdph, datatype=complex[8], order=C_order); (optional)
|
|
|
|
'tdph'=tdph - integer; (optional)
|
|
|
On entry: the second dimension of the array ph as declared in the function from which nag_complex_svd (f02xec) is called.
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_complex_svd (f02xec) returns all, or part, of the singular value decomposition of a general complex matrix.
|
|
Error Indicators and Warnings
|
|
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_INT_ARG_LT"
On entry, m must not be less than 0: .
"NE_QR_NOT_CONV"
The QR algorithm has failed to converge in iterations. Singular values may not have been found correctly and the remaining singular values may not be the smallest. The matrix will nevertheless have been factorized as , where the leading by part of is a bidiagonal matrix with as the diagonal elements and as the super-diagonal elements. This failure is not likely to occur.
|
|
|
Examples
|
|
>
|
m := 5:
n := 3:
tda := 3:
ncolb := 1:
tdb := 1:
wantq := true:
tdq := 1:
wantp := true:
tdph := 3:
a := Matrix([[0 +0.5*I , -0.5 +1.5*I , -1 +1*I ], [0.4 +0.3*I , 0.9 +1.3*I , 0.2 +1.4*I ], [0.4 +0*I , -0.4 +0.4*I , 1.8 +0*I ], [0.3 -0.4*I , 0.1 +0.7*I , 0 +0*I ], [0 -0.3*I , 0.3 +0.3*I , 0 +2.4*I ]], datatype=complex[8], order='C_order'):
b := Matrix([[-0.55 +1.05*I ], [0.49 +0.93*I ], [0.5600000000000001 -0.16*I ], [0.39 +0.23*I ], [1.13 +0.83*I ]], datatype=complex[8], order='C_order'):
q := Matrix(0, 0, datatype=complex[8], order='C_order'):
sv := Vector(3, datatype=float[8]):
ph := Matrix(3, 3, datatype=complex[8], order='C_order'):
e := Vector(3, datatype=float[8]):
NAG:-f02xec(a, wantq, sv, wantp, iter, e, failinfo, 'm' = m, 'n' = n, 'tda' = tda, 'ncolb' = ncolb, 'b' = b, 'tdb' = tdb, 'q' = q, 'tdq' = tdq, 'ph' = ph, 'tdph' = tdph):
|


|
|
See Also
|
|
Dongarra J J, Moler C B, Bunch J R and Stewart G W (1979) LINPACK Users' Guide SIAM, Philadelphia
Hammarling S (1985) The singular value decomposition in multivariate statistics SIGNUM Newsl. 20 (3) 2–25
Wilkinson J H (1978) Singular Value Decomposition – Basic Aspects Numerical Software – Needs and Availability (ed D A H Jacobs) Academic Press
f02 Chapter Introduction.
NAG Toolbox Overview.
NAG Web Site.
|
|