% This function is part of the NMSM Pipeline, see file for full license.
%
% This function calculates the integrand for design optimization.
%
% (struct, struct, struct) -> (2D matrix)
% Returns scaled integrand
function integrand = calcDesignOptimizationIntegrand(values, ...
modeledValues, auxdata)
[costTermCalculations, allowedTypes] = ...
generateCostTermStruct("continuous", "DesignOptimization");
integrand = calcTreatmentOptimizationCost( ...
costTermCalculations, allowedTypes, values, modeledValues, auxdata);
integrand = integrand ./ (auxdata.maxIntegral - auxdata.minIntegral);
integrand = integrand .^ 2;
end