Template Numerical Library version\ main:8b8c8226
|
Public Types | |
using | DeviceType = typename Vector::DeviceType |
using | IndexType = typename Vector::IndexType |
using | RealType = typename Vector::RealType |
using | VectorType = Vector |
using | VectorView = typename Vector::ViewType |
![]() | |
using | SolverMonitorType = SolverMonitor |
Type of an object used for monitoring of the convergence. | |
Public Member Functions | |
const RealType & | getRelaxation () const |
void | setRelaxation (const RealType &lambda) |
bool | setup (const Config::ParameterContainer ¶meters, const String &prefix="") |
template<typename GradientGetter > | |
bool | solve (VectorView &w, GradientGetter &&getGradient) |
![]() | |
IterativeSolver ()=default | |
Default constructor. | |
bool | checkConvergence () |
Checks whether the convergence occurred already. More... | |
bool | checkNextIteration () |
Checks if the solver is allowed to do the next iteration. More... | |
const Real & | getConvergenceResidue () const |
Gets the the convergence threshold. More... | |
const Real & | getDivergenceResidue () const |
Gets the limit for the divergence criterion. More... | |
const Index & | getIterations () const |
Gets the number of iterations performed by the solver so far. More... | |
const Index & | getMaxIterations () const |
Gets the maximal number of iterations the solver is allowed to perform. More... | |
const Index & | getMinIterations () const |
Gets the minimal number of iterations the solver is supposed to do. More... | |
const Real & | getResidue () const |
Gets the residue reached at the current iteration. More... | |
bool | nextIteration () |
Proceeds to the next iteration. More... | |
void | resetIterations () |
Sets the the number of the current iterations to zero. | |
void | setConvergenceResidue (const Real &convergenceResidue) |
Sets the threshold for the convergence. More... | |
void | setDivergenceResidue (const Real &divergenceResidue) |
Sets the residue limit for the divergence criterion. More... | |
void | setMaxIterations (const Index &maxIterations) |
Sets the maximal number of iterations the solver is allowed to perform. More... | |
void | setMinIterations (const Index &minIterations) |
Sets the minimal number of iterations the solver is supposed to do. More... | |
void | setRefreshRate (const Index &refreshRate) |
Sets the refresh rate (in milliseconds) for the solver monitor. More... | |
void | setResidue (const Real &residue) |
Sets the residue reached at the current iteration. More... | |
void | setSolverMonitor (SolverMonitorType &solverMonitor) |
Sets the solver monitor object. More... | |
bool | setup (const Config::ParameterContainer ¶meters, const String &prefix="") |
Method for setup of the iterative solver based on configuration parameters. More... | |
Static Public Member Functions | |
static void | configSetup (Config::ConfigDescription &config, const String &prefix="") |
![]() | |
static void | configSetup (Config::ConfigDescription &config, const String &prefix="") |
This method defines configuration entries for setup of the iterative solver. More... | |
Protected Attributes | |
VectorType | a |
RealType | epsilon = 1.0e-8 |
VectorType | gradient |
RealType | relaxation = 1.0 |
![]() | |
Real | convergenceResidue = 1e-6 |
Index | currentIteration = 0 |
Real | currentResidue = 0 |
Real | divergenceResidue = std::numeric_limits< Real >::max() |
Index | maxIterations = 1000000000 |
Index | minIterations = 0 |
Index | refreshRate = 1 |
std::ofstream | residualHistoryFile |
String | residualHistoryFileName = "" |
SolverMonitor * | solverMonitor = nullptr |