3 #ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH 4 #define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH 6 #include <dune/common/exceptions.hh> 7 #include <dune/common/concept.hh> 22 auto require(F&& f) -> decltype(
29 template<
class Dummy,
class F,
30 typename std::enable_if<
31 models< HasFreeDerivative, F>() ,
int>::type = 0>
39 template<
class Dummy,
class F,
40 typename std::enable_if<
41 not(models< HasFreeDerivative, F>()) ,
int>::type = 0>
44 DUNE_THROW(Dune::NotImplemented,
"Derivative not implemented");
49 template<
class Signature,
class DerivativeInterface>
57 template<
class Range,
class Domain,
class DerivativeInterface>
61 virtual Range operator() (
const Domain& x)
const = 0;
63 virtual DerivativeInterface
derivative()
const = 0;
68 template<
class Signature,
class DerivativeInterface,
class B>
73 template<
class Range,
class Domain,
class DerivativeInterface,
class B>
82 virtual Range operator() (
const Domain& x)
const 84 return this->
get()(x);
89 return derivativeIfImplemented<DerivativeInterface, Wrapped>(this->
get());
99 #endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH auto derivativeIfImplemented(const F &f) -> decltype(derivative(f))
Definition: differentiablefunction_imp.hh:32
Definition: differentiablefunction_imp.hh:19
Definition: polynomial.hh:7
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition: trigonometricfunction.hh:38
virtual DerivativeInterface derivative() const
Definition: differentiablefunction_imp.hh:87
Definition: differentiablefunction_imp.hh:69
typename B::Wrapped Wrapped
Definition: differentiablefunction_imp.hh:80
Definition: differentiablefunction_imp.hh:50
auto require(F &&f) -> decltype(derivative(f))