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 163 of file JMathlib.hh.
◆ negate()
Negate function.
- Returns
- this function
Definition at line 170 of file JMathlib.hh.
171 {
172 for (const auto& i : JF1_t::parameters) {
173 static_cast<JF1_t&>(*this).*i = -(static_cast<JF1_t&>(*this).*i);
174 }
175
176 return static_cast<JF1_t&>(*this);
177 }
◆ add()
Add function.
- Parameters
-
- Returns
- this function
Definition at line 186 of file JMathlib.hh.
187 {
188 for (const auto& i : JF1_t::parameters) {
189 static_cast<JF1_t&>(*this).*i += f1.*i;
190 }
191
192 return static_cast<JF1_t&>(*this);
193 }
◆ sub()
Subtract function.
- Parameters
-
- Returns
- this function
Definition at line 202 of file JMathlib.hh.
203 {
204 for (const auto& i : JF1_t::parameters) {
205 static_cast<JF1_t&>(*this).*i -= f1.*i;
206 }
207
208 return static_cast<JF1_t&>(*this);
209 }
◆ mul()
Scale function.
- Parameters
-
- Returns
- this function
Definition at line 218 of file JMathlib.hh.
219 {
220 for (const auto& i : JF1_t::parameters) {
221 static_cast<JF1_t&>(*this).*i *= factor;
222 }
223
224 return static_cast<JF1_t&>(*this);
225 }
◆ div()
Scale function.
- Parameters
-
- Returns
- this function
Definition at line 234 of file JMathlib.hh.
235 {
236 for (const auto& i : JF1_t::parameters) {
237 static_cast<JF1_t&>(*this).*i /= factor;
238 }
239
240 return static_cast<JF1_t&>(*this);
241 }
◆ 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 251 of file JMathlib.hh.
252 {
253 return function.add(value);
254 }
◆ 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 264 of file JMathlib.hh.
265 {
266 return function.sub(value);
267 }
◆ 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 277 of file JMathlib.hh.
278 {
279 return function.mul(factor);
280 }
◆ 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 290 of file JMathlib.hh.
291 {
292 return function.div(factor);
293 }
The documentation for this struct was generated from the following file: