0001 classdef (Abstract) matRad_DoseConstraint < matRad_DoseOptimizationFunction 0002 % matRad_DoseConstraint: Interface for optimization constraints. 0003 % This abstract base class provides the interface of constraints for 0004 % non-linear optimization. 0005 % 0006 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0007 0008 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0009 % 0010 % Copyright 2015 the matRad development team. 0011 % 0012 % This file is part of the matRad project. It is subject to the license 0013 % terms in the LICENSE file found in the top-level directory of this 0014 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part 0015 % of the matRad project, including this file, may be copied, modified, 0016 % propagated, or distributed except according to the terms contained in the 0017 % LICENSE file. 0018 % 0019 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0020 0021 %These should be abstract methods, however Octave can't parse them. As soon 0022 %as Octave is able to do this, they should be made abstract again 0023 methods %(Abstract) 0024 %returns the constraint function(s) value(s) for a given dose 0025 %vector. Needs to be implemented in sub-classes. 0026 function cDose = computeDoseConstraintFunction(obj,dose) 0027 error('Function needs to be implemented!'); 0028 end 0029 0030 %return the (dose-dependent) constraint function jacobian for a 0031 %given dose vector. Needs to be implemented in sub-classes. 0032 function cDoseJacob = computeDoseConstraintJacobian(obj,dose) 0033 error('Function needs to be implemented!'); 0034 end 0035 0036 %Returns upper bound(s) / max value(s) for constraint function(s) 0037 %Needs to be implemented in sub-classes. 0038 function cu = upperBounds(obj,n) 0039 error('Function needs to be implemented!'); 0040 end 0041 0042 %Returns lower bound(s) / min value(s) for constraint function(s) 0043 %Needs to be implemented in sub-classes. 0044 function cl = lowerBounds(obj,n) 0045 error('Function needs to be implemented!'); 0046 end 0047 end 0048 0049 methods (Access = public) 0050 0051 % default constructor of matRad_DoseConstraint 0052 function obj = matRad_DoseConstraint(varargin) 0053 %default initialization from struct (parameters & penalty) 0054 obj@matRad_DoseOptimizationFunction(varargin{:}); 0055 end 0056 0057 function jStruct = getDoseConstraintJacobianStructure(obj,n) 0058 %return the structure of the (dose-dependent) constraint function 0059 %jacobian for a given length n of the dose vector. Returns a 0060 %default of a jStruct 0061 jStruct = ones(n,1); 0062 end 0063 0064 %Overloads the struct function to add Objective related information 0065 %to output struct 0066 function s = struct(obj) 0067 s = struct@matRad_DoseOptimizationFunction(obj); 0068 end 0069 end 0070 end 0071