Jpp 21.0.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JMATH::JExp< JF1_t > Struct Template Reference

Exponent of function. More...

#include <JMathlib.hh>

Inheritance diagram for JMATH::JExp< JF1_t >:
JMATH::JMathlib< JExp< JX > > JMATH::JX JMATH::JMathlib< JX > JMATH::JCalculus< JX >

Public Member Functions

 JExp ()
 Default constructor.
 
 JExp (const JF1_t &f1)
 Constructor.
 
double getValue (const double x) const
 Function value.
 
double getDerivative (const double x) const
 Derivative value.
 
JExp getGradient (const double x) const
 Get gradient.
 
double operator() (const Args &...args) const
 Function value.
 
double operator[] (const size_t i) const
 Get value of parameter at given index.
 
double & operator[] (const size_t i)
 Get value of parameter at given index.
 
double operator() (const Args &...args) const
 Function value.
 
double operator[] (const size_t i) const
 Get value of parameter at given index.
 
double & operator[] (const size_t i)
 Get value of parameter at given index.
 
JXnegate ()
 Negate function.
 
JXadd (const JX &f1)
 Add function.
 
JXsub (const JX &f1)
 Subtract function.
 
JXmul (const double factor)
 Scale function.
 
JXdiv (const double factor)
 Scale function.
 

Static Public Member Functions

static size_t size ()
 Get size of parameter.
 
static size_t size ()
 Get size of parameter.
 

Static Public Attributes

static constexpr parameter_list< JX, 0 > parameters {}
 

Detailed Description

template<class JF1_t = JX>
struct JMATH::JExp< JF1_t >

Exponent of function.

Definition at line 2593 of file JMathlib.hh.

Constructor & Destructor Documentation

◆ JExp() [1/2]

template<class JF1_t = JX>
JMATH::JExp< JF1_t >::JExp ( )
inline

Default constructor.

Definition at line 2604 of file JMathlib.hh.

2604 :
2605 JF1_t()
2606 {}

◆ JExp() [2/2]

template<class JF1_t = JX>
JMATH::JExp< JF1_t >::JExp ( const JF1_t & f1)
inline

Constructor.

Parameters
f1function

Definition at line 2614 of file JMathlib.hh.

2614 :
2615 JF1_t(f1)
2616 {}

Member Function Documentation

◆ getValue()

template<class JF1_t = JX>
double JMATH::JExp< JF1_t >::getValue ( const double x) const
inline

Function value.

Parameters
xabscissa value
Returns
function value

Definition at line 2625 of file JMathlib.hh.

2626 {
2627 return exp(static_cast<const JF1_t&>(*this).getValue(x));
2628 }

◆ getDerivative()

template<class JF1_t = JX>
double JMATH::JExp< JF1_t >::getDerivative ( const double x) const
inline

Derivative value.

Parameters
xabscissa value
Returns
derivative value

Definition at line 2637 of file JMathlib.hh.

2638 {
2639 return static_cast<const JF1_t&>(*this).getDerivative(x) * getValue(x);
2640 }
double getValue(const double x) const
Function value.
Definition JMathlib.hh:2625

◆ getGradient()

template<class JF1_t = JX>
JExp JMATH::JExp< JF1_t >::getGradient ( const double x) const
inline

Get gradient.

Parameters
xabscissa value
Returns
gradient

Definition at line 2649 of file JMathlib.hh.

2650 {
2651 JExp gradient;
2652
2653 static_cast<JF1_t&>(gradient) = static_cast<const JF1_t&>(*this).getGradient(x);
2654 static_cast<JF1_t&>(gradient) *= getValue(x);
2655
2656 return gradient;
2657 }
JExp()
Default constructor.
Definition JMathlib.hh:2604

◆ operator()() [1/2]

double JMATH::JMathlib< JExp< JX > >::operator() ( const Args &... args) const
inlineinherited

Function value.

Parameters
argsabscissa value(s)
Returns
function value

Definition at line 331 of file JMathlib.hh.

332 {
333 return static_cast<const JF1_t&>(*this).getValue(args...);
334 }

◆ size() [1/2]

static size_t JMATH::JMathlib< JExp< JX > >::size ( )
inlinestaticinherited

Get size of parameter.

Returns
size

Definition at line 538 of file JMathlib.hh.

539 {
540 return JF1_t::parameters.size();
541 }

