Jpp  18.6.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Friends | List of all members
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. More...
 
JF1_t & add (const JF1_t &f1)
 Add function. More...
 
JF1_t & sub (const JF1_t &f1)
 Subtract function. More...
 
JF1_t & mul (const double factor)
 Scale function. More...
 
JF1_t & div (const double factor)
 Scale function. More...
 

Friends

JF1_t & operator+= (JF1_t &function, const JF1_t &value)
 Add function. More...
 
JF1_t & operator-= (JF1_t &function, const JF1_t &value)
 Subtract function. More...
 
JF1_t & operator*= (JF1_t &function, const double factor)
 Scale function. More...
 
JF1_t & operator/= (JF1_t &function, const double factor)
 Scale function. More...
 

Detailed Description

template<class JF1_t>
struct JMATH::JCalculus< JF1_t >

Auxiliary base class for mathematical operations on parameters of function.

Definition at line 196 of file JMathlib.hh.

Member Function Documentation

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

Negate function.

Returns
this function

Definition at line 203 of file JMathlib.hh.

204  {
205  for (const auto& i : JF1_t::parameters) {
206  static_cast<JF1_t&>(*this).*i = -(static_cast<JF1_t&>(*this).*i);
207  }
208 
209  return static_cast<JF1_t&>(*this);
210  }
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
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 219 of file JMathlib.hh.

220  {
221  for (const auto& i : JF1_t::parameters) {
222  static_cast<JF1_t&>(*this).*i += f1.*i;
223  }
224 
225  return static_cast<JF1_t&>(*this);
226  }
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
const JPolynome f1(1.0, 2.0, 3.0)
Function.
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 235 of file JMathlib.hh.

236  {
237  for (const auto& i : JF1_t::parameters) {
238  static_cast<JF1_t&>(*this).*i -= f1.*i;
239  }
240 
241  return static_cast<JF1_t&>(*this);
242  }
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
const JPolynome f1(1.0, 2.0, 3.0)
Function.
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 251 of file JMathlib.hh.

252  {
253  for (const auto& i : JF1_t::parameters) {
254  static_cast<JF1_t&>(*this).*i *= factor;
255  }
256 
257  return static_cast<JF1_t&>(*this);
258  }
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
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 267 of file JMathlib.hh.

268  {
269  for (const auto& i : JF1_t::parameters) {
270  static_cast<JF1_t&>(*this).*i /= factor;
271  }
272 
273  return static_cast<JF1_t&>(*this);
274  }
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38

Friends And Related Function Documentation

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 284 of file JMathlib.hh.

285  {
286  return function.add(value);
287  }
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 297 of file JMathlib.hh.

298  {
299  return function.sub(value);
300  }
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 310 of file JMathlib.hh.

311  {
312  return function.mul(factor);
313  }
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 323 of file JMathlib.hh.

324  {
325  return function.div(factor);
326  }

The documentation for this struct was generated from the following file: