From 26e7d3bc61c16768a8409d6ea8e2c59b3e165367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20Gr=C3=A4ser?= <graeser@dune-project.org> Date: Wed, 24 Aug 2016 16:26:59 +0200 Subject: [PATCH] Add operator() to PythonFunction For simplicity we make PythonFunction callable. In the long run, we can/should implement this independently of the VirtualFunction interface. --- dune/fufem/python/function.hh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dune/fufem/python/function.hh b/dune/fufem/python/function.hh index 6276ce23..ec291661 100644 --- a/dune/fufem/python/function.hh +++ b/dune/fufem/python/function.hh @@ -101,6 +101,14 @@ class PythonFunction : callable_(x).toC(y); } + /** + * \brief Evaluate function + */ + RT operator()(const DT& x) const + { + return callable_(x).template toC<RT>(); + } + protected: Python::Callable callable_; @@ -172,6 +180,14 @@ class DifferentiablePythonFunction : derivative_(x).toC(y); } + /** + * \brief Evaluate function + */ + RT operator()(const DT& x) const + { + return callable_(x).template toC<RT>(); + } + protected: Python::Callable value_; -- GitLab