matRad_MinMaxEUD

Purpose ^

Synopsis ^

This is a script file.

Description ^

Cross-reference information ^

This function calls: This function is called by:

Subfunctions ^

Source code ^

0001 classdef matRad_MinMaxEUD < DoseConstraints.matRad_DoseConstraint
0002     % matRad_MinMaxEUD Implements a MinMaxEUD constraint
0003     %   See matRad_DoseConstraint for interface description
0004     %
0005     % References
0006     %   -
0007     %
0008     % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0009     %
0010     % Copyright 2020 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     properties (Constant)
0022         name = 'EUD constraint';
0023         parameterNames = {'k','EUD^{min}', 'EUD^{max}'};
0024         %parameterIsDose = logical([0 1 1]);
0025         parameterTypes = {'numeric','dose','dose'};
0026     end
0027     
0028     properties
0029         parameters = {5,0,30};
0030     end
0031     
0032     methods
0033         function obj = matRad_MinMaxEUD(exponent,eudMin,eudMax)
0034             %If we have a struct in first argument
0035             if nargin == 1 && isstruct(exponent)
0036                 inputStruct = exponent;
0037                 initFromStruct = true;
0038             else
0039                 initFromStruct = false;
0040                 inputStruct = [];
0041             end
0042             
0043             %Call Superclass Constructor (for struct initialization)
0044             obj@DoseConstraints.matRad_DoseConstraint(inputStruct);
0045             
0046             %now handle initialization from other parameters
0047             if ~initFromStruct
0048                 
0049                 if nargin == 3 && isscalar(eudMax)
0050                     obj.parameters{3} = eudMax;
0051                 end
0052                 
0053                 if nargin >= 1 && isscalar(exponent)
0054                     obj.parameters{1} = exponent;
0055                 end
0056                 
0057                 if nargin >= 2 && isscalar(eudMin)
0058                     obj.parameters{2} = eudMin;
0059                 end
0060             end
0061         end
0062         
0063         %Overloads the struct function to add constraint specific
0064         %parameters
0065         function s = struct(obj)
0066             s = struct@DoseConstraints.matRad_DoseConstraint(obj);
0067             %Nothing to do here...
0068         end
0069         
0070         function cu = upperBounds(obj,n)
0071             cu = obj.parameters{3};
0072         end
0073         function cl = lowerBounds(obj,n)
0074             cl = obj.parameters{2};
0075         end
0076         %% Calculates the Constraint Function value
0077         function cDose = computeDoseConstraintFunction(obj,dose)
0078             k = obj.parameters{1};
0079             cDose = mean(dose.^k)^(1/k);
0080         end
0081         
0082         %% Calculates the Constraint jacobian
0083         function cDoseJacob  = computeDoseConstraintJacobian(obj,dose)
0084             k = obj.parameters{1};
0085             cDoseJacob = nthroot(1/numel(dose),k) * sum(dose.^k)^((1-k)/k) * (dose.^(k-1));
0086         end
0087     end
0088     
0089 end
0090 
0091

| Generated by m2html © 2005