3#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
19struct HasFreeDerivative
22 auto require(F&& f) ->
decltype(
29template<
class Dummy,
class F,
31 models< HasFreeDerivative, F>() ,
int>::type = 0>
32auto derivativeIfImplemented(
const F& f) ->
decltype(
derivative(f))
39template<
class Dummy,
class F,
41 not(models< HasFreeDerivative, F>()) ,
int>::type = 0>
42Dummy derivativeIfImplemented(
const F& f)
49template<
class Signature,
class DerivativeInterface>
50class DifferentiableFunctionWrapperInterface
57template<
class Range,
class Domain,
class DerivativeInterface>
58class DifferentiableFunctionWrapperInterface<Range(Domain), DerivativeInterface>
61 virtual Range
operator() (
const Domain& x)
const = 0;
63 virtual DerivativeInterface
derivative()
const = 0;
68template<
class Signature,
class DerivativeInterface,
class B>
69class DifferentiableFunctionWrapperImplementation
73template<
class Range,
class Domain,
class DerivativeInterface,
class B>
74class DifferentiableFunctionWrapperImplementation< Range(Domain), DerivativeInterface, B> :
80 using Wrapped =
typename B::Wrapped;
82 virtual Range
operator() (
const Domain& x)
const
84 return this->
get()(x);
89 return derivativeIfImplemented<DerivativeInterface, Wrapped>(this->
get());
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition trigonometricfunction.hh:39
virtual void operator()()=0
Reference get(const RAPropertyMapHelper< Reference, PropertyMap > &pmap, const Key &key)