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

Restarted right-preconditioned GMRES with independent batched columns. More...

#include <linear_gmres.h>

Collaboration diagram for hsolver::LinearGMRES< T, Device >:

Public Member Functions

 LinearGMRES (double tolerance, int restart, int max_iter, const diag_comm_info &comm)
LinearSolveResult solve (const LinearOperator< T, Device > &op, const LinearOperator< T, Device > &preconditioner, int ld, int nvec, int dim, T *x, const T *b, const T *initial_residual, bool force_check, int max_iter, bool reconstruct)
 Use the per-call budget and reconstruction policy; force_check requests an independent final application.

Private Types

using Wide = std::complex<double>
using Real = typename GetTypeReal<T>::type

Private Member Functions

T * vector (int slot)
T * residual ()
T * solution ()
T * basis (int index)
T * direction (int index)
T * image (int index)
bool start_cycle (const std::vector< double > &threshold, std::vector< T > *coefficients)
void orthogonalize (int j, T *next, std::vector< T > *coefficients)
bool update_qr (int b, int j, double norm)
bool back_substitute (int b, int j, std::vector< Wide > *weights)
void update_solution (int j, const std::vector< int > &done, const std::vector< std::vector< Wide > > &weights, bool reconstruct, std::vector< T > *coefficients)
void retire (int band)
void apply_swaps (int last)
bool cycle (const LinearOperator< T, Device > &op, const LinearOperator< T, Device > &preconditioner, const std::vector< double > &threshold, bool reconstruct, int max_iter, LinearSolveResult *result)

Private Attributes

const double tolerance_
int restart_
LinearWorkspace< T, Device > work_
LinearAlgebra< T, Device > algebra_
ct::Tensor krylov_
std::vector< std::vector< Wide > > h_
std::vector< std::vector< Wide > > g_
std::vector< std::vector< Wide > > sine_
std::vector< std::vector< double > > cosine_
std::vector< int > order_
std::vector< int > swaps_
int ld_ = 0
int dim_ = 0
int bands_ = 0
int stride_ = 0
int active_ = 0

Detailed Description

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

Restarted right-preconditioned GMRES with independent batched columns.

Member Typedef Documentation

◆ Real

template<typename T, typename Device>
using hsolver::LinearGMRES< T, Device >::Real = typename GetTypeReal<T>::type
private

◆ Wide

template<typename T, typename Device>
using hsolver::LinearGMRES< T, Device >::Wide = std::complex<double>
private

Constructor & Destructor Documentation

◆ LinearGMRES()

template<typename T, typename Device>
hsolver::LinearGMRES< T, Device >::LinearGMRES ( double tolerance,
int restart,
int max_iter,
const diag_comm_info & comm )

Member Function Documentation

◆ apply_swaps()

template<typename T, typename Device>
void hsolver::LinearGMRES< T, Device >::apply_swaps ( int last)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ back_substitute()

template<typename T, typename Device>
bool hsolver::LinearGMRES< T, Device >::back_substitute ( int b,
int j,
std::vector< Wide > * weights )
private
Here is the caller graph for this function:

◆ basis()

template<typename T, typename Device>
T * hsolver::LinearGMRES< T, Device >::basis ( int index)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cycle()

template<typename T, typename Device>
bool hsolver::LinearGMRES< T, Device >::cycle ( const LinearOperator< T, Device > & op,
const LinearOperator< T, Device > & preconditioner,
const std::vector< double > & threshold,
bool reconstruct,
int max_iter,
LinearSolveResult * result )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ direction()

template<typename T, typename Device>
T * hsolver::LinearGMRES< T, Device >::direction ( int index)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ image()

template<typename T, typename Device>
T * hsolver::LinearGMRES< T, Device >::image ( int index)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ orthogonalize()

template<typename T, typename Device>
void hsolver::LinearGMRES< T, Device >::orthogonalize ( int j,
T * next,
std::vector< T > * coefficients )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ residual()

template<typename T, typename Device>
T * hsolver::LinearGMRES< T, Device >::residual ( )
private
Here is the caller graph for this function:

◆ retire()

template<typename T, typename Device>
void hsolver::LinearGMRES< T, Device >::retire ( int band)
private
Here is the caller graph for this function:

◆ solution()

template<typename T, typename Device>
T * hsolver::LinearGMRES< T, Device >::solution ( )
private
Here is the caller graph for this function:

◆ solve()

template<typename T, typename Device>
LinearSolveResult hsolver::LinearGMRES< T, Device >::solve ( const LinearOperator< T, Device > & op,
const LinearOperator< T, Device > & preconditioner,
int ld,
int nvec,
int dim,
T * x,
const T * b,
const T * initial_residual,
bool force_check,
int max_iter,
bool reconstruct )

Use the per-call budget and reconstruction policy; force_check requests an independent final application.

Here is the call graph for this function:

◆ start_cycle()

template<typename T, typename Device>
bool hsolver::LinearGMRES< T, Device >::start_cycle ( const std::vector< double > & threshold,
std::vector< T > * coefficients )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_qr()

template<typename T, typename Device>
bool hsolver::LinearGMRES< T, Device >::update_qr ( int b,
int j,
double norm )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_solution()

template<typename T, typename Device>
void hsolver::LinearGMRES< T, Device >::update_solution ( int j,
const std::vector< int > & done,
const std::vector< std::vector< Wide > > & weights,
bool reconstruct,
std::vector< T > * coefficients )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vector()

template<typename T, typename Device>
T * hsolver::LinearGMRES< T, Device >::vector ( int slot)
private
Here is the caller graph for this function:

Member Data Documentation

◆ active_

template<typename T, typename Device>
int hsolver::LinearGMRES< T, Device >::active_ = 0
private

◆ algebra_

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

◆ bands_

template<typename T, typename Device>
int hsolver::LinearGMRES< T, Device >::bands_ = 0
private

◆ cosine_

template<typename T, typename Device>
std::vector<std::vector<double> > hsolver::LinearGMRES< T, Device >::cosine_
private

◆ dim_

template<typename T, typename Device>
int hsolver::LinearGMRES< T, Device >::dim_ = 0
private

◆ g_

template<typename T, typename Device>
std::vector<std::vector<Wide> > hsolver::LinearGMRES< T, Device >::g_
private

◆ h_

template<typename T, typename Device>
std::vector<std::vector<Wide> > hsolver::LinearGMRES< T, Device >::h_
private

◆ krylov_

template<typename T, typename Device>
ct::Tensor hsolver::LinearGMRES< T, Device >::krylov_
private

◆ ld_

template<typename T, typename Device>
int hsolver::LinearGMRES< T, Device >::ld_ = 0
private

◆ order_

template<typename T, typename Device>
std::vector<int> hsolver::LinearGMRES< T, Device >::order_
private

◆ restart_

template<typename T, typename Device>
int hsolver::LinearGMRES< T, Device >::restart_
private

◆ sine_

template<typename T, typename Device>
std::vector<std::vector<Wide> > hsolver::LinearGMRES< T, Device >::sine_
private

◆ stride_

template<typename T, typename Device>
int hsolver::LinearGMRES< T, Device >::stride_ = 0
private

◆ swaps_

template<typename T, typename Device>
std::vector<int> hsolver::LinearGMRES< T, Device >::swaps_
private

◆ tolerance_

template<typename T, typename Device>
const double hsolver::LinearGMRES< T, Device >::tolerance_
private

◆ work_

template<typename T, typename Device>
LinearWorkspace<T, Device> hsolver::LinearGMRES< T, Device >::work_
private

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