Computes the leading singular triplets of an arbitrary linear operator using the Lanczos iterative process. Given a linear operator , it finds the leading singular values and singular vectors such that:
The subspaces and are constructed via Lanczos factorization, resulting in a bidiagonal matrix . The singular values of are approximated by those of and the singular vectors are computed accordingly.
References
call svds(A, U, S, V, residuals, info [, kdim] [,tolerance])
A
: Linear operator derived from abstract_sym_linop_rsp
, abstract_sym_linop_rdp
,
abstract_hermitian_linop_csp
or abstract_hermitian_linop_cdp
whose leading
eigenpairs need to be computed. It is an intent(in)
argument.
U
: Array of abstract_vectors
with the same type and kind as A
. On exit, it
contains the left singular vectors of A
. Note that the dimension of U
fixes
the number of eigenpairs computed.
S
: Rank-1 array of real
numbers. On exit, it contains the leading
singular values of A
. It is an intent(out)
argument.
V
: Array of abstract_vectors
with the same type and kind as A
. On exit, it
contains the left singular vectors of A
. Note that the dimension of U
fixes
the number of eigenpairs computed.
residuals
: Rank-1 array of real
numbers. On exit, it contains the residuals
associated with each singular triplet. It is an intent(out)
argument.
info
: integer
Information flag.
kdim
(optional) : integer
, maximum dimension of the Krylov subspace used to
approximate the leading singular triplets. It is an intent(in)
argument. By default, kdim = 4*size(X)
.
tolerance
(optional) : real
tolerance below which a triplet is considered as
being converged. It is an intent(in)
agument. By default,
tolerance = rtol_sp
or tolerance = rtol_dp
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_linop_rsp), | intent(in) | :: | A |
Linear operator whose leading singular triplets need to be computed. |
||
class(abstract_vector_rsp), | intent(out) | :: | U(:) |
Leading left singular vectors. |
||
real(kind=sp), | intent(out), | allocatable | :: | S(:) |
Leading singular values. |
|
class(abstract_vector_rsp), | intent(out) | :: | V(:) |
Leading right singular vectors. |
||
real(kind=sp), | intent(out), | allocatable | :: | residuals(:) |
Residuals associated to each Ritz eigenpair. |
|
integer, | intent(out) | :: | info |
Information flag. |
||
integer, | intent(in), | optional | :: | kdim |
Desired number of eigenpairs. |
|
real(kind=sp), | intent(in), | optional | :: | tolerance |
Tolerance. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_linop_rdp), | intent(in) | :: | A |
Linear operator whose leading singular triplets need to be computed. |
||
class(abstract_vector_rdp), | intent(out) | :: | U(:) |
Leading left singular vectors. |
||
real(kind=dp), | intent(out), | allocatable | :: | S(:) |
Leading singular values. |
|
class(abstract_vector_rdp), | intent(out) | :: | V(:) |
Leading right singular vectors. |
||
real(kind=dp), | intent(out), | allocatable | :: | residuals(:) |
Residuals associated to each Ritz eigenpair. |
|
integer, | intent(out) | :: | info |
Information flag. |
||
integer, | intent(in), | optional | :: | kdim |
Desired number of eigenpairs. |
|
real(kind=dp), | intent(in), | optional | :: | tolerance |
Tolerance. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_linop_csp), | intent(in) | :: | A |
Linear operator whose leading singular triplets need to be computed. |
||
class(abstract_vector_csp), | intent(out) | :: | U(:) |
Leading left singular vectors. |
||
real(kind=sp), | intent(out), | allocatable | :: | S(:) |
Leading singular values. |
|
class(abstract_vector_csp), | intent(out) | :: | V(:) |
Leading right singular vectors. |
||
real(kind=sp), | intent(out), | allocatable | :: | residuals(:) |
Residuals associated to each Ritz eigenpair. |
|
integer, | intent(out) | :: | info |
Information flag. |
||
integer, | intent(in), | optional | :: | kdim |
Desired number of eigenpairs. |
|
real(kind=sp), | intent(in), | optional | :: | tolerance |
Tolerance. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_linop_cdp), | intent(in) | :: | A |
Linear operator whose leading singular triplets need to be computed. |
||
class(abstract_vector_cdp), | intent(out) | :: | U(:) |
Leading left singular vectors. |
||
real(kind=dp), | intent(out), | allocatable | :: | S(:) |
Leading singular values. |
|
class(abstract_vector_cdp), | intent(out) | :: | V(:) |
Leading right singular vectors. |
||
real(kind=dp), | intent(out), | allocatable | :: | residuals(:) |
Residuals associated to each Ritz eigenpair. |
|
integer, | intent(out) | :: | info |
Information flag. |
||
integer, | intent(in), | optional | :: | kdim |
Desired number of eigenpairs. |
|
real(kind=dp), | intent(in), | optional | :: | tolerance |
Tolerance. |