funCola

PURPOSE ^

% Colas's function

SYNOPSIS ^

function [p,dp]=funCola(xx)

DESCRIPTION ^

% Colas's function
L. LAURENT -- 04/11/2016 -- luc.laurent@lecnam.net

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% Colas's function
0002 %L. LAURENT -- 04/11/2016 -- luc.laurent@lecnam.net
0003 
0004 % sources available here:
0005 % https://bitbucket.org/luclaurent/optigtest/
0006 % https://github.com/luclaurent/optigtest/
0007 
0008 % optiGTest - set of testing functions    A toolbox to easy manipulate functions.
0009 % Copyright (C) 2017  Luc LAURENT <luc.laurent@lecnam.net>
0010 %
0011 % This program is free software: you can redistribute it and/or modify
0012 % it under the terms of the GNU General Public License as published by
0013 % the Free Software Foundation, either version 3 of the License, or
0014 % (at your option) any later version.
0015 %
0016 % This program is distributed in the hope that it will be useful,
0017 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0018 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0019 % GNU General Public License for more details.
0020 %
0021 % You should have received a copy of the GNU General Public License
0022 % along with this program.  If not, see <http://www.gnu.org/licenses/>.
0023 
0024 %
0025 %numerous local minima
0026 %1 global minimum : x=(0.651906,1.30194,0.099242,?0.883791,?0.8796,
0027 %               0.204651,-3.28414,0.851188,-3.46245,2.53245,-0.895246,
0028 %               0.204651,-3.28414,0.851188,-3.46245,2.53245,-0.895246,
0029 %               1.40992,-3.07367,1.96257,-2.97872,?0.807849,-1.68978) >> f(x)=11.7464
0030 %
0031 %design space -1<xi<4
0032 
0033 
0034 function [p,dp]=funCola(xx)
0035 fprintf('NEED to FIXED\n')
0036 %cf. https://github.com/andyfaff/ampgo/blob/master/%20ampgo%20--username%20andrea.gavana%40gmail.com/go_benchmark.py
0037 
0038 %constant
0039 dd=[0    0    0    0    0    0    0    0    0
0040     1.27 0    0    0    0    0    0    0    0
0041     1.69 1.43 0    0    0    0    0    0    0
0042     2.04 2.35 2.45 0    0    0    0    0    0
0043     3.09 3.18 3.26 2.85 0    0    0    0    0
0044     3.20 3.22 3.27 2.88 1.55 0    0    0    0
0045     2.86 2.56 2.58 2.59 3.12 3.06 0    0    0
0046     3.17 3.18 3.18 3.12 1.31 1.64 3.00 0    0
0047     3.21 3.18 3.18 3.17 1.70 1.36 2.95 1.32 0
0048     2.38 2.31 2.42 1.94 2.85 2.81 2.56 2.91 2.97];
0049 %handle function
0050 funR=@(xi,xj,yi,yj)sqrt((xi-xj).^2+(yi-yj).^2);
0051 
0052 %evaluation and derivatives
0053 nS=[size(xx,1) size(xx,2) size(xx,3)];
0054 %
0055 zz=zeros(nS(1),nS(2));
0056 xC=cat(3,zz,xx(:,:,1:2:end));
0057 yC=cat(3,zz,zz,xx(:,:,2:2:end));
0058 %
0059 p=zeros(nS(1:2));
0060 for itI=1:size(xC,3)
0061     for itJ=1:itI-1
0062         % dd(itI,itJ)
0063         p=p+(funR(xC(:,:,itI),xC(:,:,itJ),yC(:,:,itI),yC(:,:,itJ))-dd(itI,itJ)).^2;
0064         % p
0065     end
0066 end
0067 
0068 if nargout==2
0069     fprintf('Derivatives not implemented\n')
0070     dp=zeros(nS);
0071     %   dp=4*xx.*repmat(pSum,[1 1 size(xx,3)]);
0072 end
0073 end

Generated on Tue 28-May-2019 16:00:34 by m2html © 2005