MPQC  3.0.0-alpha
sc::ConjugateGradientSolver< D, F > Struct Template Reference

Solves linear system a(x) = b using conjugate gradient solver where a is a linear function of x. More...

#include <math/optimize/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)
 

Detailed Description

template<typename D, typename F>
struct sc::ConjugateGradientSolver< D, F >

Solves linear system a(x) = b using conjugate gradient solver where a is a linear function of x.

Template Parameters
Dtype of x and b, as well as the preconditioner; must implement the following standalone functions:
  • size_t size(const D&)
  • D clone(const D&)
  • D copy(const D&)
  • value_type minabs_value(const D&)
  • value_type maxabs_value(const D&)
  • void vec_multiply(D& a, const D& b) (element-wise multiply of a by b)
  • value_type dot_product(const D& a, const D& b)
  • void scale(D&, value_type)
  • void daxpy(D& y, value_type a, const D& x)
  • void assign(D&, const D&)
  • double norm2(const D&)
Ftype that evaluates the LHS, will call F::operator()(x, result), hence must implement operator()(const D&, D&) const
Parameters
aobject of type F
bRHS
xunknown
preconditioner
convergence_target
Returns
the 2-norm of the residual, a(x) - b, divided by the number of elements in the residual.

The documentation for this struct was generated from the following file:

Generated at Sun Jan 26 2020 23:24:04 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.