Jpp 21.0.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JMATH::JCalculus< JF1_t > Struct Template Reference

Auxiliary base class for mathematical operations on parameters of function. More...

#include <JMathlib.hh>

Public Member Functions

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.
 

Friends

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.
 

Detailed Description

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.

Member Function Documentation

◆ negate()

template<class JF1_t >
JF1_t & JMATH::JCalculus< JF1_t >::negate ( )
inline

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()

template<class JF1_t >
JF1_t & JMATH::JCalculus< JF1_t >::add ( const JF1_t & f1)
inline

Add function.

Parameters
f1function
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()

template<class JF1_t >
JF1_t & JMATH::JCalculus< JF1_t >::sub ( const JF1_t & f1)
inline

Subtract function.

Parameters
f1function
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()

template<class JF1_t >
JF1_t & JMATH::JCalculus< JF1_t >::mul ( const double factor)
inline

Scale function.

Parameters
factorfactor
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()

template<class JF1_t >
JF1_t & JMATH::JCalculus< JF1_t >::div ( const double factor)
inline

Scale function.

Parameters
factorfactor
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 }

Friends And Related Symbol Documentation

◆ operator+=

template<class JF1_t >
JF1_t & operator+= ( JF1_t & function,
const JF1_t & value )
friend

Add function.

Parameters
functionthis function
valuevalue
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
functionthis function
valuevalue
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
functionthis function
factorfactor
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
functionthis function
factorfactor
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: