|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Diagonal inverse with an optional response or Galerkin coarse correction. More...
#include <linear_low_rank.h>
Public Member Functions | |
| LinearLowRank (LinearAlgebra< T, Device > &algebra, const T *diagonal, int dim) | |
| bool | is_identity () const override |
| Allow solvers to bypass identity preconditioner copies. | |
| int | rank () const |
| void | prepare_response (int ld, int rank, const T *directions, const T *images, ct::Tensor *workspace) |
| Prepare a response correction with orthonormal images. | |
| void | prepare_subspace (int ld, int rank, const T *basis, const T *images, const LinearSmallLU &factor, ct::Tensor *workspace) |
| Prepare a Galerkin coarse correction. | |
| void | apply (const T *x, T *y, int ld, int nvec) const override |
| Apply the fixed correction; throw LinearPreconditionerError if the coarse solve fails. | |
| Public Member Functions inherited from hsolver::LinearOperator< T, Device > | |
| virtual | ~LinearOperator ()=default |
Private Member Functions | |
| void | prepare (int ld, int rank, const T *z, const T *w, const T *test, const LinearSmallLU *factor, ct::Tensor *workspace) |
| Form Z-D*W and retain the projection data for subsequent applications. | |
Private Attributes | |
| LinearAlgebra< T, Device > & | algebra_ |
| const T * | diagonal_ |
| const int | dim_ |
| const T * | test_ = nullptr |
| int | rank_ = 0 |
| const LinearSmallLU * | factor_ = nullptr |
| const T * | correction_ = nullptr |
Diagonal inverse with an optional response or Galerkin coarse correction.
|
inline |
|
overridevirtual |
Apply the fixed correction; throw LinearPreconditionerError if the coarse solve fails.
Implements hsolver::LinearOperator< T, Device >.
|
inlineoverridevirtual |
Allow solvers to bypass identity preconditioner copies.
Reimplemented from hsolver::LinearOperator< T, Device >.
|
private |
Form Z-D*W and retain the projection data for subsequent applications.
| void hsolver::LinearLowRank< T, Device >::prepare_response | ( | int | ld, |
| int | rank, | ||
| const T * | directions, | ||
| const T * | images, | ||
| ct::Tensor * | workspace ) |
Prepare a response correction with orthonormal images.
| images | Borrowed projection vectors; keep them valid and unchanged until the last apply. |
| workspace | Caller-owned correction storage; do not modify or resize it until the last apply. |
| void hsolver::LinearLowRank< T, Device >::prepare_subspace | ( | int | ld, |
| int | rank, | ||
| const T * | basis, | ||
| const T * | images, | ||
| const LinearSmallLU & | factor, | ||
| ct::Tensor * | workspace ) |
Prepare a Galerkin coarse correction.
| basis | Borrowed projection vectors; keep them valid and unchanged until the last apply. |
| factor | Borrowed factorization of basis^H*images; keep it valid and unchanged until the last apply. |
| workspace | Caller-owned correction storage; do not modify or resize it until the last apply. |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |