Medusa  1.1
Coordinate Free Mehless Method implementation
mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep Class Reference

#include <AdamsBashforth_fwd.hpp>

Detailed Description

template<typename Scalar, int num_steps>
template<typename func_t, typename initial_method_t = RKExplicit<Scalar, num_steps>>
class mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep

Class representing a step in the integration process.

This class satisfies std::forward_iterator requirements and can therefore be used with STL-type algorithms.

Definition at line 85 of file AdamsBashforth_fwd.hpp.

+ Inheritance diagram for mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep:
+ Collaboration diagram for mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep:

Public Member Functions

 IterationStep (const Integrator &integrator)
 Construct an iterator at the initial values of the equation. More...
 
 IterationStep (const Integrator &integrator, int)
 Construct an (invalid) iterator pointing past the last step. More...
 
IterationStepoperator++ ()
 Advance the stepper for one time step, returning the new value. More...
 
IterationStep operator++ (int)
 Advance the stepper for one time step, returning the old value. More...
 
bool operator== (const IterationStep &other) const
 Compare two steppers if they are on the same step. More...
 
bool operator!= (const IterationStep &other) const
 Negation of IterationStep::operator==. More...
 
IterationStepoperator* ()
 Noop, used to conform to std::iterator requirements. More...
 
const IterationStepoperator* () const
 const version of IterationStep::operator* More...
 
 operator bool ()
 Returns false if integrator went past the last step and true otherwise. More...
 
bool is_last () const
 Returns true if integrator just completed its last step. More...
 
scalar_t time () const
 Get current time. More...
 
Eigen::Matrix< scalar_t, Eigen::Dynamic, steps >::ConstColXpr value () const
 Get current value. More...
 
scalar_ttime ()
 Read-write access to current time. More...
 
Eigen::Matrix< scalar_t, Eigen::Dynamic, steps >::ColXpr value ()
 Read-write access to current value. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const IterationStep &step)
 Output current state of the stepper. More...
 

Private Attributes

const Integratorintegrator
 reference to underlying integrator More...
 
scalar_t t
 current time More...
 
Eigen::Matrix< scalar_t, Eigen::Dynamic, stepslast_ys
 current value More...
 
int cur_step
 current step More...
 

Constructor & Destructor Documentation

◆ IterationStep() [1/2]

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::IterationStep ( const Integrator integrator)
inlineexplicit

Construct an iterator at the initial values of the equation.

Definition at line 99 of file AdamsBashforth_fwd.hpp.

◆ IterationStep() [2/2]

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::IterationStep ( const Integrator integrator,
int   
)
inline

Construct an (invalid) iterator pointing past the last step.

Definition at line 106 of file AdamsBashforth_fwd.hpp.

Member Function Documentation

◆ is_last()

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
bool mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::is_last ( ) const
inline

Returns true if integrator just completed its last step.

Definition at line 141 of file AdamsBashforth_fwd.hpp.

◆ operator bool()

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::operator bool ( )
inlineexplicit

Returns false if integrator went past the last step and true otherwise.

Definition at line 136 of file AdamsBashforth_fwd.hpp.

◆ operator!=()

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
bool mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::operator!= ( const IterationStep other) const
inline

Negation of IterationStep::operator==.

Definition at line 127 of file AdamsBashforth_fwd.hpp.

◆ operator*() [1/2]

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
IterationStep& mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::operator* ( )
inline

Noop, used to conform to std::iterator requirements.

Definition at line 130 of file AdamsBashforth_fwd.hpp.

◆ operator*() [2/2]

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
const IterationStep& mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::operator* ( ) const
inline

const version of IterationStep::operator*

Definition at line 133 of file AdamsBashforth_fwd.hpp.

◆ operator++() [1/2]

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t >
AdamsBashforth< Scalar, num_steps >::template Integrator< func_t, initial_method_t >::IterationStep & mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::operator++

Advance the stepper for one time step, returning the new value.

Definition at line 19 of file AdamsBashforth.hpp.

◆ operator++() [2/2]

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
IterationStep mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::operator++ ( int  )
inline

Advance the stepper for one time step, returning the old value.

Warning
usually the prefix increment ++step is preferred, due to not having a temporary variable.

Definition at line 117 of file AdamsBashforth_fwd.hpp.

◆ operator==()

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
bool mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::operator== ( const IterationStep other) const
inline

Compare two steppers if they are on the same step.

Definition at line 124 of file AdamsBashforth_fwd.hpp.

◆ time() [1/2]

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
scalar_t& mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::time ( )
inline

Read-write access to current time.

Definition at line 154 of file AdamsBashforth_fwd.hpp.

◆ time() [2/2]

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
scalar_t mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::time ( ) const
inline

Get current time.

Definition at line 146 of file AdamsBashforth_fwd.hpp.

◆ value() [1/2]

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
Eigen::Matrix<scalar_t, Eigen::Dynamic, steps>::ColXpr mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::value ( )
inline

Read-write access to current value.

Definition at line 157 of file AdamsBashforth_fwd.hpp.

◆ value() [2/2]

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
Eigen::Matrix<scalar_t, Eigen::Dynamic, steps>::ConstColXpr mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::value ( ) const
inline

Get current value.

Definition at line 149 of file AdamsBashforth_fwd.hpp.

Friends And Related Function Documentation

◆ operator<<

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
std::ostream& operator<< ( std::ostream &  os,
const IterationStep step 
)
friend

Output current state of the stepper.

Definition at line 162 of file AdamsBashforth_fwd.hpp.

Member Data Documentation

◆ cur_step

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
int mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::cur_step
private

current step

Definition at line 95 of file AdamsBashforth_fwd.hpp.

◆ integrator

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
const Integrator& mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::integrator
private

reference to underlying integrator

Definition at line 92 of file AdamsBashforth_fwd.hpp.

◆ last_ys

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
Eigen::Matrix<scalar_t, Eigen::Dynamic, steps> mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::last_ys
private

current value

Definition at line 94 of file AdamsBashforth_fwd.hpp.

◆ t

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
scalar_t mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::IterationStep::t
private

current time

Definition at line 93 of file AdamsBashforth_fwd.hpp.


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