Medusa  1.1
Coordinate Free Mehless Method implementation
mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep Class Reference

#include <RKExplicit_fwd.hpp>

Detailed Description

template<typename Scalar, int num_stages>
template<typename func_t>
class mm::RKExplicit< Scalar, num_stages >::Integrator< func_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 87 of file RKExplicit_fwd.hpp.

+ Inheritance diagram for mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep:
+ Collaboration diagram for mm::RKExplicit< Scalar, num_stages >::Integrator< func_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::VectorXd value () const
 Get current value. More...
 
scalar_ttime ()
 Read-write access to current time. More...
 
Eigen::VectorXd & 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::VectorXd y
 current value More...
 
int cur_step
 current step More...
 

Constructor & Destructor Documentation

◆ IterationStep() [1/2]

template<typename Scalar , int num_stages>
template<typename func_t >
mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep::IterationStep ( const Integrator integrator)
inlineexplicit

Construct an iterator at the initial values of the equation.

Definition at line 101 of file RKExplicit_fwd.hpp.

◆ IterationStep() [2/2]

template<typename Scalar , int num_stages>
template<typename func_t >
mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep::IterationStep ( const Integrator integrator,
int   
)
inline

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

Definition at line 105 of file RKExplicit_fwd.hpp.

Member Function Documentation

◆ is_last()

template<typename Scalar , int num_stages>
template<typename func_t >
bool mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep::is_last ( ) const
inline

Returns true if integrator just completed its last step.

Definition at line 145 of file RKExplicit_fwd.hpp.

◆ operator bool()

template<typename Scalar , int num_stages>
template<typename func_t >
mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep::operator bool ( )
inlineexplicit

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

Definition at line 140 of file RKExplicit_fwd.hpp.

◆ operator!=()

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

Negation of IterationStep::operator==.

Definition at line 131 of file RKExplicit_fwd.hpp.

◆ operator*() [1/2]

template<typename Scalar , int num_stages>
template<typename func_t >
IterationStep& mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep::operator* ( )
inline

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

Definition at line 134 of file RKExplicit_fwd.hpp.

◆ operator*() [2/2]

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

const version of IterationStep::operator*

Definition at line 137 of file RKExplicit_fwd.hpp.

◆ operator++() [1/2]

template<typename Scalar , int num_stages>
template<typename func_t >
IterationStep& mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep::operator++ ( )
inline

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

Definition at line 109 of file RKExplicit_fwd.hpp.

◆ operator++() [2/2]

template<typename Scalar , int num_stages>
template<typename func_t >
IterationStep mm::RKExplicit< Scalar, num_stages >::Integrator< func_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 121 of file RKExplicit_fwd.hpp.

◆ operator==()

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

Compare two steppers if they are on the same step.

Definition at line 128 of file RKExplicit_fwd.hpp.

◆ time() [1/2]

template<typename Scalar , int num_stages>
template<typename func_t >
scalar_t& mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep::time ( )
inline

Read-write access to current time.

Definition at line 156 of file RKExplicit_fwd.hpp.

◆ time() [2/2]

template<typename Scalar , int num_stages>
template<typename func_t >
scalar_t mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep::time ( ) const
inline

Get current time.

Definition at line 150 of file RKExplicit_fwd.hpp.

◆ value() [1/2]

template<typename Scalar , int num_stages>
template<typename func_t >
Eigen::VectorXd& mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep::value ( )
inline

Read-write access to current value.

Definition at line 159 of file RKExplicit_fwd.hpp.

◆ value() [2/2]

template<typename Scalar , int num_stages>
template<typename func_t >
Eigen::VectorXd mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep::value ( ) const
inline

Get current value.

Definition at line 153 of file RKExplicit_fwd.hpp.

Friends And Related Function Documentation

◆ operator<<

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

Output current state of the stepper.

Definition at line 162 of file RKExplicit_fwd.hpp.

Member Data Documentation

◆ cur_step

template<typename Scalar , int num_stages>
template<typename func_t >
int mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep::cur_step
private

current step

Definition at line 97 of file RKExplicit_fwd.hpp.

◆ integrator

template<typename Scalar , int num_stages>
template<typename func_t >
const Integrator& mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep::integrator
private

reference to underlying integrator

Definition at line 94 of file RKExplicit_fwd.hpp.

◆ t

template<typename Scalar , int num_stages>
template<typename func_t >
scalar_t mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep::t
private

current time

Definition at line 95 of file RKExplicit_fwd.hpp.

◆ y

template<typename Scalar , int num_stages>
template<typename func_t >
Eigen::VectorXd mm::RKExplicit< Scalar, num_stages >::Integrator< func_t >::IterationStep::y
private

current value

Definition at line 96 of file RKExplicit_fwd.hpp.


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