12#include <include/qlibs_types.hpp>
52 real_t x[ 3 ] = { 0.0_re, 0.0_re, 0.0_re };
53 void inline update(
const real_t &s )
71 const real_t sn_1 = 0.0_re,
72 const real_t sn_2 = 0.0_re )
noexcept
74 init( x0, sn_1, sn_2 );
85 const real_t sn_1 = 0.0_re,
86 const real_t sn_2 = 0.0_re )
noexcept;
97 const bool bUpdate =
true ) noexcept;
108 const
bool bUpdate = true ) noexcept;
158 return x[ 0 ]*rValue;
162 return x[ 0 ]/rValue;
166 return x[ 0 ] + rValue;
170 return x[ 0 ] - rValue;
173 const nState& s )
noexcept;
175 const nState& s )
noexcept;
177 const nState& s )
noexcept;
179 const nState& s )
noexcept;
185 const nState& s )
noexcept
187 return rValue*s.x[ 0 ];
190 const nState& s )
noexcept
192 return rValue/s.x[ 0 ];
195 const nState& s )
noexcept
197 return rValue + s.x[ 0 ];
200 const nState& s )
noexcept
202 return rValue - s.x[ 0 ];
A numerical state object.
Definition numa.hpp:50
virtual ~nState()
Definition numa.hpp:61
void setDerivationMethod(derivationMethod m) noexcept
Set derivation method.
Definition numa.hpp:141
real_t derive(const real_t s, const real_t dt, const bool bUpdate=true) noexcept
Perform a numerical derivation step by using the delta rule.
Definition numa.cpp:42
real_t integrate(const real_t s, const real_t dt, const bool bUpdate=true) noexcept
Perform a numerical integration step.
Definition numa.cpp:15
void init(const real_t x0=0.0_re, const real_t sn_1=0.0_re, const real_t sn_2=0.0_re) noexcept
Initialize the state object.
Definition numa.cpp:6
void setIntegrationMethod(integrationMethod m) noexcept
Set integration method .
Definition numa.hpp:124
real_t operator()(void) const noexcept
Get the value of the state.
Definition numa.hpp:150
nState(const real_t x0=0.0_re, const real_t sn_1=0.0_re, const real_t sn_2=0.0_re) noexcept
Constructor for the state object.
Definition numa.hpp:70
derivationMethod
An enum with all the available derivation methods.
Definition numa.hpp:38
integrationMethod
An enum with all the available integration methods.
Definition numa.hpp:28
@ DERIVATION_FORWARD
Definition numa.hpp:41
@ DERIVATION_BACKWARD
Definition numa.hpp:40
@ DERIVATION_2POINTS
Definition numa.hpp:39
@ INTEGRATION_QUADRATIC
Definition numa.hpp:32
@ INTEGRATION_SIMPSON
Definition numa.hpp:31
@ INTEGRATION_TRAPEZOIDAL
Definition numa.hpp:30
@ INTEGRATION_RECTANGULAR
Definition numa.hpp:29
The qLibs++ library namespace.
Definition fp16.cpp:4
float real_t
A type to instantiate a real variable double-precision of 64-bits IEEE 754.
Definition qlibs_types.hpp:43