BayesOpt
displaygp.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 _DISPLAYGP_HPP_
26 #define _DISPLAYGP_HPP_
27 
28 #include "bayesopt/bayesopt.hpp"
29 #include "matplotpp.h"
30 
31 namespace bayesopt
32 {
33  namespace utils
34  {
35  enum RunningStatus
36  {
37  RUN, STEP, STOP, NOT_READY
38  };
39 
40  class DisplayProblem1D :public MatPlot
41  {
42  private:
43  RunningStatus status;
44  size_t state_ii;
45  BayesOptBase* bopt_model;
46  std::vector<double> lx,ly;
47 
48  public:
50  void init(BayesOptBase* bopt, size_t dim);
51  void setSTEP();
52  void toogleRUN();
53  void DISPLAY();
54  };
55 
56  class DisplayProblem2D :public MatPlot
57  {
58  private:
59  RunningStatus status;
60  size_t state_ii;
61  BayesOptBase* bopt_model;
62  std::vector<double> lx,ly;
63  std::vector<double> cx, cy;
64  std::vector<double> solx, soly;
65  size_t c_points;
66  std::vector<double> cX,cY;
67  std::vector<std::vector<double> > cZ;
68 
69  public:
71  void setSolution(vectord sol);
72  void prepareContourPlot();
73  void init(BayesOptBase* bopt, size_t dim);
74  void setSTEP();
75  void toogleRUN();
76  void DISPLAY();
77  };
78 
79 
80  } //namespace utils
81 
82 } //namespace bayesopt
83 
84 
85 #endif
Namespace of the library interface.
Definition: using.dox:1
BayesOpt main C++ interface.
Abstract module for Bayesian optimization.