◆ operator[]() [1/4]

double JMATH::JMathlib< JExp< JX > >::operator[] ( const size_t i) const
inlineinherited

Get value of parameter at given index.

Parameters
iindex
Returns
value

Definition at line 550 of file JMathlib.hh.

551 {
552 return static_cast<const JF1_t&>(*this).*JF1_t::parameters[i];
553 }

◆ operator[]() [2/4]

double & JMATH::JMathlib< JExp< JX > >::operator[] ( const size_t i)
inlineinherited

Get value of parameter at given index.

Parameters
iindex
Returns
value

Definition at line 562 of file JMathlib.hh.

563 {
564 return static_cast<JF1_t&>(*this).*JF1_t::parameters[i];
565 }

◆ operator()() [2/2]

double JMATH::JMathlib< JX >::operator() ( const Args &... args) const
inlineinherited

Function value.

Parameters
argsabscissa value(s)
Returns
function value

Definition at line 331 of file JMathlib.hh.

332 {
333 return static_cast<const JF1_t&>(*this).getValue(args...);
334 }

◆ size() [2/2]

static size_t JMATH::JMathlib< JX >::size ( )
inlinestaticinherited

Get size of parameter.

Returns
size

Definition at line 538 of file JMathlib.hh.

539 {
540 return JF1_t::parameters.size();
541 }

◆ operator[]() [3/4]

double JMATH::JMathlib< JX >::operator[] ( const size_t i) const
inlineinherited

Get value of parameter at given index.

Parameters
iindex
Returns
value

Definition at line 550 of file JMathlib.hh.

551 {
552 return static_cast<const JF1_t&>(*this).*JF1_t::parameters[i];
553 }

◆ operator[]() [4/4]

double & JMATH::JMathlib< JX >::operator[] ( const size_t i)
inlineinherited

Get value of parameter at given index.

Parameters
iindex
Returns
value

Definition at line 562 of file JMathlib.hh.

563 {
564 return static_cast<JF1_t&>(*this).*JF1_t::parameters[i];
565 }

◆ negate()

JX & JMATH::JCalculus< JX >::negate ( )
inlineinherited

Negate function.

Returns
this function

Definition at line 170 of file JMathlib.hh.

171 {
172 for (const auto& i : JF1_t::parameters) {
173 static_cast<JF1_t&>(*this).*i = -(static_cast<JF1_t&>(*this).*i);
174 }
175
176 return static_cast<JF1_t&>(*this);
177 }

◆ add()

JX & JMATH::JCalculus< JX >::add ( const JX & f1)
inlineinherited

Add function.

Parameters
f1function
Returns
this function

Definition at line 186 of file JMathlib.hh.

187 {
188 for (const auto& i : JF1_t::parameters) {
189 static_cast<JF1_t&>(*this).*i += f1.*i;
190 }
191
192 return static_cast<JF1_t&>(*this);
193 }

◆ sub()

JX & JMATH::JCalculus< JX >::sub ( const JX & f1)
inlineinherited

Subtract function.

Parameters
f1function
Returns
this function

Definition at line 202 of file JMathlib.hh.

203 {
204 for (const auto& i : JF1_t::parameters) {
205 static_cast<JF1_t&>(*this).*i -= f1.*i;
206 }
207
208 return static_cast<JF1_t&>(*this);
209 }

◆ mul()

JX & JMATH::JCalculus< JX >::mul ( const double factor)
inlineinherited

Scale function.

Parameters
factorfactor
Returns
this function

Definition at line 218 of file JMathlib.hh.

219 {
220 for (const auto& i : JF1_t::parameters) {
221 static_cast<JF1_t&>(*this).*i *= factor;
222 }
223
224 return static_cast<JF1_t&>(*this);
225 }

◆ div()

JX & JMATH::JCalculus< JX >::div ( const double factor)
inlineinherited

Scale function.

Parameters
factorfactor
Returns
this function

Definition at line 234 of file JMathlib.hh.

235 {
236 for (const auto& i : JF1_t::parameters) {
237 static_cast<JF1_t&>(*this).*i /= factor;
238 }
239
240 return static_cast<JF1_t&>(*this);
241 }

Member Data Documentation

◆ parameters

parameter_list<JX, 0> JMATH::JX::parameters {}
staticconstexprinherited

Definition at line 1599 of file JMathlib.hh.

1599{};

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