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

Negate of function. More...

#include <JMathlib.hh>

Inheritance diagram for JMATH::JNegate< JF1_t >:
JMATH::JMathlib< JNegate< JF1_t > >

Public Member Functions

 JNegate ()
 Default constructor.
 
 JNegate (const JF1_t &f1)
 Constructor.
 
template<class ... Args>
double getValue (const Args &...args) const
 Function value.
 
double getDerivative (const double x) const
 Derivative value.
 
template<class ... Args>
JNegate getGradient (const Args &...args) 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.
 

Detailed Description

template<class JF1_t>
struct JMATH::JNegate< JF1_t >

Negate of function.

Definition at line 561 of file JMathlib.hh.

Constructor & Destructor Documentation

◆ JNegate() [1/2]

template<class JF1_t >
JMATH::JNegate< JF1_t >::JNegate ( )
inline

Default constructor.

Definition at line 572 of file JMathlib.hh.

573 {}

◆ JNegate() [2/2]

template<class JF1_t >
JMATH::JNegate< JF1_t >::JNegate ( const JF1_t & f1)
inline

Constructor.

Parameters
f1function

Definition at line 581 of file JMathlib.hh.

581 :
582 JF1_t(f1)
583 {}

Member Function Documentation

◆ getValue()

template<class JF1_t >
template<class ... Args>
double JMATH::JNegate< JF1_t >::getValue ( const Args &... args) const
inline

Function value.

Parameters
argsabscissa value(s)
Returns
function value

Definition at line 593 of file JMathlib.hh.

594 {
595 return -static_cast<const JF1_t&>(*this).getValue(args...);
596 }

◆ getDerivative()

template<class JF1_t >
double JMATH::JNegate< JF1_t >::getDerivative ( const double x) const
inline

Derivative value.

Parameters
xabscissa value
Returns
derivative value

Definition at line 605 of file JMathlib.hh.

606 {
607 return -static_cast<const JF1_t&>(*this).getDerivative(x);
608 }

◆ getGradient()

template<class JF1_t >
template<class ... Args>
JNegate JMATH::JNegate< JF1_t >::getGradient ( const Args &... args) const
inline

Get gradient.

Parameters
argsabscissa value(s)
Returns
gradient

Definition at line 618 of file JMathlib.hh.

619 {
620 JNegate gradient;
621
622 static_cast<JF1_t&>(gradient) = static_cast<const JF1_t&>(*this).getGradient(args...);
623 static_cast<JF1_t&>(gradient).negate();
624
625 return gradient;
626 }
JNegate()
Default constructor.
Definition JMathlib.hh:572

◆ operator()()

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

Function value.

Parameters
argsabscissa value(s)
Returns
function value

Definition at line 330 of file JMathlib.hh.

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

◆ operator[]() [1/2]

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

Get value of parameter at given index.

Parameters
iindex
Returns
value

Definition at line 538 of file JMathlib.hh.

539 {
540 return static_cast<const JF1_t&>(*this).*JF1_t::parameters[i];
541 }

◆ operator[]() [2/2]

double & JMATH::JMathlib< JF1_t >::operator[] ( const size_t i)
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<JF1_t&>(*this).*JF1_t::parameters[i];
553 }

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