ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
hsolver::LinearLowRank< T, Device > Class Template Referencefinal

Diagonal inverse with an optional response or Galerkin coarse correction. More...

#include <linear_low_rank.h>

Inheritance diagram for hsolver::LinearLowRank< T, Device >:
Collaboration diagram for hsolver::LinearLowRank< T, Device >:

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

Detailed Description

template<typename T, typename Device>
class hsolver::LinearLowRank< T, Device >

Diagonal inverse with an optional response or Galerkin coarse correction.

Constructor & Destructor Documentation

◆ LinearLowRank()

template<typename T, typename Device>
hsolver::LinearLowRank< T, Device >::LinearLowRank ( LinearAlgebra< T, Device > & algebra,
const T * diagonal,
int dim )
inline

Member Function Documentation

◆ apply()

template<typename T, typename Device>
void hsolver::LinearLowRank< T, Device >::apply ( const T * x,
T * y,
int ld,
int nvec ) const
overridevirtual

Apply the fixed correction; throw LinearPreconditionerError if the coarse solve fails.

Implements hsolver::LinearOperator< T, Device >.

Here is the call graph for this function:

◆ is_identity()

template<typename T, typename Device>
bool hsolver::LinearLowRank< T, Device >::is_identity ( ) const
inlineoverridevirtual

Allow solvers to bypass identity preconditioner copies.

Reimplemented from hsolver::LinearOperator< T, Device >.

◆ prepare()

template<typename T, typename Device>
void hsolver::LinearLowRank< T, Device >::prepare ( int ld,
int rank,
const T * z,
const T * w,
const T * test,
const LinearSmallLU * factor,
ct::Tensor * workspace )
private

Form Z-D*W and retain the projection data for subsequent applications.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepare_response()

template<typename T, typename Device>
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.

Parameters
imagesBorrowed projection vectors; keep them valid and unchanged until the last apply.
workspaceCaller-owned correction storage; do not modify or resize it until the last apply.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepare_subspace()

template<typename T, typename Device>
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.

Parameters
basisBorrowed projection vectors; keep them valid and unchanged until the last apply.
factorBorrowed factorization of basis^H*images; keep it valid and unchanged until the last apply.
workspaceCaller-owned correction storage; do not modify or resize it until the last apply.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rank()

template<typename T, typename Device>
int hsolver::LinearLowRank< T, Device >::rank ( ) const
inline
Here is the caller graph for this function:

Member Data Documentation

◆ algebra_

template<typename T, typename Device>
LinearAlgebra<T, Device>& hsolver::LinearLowRank< T, Device >::algebra_
private

◆ correction_

template<typename T, typename Device>
const T* hsolver::LinearLowRank< T, Device >::correction_ = nullptr
private

◆ diagonal_

template<typename T, typename Device>
const T* hsolver::LinearLowRank< T, Device >::diagonal_
private

◆ dim_

template<typename T, typename Device>
const int hsolver::LinearLowRank< T, Device >::dim_
private

◆ factor_

template<typename T, typename Device>
const LinearSmallLU* hsolver::LinearLowRank< T, Device >::factor_ = nullptr
private

◆ rank_

template<typename T, typename Device>
int hsolver::LinearLowRank< T, Device >::rank_ = 0
private

◆ test_

template<typename T, typename Device>
const T* hsolver::LinearLowRank< T, Device >::test_ = nullptr
private

The documentation for this class was generated from the following files: