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

Lambda wrapper for scalar functions with value and derivative. Wraps a lambda/callable into a functor with Values() method. More...

#include <MathUtils_FunctorScalar.hxx>

Public Member Functions

 ScalarLambdaWithDerivative (Lambda theLambda)
 Constructor from lambda/callable.
 
bool Values (double theX, double &theY, double &theDY) const
 Evaluates function and derivative at theX.
 
bool Value (double theX, double &theY) const
 Evaluates only the function value (for algorithms that don't need derivative).
 

Detailed Description

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

Lambda wrapper for scalar functions with value and derivative. Wraps a lambda/callable into a functor with Values() method.

Usage:

auto aFunc = ScalarLambdaWithDerivative([](double x, double& y, double& dy) {
y = x * x - 2.0;
dy = 2.0 * x;
return true;
});
GLint GLint GLint GLint GLint x
Definition OpenGl_glext.h:125
ScalarLambdaWithDerivative(Lambda theLambda)
Constructor from lambda/callable.
Definition MathUtils_FunctorScalar.hxx:87
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142
MathUtils::ScalarResult Newton(Function &theFunc, double theGuess, const MathUtils::Config &theConfig=MathUtils::Config())
Newton-Raphson root finding algorithm. Finds x such that f(x) = 0 using Newton's method with derivati...
Definition MathRoot_Newton.hxx:45
Template Parameters
Lambdacallable type with signature bool(double, double&, double&)

Constructor & Destructor Documentation

◆ ScalarLambdaWithDerivative()

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

Constructor from lambda/callable.

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

Member Function Documentation

◆ Value()

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

Evaluates only the function value (for algorithms that don't need derivative).

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

◆ Values()

template<typename Lambda >
bool MathUtils::ScalarLambdaWithDerivative< Lambda >::Values ( double theX,
double & theY,
double & theDY ) const
inline

Evaluates function and derivative at theX.

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

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