dune-functions 2.9.0
Public Member Functions | List of all members
Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface > Class Template Reference

Wrap a callable object as Dune::Function or Dune::VirtualFunction. More...

#include <dune/functions/common/functionfromcallable.hh>

Inheritance diagram for Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface >:
Inheritance graph

Public Member Functions

 FunctionFromCallable (F &&f)
 Create VirtualFunction from callable object. More...
 
 FunctionFromCallable (const F &f)
 Create VirtualFunction from callable object. More...
 
void evaluate (const Domain &x, Range &y) const
 Evaluate function. More...
 

Detailed Description

template<class Range, class Domain, class F, class FunctionInterface>
class Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface >

Wrap a callable object as Dune::Function or Dune::VirtualFunction.

You can use this to implement a DifferentiableFunction including a variable number of derivatives using callable objects. All types that can be assigned to std::function<Range(Domain)> are supported, i.e. functions, functors, lambdas, ...

Template Parameters
RangeRange type
DomainDomain type
FType of wrapped function
FunctionInterfaceInterface to implement, this can be either Dune::Function or Dune::VirtualFunction

Constructor & Destructor Documentation

◆ FunctionFromCallable() [1/2]

template<class Range , class Domain , class F , class FunctionInterface >
Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface >::FunctionFromCallable ( F &&  f)
inline

Create VirtualFunction from callable object.

This will store the given function and pass evaluate() to its operator(). This constructor moves data from given function.

Parameters
fCallable object to use for evaluate()

◆ FunctionFromCallable() [2/2]

template<class Range , class Domain , class F , class FunctionInterface >
Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface >::FunctionFromCallable ( const F &  f)
inline

Create VirtualFunction from callable object.

This will store the given function and pass evaluate() to its operator(). This constructor copies the given function.

Parameters
fCallable object to use for evaluate()

Member Function Documentation

◆ evaluate()

template<class Range , class Domain , class F , class FunctionInterface >
void Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface >::evaluate ( const Domain &  x,
Range &  y 
) const
inline

Evaluate function.

This call is passed to the function


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