% Method of optiGTest class L. LAURENT -- 15/04/2018 -- luc.laurent@lecnam.net
0001 %% Method of optiGTest class 0002 % L. LAURENT -- 15/04/2018 -- 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) 2018 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 %% check all problems 0025 % INPUTS: 0026 % - varargin [optional]: 0027 % - boolean: if true, continue to check problems from the previous one, is false, start at the beginning 0028 % - string: type of problem (unconstrained, constrained, multiobjective) 0029 % OUTPUT: 0030 % - status: status of the constraints violation stored in cells (in the case of one constraint no cell is used) 0031 0032 function isOk=checkAllPb(obj,varargin) 0033 %default values 0034 isOk=true; 0035 flag=false; 0036 typeCheckPb=''; 0037 %deal with input arguments 0038 for itV=1:numel(varargin) 0039 if islogical(varargin{itV}) 0040 flag=varargin{itV}; 0041 elseif ischar(varargin{itV}) 0042 typeCheckPb=varargin{itV}; 0043 end 0044 end 0045 0046 %extract list of problems 0047 listFun=listPb(typeCheckPb); 0048 if flag %check all by continuing at the current position 0049 currPos=find(ismember(listFun,obj.consPb)); 0050 currPos=currPos(1); 0051 listFun=listFun(currPos:end); 0052 end 0053 %check every function 0054 for itF=1:numel(listFun) 0055 Ofprintf(' >>> Problem %s\n',listFun{itF}); 0056 tmpStatus=obj.checkPb(listFun{itF},true); 0057 isOk=isOk&&tmpStatus; 0058 end 0059 end