numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
num_collect::ode::step_size_controller_base< Derived, Formula > Class Template Reference

Base class of classes to control step sizes. More...

#include <num_collect/ode/step_size_controller_base.h>

+ Inheritance diagram for num_collect::ode::step_size_controller_base< Derived, Formula >:
+ Collaboration diagram for num_collect::ode::step_size_controller_base< Derived, Formula >:

Public Types

using formula_type = Formula
 Type of formula.
 
using problem_type = typename formula_type::problem_type
 Type of problem.
 
using scalar_type = typename problem_type::scalar_type
 Type of scalars.
 
using variable_type = typename problem_type::variable_type
 Type of variables.
 

Public Member Functions

auto limits () const -> const step_size_limits< scalar_type > &
 Get the limits of step sizes.
 
auto limits (const step_size_limits< scalar_type > &val) -> Derived &
 Set the limits of step sizes.
 
auto reduction_rate (const scalar_type &val) -> Derived &
 Set the rate to reduce step sizes when error is large.
 
auto tolerances () const -> const error_tolerances< variable_type > &
 Get the error tolerances.
 
auto tolerances (const error_tolerances< variable_type > &val) -> Derived &
 Set the error tolerances.
 
- Public Member Functions inherited from num_collect::logging::logging_mixin
 logging_mixin (log_tag_view tag)
 Constructor.
 
template<typename Child >
void configure_child_algorithm_logger_if_exists (Child &child)
 Configure a logger of a child algorithm if exists.
 
auto logger () const noexcept -> const num_collect::logging::logger &
 Access to the logger.
 
auto logger () noexcept -> num_collect::logging::logger &
 Access to the logger.
 

Protected Member Functions

 step_size_controller_base (logging::log_tag_view tag)
 Constructor.
 
auto derived () const noexcept -> const Derived &
 Access derived object.
 
auto derived () noexcept -> Derived &
 Access derived object.
 
auto reduce_if_needed (scalar_type &step_size, const variable_type &variable, const variable_type &error) -> bool
 Reduce step size if needed.
 

Private Attributes

step_size_limits< scalar_typelimits_ {}
 Limits of step sizes.
 
scalar_type reduction_rate_ {default_reduction_rate}
 Rate to reduce step sizes when error is large.
 
error_tolerances< variable_typetolerances_ {}
 Error tolerances.
 

Static Private Attributes

static constexpr auto default_reduction_rate
 Default rate to reduce step sizes when error is large.
 

Detailed Description

template<typename Derived, concepts::formula Formula>
class num_collect::ode::step_size_controller_base< Derived, Formula >

Base class of classes to control step sizes.

Template Parameters
DerivedType of derived class.
FormulaType of the formula.

Definition at line 40 of file step_size_controller_base.h.

Member Typedef Documentation

◆ formula_type

template<typename Derived , concepts::formula Formula>
using num_collect::ode::step_size_controller_base< Derived, Formula >::formula_type = Formula

Type of formula.

Definition at line 43 of file step_size_controller_base.h.

◆ problem_type

template<typename Derived , concepts::formula Formula>
using num_collect::ode::step_size_controller_base< Derived, Formula >::problem_type = typename formula_type::problem_type

Type of problem.

Definition at line 46 of file step_size_controller_base.h.

◆ scalar_type

template<typename Derived , concepts::formula Formula>
using num_collect::ode::step_size_controller_base< Derived, Formula >::scalar_type = typename problem_type::scalar_type

Type of scalars.

Definition at line 52 of file step_size_controller_base.h.

◆ variable_type

template<typename Derived , concepts::formula Formula>
using num_collect::ode::step_size_controller_base< Derived, Formula >::variable_type = typename problem_type::variable_type

Type of variables.

Definition at line 49 of file step_size_controller_base.h.

Constructor & Destructor Documentation

◆ step_size_controller_base()

template<typename Derived , concepts::formula Formula>
num_collect::ode::step_size_controller_base< Derived, Formula >::step_size_controller_base ( logging::log_tag_view tag)
inlineexplicitprotected

Constructor.

Parameters
[in]tagLog tag.

Definition at line 115 of file step_size_controller_base.h.

Member Function Documentation

◆ derived() [1/2]

