Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
MathUtils::Sum< F, G > Class Template Reference

Sum of functions functor: f(x) + g(x). More...

#include <MathUtils_FunctorScalar.hxx>

Public Member Functions

 Sum (F theF, G theG)
 Constructor from two functions.
 
bool Value (double theX, double &theY) const
 Evaluates sum f(theX) + g(theX).
 

Detailed Description

template<typename F, typename G>
class MathUtils::Sum< F, G >

Sum of functions functor: f(x) + g(x).

Usage:

Polynomial aF({1.0, 2.0}); // f(x) = 1 + 2x
Polynomial aG({3.0, 0.0, 1.0}); // g(x) = 3 + x^2
Sum aSum(aF, aG); // h(x) = 4 + 2x + x^2
Polynomial functor: f(x) = sum(a[i] * x^i). Coefficients are stored in order: a[0] + a[1]*x + a[2]*x^...
Definition MathUtils_FunctorScalar.hxx:148
Sum(F theF, G theG)
Constructor from two functions.
Definition MathUtils_FunctorScalar.hxx:402
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142
Template Parameters
Ffirst function type
Gsecond function type

Constructor & Destructor Documentation

◆ Sum()

template<typename F , typename G >
MathUtils::Sum< F, G >::Sum ( F theF,
G theG )
inline

Constructor from two functions.

Parameters
theFfirst function
theGsecond function

Member Function Documentation

◆ Value()

template<typename F , typename G >
bool MathUtils::Sum< F, G >::Value ( double theX,
double & theY ) const
inline

Evaluates sum f(theX) + g(theX).

Parameters
[in]theXinput value
[out]theYsum value
Returns
false if either evaluation fails

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