亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? example43_run_b2.m

?? 神經網絡VC++代碼 人工神經網絡原理及仿真實例.
?? M
?? 第 1 頁 / 共 5 頁
字號:
if any(eq(ub, -inf)) 
   error('-Inf detected in upper bound: upper bounds must be > -Inf.');
elseif any(eq(lb,inf))
   error('+Inf detected in lower bound: lower bounds must be < Inf.');
end

x = xin;
function [X,lambda,exitflag,output,how]=qpsub(H,f,A,B,lb,ub,X,neqcstr,verbosity,caller,ncstr,numberOfVariables,options,defaultopt)


% Define constant strings
NewtonStep = 'Newton';
SteepDescent = 'steepest descent';
Conls = 'lsqlin';
Lp = 'linprog';
Qp = 'quadprog';
Qpsub = 'qpsub';
Nlconst = 'nlconst';
how = 'ok'; 

% Override quadprog/linprog MaxIter default limit which is
% really just for largescale, not active set methods.
defaultopt.MaxIter = Inf;  

exitflag = 1;
output = [];
iterations = 0;
if nargin < 13
   options = [];
end

lb=lb(:); ub = ub(:);

msg = nargchk(12,12,nargin);
if isempty(verbosity), verbosity = 1; end
if isempty(neqcstr), neqcstr = 0; end

LLS = 0;
if strcmp(caller, Conls)
   LLS = 1;
   [rowH,colH]=size(H);
   numberOfVariables = colH;
end
if strcmp(caller, Qpsub)
   normalize = -1;
else
   normalize = 1;
end

simplex_iter = 0;
if  norm(H,'inf')==0 | isempty(H), is_qp=0; else, is_qp=1; end



if LLS==1
   is_qp=0;
end

normf = 1;
if normalize > 0
   % Check for lp
   if ~is_qp & ~LLS
      normf = norm(f);
      if normf > 0
         f = f./normf;
      end
   end
end

% Handle bounds as linear constraints
arglb = ~eq(lb,-inf);
lenlb=length(lb); % maybe less than numberOfVariables due to old code
if nnz(arglb) > 0     
   lbmatrix = -eye(lenlb,numberOfVariables);
   
   A=[A; lbmatrix(arglb,1:numberOfVariables)]; % select non-Inf bounds
   B=[B;-lb(arglb)];
end


argub = ~eq(ub,inf);
lenub=length(ub);
if nnz(argub) > 0
   ubmatrix = eye(lenub,numberOfVariables);
   A=[A; ubmatrix(argub,1:numberOfVariables)];
   B=[B; ub(argub)];
end 
ncstr=ncstr + nnz(arglb) + nnz(argub);

% Figure out max iteration count
% For linprog/quadprog/lsqlin/qpsub problems, use 'MaxIter' for this.
% For nlconst (fmincon, etc) problems, use 'MaxSQPIter' for this.
if isequal(caller,Nlconst)
	maxiter = optimget(options,'MaxSQPIter',defaultopt,'fast');
else
	maxiter = optimget(options,'MaxIter',defaultopt,'fast'); 
end
% Used for determining threshold for whether a direction will violate
% a constraint.
normA = ones(ncstr,1);
if normalize > 0 
   for i=1:ncstr
      n = norm(A(i,:));
      if (n ~= 0)
         A(i,:) = A(i,:)/n;
         B(i) = B(i)/n;
         normA(i,1) = n;
      end
   end
else 
   normA = ones(ncstr,1);
end
errnorm = 0.01*sqrt(eps); 

tolDep = 100*numberOfVariables*eps;      
lambda=zeros(ncstr,1);
aix=lambda;
ACTCNT=0;
ACTSET=[];
ACTIND=0;
CIND=1;
eqix = 1:neqcstr; 

%------------EQUALITY CONSTRAINTS---------------------------
Q = zeros(numberOfVariables,numberOfVariables);
R = []; 
indepInd = 1:ncstr; 

if neqcstr>0
   % call equality constraint solver
   [Q,R,A,B,CIND,X,Z,actlambda,how,...
         ACTSET,ACTIND,ACTCNT,aix,eqix,neqcstr,ncstr,remove,exitflag]= ...
      eqnsolv(A,B,eqix,neqcstr,ncstr,numberOfVariables,LLS,H,X,f,normf,normA,verbosity, ...
      aix,how,exitflag);   
   
   if ~isempty(remove)
      indepInd(remove)=[];
      normA = normA(indepInd);
   end
   
   if ACTCNT >= numberOfVariables - 1  
      simplex_iter = 1; 
   end
   [m,n]=size(ACTSET);
   
   if strcmp(how,'infeasible')
      % Equalities are inconsistent, so X and lambda have no valid values
      % Return original X and zeros for lambda.
      output.iterations = iterations;
      return
   end
   
   err = 0;
   if neqcstr > numberOfVariables
      err = max(abs(A(eqix,:)*X-B(eqix)));
      if (err > 1e-8)  % Equalities not met
         how='infeasible';
         % was exitflag = 7; 
         exitflag = -1;
         if verbosity > 0 
            disp('Exiting: The equality constraints are overly stringent;')
            disp('         there is no feasible solution.')
         end
         % Equalities are inconsistent, X and lambda have no valid values
         % Return original X and zeros for lambda.
         output.iterations = iterations;
         return
      else % Check inequalities
         if (max(A*X-B) > 1e-8)
            how = 'infeasible';
            % was exitflag = 8; 
            exitflag = -1;
            if verbosity > 0
               disp('Exiting: The constraints or bounds are overly stringent;')
               disp('         there is no feasible solution.')
               disp('         Equality constraints have been met.')
            end
         end
      end
      if is_qp
         actlambda = -R\(Q'*(H*X+f));
      elseif LLS
         actlambda = -R\(Q'*(H'*(H*X-f)));
      else
         actlambda = -R\(Q'*f);
      end
      lambda(indepInd(eqix)) = normf * (actlambda ./normA(eqix));
      output.iterations = iterations;
      return
   end
   if isempty(Z)
      if is_qp
         actlambda = -R\(Q'*(H*X+f));
      elseif LLS
         actlambda = -R\(Q'*(H'*(H*X-f)));
      else
         actlambda = -R\(Q'*f);
      end
      lambda(indepInd(eqix)) = normf * (actlambda./normA(eqix));
      if (max(A*X-B) > 1e-8)
         how = 'infeasible';
         % was exitflag = 8; 
         exitflag = -1;
         if verbosity > 0
            disp('Exiting: The constraints or bounds are overly stringent;')
            disp('         there is no feasible solution.')
            disp('         Equality constraints have been met.')
         end
      end
      output.iterations = iterations;
      return
   end
   
   
   % Check whether in Phase 1 of feasibility point finding. 
   if (verbosity == -2)
      cstr = A*X-B; 
      mc=max(cstr(neqcstr+1:ncstr));
      if (mc > 0)
         X(numberOfVariables) = mc + 1;
      end
   end
else
   Z=1;
end

% Find Initial Feasible Solution
cstr = A*X-B;
mc=max(cstr(neqcstr+1:ncstr));
if mc>eps
   A2=[[A;zeros(1,numberOfVariables)],[zeros(neqcstr,1);-ones(ncstr+1-neqcstr,1)]];
   quiet = -2;
   options = struct('MaxIter',Inf);
   defaultopt = options;
   [XS,lambdaS,exitflagS,outputS] = qpsub([],[zeros(numberOfVariables,1);1],A2,[B;1e-5], ...
      [],[],[X;mc+1],neqcstr,quiet,Qpsub,size(A2,1),numberOfVariables+1,options,defaultopt);
   X=XS(1:numberOfVariables);
   cstr=A*X-B;
   if XS(numberOfVariables+1)>eps 
      if XS(numberOfVariables+1)>1e-8 
         how='infeasible';
         % was exitflag = 4; 
         exitflag = -1;
         if verbosity > 0
            disp('Exiting: The constraints are overly stringent;')
            disp('         no feasible starting point found.')
         end
      else
         how = 'overly constrained';
         % was exitflag = 3; 
         exitflag = -1;
         if verbosity > 0
            disp('Exiting: The constraints are overly stringent;')
            disp(' initial feasible point found violates constraints ')
            disp(' by more than eps.');
         end
      end
      lambda(indepInd) = normf * (lambdaS((1:ncstr)')./normA);
      output.iterations = iterations;
      return
   end
end

if (is_qp)
   gf=H*X+f;
   %  SD=-Z*((Z'*H*Z)\(Z'*gf));
   [SD, dirType] = compdir(Z,H,gf,numberOfVariables,f);
   
   % Check for -ve definite problems:
   %  if SD'*gf>0, is_qp = 0; SD=-SD; end
elseif (LLS)
   HXf=H*X-f;
   gf=H'*(HXf);
   HZ= H*Z;
   [mm,nn]=size(HZ);
   if mm >= nn
      %   SD =-Z*((HZ'*HZ)\(Z'*gf));
      [QHZ, RHZ] =  qr(HZ,0);
      Pd = QHZ'*HXf;
      % Now need to check which is dependent
      if min(size(RHZ))==1 % Make sure RHZ isn't a vector
         depInd = find( abs(RHZ(1,1)) < tolDep);
      else
         depInd = find( abs(diag(RHZ)) < tolDep );
      end  
   end
   if mm >= nn & isempty(depInd) % Newton step
      SD = - Z*(RHZ(1:nn, 1:nn) \ Pd(1:nn,:));
      dirType = NewtonStep;
   else % steepest descent direction
      SD = -Z*(Z'*gf);
      dirType = SteepDescent;
   end
else % lp
   gf = f;
   SD=-Z*Z'*gf;
   dirType = SteepDescent; 
   if norm(SD) < 1e-10 & neqcstr
      % This happens when equality constraint is perpendicular
      % to objective function f.x.
      actlambda = -R\(Q'*(gf));
      lambda(indepInd(eqix)) = normf * (actlambda ./ normA(eqix));
      output.iterations = iterations;
      return;
   end
end

oldind = 0; 

% The maximum number of iterations for a simplex type method is when ncstr >=n:
% maxiters = prod(1:ncstr)/(prod(1:numberOfVariables)*prod(1:max(1,ncstr-numberOfVariables)));

%--------------Main Routine-------------------
while iterations < maxiter
   iterations = iterations + 1;
   if isinf(verbosity)
      curr_out = sprintf('Iter: %5.0f, Active: %5.0f, step: %s, proc: %s',iterations,ACTCNT,dirType,how);
      disp(curr_out); 
   end
   
   % Find distance we can move in search direction SD before a 
   % constraint is violated.
   % Gradient with respect to search direction.
   GSD=A*SD;
   
   % Note: we consider only constraints whose gradients are greater
   % than some threshold. If we considered all gradients greater than 
   % zero then it might be possible to add a constraint which would lead to
   % a singular (rank deficient) working set. The gradient (GSD) of such
   % a constraint in the direction of search would be very close to zero.
   indf = find((GSD > errnorm * norm(SD))  &  ~aix);
   
   if isempty(indf) % No constraints to hit
      STEPMIN=1e16;
      dist=[]; ind2=[]; ind=[];
   else % Find distance to the nearest constraint
      dist = abs(cstr(indf)./GSD(indf));
      [STEPMIN,ind2] =  min(dist);
      ind2 = find(dist == STEPMIN);
      % Bland's rule for anti-cycling: if there is more than one 
      % blocking constraint then add the one with the smallest index.
      ind=indf(min(ind2));
      % Non-cycling rule:
      % ind = indf(ind2(1));
   end
   %-----Update X-------------
   
   % Assume we do not delete a constraint
   delete_constr = 0;   
   
   if ~isempty(indf)& isfinite(STEPMIN) % Hit a constraint
      if strcmp(dirType, NewtonStep)
         % Newton step and hit a constraint: LLS or is_qp
         if STEPMIN > 1  % Overstepped minimum; reset STEPMIN
            STEPMIN = 1;
            delete_constr = 1;
         end
         X = X+STEPMIN*SD;
      else
         % Not a Newton step and hit a constraint: is_qp or LLS or maybe lp
         X = X+STEPMIN*SD;          
      end              
   else %  isempty(indf) | ~isfinite(STEPMIN)
      % did not hit a constraint
      if strcmp(dirType, NewtonStep)
         % Newton step and no constraint hit: LLS or maybe is_qp
         STEPMIN = 1;   % Exact distance to the solution. Now delete constr.
         X = X + SD;
         delete_constr = 1;
      else % Not a Newton step: is_qp or lp or LLS
         if is_qp
            % Is it semi-def, neg-def or indef?
            eigoptions.disp = 0;
            ZHZ = Z'*H*Z;
            if numberOfVariables < 400 % only use EIGS on large problems
               [VV,DD] = eig(ZHZ);
               [smallRealEig, eigind] = min(diag(DD));
               ev = VV(:,eigind(1));
            else
               [ev,smallRealEig,flag] = eigs(ZHZ,1,'sr',eigoptions);
               if flag  % Call to eigs failed
                  [VV,DD] = eig(ZHZ);
                  [smallRealEig, eigind] = min(diag(DD));
                  ev = VV(:,eigind(1));
               end
            end
            
         else % define smallRealEig for LLS
            smallRealEig=0;
         end
         
         if (~is_qp & ~LLS) | (smallRealEig < -100*eps) % LP or neg def: not LLS
            % neg def -- unbounded
            if norm(SD) > errnorm
               if normalize < 0
                  STEPMIN=abs((X(numberOfVariables)+1e-5)/(SD(numberOfVariables)+eps));
               else 
                  STEPMIN = 1e16;
               end
               X=X+STEPMIN*SD;
               how='unbounded'; 
               % was exitflag = 5; 
               exitflag = -1;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩综合在线视频| 久久久99久久| www.亚洲激情.com| 精品无人码麻豆乱码1区2区 | 欧美色倩网站大全免费| 99re成人精品视频| 成人av在线资源网站| 成人午夜电影网站| 成人av动漫在线| 99精品视频在线观看| 福利一区在线观看| 波多野结衣中文字幕一区二区三区| 裸体一区二区三区| 久久国产精品色| 久久爱另类一区二区小说| 久久91精品久久久久久秒播| 久久国产三级精品| 国内外成人在线| 热久久一区二区| 久久不见久久见免费视频7| 国产精品亚洲第一| 色系网站成人免费| 欧美放荡的少妇| 久久精品视频在线免费观看| 日韩伦理电影网| 三级影片在线观看欧美日韩一区二区| 另类调教123区| 成人深夜在线观看| 欧美在线三级电影| 2024国产精品| 亚洲三级久久久| 天堂一区二区在线免费观看| 激情综合色播激情啊| jiyouzz国产精品久久| 精品视频在线免费| 7777精品伊人久久久大香线蕉 | 亚洲视频在线一区观看| 亚洲免费色视频| 人妖欧美一区二区| www.亚洲免费av| 日韩一二三区视频| 国产精品久久久久久久久久久免费看 | 亚洲精品国产精华液| 日本不卡一区二区三区| 国产美女在线精品| 欧美久久久久免费| 国产精品的网站| 国产综合久久久久影院| 日本韩国视频一区二区| 久久精品亚洲精品国产欧美kt∨ | 美女视频黄久久| 91国内精品野花午夜精品| 久久精品人人做人人综合| 亚洲va中文字幕| 99精品久久只有精品| 久久伊人蜜桃av一区二区| 亚洲高清免费观看| 91在线国产观看| 日本一区二区成人在线| 欧美一区二区三区免费观看视频| 国产三级精品在线| 香蕉乱码成人久久天堂爱免费| 看电视剧不卡顿的网站| 在线观看中文字幕不卡| 国产精品进线69影院| 激情欧美日韩一区二区| 欧美日韩一区二区三区高清 | 成人午夜在线视频| 久久久精品蜜桃| 精品无人码麻豆乱码1区2区 | 国产精品自拍一区| 欧美电视剧在线观看完整版| 午夜精品久久久久久久久久| 91视频免费看| 亚洲免费av高清| 色综合天天做天天爱| 国产精品免费久久久久| www.久久精品| 亚洲桃色在线一区| 在线免费观看日韩欧美| 亚洲综合小说图片| 欧美日韩日本视频| 日日夜夜免费精品视频| 欧美性大战久久| 亚洲va欧美va人人爽| 777奇米四色成人影色区| 婷婷综合久久一区二区三区| 欧美日韩aaa| 久久国产精品免费| 国产校园另类小说区| 不卡一区在线观看| 一区二区三区在线观看国产| 欧美日韩国产一二三| 美美哒免费高清在线观看视频一区二区 | 97精品国产露脸对白| 国产精品护士白丝一区av| 色欧美乱欧美15图片| 日韩国产精品大片| 国产日韩精品一区| 欧美性一区二区| 久久精品国产亚洲a| 国产精品美女久久久久久久久| 91麻豆精品一区二区三区| 日韩国产精品久久| 国产欧美一区二区在线| 欧美午夜一区二区三区免费大片| 蜜臀av亚洲一区中文字幕| 国产欧美在线观看一区| 91成人在线精品| 激情综合亚洲精品| 亚洲精品乱码久久久久久| 日韩欧美一区在线观看| av在线一区二区| 日韩高清不卡在线| 国产精品毛片大码女人 | 免费在线欧美视频| 欧美激情一区三区| 欧美高清视频不卡网| 成人黄色a**站在线观看| 日本成人在线看| 成人免费在线播放视频| 日韩欧美中文字幕精品| 国产91精品一区二区| 亚洲第一激情av| 国产精品美女久久久久av爽李琼| 欧美日韩国产小视频在线观看| 国产成人精品免费网站| 蜜臀91精品一区二区三区| 亚洲日本中文字幕区| 久久无码av三级| 91精品国产欧美一区二区成人| 99久久久精品| 国产成人免费xxxxxxxx| 青草av.久久免费一区| 亚洲综合男人的天堂| 国产精品私人自拍| 久久综合色天天久久综合图片| 欧美高清精品3d| 欧美三级在线视频| 一本色道久久加勒比精品| 波多野洁衣一区| 成人午夜激情影院| 国产精品123区| 国产剧情在线观看一区二区| 久久国产尿小便嘘嘘| 免费欧美高清视频| 奇米色一区二区| 日韩va亚洲va欧美va久久| 一区二区三区免费观看| 一个色在线综合| 亚洲最新视频在线观看| 亚洲国产精品自拍| 亚洲综合一区二区| 香蕉影视欧美成人| 日韩一区二区免费高清| 久久国产精品72免费观看| 亚洲猫色日本管| 亚洲日本va在线观看| 自拍偷自拍亚洲精品播放| 国产精品成人免费| 日韩理论在线观看| 国产精品人人做人人爽人人添| 国产人成一区二区三区影院| 久久久精品中文字幕麻豆发布| 久久一区二区三区四区| 亚洲国产成人午夜在线一区| 欧美激情一区二区三区全黄| 国产精品天美传媒| 亚洲自拍偷拍图区| 婷婷成人激情在线网| 久久国产尿小便嘘嘘尿| 国产一区二区三区免费在线观看| 国产夫妻精品视频| 99精品久久只有精品| 欧美理论在线播放| 欧美大片拔萝卜| 国产免费成人在线视频| 亚洲女同一区二区| 亚洲成人1区2区| 久久99精品一区二区三区三区| 毛片基地黄久久久久久天堂| 国产麻豆成人精品| av在线不卡电影| 精品视频1区2区3区| 精品精品国产高清a毛片牛牛| 精品国产91乱码一区二区三区 | 午夜av一区二区| 国模冰冰炮一区二区| 色欧美日韩亚洲| 精品福利在线导航| 亚洲精品国产精品乱码不99| 韩日av一区二区| 91成人免费网站| 国产亚洲人成网站| 爽好久久久欧美精品| 99久久久精品| 26uuu精品一区二区| 亚洲高清免费在线| av男人天堂一区| 欧美精品一区二区三区一线天视频|