matRad IPOPT get constraint bounds wrapper function call [cl,cu] = matRad_getConstraintBounds(optiProb,cst) input cst: matRad cst struct output cl: lower bounds on constraints cu: lower bounds on constraints References - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright 2016 the matRad development team. This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function [cl,cu] = matRad_getConstraintBounds(optiProb,cst) 0002 % matRad IPOPT get constraint bounds wrapper function 0003 % 0004 % call 0005 % [cl,cu] = matRad_getConstraintBounds(optiProb,cst) 0006 % 0007 % input 0008 % cst: matRad cst struct 0009 % 0010 % output 0011 % cl: lower bounds on constraints 0012 % cu: lower bounds on constraints 0013 % 0014 % References 0015 % - 0016 % 0017 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0018 % 0019 % Copyright 2016 the matRad development team. 0020 % 0021 % This file is part of the matRad project. It is subject to the license 0022 % terms in the LICENSE file found in the top-level directory of this 0023 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part 0024 % of the matRad project, including this file, may be copied, modified, 0025 % propagated, or distributed except according to the terms contained in the 0026 % LICENSE file. 0027 % 0028 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0029 0030 0031 BPtype = class(optiProb.BP); 0032 isEffectBP = strcmp(BPtype,'matRad_EffectProjection'); 0033 0034 % Initialize bounds 0035 cl = []; 0036 cu = []; 0037 0038 % compute objective function for every VOI. 0039 for i = 1:size(cst,1) 0040 0041 % Only take OAR or target VOI. 0042 if ~isempty(cst{i,4}) && ( isequal(cst{i,3},'OAR') || isequal(cst{i,3},'TARGET') ) 0043 0044 % loop over the number of constraints for the current VOI 0045 for j = 1:numel(cst{i,6}) 0046 0047 optiFunc = cst{i,6}{j}; 0048 0049 % only perform computations for constraints 0050 %if ~isempty(strfind(cst{i,6}{j}.type,'constraint')) 0051 if isa(optiFunc,'DoseConstraints.matRad_DoseConstraint') 0052 0053 0054 if isEffectBP 0055 doses = optiFunc.getDoseParameters(); 0056 0057 effect = cst{i,5}.alphaX*doses + cst{i,5}.betaX*doses.^2; 0058 0059 optiFunc = optiFunc.setDoseParameters(effect); 0060 end 0061 0062 0063 cl = [cl;optiFunc.lowerBounds(numel(cst{i,4}{1}))]; 0064 cu = [cu;optiFunc.upperBounds(numel(cst{i,4}{1}))]; 0065 0066 %end 0067 end 0068 0069 end % over all objectives of structure 0070 0071 end % if structure not empty and target or oar 0072 0073 end % over all structures 0074 0075