www.gusucode.com > mbcexpr 工具箱 matlab 源码程序 > mbcexpr/@cglookuptwo/getFillOptimParameters.m

    function [V,JacP,Bnds,Ind,A,C]= getFillOptimParameters(LT,MaxGrad,RemoveNull)
%GETFILLOPTIMPARAMS optimization parameters for feature filling
%
% [V,JacP,Bnds,Ind,A,C]= getFillOptimParameters.m(LT,MaxGrad)

%  Copyright 2005-2009 The MathWorks, Inc.


% get inputs
xinp= getinputs(LT.Xexpr.info);
xv= i_eval(xinp.info);
yinp= getinputs(LT.Yexpr.info);
yv= i_eval(yinp.info);

X= zeros(max(length(xv),length(yv)),2);
X(:,1)= xv;
X(:,2)= yv;



V= LT.Values;
% randomise starting values
% V= V.*(1+randn(size(V))*0.1);

% find structurally unestimatable table values
JacP = JacobPattern(LT,X);

% remove locks
vlocks= LT.VLocks;

if nargin < 3 || RemoveNull
    Ind= any(JacP,1)' & ~vlocks(:);
else
    Ind = ~vlocks(:);
end
mask= getExtrapolationMask(LT);
if ~isempty(mask) && any(mask(:))
    % only select entries in extrapolation mask
    Ind= Ind & mask(:);
end

V= V(Ind);
JacP= JacP(:,Ind);

Bnds= LT.Clips;
Bnds= repmat(Bnds,numel(V),1);
% select estimatable values

if nargin>1 && ~isempty(MaxGrad) && any(isfinite(MaxGrad(:)))
    [A,C]= deltablecon(LT,Ind,MaxGrad);
else
    A= zeros(0,sum(Ind));
    C= ones(0,1);
end