Negate of function.
More...
#include <JMathlib.hh>
|
| | 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.
|
| |
template<class JF1_t>
struct JMATH::JNegate< JF1_t >
Negate of function.
Definition at line 561 of file JMathlib.hh.
◆ JNegate() [1/2]
◆ JNegate() [2/2]
Constructor.
- Parameters
-
Definition at line 581 of file JMathlib.hh.
581 :
582 JF1_t(f1)
583 {}
◆ getValue()
template<class JF1_t >
template<class ... Args>
| double JMATH::JNegate< JF1_t >::getValue |
( |
const Args &... | args | ) |
const |
|
inline |
Function value.
- Parameters
-
- Returns
- function value
Definition at line 593 of file JMathlib.hh.
594 {
595 return -
static_cast<const JF1_t&
>(*this).getValue(
args...);
596 }
◆ getDerivative()
Derivative value.
- Parameters
-
- 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>
Get gradient.
- Parameters
-
- Returns
- gradient
Definition at line 618 of file JMathlib.hh.
619 {
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.
◆ operator()()
Function value.
- Parameters
-
- 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]
Get value of parameter at given index.
- Parameters
-
- 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]
Get value of parameter at given index.
- Parameters
-
- 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: