|
Mundy: Multibody Nonlocal Dynamics Version of the Day
|
The CG strategy: initialize/iterate/done/result over (Problem, State), preconditioned by Precond. More...
#include <linear_system.hpp>
Public Types | |
| using | value_type = typename Config::value_type |
| using | residual_policy_t = ResidualPolicy |
| using | config_t = Config |
| using | preconditioner_t = Precond |
| using | result_t = CGResult<value_type> |
Public Member Functions | |
| CGStrategy (residual_policy_t resid, config_t cfg={}) | |
| CGStrategy (residual_policy_t resid, config_t cfg, Precond &&precond) | |
| const auto & | precond () const |
| template<class Problem, class State> | |
| void | initialize (const Problem &prob, State &state) const |
| template<class Problem, class State> | |
| bool | iterate (const Problem &prob, State &state) const |
| template<class State> | |
| bool | done (const State &state) const |
| template<class State> | |
| result_t | result (const State &state) const |
alpha/beta are fixed by the conjugate-direction recurrence, so there is no step policy – only how the residual is measured (ResidualPolicy, a VectorResidualPolicy) and the preconditioner P (a Preconditioner) are pluggable. The residual measured is that of A x = b, with or without P. CG starts from alpha x for the caller's guess x, alpha = x^T b / x^T A x, the multiple of x nearest the solution in the A-norm, wherever x^T A x > 0.
| using mundy::CGStrategy< ResidualPolicy, Config, Precond >::value_type = typename Config::value_type |
| using mundy::CGStrategy< ResidualPolicy, Config, Precond >::residual_policy_t = ResidualPolicy |
| using mundy::CGStrategy< ResidualPolicy, Config, Precond >::config_t = Config |
| using mundy::CGStrategy< ResidualPolicy, Config, Precond >::preconditioner_t = Precond |
| using mundy::CGStrategy< ResidualPolicy, Config, Precond >::result_t = CGResult<value_type> |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |