BayesOpt
criteria_prod.hpp
Go to the documentation of this file.
1 
2 /*
3 -------------------------------------------------------------------------
4  This file is part of BayesOpt, an efficient C++ library for
5  Bayesian optimization.
6 
7  Copyright (C) 2011-2015 Ruben Martinez-Cantin <rmcantin@unizar.es>
8 
9  BayesOpt is free software: you can redistribute it and/or modify it
10  under the terms of the GNU Affero General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  BayesOpt is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU Affero General Public License for more details.
18 
19  You should have received a copy of the GNU Affero General Public License
20  along with BayesOpt. If not, see <http://www.gnu.org/licenses/>.
21 ------------------------------------------------------------------------
22 */
23 
24 #ifndef _CRITERIA_PROD_HPP_
25 #define _CRITERIA_PROD_HPP_
26 
27 #include "criteria_combined.hpp"
28 
29 
30 namespace bayesopt
31 {
34 
38  {
39  public:
40  virtual ~ProdCriteria() {};
41 
42  double operator() (const vectord &x)
43  {
44  double prod = 1.0;
45  for(size_t i = 0; i<mCriteriaList.size(); ++i)
46  {
47  prod *= mCriteriaList[i](x);
48  }
49  return prod;
50  };
51 
52  std::string name() {return "cProd";};
53  };
54 
56 
57 } //namespace bayesopt
58 
59 
60 #endif
Namespace of the library interface.
Definition: using.dox:1
Abstract class for combined criteria functions.
Abstract module for combined criteria.
Product of criterion functions.