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.
|
| |
|
| static size_t | size () |
| | Get size of parameter.
|
| |
template<class JF1_t>
struct JMATH::JNegate< JF1_t >
Negate of function.
Definition at line 573 of file JMathlib.hh.
◆ JNegate() [1/2]
◆ JNegate() [2/2]
Constructor.
- Parameters
-
Definition at line 593 of file JMathlib.hh.
593 :
594 JF1_t(f1)
595 {}
◆ 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 605 of file JMathlib.hh.
606 {
607 return -
static_cast<const JF1_t&
>(*this).getValue(
args...);
608 }
◆ getDerivative()
Derivative value.
- Parameters
-
- Returns
- derivative value
Definition at line 617 of file JMathlib.hh.
618 {
619 return -static_cast<const JF1_t&>(*this).getDerivative(x);
620 }
◆ getGradient()
template<class JF1_t >
template<class ... Args>
Get gradient.
- Parameters
-
- Returns
- gradient
Definition at line 630 of file JMathlib.hh.
631 {
633
634 static_cast<JF1_t&
>(gradient) =
static_cast<const JF1_t&
>(*this).getGradient(
args...);
635 static_cast<JF1_t&>(gradient).negate();
636
637 return gradient;
638 }
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 }
◆ size()
Get size of parameter.
- Returns
- size
Definition at line 538 of file JMathlib.hh.
539 {
540 return JF1_t::parameters.size();
541 }
◆ operator[]() [1/2]
Get value of parameter at given index.
- Parameters
-
- Returns
- value
Definition at line 550 of file JMathlib.hh.
551 {
552 return static_cast<const JF1_t&>(*this).*JF1_t::parameters[i];
553 }
◆ operator[]() [2/2]
Get value of parameter at given index.
- Parameters
-
- Returns
- value
Definition at line 562 of file JMathlib.hh.
563 {
564 return static_cast<JF1_t&>(*this).*JF1_t::parameters[i];
565 }
The documentation for this struct was generated from the following file: