This funciton evaluates the contraints defined in Constraints for lattice Constraints: cell array of struct('Fun',@functname,'Min',min,'Max',max,'OtherParameters',otherargs} Constraints: structure array struct('Fun',@(ring)functname(ring,parameters), 'Min',min, % of unweigthed funct val 'Max',max, 'Weight',w, 'RefPoints',[]) Constraints: structure array struct(... 'Fun',@(ring,lindata,globaldata,refpts)functname(... ring,lindata,globaldata,refpts,parameters), 'Min',min, % of unweigthed funct val 'Max',max, 'Weight',w, 'RefPoints',refpts); lindata is the output of atlinopt globdata.tune=tune fromk atlinopt globdata.chrom=chrom from atlinopt functname: handle to vector valued function: [res]=functname(THERING,otherargs) min and max have to be the same size as res. (this allows to give functions as limits!) created 30-8-2012 updated 12-10-2012 other_function_args is a cell array, ifit is not it is transformed in a cell array
0001 function atDisplayConstraintsChange(Constraints,results) 0002 % This funciton evaluates the contraints defined in Constraints for lattice 0003 % Constraints: cell array of struct('Fun',@functname,'Min',min,'Max',max,'OtherParameters',otherargs} 0004 % 0005 % Constraints: structure array struct('Fun',@(ring)functname(ring,parameters), 0006 % 'Min',min, % of unweigthed funct val 0007 % 'Max',max, 0008 % 'Weight',w, 0009 % 'RefPoints',[]) 0010 % 0011 % Constraints: structure array struct(... 0012 % 'Fun',@(ring,lindata,globaldata,refpts)functname(... 0013 % ring,lindata,globaldata,refpts,parameters), 0014 % 'Min',min, % of unweigthed funct val 0015 % 'Max',max, 0016 % 'Weight',w, 0017 % 'RefPoints',refpts); 0018 % 0019 % lindata is the output of atlinopt 0020 % globdata.tune=tune fromk atlinopt 0021 % globdata.chrom=chrom from atlinopt 0022 % 0023 % functname: handle to vector valued function: [res]=functname(THERING,otherargs) 0024 % 0025 % min and max have to be the same size as res. (this allows to give functions as limits!) 0026 % 0027 % created 30-8-2012 0028 % updated 12-10-2012 other_function_args is a cell array, ifit is not it is 0029 % transformed in a cell array 0030 0031 0032 disp(' ') 0033 disp('Final constraints values:') 0034 disp(' ') 0035 disp('Name lat_indx before after low high min dif before min dif after ') 0036 ok=arrayfun(@dispc, Constraints,results); %#ok<NASGU> 0037 disp(' ') 0038 disp('-----oooooo----oooooo----oooooo----') 0039 disp(' ') 0040 0041 function ok=dispc(cstr,res) 0042 nv=length(res.val1); 0043 ConstrName=sprintf('%-20.20s',func2str(cstr.Fun)); 0044 disp([repmat(ConstrName,nv,1) repmat(' ',nv,1)... 0045 num2str((1:nv)','%d') repmat(' ',nv,1) ... 0046 num2str([res.val1;res.val2;cstr.Min;cstr.Max;... 0047 res.penalty1;res.penalty1;]','%03.3e\t')]); 0048 ok=0; 0049 end 0050 0051 end