dune-functions 2.9.0
|
Wrap a Dune::VirtualFunction into a callable object. More...
#include <dune/functions/common/callable.hh>
Public Member Functions | |
CallableFunctionWrapper (const F &f) | |
Instantiate from reference to f. More... | |
CallableFunctionWrapper (const std::shared_ptr< const F > &f) | |
Instantiate from std::shared_ptr to f. More... | |
Range | operator() (const Domain &x) const |
Forward operator() to F::evaluate() More... | |
Wrap a Dune::VirtualFunction into a callable object.
F | Some function deriving from Dune::VirtualFunction |
This class provides an operator() that forwards to the evaluate method. In order to allow this F::RangeType must be default constructible. This class is copyable and ownership policy of the wrapped function (see constructors) will be the same for all copies.
This models the Concept::DifferentiableFunction<Range(Domain), DerivativeTraits> concept.
Using this wrapper you can e.g. pass a Dune::VirtualFunction<D,R> to the standard wrapper std::function<R(D)>.
|
inline |
Instantiate from reference to f.
The CallableFunctionWrapper will not take ownership of the provided function.
|
inline |
Instantiate from std::shared_ptr to f.
The CallableFunctionWrapper will share ownership with the provided function.
|
inline |
Forward operator() to F::evaluate()
This uses the default constructor of F::RangeType