diff options
author | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2012-04-01 18:17:41 +0000 |
---|---|---|
committer | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2012-04-01 18:17:41 +0000 |
commit | 3a8b1ca89c9b62e35e24d414d7a79f4c325dfd09 (patch) | |
tree | 6f87c5ee405c128007254055a88732f93b780a9e /core | |
parent | 87ede9b87ebb7323d167d09f0c7b8efde03c736c (diff) | |
download | opt-utilities-3a8b1ca89c9b62e35e24d414d7a79f4c325dfd09.tar.bz2 |
git-svn-id: file:///home/svn/opt_utilities@230 ed2142bd-67ad-457f-ba7c-d818d4011675
Diffstat (limited to 'core')
-rw-r--r-- | core/fp_fo_adapter.hpp | 33 |
1 files changed, 33 insertions, 0 deletions
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 <typename rT,typename pT> + class fp_fo_adapter + :public func_obj<rT,pT> + { + private: + fp_fo_adapter(); + rT (*fp)(const pT&); + public: + fp_fo_adapter(rT (*_fp)(const pT&)) + :fp(_fp) + {} + + fp_fo_adapter<rT,pT>* do_clone()const + { + return new fp_fo_adapter<rT,pT>(*this); + } + + rT do_eval(const pT& x) + { + return fp(x); + } + }; +}; + + +#endif + |