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 562 of file JMathlib.hh.
◆ JNegate() [1/2]
◆ JNegate() [2/2]
Constructor.
- Parameters
-
Definition at line 582 of file JMathlib.hh.
582 :
583 JF1_t(f1)
584 {}
◆ 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 594 of file JMathlib.hh.
595 {
596 return -
static_cast<const JF1_t&
>(*this).getValue(
args...);
597 }
◆ getDerivative()
Derivative value.
- Parameters
-
- 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>
Get gradient.
- Parameters
-
- Returns
- gradient
Definition at line 619 of file JMathlib.hh.
620 {
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.
◆ operator()()
Function value.
- Parameters
-
- 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]
Get value of parameter at given index.
- Parameters
-
- 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]
Get value of parameter at given index.
- Parameters
-
- 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: