BayesOpt
langermann.m
1 %
2 % -------------------------------------------------------------------------
3 % This file is part of BayesOpt, an efficient C++ library for
4 % Bayesian optimization.
5 %
6 % Copyright (C) 2011-2015 Ruben Martinez-Cantin <rmcantin@unizar.es>
7 %
8 % BayesOpt is free software: you can redistribute it and/or modify it
9 % under the terms of the GNU Affero General Public License as published by
10 % the Free Software Foundation, either version 3 of the License, or
11 % (at your option) any later version.
12 %
13 % BayesOpt is distributed in the hope that it will be useful, but
14 % WITHOUT ANY WARRANTY; without even the implied warranty of
15 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 % GNU Affero General Public License for more details.
17 %
18 % You should have received a copy of the GNU Affero General Public License
19 % along with BayesOpt. If not, see <http://www.gnu.org/licenses/>.
20 % ------------------------------------------------------------------------
21 %
22 
23 function x_out = langermann(x_in)
24 % Bounds [3,5]
25  a = [3,5,2,1,7];
26  b = [5,2,1,4,9];
27  c = [1,2,5,2,3];
28 
29  x = x_in(1);
30  y = x_in(2);
31 
32  t1 = exp(-(x-a).^2/pi -(y-b).^2/pi);
33  t2 = cos(pi*(x-a).^2 + pi*(y-b).^2);
34 
35  x_out = sum(c.*t1.*t2);