Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
MathUtils::ScalarLambda< Lambda > Class Template Reference

Lambda wrapper for scalar functions with value only. Wraps a lambda/callable into a functor with Value() method. More...

#include <MathUtils_FunctorScalar.hxx>

Public Member Functions

 ScalarLambda (Lambda theLambda)
 Constructor from lambda/callable.
 
bool Value (double theX, double &theY) const
 Evaluates the function at theX.
 

Detailed Description

template<typename Lambda>
class MathUtils::ScalarLambda< Lambda >

Lambda wrapper for scalar functions with value only. Wraps a lambda/callable into a functor with Value() method.

Usage:

auto aFunc = ScalarLambda([](double x, double& y) {
y = x * x - 2.0;
return true;
});
auto aResult = MathRoot::Brent(aFunc, 0.0, 2.0);
ScalarLambda(Lambda theLambda)
Constructor from lambda/callable.
Definition MathUtils_FunctorScalar.hxx:52
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142
MathUtils::ScalarResult Brent(Function &theFunc, double theLower, double theUpper, const MathUtils::Config &theConfig=MathUtils::Config())
Brent's method for root finding. Combines bisection, secant, and inverse quadratic interpolation....
Definition MathRoot_Brent.hxx:45
Template Parameters
Lambdacallable type with signature bool(double, double&)

Constructor & Destructor Documentation

◆ ScalarLambda()

template<typename Lambda >
MathUtils::ScalarLambda< Lambda >::ScalarLambda ( Lambda theLambda)
inlineexplicit

Constructor from lambda/callable.

Parameters
theLambdacallable with signature bool(double theX, double& theY)

Member Function Documentation

◆ Value()

template<typename Lambda >
bool MathUtils::ScalarLambda< Lambda >::Value ( double theX,
double & theY ) const
inline

Evaluates the function at theX.

Parameters
[in]theXinput value
[out]theYfunction value f(theX)
Returns
true if evaluation succeeded

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