TiledArray::math::linalg::ConjugateGradientSolver< D, F > Struct Template Reference
Documentation
template<typename D, typename F>
struct TiledArray::math::linalg::ConjugateGradientSolver< D, F >
Solves real linear system a(x) = b , with a is a linear function of x , using conjugate gradient solver with a diagonal preconditioner.
- Template Parameters
-
D type of xandb, as well as the preconditioner;F type that evaluates the LHS, will call F::operator()(x,result),Dmust implementoperator()(const D&, D&) constD::element_typemust be defined andDmust provide the following stand-alone functions:std::size_t volume(const D&)(returns the total number of elements)D clone(const D&), returns a deep copyvalue_type minabs_value(const D&)value_type maxabs_value(const D&)void vec_multiply(D& a, const D& b)(element-wise multiply ofabyb)value_type inner_product(const D& a, const D& b)void scale(D&, value_type)void axpy(D& y,value_type a, const D& x)void assign(D&, const D&)double norm2(const D&)
Definition at line 62 of file conjgrad.h.
Public Types | |
| typedef D::element_type | value_type |
Public Member Functions | |
| value_type | operator() (F &a, const D &b, D &x, const D &preconditioner, value_type convergence_target=-1.0) |
Member Typedef Documentation
◆ value_type
template<typename D , typename F >
| typedef D::element_type TiledArray::math::linalg::ConjugateGradientSolver< D, F >::value_type |
Definition at line 63 of file conjgrad.h.
Member Function Documentation
◆ operator()()
template<typename D , typename F >
|
inline |
- Parameters
-
a object of type F b RHS x unknown preconditioner convergence_target The convergence target [default = -1.0]
- Returns
- The 2-norm of the residual, a(x) - b, divided by the number of elements in the residual.
Definition at line 72 of file conjgrad.h.
Here is the call graph for this function:

The documentation for this struct was generated from the following file:
- TiledArray/math/linalg/conjgrad.h
1.8.20