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

Auxiliary base class for mathematical operations on functions. More...

#include <JMathlib.hh>

Public Member Functions

template<class ... Args>
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.
 

Friends

const JF1_t & operator+ (const JF1_t &function)
 Affirm operator.
 
JNegate< JF1_t > operator- (const JF1_t &function)
 Negate operator.
 
JAdd< JF1_t > operator+ (const JF1_t &f1, const double value)
 Addition of constant value.
 
JAdd< JF1_t > operator+ (const double value, const JF1_t &f1)
 Addition of constant value.
 
JSub< JF1_t > operator- (const JF1_t &f1, const double value)
 Subtraction of constant value.
 
JAdd< JNegate< JF1_t > > operator- (const double value, const JF1_t &f1)
 Subtraction of constant value.
 
JMul< JF1_t > operator* (const JF1_t &f1, const double value)
 Multiplication of constant value.
 
JMul< JF1_t > operator* (const double value, const JF1_t &f1)
 Multiplication of constant value.
 
JDiv< JF1_t > operator/ (const JF1_t &f1, const double value)
 Division of constant value.
 
template<class JF2_t >
JAdd< JF1_t, JF2_t > operator+ (const JF1_t &f1, const JF2_t &f2)
 Addition of two functions.
 
template<class JF2_t >
JSub< JF1_t, JF2_t > operator- (const JF1_t &f1, const JF2_t &f2)
 Subtraction of two functions.
 
template<class JF2_t >
JMul< JF1_t, JF2_t > operator* (const JF1_t &f1, const JF2_t &f2)
 Multiplication of two functions.
 
template<class JF2_t >
JDiv< JF1_t, JF2_t > operator/ (const JF1_t &f1, const JF2_t &f2)
 Division of two functions.
 
JFn< JF1_t > operator^ (const JF1_t &f1, int N)
 Power-of operator.
 
JPf< JF1_t > operator& (const JF1_t &f1)
 Address-of operator.
 

Detailed Description

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

Auxiliary base class for mathematical operations on functions.

Definition at line 322 of file JMathlib.hh.

Member Function Documentation

◆ operator()()

template<class JF1_t >
template<class ... Args>
double JMATH::JMathlib< JF1_t >::operator() ( const Args &... args) const
inline

Function value.

Parameters
argsabscissa value(s)
Returns
function value

Definition at line 330 of file JMathlib.hh.

331 {
332 return static_cast<const JF1_t&>(*this).getValue(args...);
333 }

◆ operator[]() [1/2]

template<class JF1_t >
double JMATH::JMathlib< JF1_t >::operator[] ( const size_t i) const
inline

Get value of parameter at given index.

Parameters
iindex
Returns
value

Definition at line 538 of file JMathlib.hh.

539 {
540 return static_cast<const JF1_t&>(*this).*JF1_t::parameters[i];
541 }

◆ operator[]() [2/2]

template<class JF1_t >
double & JMATH::JMathlib< JF1_t >::operator[] ( const size_t i)
inline

Get value of parameter at given index.

Parameters
iindex
Returns
value

Definition at line 550 of file JMathlib.hh.

551 {
552 return static_cast<JF1_t&>(*this).*JF1_t::parameters[i];
553 }

Friends And Related Symbol Documentation

◆ operator+ [1/4]

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

Affirm operator.

Parameters
functionthis function
Returns
result function

Definition at line 342 of file JMathlib.hh.

343 {
344 return function;
345 }

◆ operator- [1/4]

template<class JF1_t >
JNegate< JF1_t > operator- ( const JF1_t & function)
friend

Negate operator.

Parameters
functionthis function
Returns
result function

Definition at line 354 of file JMathlib.hh.

355 {
356 return JNegate<JF1_t>(function);
357 }

◆ operator+ [2/4]

template<class JF1_t >
JAdd< JF1_t > operator+ ( const JF1_t & f1,
const double value )
friend

Addition of constant value.

Parameters
f1function
valuevalue
Returns
result function

Definition at line 367 of file JMathlib.hh.

368 {
369 return JAdd<JF1_t>(f1, value);
370 }

◆ operator+ [3/4]

template<class JF1_t >
JAdd< JF1_t > operator+ ( const double value,
const JF1_t & f1 )
friend

Addition of constant value.

