Jpp 21.0.0-rc.1
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 562 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 573 of file JMathlib.hh.

574 {}

◆ JNegate() [2/2]

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

Constructor.

Parameters
f1function

Definition at line 582 of file JMathlib.hh.

582 :
583 JF1_t(f1)
584 {}

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 594 of file JMathlib.hh.

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

◆ 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 606 of file JMathlib.hh.

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

◆ 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 619 of file JMathlib.hh.

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

◆ operator()()

double JMATH::JMathlib< JF1_t >::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 }

◆ 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 539 of file JMathlib.hh.

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

◆ 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 551 of file JMathlib.hh.

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

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