www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgoptimstore/gridPevEvaluate.m

    function [y, ysums] = gridPevEvaluate(optimstore, X, varargin)
%GRIDPEVEVALUATE Grid evaluation of prediction error variance (PEV)
%
%   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   % WARNING: The evaluation of PEV is no longer supported in         %
%   % cgoptimstore and this method will return zero matrices (as       %
%   % detailed below) if called.                                       %      
%   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%   Y = GRIDPEVEVALUATE(OPTIMSTORE, X) produces identical results to the
%   equivalent call to CGOPTIMSTORE/PEVEVALUATE. 
%
%   Y = GRIDPEVEVALUATE(OPTIMSTORE, X, OBJCONNAME) returns PEV values of
%   zero for the objectives/constraints specified in the cell array
%   OBJCONNAME.
%
%   Y = GRIDPEVEVALUATE(OPTIMSTORE, X, OBJCONNAME, DATASETNAME) returns PEV
%   values of zero for the specified objectives/constraints. The return
%   matrix, Y, is of size SIZE(X,1)-by-(NOBJCON)-by-NPTS, where NOBJCON is
%   the number of specified objectives/constraints and NPTS is the number
%   of rows in P. 
%
%   Y = GRIDPEVEVALUATE(OPTIMSTORE, X, DATASETNAME, OBJCONNAME, ROWIND)
%   returns PEV values of zero for the specified objectives/constraints. Y
%   is a LENGTH(ROWIND) by LENGTH(OBJCONNAME) by NPTS matrix.

%  Copyright 2000-2005 The MathWorks, Inc. and Ford Global Technologies, Inc.


% Tell the user that gridPevEvaluate is no longer supported
warning(message('mbc:cgoptimstore:obsolete1'));

% Get information about the objects for evaluation
[datasetName, reqObj, reqNcon, reqLcon, unused, rowInd] = ...
    pPrepareEvaluate(optimstore, varargin{:});

% As no longer supported, just return zeros of the required size
NX = size(X, 1);
if isempty(datasetName)
    NROW = NX*length(getRunIndices(optimstore.OptimRunner));
elseif isempty(rowInd)
    NROW = NX*getNumRowsInDataset(optimstore, datasetName);
else
    NROW = NX*length(rowInd);
end
NCOL = length(reqObj) + length(reqNcon) + length(reqLcon);
y = zeros(NROW, NCOL);

% This function will not support sums. Return empty for ysums
ysums = [];