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

Right-preconditioned BiCGSTAB for independent complex right-hand sides. More...

#include <linear_bicgstab.h>

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

Public Member Functions

 LinearBiCGSTAB (const double tolerance, const diag_comm_info &comm)
LinearSolveResult solve (const LinearOperator< T, Device > &op, const LinearOperator< T, Device > &preconditioner, int ld, int nband, int dim, T *x, const T *b, const T *initial_residual, const int max_iterations)
 Solve A*x=b, using x as initial guess and M as inverse preconditioner.

Private Types

enum  WorkspaceSlot {
  residual_slot = 0 , shadow_slot = 1 , direction_slot = 2 , image_slot = 3 ,
  intermediate_slot = 4 , precond_direction_slot = 5 , precond_intermediate_slot = 6 , intermediate_image_slot = 7 ,
  solution_slot = 8
}

Private Member Functions

bool iterate (const LinearOperator< T, Device > &op, const LinearOperator< T, Device > &preconditioner, LinearSolveResult *result)
void retire (const int band)
void retire_converged (const bool alpha_step, const bool identity)
bool breakdown (const T divisor, const int band, LinearSolveResult *result) const

Private Attributes

const double tolerance_
LinearWorkspace< T, Device > work_
int ld_ = 0
int dim_ = 0
int active_ = 0
std::vector< T > beta_
std::vector< T > rho_
std::vector< T > rho_prev_
std::vector< T > alpha_
std::vector< T > omega_
std::vector< T > denominator_
std::vector< T > tt_
std::vector< T > norm_
std::vector< double > threshold_
std::vector< int > original_
std::vector< int > swaps_
std::vector< int > skip_

Detailed Description

template<typename T, typename Device = base_device::DEVICE_CPU>
class hsolver::LinearBiCGSTAB< T, Device >

Right-preconditioned BiCGSTAB for independent complex right-hand sides.

Member Enumeration Documentation

◆ WorkspaceSlot

template<typename T, typename Device = base_device::DEVICE_CPU>
enum hsolver::LinearBiCGSTAB::WorkspaceSlot
private
Enumerator
residual_slot 
shadow_slot 
direction_slot 
image_slot 
intermediate_slot 
precond_direction_slot 
precond_intermediate_slot 
intermediate_image_slot 
solution_slot 

Constructor & Destructor Documentation

◆ LinearBiCGSTAB()

template<typename T, typename Device>
hsolver::LinearBiCGSTAB< T, Device >::LinearBiCGSTAB ( const double tolerance,
const diag_comm_info & comm )

Member Function Documentation

◆ breakdown()

template<typename T, typename Device>
bool hsolver::LinearBiCGSTAB< T, Device >::breakdown ( const T divisor,
const int band,
LinearSolveResult * result ) const
private
Here is the call graph for this function:

◆ iterate()

template<typename T, typename Device>
bool hsolver::LinearBiCGSTAB< T, Device >::iterate ( const LinearOperator< T, Device > & op,
const LinearOperator< T, Device > & preconditioner,
LinearSolveResult * result )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ retire()

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

◆ retire_converged()

template<typename T, typename Device>
void hsolver::LinearBiCGSTAB< T, Device >::retire_converged ( const bool alpha_step,
const bool identity )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ solve()

template<typename T, typename Device>
LinearSolveResult hsolver::LinearBiCGSTAB< T, Device >::solve ( const LinearOperator< T, Device > & op,
const LinearOperator< T, Device > & preconditioner,
int ld,
int nband,
int dim,
T * x,
const T * b,
const T * initial_residual,
const int max_iterations )

Solve A*x=b, using x as initial guess and M as inverse preconditioner.

Parameters
ldColumn stride, at least dim. Padding is neither read nor overwritten.
dimLocal valid row count; may be zero on an MPI participant.
initial_residualOptional initial residual, reused on the first cycle only; otherwise nullptr.
max_iterationsIteration budget for this call, shared by all restart cycles.
Note
Accepts only true residuals below tolerance*max(1, norm(b)) per column.
Here is the call graph for this function:

Member Data Documentation

◆ active_

template<typename T, typename Device = base_device::DEVICE_CPU>
int hsolver::LinearBiCGSTAB< T, Device >::active_ = 0
private

◆ alpha_

template<typename T, typename Device = base_device::DEVICE_CPU>
std::vector<T> hsolver::LinearBiCGSTAB< T, Device >::alpha_
private

◆ beta_

template<typename T, typename Device = base_device::DEVICE_CPU>
std::vector<T> hsolver::LinearBiCGSTAB< T, Device >::beta_
private

◆ denominator_

template<typename T, typename Device = base_device::DEVICE_CPU>
std::vector<T> hsolver::LinearBiCGSTAB< T, Device >::denominator_
private

◆ dim_

template<typename T, typename Device = base_device::DEVICE_CPU>
int hsolver::LinearBiCGSTAB< T, Device >::dim_ = 0
private

◆ ld_

template<typename T, typename Device = base_device::DEVICE_CPU>
int hsolver::LinearBiCGSTAB< T, Device >::ld_ = 0
private

◆ norm_

template<typename T, typename Device = base_device::DEVICE_CPU>
std::vector<T> hsolver::LinearBiCGSTAB< T, Device >::norm_
private

◆ omega_

template<typename T, typename Device = base_device::DEVICE_CPU>
std::vector<T> hsolver::LinearBiCGSTAB< T, Device >::omega_
private

◆ original_

template<typename T, typename Device = base_device::DEVICE_CPU>
std::vector<int> hsolver::LinearBiCGSTAB< T, Device >::original_
private

◆ rho_

template<typename T, typename Device = base_device::DEVICE_CPU>
std::vector<T> hsolver::LinearBiCGSTAB< T, Device >::rho_
private

◆ rho_prev_

template<typename T, typename Device = base_device::DEVICE_CPU>
std::vector<T> hsolver::LinearBiCGSTAB< T, Device >::rho_prev_
private

◆ skip_

template<typename T, typename Device = base_device::DEVICE_CPU>
std::vector<int> hsolver::LinearBiCGSTAB< T, Device >::skip_
private

◆ swaps_

template<typename T, typename Device = base_device::DEVICE_CPU>
std::vector<int> hsolver::LinearBiCGSTAB< T, Device >::swaps_
private

◆ threshold_

template<typename T, typename Device = base_device::DEVICE_CPU>
std::vector<double> hsolver::LinearBiCGSTAB< T, Device >::threshold_
private

◆ tolerance_

template<typename T, typename Device = base_device::DEVICE_CPU>
const double hsolver::LinearBiCGSTAB< T, Device >::tolerance_
private

◆ tt_

template<typename T, typename Device = base_device::DEVICE_CPU>
std::vector<T> hsolver::LinearBiCGSTAB< T, Device >::tt_
private

◆ work_

template<typename T, typename Device = base_device::DEVICE_CPU>
LinearWorkspace<T, Device> hsolver::LinearBiCGSTAB< T, Device >::work_
private

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