|
NAG[f02wec] NAG[nag_real_svd] - SVD of real matrix
|
|
Calling Sequence
f02wec(a, wantq, sv, wantp, iter, e, failinfo, 'm'=m, 'n'=n, 'tda'=tda, 'ncolb'=ncolb, 'b'=b, 'tdb'=tdb, 'q'=q, 'tdq'=tdq, 'pt'=pt, 'tdpt'=tdpt, 'fail'=fail)
nag_real_svd(. . .)
Parameters
|
a - Matrix(1..m, 1..tda, datatype=float[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 wantq = false, 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 pt 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 pt and the second dimension of the array ptthe 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_real_svd (f02wec) 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=float[8], order=C_order); (optional)
|
|
|
|
'tdb'=tdb - integer; (optional)
|
|
|
On entry: the second dimension of the array b as declared in the function from which nag_real_svd (f02wec) is called.
|
|
Constraint: if then . .
|
|
|
'q'=q - Matrix(1..m, 1..tdq, datatype=float[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_real_svd (f02wec) is called.
|
|
|
'pt'=pt - Matrix(1..n, 1..tdpt, datatype=float[8], order=C_order); (optional)
|
|
|
|
'tdpt'=tdpt - integer; (optional)
|
|
|
On entry: the second dimension of the array pt as declared in the function from which nag_real_svd (f02wec) is called.
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_real_svd (f02wec) returns all, or part, of the singular value decomposition of a general real matrix.
|
|
|
Examples
|
|
>
|
m := 5:
n := 3:
tda := 3:
ncolb := 1:
tdb := 1:
wantq := true:
tdq := 1:
wantp := true:
tdpt := 3:
a := Matrix([[2, 2.5, 2.5], [2, 2.5, 2.5], [1.6, -0.4, 2.8], [2, -0.5, 0.5], [1.2, -0.3, -2.9]], datatype=float[8], order='C_order'):
b := Matrix([[1.1], [0.9], [0.6], [0], [-0.8]], datatype=float[8], order='C_order'):
q := Matrix(0, 0, datatype=float[8], order='C_order'):
sv := Vector(3, datatype=float[8]):
pt := Matrix(3, 3, datatype=float[8], order='C_order'):
e := Vector(3, datatype=float[8]):
NAG:-f02wec(a, wantq, sv, wantp, iter, e, failinfo, 'm' = m, 'n' = n, 'tda' = tda, 'ncolb' = ncolb, 'b' = b, 'tdb' = tdb, 'q' = q, 'tdq' = tdq, 'pt' = pt, 'tdpt' = tdpt):
|
|
|
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.
|
|