GQCP
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
GQCP::IterativeAlgorithm< _Environment > Class Template Reference

#include <IterativeAlgorithm.hpp>

Collaboration diagram for GQCP::IterativeAlgorithm< _Environment >:
Collaboration graph

Public Types

using Environment = _Environment
 

Public Member Functions

template<typename Criterion >
 IterativeAlgorithm (const StepCollection< Environment > &steps, const Criterion &convergence_criterion, const size_t maximum_number_of_iterations=128)
 
std::string description () const
 
template<typename Z = Step<Environment>>
enable_if_t< std::is_same< Environment, typename Z::Environment >::value, void > insert (const Z &step, const size_t index)
 
size_t maximumNumberOfIterations () const
 
size_t numberOfIterations () const
 
void perform (Environment &environment)
 
void remove (const size_t index)
 
template<typename Z = Step<Environment>>
enable_if_t< std::is_same< Environment, typename Z::Environment >::value, void > replace (const Z &step, const size_t index)
 

Detailed Description

template<typename _Environment>
class GQCP::IterativeAlgorithm< _Environment >

An algorithm that performs iterations. In every iteration, convergence is checked and a set of iteration steps is performed.

Parameters
_Environmentthe type of environment that this algorithm is associated to

Member Typedef Documentation

◆ Environment

template<typename _Environment >
using GQCP::IterativeAlgorithm< _Environment >::Environment = _Environment

Constructor & Destructor Documentation

◆ IterativeAlgorithm()

template<typename _Environment >
template<typename Criterion >
GQCP::IterativeAlgorithm< _Environment >::IterativeAlgorithm ( const StepCollection< Environment > &  steps,
const Criterion &  convergence_criterion,
const size_t  maximum_number_of_iterations = 128 
)
inline

Initialize the members of the iterative algorithm

Template Parameters
Criterionthe type of the convergence criterion that is used
Parameters
stepsthe collection of algorithm steps that is performed in-between convergence checks
convergence_criterionthe convergence criterion that must be fulfilled in order for the algorithm to have converged
maximum_number_of_iterationsthe maximum number of iterations the algorithm may perform

Member Function Documentation

◆ description()

template<typename _Environment >
std::string GQCP::IterativeAlgorithm< _Environment >::description ( ) const
inline
Returns
a textual description of this iterative algorithm.

◆ insert()

template<typename _Environment >
template<typename Z = Step<Environment>>
enable_if_t< std::is_same< Environment, typename Z::Environment >::value, void > GQCP::IterativeAlgorithm< _Environment >::insert ( const Z &  step,
const size_t  index 
)
inline

Insert an algorithm step at the given index.

Parameters
stepthe step that should be inserted into this algorithm
indexthe zero-based index that the given step should be performed at in this algorithm

◆ maximumNumberOfIterations()

template<typename _Environment >
size_t GQCP::IterativeAlgorithm< _Environment >::maximumNumberOfIterations ( ) const
inline
Returns
the maximum number of iterations the algorithm may perform

◆ numberOfIterations()

template<typename _Environment >
size_t GQCP::IterativeAlgorithm< _Environment >::numberOfIterations ( ) const
inline
Returns
the number of iterations that have been performed

◆ perform()

template<typename _Environment >
void GQCP::IterativeAlgorithm< _Environment >::perform ( Environment environment)
inline

Perform the iteration steps until convergence is achieved

Parameters
environmentthe environment that this algorithm is associated to

◆ remove()

template<typename _Environment >
void GQCP::IterativeAlgorithm< _Environment >::remove ( const size_t  index)
inline

Remove the algorithm step at the given index.

Parameters
indexthe zero-based index of the step in this algorithm that should be removed

◆ replace()

template<typename _Environment >
template<typename Z = Step<Environment>>
enable_if_t< std::is_same< Environment, typename Z::Environment >::value, void > GQCP::IterativeAlgorithm< _Environment >::replace ( const Z &  step,
const size_t  index 
)
inline

Replace an algorithm step at the given index.

Parameters
stepthe step that should be inserted into this algorithm
indexthe zero-based index of the step that should be replaced

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