www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgoptimconstraint/getSummary.m
function [feasSummary, valueDesc, conSummary, leftSummary, rightSummary] = ... getSummary( obj, inputValues, feasValue, conValue, leftValue, rightValue,DS ) %GETSUMMARY Return a summarised evaluation of the constraint % % [FEASSUMMARY, VALUEDESC, CONSUMMARY, LEFTSUMMARY, RIGHTSUMMARY] = % GETSUMMARY(OBJ, INPUTVALUES, FEASVALUE, CONVALUE, LEFTVALUE, % RIGHTVALUE) returns a summarised evaluation of OBJ. % % CONVALUE, LEFTVALUE, RIGHTVALUE and FEASVALUE are evaluations of OBJ % from which the summarized values are generated. The input values at % which OBJ was evaluated are also supplied through INPUTVALUES. % % DS is a cgstaticdataset object if the constraint is evaluated over a % dataset. Otherwise it is empty. % % VALUEDESC is a NSUMMARY-by-1 cell array of descriptions of each % constraint value. CONSUMMARY, LEFTSUMMARY, RIGHTSUMMARY and FEASSUMMARY % are NSUMMARY-by-1 summarized evaluations of OBJ. % % FEASSUMMARY = GETSUMMARY(OBJ, FEASVALUE, CONVALUE, LEFTVALUE, % RIGHTVALUE) returns a summarised feasibility status of the constraints % only. % % This is a default implementation. Subclasses can customise this by % overloading this method. % Copyright 2007-2009 The MathWorks, Inc. % Just pass feasible values straight back out feasSummary = feasValue; if nargout > 1 % Size of summarised evaluation nSummary = size(conValue, 1); % Constraint descriptions valueDesc = cell(nSummary, 1); [valueDesc{:}] = deal(char(obj)); if ~isempty(DS) for i=1:nSummary valueDesc{i} = sprintf('%s: %s',DS.Name,valueDesc{i}); end end % Summarised constraint evaluation conSummary = conValue; leftSummary = leftValue; rightSummary = rightValue; end