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(inout) 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. It is an intent(out) argument.
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. It is an intent(out) argument.
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 optional
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
optional intent(in) argument. By default, tolerance = rtol_sportolerance = rtol_dp`.
Note
This implementation does not currently include an automatic restarting procedure
such as krylov_schur for eigs. This is work in progress.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(abstract_linop_cdp), | intent(inout) | :: | 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. |
||
| class(abstract_vector_cdp), | intent(in), | optional | :: | u0 | ||
| integer, | intent(in), | optional | :: | kdim |
Desired number of eigenpairs. |
|
| real(kind=dp), | intent(in), | optional | :: | tolerance |
Tolerance. |
|
| logical, | intent(in), | optional | :: | write_intermediate |
Write intermediate eigenvalues to file during iteration? |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(abstract_linop_csp), | intent(inout) | :: | 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. |
||
| class(abstract_vector_csp), | intent(in), | optional | :: | u0 | ||
| integer, | intent(in), | optional | :: | kdim |
Desired number of eigenpairs. |
|
| real(kind=sp), | intent(in), | optional | :: | tolerance |
Tolerance. |
|
| logical, | intent(in), | optional | :: | write_intermediate |
Write intermediate eigenvalues to file during iteration? |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(abstract_linop_rdp), | intent(inout) | :: | 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. |
||
| class(abstract_vector_rdp), | intent(in), | optional | :: | u0 | ||
| integer, | intent(in), | optional | :: | kdim |
Desired number of eigenpairs. |
|
| real(kind=dp), | intent(in), | optional | :: | tolerance |
Tolerance. |
|
| logical, | intent(in), | optional | :: | write_intermediate |
Write intermediate eigenvalues to file during iteration? |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(abstract_linop_rsp), | intent(inout) | :: | 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. |
||
| class(abstract_vector_rsp), | intent(in), | optional | :: | u0 | ||
| integer, | intent(in), | optional | :: | kdim |
Desired number of eigenpairs. |
|
| real(kind=sp), | intent(in), | optional | :: | tolerance |
Tolerance. |
|
| logical, | intent(in), | optional | :: | write_intermediate |
Write intermediate eigenvalues to file during iteration? |