BayesOpt
optimizable.hpp
Go to the documentation of this file.
1 
3 /*
4 -------------------------------------------------------------------------
5  This file is part of BayesOpt, an efficient C++ library for
6  Bayesian optimization.
7 
8  Copyright (C) 2011-2015 Ruben Martinez-Cantin <rmcantin@unizar.es>
9 
10  BayesOpt is free software: you can redistribute it and/or modify it
11  under the terms of the GNU Affero General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  BayesOpt is distributed in the hope that it will be useful, but
16  WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU Affero General Public License for more details.
19 
20  You should have received a copy of the GNU Affero General Public License
21  along with BayesOpt. If not, see <http://www.gnu.org/licenses/>.
22 ------------------------------------------------------------------------
23 */
24 
25 #ifndef __OPTIMIZABLE_HPP__
26 #define __OPTIMIZABLE_HPP__
27 
28 #include "specialtypes.hpp"
29 
30 namespace bayesopt {
31 
32 
34  {
35  public:
36  RBOptimizable(){};
37  virtual ~RBOptimizable(){};
38 
39  virtual double evaluate(const vectord& query) = 0;
40  };
41 
43  {
44  public:
45  RGBOptimizable(){};
46  virtual ~RGBOptimizable(){};
47 
48  virtual double evaluate(const vectord& query) = 0;
49  virtual double evaluate(const vectord& query,
50  vectord& grad) = 0;
51 
52  };
53 
54 
56  {
57  public:
58  explicit RBOptimizableWrapper(RBOptimizable* rbo): rbo_(rbo){};
59  virtual ~RBOptimizableWrapper(){};
60  double evaluate(const vectord& query){return rbo_->evaluate(query);}
61  private:
62  RBOptimizable* rbo_;
63  };
64 
66  {
67  public:
68  explicit RGBOptimizableWrapper(RGBOptimizable* rgbo): rgbo_(rgbo){};
69  virtual ~RGBOptimizableWrapper(){};
70  double evaluate(const vectord& query, vectord& grad){return rgbo_->evaluate(query,grad);}
71  private:
72  RGBOptimizable* rgbo_;
73  };
74 
75 
76 } // namespace bayesopt
77 
78 #endif
Boost vector and matrix types.
Namespace of the library interface.
Definition: using.dox:1