Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
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. More...
 
 JNegate (const JF1_t &f1)
 Constructor. More...
 
template<class... Args>
double getValue (const Args &...args) const
 Function value. More...
 
double getDerivative (const double x) const
 Derivative value. More...
 
template<class... Args>
const JNegategetGradient (const Args &...args) const
 Get gradient. More...
 
double operator() (const Args &...args) const
 Function value. More...
 

Detailed Description

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

Negate of function.

Definition at line 331 of file JMathlib.hh.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 567 of file JMathlib.hh.

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

Constructor.

Parameters
f1function

Definition at line 576 of file JMathlib.hh.

576  :
577  JF1_t(f1)
578  {}
const JPolynome f1(1.0, 2.0, 3.0)
Function.

Member Function Documentation

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

589  {
590  return -static_cast<const JF1_t&>(*this).getValue(args...);
591  }
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 600 of file JMathlib.hh.

601  {
602  return -static_cast<const JF1_t&>(*this).getDerivative(x);
603  }
template<class JF1_t >
template<class... Args>
const JNegate& JMATH::JNegate< JF1_t >::getGradient ( const Args &...  args) const
inline

Get gradient.

Parameters
argsabscissa value(s)
Returns
gradient

Definition at line 613 of file JMathlib.hh.

614  {
615  static JNegate gradient;
616 
617  static_cast<JF1_t&>(gradient) = static_cast<const JF1_t&>(*this).getGradient(args...);
618  static_cast<JF1_t&>(gradient).negate();
619 
620  return gradient;
621  }
const JNegate & getGradient(const Args &...args) const
Get gradient.
Definition: JMathlib.hh:613
Negate of function.
Definition: JMathlib.hh:331
double JMATH::JMathlib< JNegate< JF1_t > >::operator() ( const Args &...  args) const
inlineinherited

Function value.

Parameters
argsabscissa value(s)
Returns
function value

Definition at line 362 of file JMathlib.hh.

363  {
364  return static_cast<const JF1_t&>(*this).getValue(args...);
365  }

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