Parameters
valuevalue
f1function
Returns
result function

Definition at line 380 of file JMathlib.hh.

381 {
382 return JAdd<JF1_t>(f1, value);
383 }

◆ operator- [2/4]

template<class JF1_t >
JSub< JF1_t > operator- ( const JF1_t & f1,
const double value )
friend

Subtraction of constant value.

Parameters
f1function
valuevalue
Returns
result function

Definition at line 393 of file JMathlib.hh.

394 {
395 return JSub<JF1_t>(f1, value);
396 }

◆ operator- [3/4]

template<class JF1_t >
JAdd< JNegate< JF1_t > > operator- ( const double value,
const JF1_t & f1 )
friend

Subtraction of constant value.

Parameters
f1function
valuevalue
Returns
result function

Definition at line 406 of file JMathlib.hh.

407 {
408 return JAdd< JNegate<JF1_t> >(JNegate<JF1_t>(f1), value);
409 }

◆ operator* [1/3]

template<class JF1_t >
JMul< JF1_t > operator* ( const JF1_t & f1,
const double value )
friend

Multiplication of constant value.

Parameters
f1function
valuevalue
Returns
result function

Definition at line 419 of file JMathlib.hh.

420 {
421 return JMul<JF1_t>(f1, value);
422 }

◆ operator* [2/3]

template<class JF1_t >
JMul< JF1_t > operator* ( const double value,
const JF1_t & f1 )
friend

Multiplication of constant value.

Parameters
valuevalue
f1function
Returns
result function

Definition at line 432 of file JMathlib.hh.

433 {
434 return JMul<JF1_t>(f1, value);
435 }

◆ operator/ [1/2]

template<class JF1_t >
JDiv< JF1_t > operator/ ( const JF1_t & f1,
const double value )
friend

Division of constant value.

Parameters
f1function
valuevalue
Returns
result function

Definition at line 445 of file JMathlib.hh.

446 {
447 return JDiv<JF1_t>(f1, value);
448 }

◆ operator+ [4/4]

template<class JF1_t >
template<class JF2_t >
JAdd< JF1_t, JF2_t > operator+ ( const JF1_t & f1,
const JF2_t & f2 )
friend

Addition of two functions.

Parameters
f1first function
f2second function
Returns
result function

Definition at line 459 of file JMathlib.hh.

460 {
461 return JAdd<JF1_t, JF2_t>(f1, f2);
462 }

◆ operator- [4/4]

template<class JF1_t >
template<class JF2_t >
JSub< JF1_t, JF2_t > operator- ( const JF1_t & f1,
const JF2_t & f2 )
friend

Subtraction of two functions.

Parameters
f1first function
f2second function
Returns
result function

Definition at line 473 of file JMathlib.hh.

474 {
475 return JSub<JF1_t, JF2_t>(f1, f2);
476 }

◆ operator* [3/3]

template<class JF1_t >
template<class JF2_t >
JMul< JF1_t, JF2_t > operator* ( const JF1_t & f1,
const JF2_t & f2 )
friend

Multiplication of two functions.

Parameters
f1first function
f2second function
Returns
result function

Definition at line 487 of file JMathlib.hh.

488 {
489 return JMul<JF1_t, JF2_t>(f1, f2);
490 }

◆ operator/ [2/2]

template<class JF1_t >
template<class JF2_t >
JDiv< JF1_t, JF2_t > operator/ ( const JF1_t & f1,
const JF2_t & f2 )
friend

Division of two functions.

Parameters
f1first function
f2second function
Returns
result function

Definition at line 501 of file JMathlib.hh.

502 {
503 return JDiv<JF1_t, JF2_t>(f1, f2);
504 }

◆ operator^

template<class JF1_t >
JFn< JF1_t > operator^ ( const JF1_t & f1,
int N )
friend

Power-of operator.

Parameters
f1function
Npower
Returns
result function

Definition at line 514 of file JMathlib.hh.

515 {
516 return JFn<JF1_t>(f1, N);
517 }

◆ operator&

template<class JF1_t >
JPf< JF1_t > operator& ( const JF1_t & f1)
friend

Address-of operator.

Parameters
f1function
Returns
result function

Definition at line 526 of file JMathlib.hh.

527 {
528 return JPf<JF1_t>(std::addressof(f1));
529 }

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