From 3a8b1ca89c9b62e35e24d414d7a79f4c325dfd09 Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Sun, 1 Apr 2012 18:17:41 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@230 ed2142bd-67ad-457f-ba7c-d818d4011675 --- core/fp_fo_adapter.hpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 core/fp_fo_adapter.hpp (limited to 'core') diff --git a/core/fp_fo_adapter.hpp b/core/fp_fo_adapter.hpp new file mode 100644 index 0000000..0c5740b --- /dev/null +++ b/core/fp_fo_adapter.hpp @@ -0,0 +1,33 @@ +#ifndef FP_FO_ADAPTER_HPP +#define FP_FO_ADAPTER_HPP +#include "optimizer.hpp" + +namespace opt_utilities +{ + template + class fp_fo_adapter + :public func_obj + { + private: + fp_fo_adapter(); + rT (*fp)(const pT&); + public: + fp_fo_adapter(rT (*_fp)(const pT&)) + :fp(_fp) + {} + + fp_fo_adapter* do_clone()const + { + return new fp_fo_adapter(*this); + } + + rT do_eval(const pT& x) + { + return fp(x); + } + }; +}; + + +#endif + -- cgit v1.2.2