F08KNF (ZGELSS) computes the minimum norm solution to a complex linear least squares problem
SUBROUTINE F08KNF ( |
M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK, LWORK, RWORK, INFO) |
INTEGER |
M, N, NRHS, LDA, LDB, RANK, LWORK, INFO |
REAL (KIND=nag_wp) |
S(*), RCOND, RWORK(*) |
COMPLEX (KIND=nag_wp) |
A(LDA,*), B(LDB,*), WORK(max(1,LWORK)) |
|
The effective rank of
is determined by treating as zero those singular values which are less than
RCOND times the largest singular value.
Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999)
LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia
http://www.netlib.org/lapack/lug
- 1: M – INTEGERInput
On entry: , the number of rows of the matrix .
Constraint:
.
- 2: N – INTEGERInput
On entry: , the number of columns of the matrix .
Constraint:
.
- 3: NRHS – INTEGERInput
On entry: , the number of right-hand sides, i.e., the number of columns of the matrices and .
Constraint:
.
- 4: A(LDA,) – COMPLEX (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
A
must be at least
.
On entry: the by matrix .
On exit: the first rows of are overwritten with its right singular vectors, stored row-wise.
- 5: LDA – INTEGERInput
On entry: the first dimension of the array
A as declared in the (sub)program from which F08KNF (ZGELSS) is called.
Constraint:
.
- 6: B(LDB,) – COMPLEX (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
B
must be at least
.
On entry: the by right-hand side matrix .
On exit:
B is overwritten by the
by
solution matrix
. If
and
, the residual sum of squares for the solution in the
th column is given by the sum of squares of the modulus of elements
in that column.
- 7: LDB – INTEGERInput
On entry: the first dimension of the array
B as declared in the (sub)program from which F08KNF (ZGELSS) is called.
Constraint:
.
- 8: S() – REAL (KIND=nag_wp) arrayOutput
-
Note: the dimension of the array
S
must be at least
.
On exit: the singular values of in decreasing order.
- 9: RCOND – REAL (KIND=nag_wp)Input
On entry: used to determine the effective rank of . Singular values are treated as zero. If , machine precision is used instead.
- 10: RANK – INTEGEROutput
On exit: the effective rank of , i.e., the number of singular values which are greater than .
- 11: WORK() – COMPLEX (KIND=nag_wp) arrayWorkspace
On exit: if
, the real part of
contains the minimum value of
LWORK required for optimal performance.
- 12: LWORK – INTEGERInput
On entry: the dimension of the array
WORK as declared in the (sub)program from which F08KNF (ZGELSS) is called.
If
, a workspace query is assumed; the routine only calculates the optimal size of the
WORK array, returns this value as the first entry of the
WORK array, and no error message related to
LWORK is issued.
Suggested value:
for optimal performance,
LWORK should generally be larger. Consider increasing
LWORK by at least
, where
is the optimal
block size.
Constraint:
and .
- 13: RWORK() – REAL (KIND=nag_wp) arrayWorkspace
-
Note: the dimension of the array
RWORK
must be at least
.
- 14: INFO – INTEGEROutput
On exit:
unless the routine detects an error (see
Section 6).
The real analogue of this routine is
F08KAF (DGELSS).
This example solves the linear least squares problem
for the solution,
, of minimum norm, where
and