Auxiliary base class for mathematical operations on parameters of function.
More...
#include <JMathlib.hh>
|
| JF1_t & | negate () |
| | Negate function.
|
| |
| JF1_t & | add (const JF1_t &f1) |
| | Add function.
|
| |
| JF1_t & | sub (const JF1_t &f1) |
| | Subtract function.
|
| |
| JF1_t & | mul (const double factor) |
| | Scale function.
|
| |
| JF1_t & | div (const double factor) |
| | Scale function.
|
| |
|
| JF1_t & | operator+= (JF1_t &function, const JF1_t &value) |
| | Add function.
|
| |
| JF1_t & | operator-= (JF1_t &function, const JF1_t &value) |
| | Subtract function.
|
| |
| JF1_t & | operator*= (JF1_t &function, const double factor) |
| | Scale function.
|
| |
| JF1_t & | operator/= (JF1_t &function, const double factor) |
| | Scale function.
|
| |
template<class JF1_t>
struct JMATH::JCalculus< JF1_t >
Auxiliary base class for mathematical operations on parameters of function.
Definition at line 162 of file JMathlib.hh.
◆ negate()
Negate function.
- Returns
- this function
Definition at line 169 of file JMathlib.hh.
170 {
171 for (const auto& i : JF1_t::parameters) {
172 static_cast<JF1_t&>(*this).*i = -(static_cast<JF1_t&>(*this).*i);
173 }
174
175 return static_cast<JF1_t&>(*this);
176 }
◆ add()
Add function.
- Parameters
-
- Returns
- this function
Definition at line 185 of file JMathlib.hh.
186 {
187 for (const auto& i : JF1_t::parameters) {
188 static_cast<JF1_t&>(*this).*i += f1.*i;
189 }
190
191 return static_cast<JF1_t&>(*this);
192 }
◆ sub()
Subtract function.
- Parameters
-
- Returns
- this function
Definition at line 201 of file JMathlib.hh.
202 {
203 for (const auto& i : JF1_t::parameters) {
204 static_cast<JF1_t&>(*this).*i -= f1.*i;
205 }
206
207 return static_cast<JF1_t&>(*this);
208 }
◆ mul()
Scale function.
- Parameters
-
- Returns
- this function
Definition at line 217 of file JMathlib.hh.
218 {
219 for (const auto& i : JF1_t::parameters) {
220 static_cast<JF1_t&>(*this).*i *= factor;
221 }
222
223 return static_cast<JF1_t&>(*this);
224 }
◆ div()
Scale function.
- Parameters
-
- Returns
- this function
Definition at line 233 of file JMathlib.hh.
234 {
235 for (const auto& i : JF1_t::parameters) {
236 static_cast<JF1_t&>(*this).*i /= factor;
237 }
238
239 return static_cast<JF1_t&>(*this);
240 }
◆ operator+=
template<class JF1_t >
| JF1_t & operator+= |
( |
JF1_t & | function, |
|
|
const JF1_t & | value ) |
|
friend |
Add function.
- Parameters
-
| function | this function |
| value | value |
- Returns
- this function
Definition at line 250 of file JMathlib.hh.
251 {
252 return function.add(value);
253 }
◆ operator-=
template<class JF1_t >
| JF1_t & operator-= |
( |
JF1_t & | function, |
|
|
const JF1_t & | value ) |
|
friend |
Subtract function.
- Parameters
-
| function | this function |
| value | value |
- Returns
- this function
Definition at line 263 of file JMathlib.hh.
264 {
265 return function.sub(value);
266 }
◆ operator*=
template<class JF1_t >
| JF1_t & operator*= |
( |
JF1_t & | function, |
|
|
const double | factor ) |
|
friend |
Scale function.
- Parameters
-
| function | this function |
| factor | factor |
- Returns
- this function
Definition at line 276 of file JMathlib.hh.
277 {
278 return function.mul(factor);
279 }
◆ operator/=
template<class JF1_t >
| JF1_t & operator/= |
( |
JF1_t & | function, |
|
|
const double | factor ) |
|
friend |
Scale function.
- Parameters
-
| function | this function |
| factor | factor |
- Returns
- this function
Definition at line 289 of file JMathlib.hh.
290 {
291 return function.div(factor);
292 }
The documentation for this struct was generated from the following file: