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

Nonlinear system functor: F(x) = [f1(x), f2(x), ..., fn(x)]. Lambda wrapper for systems of nonlinear equations. More...

#include <MathUtils_FunctorVector.hxx>

Public Member Functions

 SystemLambda (Lambda theLambda, int theNbEquations)
 Constructor from lambda.
 
int NbEquations () const
 Returns the number of equations.
 
bool Value (const math_Vector &theX, math_Vector &theF) const
 Evaluates the system F(x).
 

Detailed Description

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

Nonlinear system functor: F(x) = [f1(x), f2(x), ..., fn(x)]. Lambda wrapper for systems of nonlinear equations.

Usage:

auto aSys = SystemLambda([](const math_Vector& x, math_Vector& f) {
f(1) = x(1)*x(1) + x(2)*x(2) - 1.0; // Circle
f(2) = x(1) - x(2); // Line y=x
return true;
});
GLint GLint GLint GLint GLint x
Definition OpenGl_glext.h:125
GLfloat f
Definition OpenGl_glext.h:2667
SystemLambda(Lambda theLambda, int theNbEquations)
Constructor from lambda.
Definition MathUtils_FunctorVector.hxx:723
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142
VectorResult Newton(FuncSetType &theFunc, const math_Vector &theStart, const math_Vector &theTolX, double theTolF, size_t theMaxIter=100)
Newton-Raphson method for solving systems of nonlinear equations.
Definition MathSys_Newton.hxx:41
Template Parameters
Lambdacallable with signature bool(const math_Vector&, math_Vector&)

Constructor & Destructor Documentation

◆ SystemLambda()

template<typename Lambda >
MathUtils::SystemLambda< Lambda >::SystemLambda ( Lambda theLambda,
int theNbEquations )
inline

Constructor from lambda.

Parameters
theLambdacallable for system evaluation
theNbEquationsnumber of equations in the system

Member Function Documentation

◆ NbEquations()

template<typename Lambda >
int MathUtils::SystemLambda< Lambda >::NbEquations ( ) const
inline

Returns the number of equations.

Returns
number of equations

◆ Value()

template<typename Lambda >
bool MathUtils::SystemLambda< Lambda >::Value ( const math_Vector & theX,
math_Vector & theF ) const
inline

Evaluates the system F(x).

Parameters
[in]theXinput vector
[out]theFsystem values
Returns
true if evaluation succeeded

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