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

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

?? example43_run_a.m

?? 神經網絡VC++代碼 人工神經網絡原理及仿真實例.
?? M
?? 第 1 頁 / 共 5 頁
字號:
      msg=sprintf(['\nExiting due to infeasibility:  %i lower bounds exceed the' ...
            ' corresponding upper bounds.\n'],count);
   end 
end
% check if -inf in ub or inf in lb   
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 
                  ST

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品国产精华液| 中文av字幕一区| 日本亚洲三级在线| 3d动漫精品啪啪| 理论电影国产精品| xvideos.蜜桃一区二区| 成人做爰69片免费看网站| 国产精品热久久久久夜色精品三区| 国产a精品视频| 亚洲精品五月天| 欧美喷潮久久久xxxxx| 免费高清成人在线| 亚洲国产精品二十页| 色婷婷综合久久久中文字幕| 亚洲五码中文字幕| 日韩久久久精品| 丰满少妇在线播放bd日韩电影| 综合色天天鬼久久鬼色| 欧美日韩在线播| 日本麻豆一区二区三区视频| 26uuu久久综合| 国产精品99久久久久| 国产精品久久久久久久蜜臀 | 亚洲免费看黄网站| 欧美日韩激情一区二区三区| 久久aⅴ国产欧美74aaa| 色美美综合视频| 精品国产乱码久久久久久闺蜜| 日韩国产精品久久| 欧美军同video69gay| 亚洲一区二区三区爽爽爽爽爽| 亚洲小说春色综合另类电影| 91丨porny丨国产入口| 日本一区二区成人在线| 国内久久精品视频| 日韩女同互慰一区二区| 亚洲福利国产精品| 在线影视一区二区三区| 亚洲欧美激情插| 99国产精品一区| 欧美国产乱子伦| 岛国精品在线播放| 国产欧美精品区一区二区三区| 黄一区二区三区| 精品久久久久久久久久久院品网| 午夜日韩在线电影| av不卡在线观看| 亚洲欧洲av另类| 97超碰欧美中文字幕| 日韩毛片精品高清免费| 91亚洲男人天堂| 亚洲视频综合在线| 91香蕉国产在线观看软件| 日韩理论电影院| 欧美视频一区二| 日本欧美大码aⅴ在线播放| 欧美一区二区三区电影| 蜜桃在线一区二区三区| 欧美tickling挠脚心丨vk| 经典三级在线一区| 国产精品丝袜久久久久久app| 九九精品一区二区| 91麻豆精品国产无毒不卡在线观看| 久久精品国产久精国产爱| 国产午夜精品一区二区三区四区 | 成人高清伦理免费影院在线观看| 久久久久久久久久久电影| 成人午夜在线视频| 亚洲九九爱视频| 在线影院国内精品| 亚洲香肠在线观看| 精品国产乱码久久久久久免费| 日本韩国欧美在线| 欧美韩国日本综合| 欧洲av在线精品| 奇米色一区二区| 国产欧美精品一区| 欧美情侣在线播放| 国产激情一区二区三区四区| 1000部国产精品成人观看| 色呦呦国产精品| 免费看欧美美女黄的网站| 中文字幕欧美国产| 7777精品伊人久久久大香线蕉经典版下载 | 欧美一级一区二区| 国产成人精品一区二区三区四区 | 亚洲成人av资源| 日韩欧美一区二区不卡| 高清不卡一二三区| 青青草视频一区| 综合久久久久久| 欧美一区二区黄| 91视频免费观看| 国内精品伊人久久久久影院对白| 自拍偷拍亚洲综合| 精品久久人人做人人爰| 色婷婷av一区二区三区gif| 美女视频网站黄色亚洲| 亚洲少妇30p| 久久久午夜精品| 欧美日韩欧美一区二区| caoporen国产精品视频| 精品亚洲aⅴ乱码一区二区三区| 亚洲青青青在线视频| 久久久久久久久久久99999| 欧美人xxxx| 色哟哟欧美精品| 免费精品视频在线| 亚洲手机成人高清视频| 久久久久国产精品免费免费搜索| 欧美片在线播放| 欧美性大战xxxxx久久久| 国产精品中文字幕欧美| 石原莉奈在线亚洲二区| 亚洲六月丁香色婷婷综合久久 | 欧美日韩国产另类一区| 9i在线看片成人免费| 国产一区二区中文字幕| 视频一区中文字幕| 亚洲国产精品一区二区www| 国产精品青草久久| 国产欧美视频一区二区| 久久免费美女视频| 精品国产亚洲在线| 精品国产伦一区二区三区观看方式 | 激情六月婷婷综合| 日韩电影免费在线看| 亚洲成人午夜影院| 亚洲韩国精品一区| 亚洲成人精品在线观看| 一区二区三区免费观看| 久久久久国产精品麻豆| 日韩欧美中文字幕精品| www.欧美色图| 一本色道久久加勒比精品| 99久久精品国产麻豆演员表| 99久久免费精品| 91麻豆国产香蕉久久精品| 91麻豆精东视频| 欧美亚洲国产一区二区三区| 欧美在线一区二区| 欧美视频中文一区二区三区在线观看| 91黄色免费观看| 欧美挠脚心视频网站| 欧美一区二区福利在线| 911精品国产一区二区在线| 欧美日韩午夜在线| 欧美日产在线观看| 欧美韩国日本一区| 亚洲精品网站在线观看| 首页综合国产亚洲丝袜| 精品一区二区综合| 成人美女在线观看| 欧美日韩综合在线免费观看| 欧美一级日韩一级| 久久久一区二区| 亚洲视频在线一区观看| 亚洲国产视频一区| 国模一区二区三区白浆 | 亚洲国产日韩在线一区模特| 婷婷综合五月天| 夫妻av一区二区| 欧美日韩高清不卡| 久久网这里都是精品| 国产精品成人在线观看| 中文字幕av免费专区久久| 国产三级欧美三级日产三级99 | 黄色日韩网站视频| 不卡视频在线看| 91精品国产色综合久久ai换脸 | av在线不卡观看免费观看| 欧美三日本三级三级在线播放| 欧美一级午夜免费电影| 国产精品免费av| 久久aⅴ国产欧美74aaa| 在线看一区二区| 久久久亚洲综合| 日本不卡1234视频| 91视频免费观看| 国产亚洲精久久久久久| 视频一区二区三区在线| 不卡区在线中文字幕| 欧美性做爰猛烈叫床潮| 日韩免费观看高清完整版在线观看| 欧美电视剧在线观看完整版| 亚洲一区欧美一区| 成人夜色视频网站在线观看| 日韩欧美一二三| 亚洲曰韩产成在线| 成人av网站在线观看免费| 欧美成人三级在线| 日韩**一区毛片| 欧美影片第一页| 亚洲天堂福利av| 成人理论电影网| 国产午夜精品理论片a级大结局| 青青草精品视频| 欧美日韩国产中文| 一区二区在线观看av| 精品一区二区三区在线观看国产 |