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

Base class of formulas in ODE solvers. More...

#include <num_collect/ode/formula_base.h>

+ Inheritance diagram for num_collect::ode::formula_base< Derived, Problem >:
+ Collaboration diagram for num_collect::ode::formula_base< Derived, Problem >:

Public Types

using problem_type = Problem
 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

 formula_base (const problem_type &problem=problem_type())
 Constructor.
 
auto problem () -> problem_type &
 Get the problem.
 
auto problem () const -> const problem_type &
 Get the problem.
 
void step (scalar_type time, scalar_type step_size, const variable_type &current, variable_type &estimate)
 Compute the next variable.
 

Protected Member Functions

auto derived () const noexcept -> const Derived &
 Access derived object.
 
auto derived () noexcept -> Derived &
 Access derived object.
 

Static Protected Member Functions

template<typename T >
static constexpr auto coeff (T val) -> scalar_type
 Convert coefficients.
 
template<typename T1 , typename T2 >
static constexpr auto coeff (T1 num, T2 den) -> scalar_type
 Create coefficients.
 

Private Attributes

problem_type problem_
 Problem.
 

Detailed Description

template<typename Derived, concepts::problem Problem>
class num_collect::ode::formula_base< Derived, Problem >

Base class of formulas in ODE solvers.

Template Parameters
DerivedType of the derived class.
ProblemType of the problem.

Definition at line 33 of file formula_base.h.

Member Typedef Documentation

◆ problem_type

template<typename Derived , concepts::problem Problem>
using num_collect::ode::formula_base< Derived, Problem >::problem_type = Problem

Type of problem.

Definition at line 36 of file formula_base.h.

◆ scalar_type

template<typename Derived , concepts::problem Problem>
using num_collect::ode::formula_base< Derived, Problem >::scalar_type = typename problem_type::scalar_type

Type of scalars.

Definition at line 42 of file formula_base.h.

◆ variable_type

template<typename Derived , concepts::problem Problem>
using num_collect::ode::formula_base< Derived, Problem >::variable_type = typename problem_type::variable_type

Type of variables.

Definition at line 39 of file formula_base.h.

Constructor & Destructor Documentation

◆ formula_base()

template<typename Derived , concepts::problem Problem>
num_collect::ode::formula_base< Derived, Problem >::formula_base ( const problem_type & problem = problem_type())
inlineexplicit

Constructor.

Parameters
[in]problemProblem.

Definition at line 49 of file formula_base.h.

Member Function Documentation

◆ coeff() [1/2]

template<typename Derived , concepts::problem Problem>
template<typename T >
static constexpr auto num_collect::ode::formula_base< Derived, Problem >::coeff ( T val) -> scalar_type
inlinestaticconstexprprotected

Convert coefficients.

Template Parameters
TInput type.
Parameters
[in]valInput value.
Returns
Converted value.

Definition at line 108 of file formula_base.h.

◆ coeff() [2/2]

template<typename Derived , concepts::problem Problem>
template<typename T1 , typename T2 >
static constexpr auto num_collect::ode::formula_base< Derived, Problem >::coeff ( T1 num,
T2 den ) -> scalar_type
inlinestaticconstexprprotected

Create coefficients.

Template Parameters
T1Input type.
T2Input type.
Parameters
[in]numNumerator.
[in]denDenominator.
Returns
Coefficient.

Definition at line 122 of file formula_base.h.

◆ derived() [1/2]

template<typename Derived , concepts::problem Problem>
auto num_collect::ode::formula_base< Derived, Problem >::derived ( ) const -> const Derived&
inlinenodiscardprotectednoexcept

Access derived object.

Returns
Reference to the derived object.

Definition at line 96 of file formula_base.h.

◆ derived() [2/2]

template<typename Derived , concepts::problem Problem>
auto num_collect::ode::formula_base< Derived, Problem >::derived ( ) -> Derived&
inlinenodiscardprotectednoexcept

Access derived object.

Returns
Reference to the derived object.

Definition at line 87 of file formula_base.h.

◆ problem() [1/2]

template<typename Derived , concepts::problem Problem>
auto num_collect::ode::formula_base< Derived, Problem >::problem ( ) -> problem_type&
inlinenodiscard

Get the problem.

Returns
Problem.

Definition at line 70 of file formula_base.h.

◆ problem() [2/2]

template<typename Derived , concepts::problem Problem>
auto num_collect::ode::formula_base< Derived, Problem >::problem ( ) const -> const problem_type&
inlinenodiscard

Get the problem.

Returns
Problem.

Definition at line 77 of file formula_base.h.

◆ step()

template<typename Derived , concepts::problem Problem>
void num_collect::ode::formula_base< Derived, Problem >::step ( scalar_type time,
scalar_type step_size,
const variable_type & current,
variable_type & estimate )
inline

Compute the next variable.

Parameters
[in]timeCurrent time.
[in]step_sizeStep size.
[in]currentCurrent variable.
[out]estimateEstimate of the next variable.

Definition at line 60 of file formula_base.h.

Member Data Documentation

◆ problem_

template<typename Derived , concepts::problem Problem>
problem_type num_collect::ode::formula_base< Derived, Problem >::problem_
private

Problem.

Definition at line 128 of file formula_base.h.


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