template<typename Derived , concepts::formula Formula>
auto num_collect::ode::step_size_controller_base< Derived, Formula >::derived ( ) const -> const Derived&
inlinenodiscardprotectednoexcept

Access derived object.

Returns
Reference to the derived object.

Definition at line 132 of file step_size_controller_base.h.

◆ derived() [2/2]

template<typename Derived , concepts::formula Formula>
auto num_collect::ode::step_size_controller_base< Derived, Formula >::derived ( ) -> Derived&
inlinenodiscardprotectednoexcept

Access derived object.

Returns
Reference to the derived object.

Definition at line 123 of file step_size_controller_base.h.

◆ limits() [1/2]

template<typename Derived , concepts::formula Formula>
auto num_collect::ode::step_size_controller_base< Derived, Formula >::limits ( ) const -> const step_size_limits<scalar_type>&
inlinenodiscard

Get the limits of step sizes.

Returns
Value.

Definition at line 70 of file step_size_controller_base.h.

◆ limits() [2/2]

template<typename Derived , concepts::formula Formula>
auto num_collect::ode::step_size_controller_base< Derived, Formula >::limits ( const step_size_limits< scalar_type > & val) -> Derived&
inline

Set the limits of step sizes.

Parameters
[in]valValue.
Returns
This.

Definition at line 60 of file step_size_controller_base.h.

◆ reduce_if_needed()

template<typename Derived , concepts::formula Formula>
auto num_collect::ode::step_size_controller_base< Derived, Formula >::reduce_if_needed ( scalar_type & step_size,
const variable_type & variable,
const variable_type & error ) -> bool
inlinenodiscardprotected

Reduce step size if needed.

Parameters
[in,out]step_sizeStep size.
[in]variableVariable.
[in]errorError estimate.
Return values
trueStep size was reduced.
falseOtherwise.

Definition at line 145 of file step_size_controller_base.h.

◆ reduction_rate()

template<typename Derived , concepts::formula Formula>
auto num_collect::ode::step_size_controller_base< Derived, Formula >::reduction_rate ( const scalar_type & val) -> Derived&
inline

Set the rate to reduce step sizes when error is large.

Parameters
[in]valValue.
Returns
This.

Definition at line 101 of file step_size_controller_base.h.

◆ tolerances() [1/2]

template<typename Derived , concepts::formula Formula>
auto num_collect::ode::step_size_controller_base< Derived, Formula >::tolerances ( ) const -> const error_tolerances<variable_type>&
inlinenodiscard

Get the error tolerances.

Returns
Error tolerances.

Definition at line 90 of file step_size_controller_base.h.

◆ tolerances() [2/2]

template<typename Derived , concepts::formula Formula>
auto num_collect::ode::step_size_controller_base< Derived, Formula >::tolerances ( const error_tolerances< variable_type > & val) -> Derived&
inline

Set the error tolerances.

Parameters
[in]valValue.
Returns
This.

Definition at line 80 of file step_size_controller_base.h.

Member Data Documentation

◆ default_reduction_rate

template<typename Derived , concepts::formula Formula>
auto num_collect::ode::step_size_controller_base< Derived, Formula >::default_reduction_rate
staticconstexprprivate
Initial value:
=
static_cast<scalar_type>(0.5)
typename problem_type::scalar_type scalar_type
Type of scalars.

Default rate to reduce step sizes when error is large.

Definition at line 173 of file step_size_controller_base.h.

◆ limits_

template<typename Derived , concepts::formula Formula>
step_size_limits<scalar_type> num_collect::ode::step_size_controller_base< Derived, Formula >::limits_ {}
private

Limits of step sizes.

Definition at line 167 of file step_size_controller_base.h.

◆ reduction_rate_

template<typename Derived , concepts::formula Formula>
scalar_type num_collect::ode::step_size_controller_base< Derived, Formula >::reduction_rate_ {default_reduction_rate}
private

Rate to reduce step sizes when error is large.

Definition at line 177 of file step_size_controller_base.h.

◆ tolerances_

template<typename Derived , concepts::formula Formula>
error_tolerances<variable_type> num_collect::ode::step_size_controller_base< Derived, Formula >::tolerances_ {}
private

Error tolerances.

Definition at line 170 of file step_size_controller_base.h.


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