ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
hsolver_linear.h
Go to the documentation of this file.
1#ifndef HSOLVER_LINEAR_H
2#define HSOLVER_LINEAR_H
6
7#include <memory>
8
9namespace hsolver
10{
12template <typename T, typename Device = base_device::DEVICE_CPU>
14{
15 private:
16 std::unique_ptr<LinearBiCGSTAB<T, Device>> bicgstab_;
17 std::unique_ptr<LinearCGS<T, Device>> cgs_;
18 std::unique_ptr<LinearGMRES<T, Device>> gmres_;
19 double tolerance_ = 0.0;
20 const int max_iter_;
21 const bool reconstruct_;
22
23 public:
24 HSolverLinear(const LinearControls& linear_ctrl, const diag_comm_info& comm);
26 double tolerance() const
27 {
28 return tolerance_;
29 }
30
32 const LinearOperator<T, Device>& preconditioner,
33 int ld,
34 int nvec,
35 int dim,
36 T* x,
37 const T* b,
38 const T* initial_residual,
39 bool force_check);
42 const LinearOperator<T, Device>& preconditioner,
43 int ld,
44 int nvec,
45 int dim,
46 T* x,
47 const T* b,
48 const T* initial_residual,
49 bool force_check,
50 int max_iter,
51 bool reconstruct);
52};
53} // namespace hsolver
54#endif
const int max_iter_
Definition hsolver_linear.h:20
HSolverLinear(const LinearControls &linear_ctrl, const diag_comm_info &comm)
Definition hsolver_linear.cpp:26
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)
Reuse an optional CN residual and control independent GMRES verification.
Definition hsolver_linear.cpp:51
double tolerance() const
Return the effective tolerance after resolving the precision-dependent default.
Definition hsolver_linear.h:26
const bool reconstruct_
Definition hsolver_linear.h:21
std::unique_ptr< LinearGMRES< T, Device > > gmres_
Definition hsolver_linear.h:18
std::unique_ptr< LinearBiCGSTAB< T, Device > > bicgstab_
Definition hsolver_linear.h:16
double tolerance_
Definition hsolver_linear.h:19
std::unique_ptr< LinearCGS< T, Device > > cgs_
Definition hsolver_linear.h:17
Device-resident block operator for independent right-hand sides.
Definition linear_operator.h:31
#define T
Definition exp.cpp:237
Definition dense_eigensolver.cpp:23
Numerical policy; tolerance zero selects the precision-aware default.
Definition linear_solver_types.h:42
Convergence result, operator work, and independent or reconstructed residual provenance.
Definition linear_solver_types.h:20
Definition diag_comm_info.h:12