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

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

?? quadprog.m

?? 各人用Mtalab編寫的SVM程序
?? M
字號:
function [X,fval,exitflag,output,lambda]=quadprog(H,f,A,B,Aeq,Beq,lb,ub,X0,options,varargin)
%QUADPROG Quadratic programming. 
%   X=QUADPROG(H,f,A,b) attempts to solve the quadratic programming problem:
%
%            min 0.5*x'*H*x + f'*x   subject to:  A*x <= b 
%             x    
%
%   X=QUADPROG(H,f,A,b,Aeq,beq) solves the problem above while additionally
%   satisfying the equality constraints Aeq*x = beq.
%
%   X=QUADPROG(H,f,A,b,Aeq,beq,LB,UB) defines a set of lower and upper
%   bounds on the design variables, X, so that the solution is in the 
%   range LB <= X <= UB. Use empty matrices for LB and UB
%   if no bounds exist. Set LB(i) = -Inf if X(i) is unbounded below; 
%   set UB(i) = Inf if X(i) is unbounded above.
%
%   X=QUADPROG(H,f,A,b,Aeq,beq,LB,UB,X0) sets the starting point to X0.
%
%   X=QUADPROG(H,f,A,b,Aeq,beq,LB,UB,X0,OPTIONS) minimizes with the default 
%   optimization parameters replaced by values in the structure OPTIONS, an 
%   argument created with the OPTIMSET function.  See OPTIMSET for details.  
%   Used options are Display, Diagnostics, TolX, TolFun, HessMult, LargeScale, 
%   MaxIter, PrecondBandWidth, TypicalX, TolPCG, and MaxPCGIter. Currently, 
%   only 'final' and 'off' are valid values for the parameter Display ('iter'
%   is not available).
%
%   X=QUADPROG(Hinfo,f,A,b,Aeq,beq,LB,UB,X0,OPTIONS,P1,P2,...) passes the 
%   problem-dependent parameters P1,P2,... directly to the HMFUN function
%   when OPTIMSET('HessMult',HMFUN) is set. HMFUN is provided by the user. 
%   Pass empty matrices for A, b, Aeq, beq, LB, UB, XO, OPTIONS, to use the 
%   default values.
%
%   [X,FVAL]=QUADPROG(H,f,A,b) returns the value of the objective function at X:
%   FVAL = 0.5*X'*H*X + f'*X.
%
%   [X,FVAL,EXITFLAG] = QUADPROG(H,f,A,b) returns an EXITFLAG that describes the
%   exit condition of QUADPROG. Possible values of EXITFLAG and the corresponding 
%   exit conditions are
%
%     1  QUADPROG converged with a solution X.
%     3  Change in objective function value smaller than the specified tolerance.
%     4  Local minimizer found.
%     0  Maximum number of iterations exceeded.
%    -2  No feasible point found.
%    -3  Problem is unbounded.
%    -4  Current search direction is not a direction of descent; no further 
%         progress can be made.
%    -7  Magnitude of search direction became too small; no further progress can
%         be made.
%
%   [X,FVAL,EXITFLAG,OUTPUT] = QUADPROG(H,f,A,b) returns a structure
%   OUTPUT with the number of iterations taken in OUTPUT.iterations,
%   the type of algorithm used in OUTPUT.algorithm, the number of conjugate
%   gradient iterations (if used) in OUTPUT.cgiterations, a measure of first 
%   order optimality (if used) in OUPUT.firstorderopt, and the exit message
%   in OUTPUT.message.
%
%   [X,FVAL,EXITFLAG,OUTPUT,LAMBDA]=QUADPROG(H,f,A,b) returns the set of 
%   Lagrangian multipliers LAMBDA, at the solution: LAMBDA.ineqlin for the 
%   linear inequalities A, LAMBDA.eqlin for the linear equalities Aeq, 
%   LAMBDA.lower for LB, and LAMBDA.upper for UB.

%   Copyright 1990-2004 The MathWorks, Inc. 
%   $Revision: 1.28.4.7 $  $Date: 2004/04/20 23:19:28 $

% Handle missing arguments

defaultopt = struct('Display','final','Diagnostics','off',...
   'HessMult',[],... % must be [] by default
   'TolX',100*eps,'TolFun',100*eps,...
   'LargeScale','on','MaxIter',200,...
   'PrecondBandWidth',0,'TypicalX','ones(numberOfVariables,1)',...
   'TolPCG',0.1,'MaxPCGIter','max(1,floor(numberOfVariables/2))');

% If just 'defaults' passed in, return the default options in X
if nargin==1 && nargout <= 1 && isequal(H,'defaults')
   X = defaultopt;
   return
end

if nargin < 2
   error('optim:quadprog:NotEnoughInputs', ...
         'QUADPROG requires at least two input arguments.')
end

if nargin < 10, options =[];
   if nargin < 9, X0 = []; 
      if nargin < 8, ub = []; 
         if nargin < 7, lb = []; 
            if nargin < 6, Beq = []; 
               if nargin < 5, Aeq = [];
                  if nargin < 4, B = [];
                     if nargin < 3, A = [];
                     end, end, end, end, end, end, end, end

% Check for non-double inputs
if ~isa(H,'double') || ~isa(f,'double') || ~isa(A,'double') || ...
      ~isa(B,'double') || ~isa(Aeq,'double') || ...
      ~isa(Beq,'double') || ~isa(lb,'double') || ...
      ~isa(ub,'double') || ~isa(X0,'double')
  error('optim:quadprog:NonDoubleInput', ...
        'QUADPROG only accepts inputs of data type double.')
end                     
                     
% Set up constant strings
medium =  'medium-scale: active-set';
large = 'large-scale';

if nargout > 4
   computeLambda = 1;
else 
   computeLambda = 0;
end

% Options setup
largescale = isequal(optimget(options,'LargeScale',defaultopt,'fast'),'on');
diagnostics = isequal(optimget(options,'Diagnostics',defaultopt,'fast'),'on');
switch optimget(options,'Display',defaultopt,'fast')
case {'off', 'none'}
   verbosity = 0;
case 'iter'
   verbosity = 2;
case 'final'
   verbosity = 1;
case 'testing'
   verbosity = Inf;
otherwise
   verbosity = 1;
end
mtxmpy = optimget(options,'HessMult',defaultopt,'fast');
% check if name clash
if isequal(mtxmpy,'hmult')
   warning('optim:quadprog:HessMultNameClash', ...
           ['Potential function name clash with a Toolbox helper function:\n' ...
            'Use a name besides ''hmult'' for your HessMult function to\n' ...
            'avoid errors or unexpected results.'])
end

% Set the constraints up: defaults and check size
[nineqcstr,numberOfVariablesineq]=size(A);
[neqcstr,numberOfVariableseq]=size(Aeq);
if isa(H,'double') && ( isempty(mtxmpy) )
   lengthH = length(H);
else % HessMult in effect, so H can be anything
   lengthH = 0;
end

numberOfVariables = ...
    max([length(f),lengthH,numberOfVariablesineq,numberOfVariableseq]); % In case A or Aeq is empty
ncstr = nineqcstr + neqcstr;

if isempty(f), f=zeros(numberOfVariables,1); end
if isempty(A), A=zeros(0,numberOfVariables); end
if isempty(B), B=zeros(0,1); end
if isempty(Aeq), Aeq=zeros(0,numberOfVariables); end
if isempty(Beq), Beq=zeros(0,1); end

% Expect vectors
f=f(:);
B=B(:);
Beq=Beq(:);

if ~isequal(length(B),nineqcstr)
    error('optim:quadprog:InvalidSizesOfAAndB', ...
          'The number of rows in A must be the same as the length of b.')
elseif ~isequal(length(Beq),neqcstr)
    error('optim:quadprog:InvalidSizesOfAeqAndBeq', ...
          'The number of rows in Aeq must be the same as the length of beq.')
elseif ~isequal(length(f),numberOfVariablesineq) && ~isempty(A)
    error('optim:quadprog:InvalidSizesOfAAndF', ...
          'The number of columns in A must be the same as the length of f.')
elseif ~isequal(length(f),numberOfVariableseq) && ~isempty(Aeq)
    error('optim:quadprog:InvalidSizesOfAeqAndf', ...
          'The number of columns in Aeq must be the same as the length of f.')
end

[X0,lb,ub,msg] = checkbounds(X0,lb,ub,numberOfVariables);
if ~isempty(msg)
   exitflag = -2;
   X=X0; fval = []; lambda = [];
   output.iterations = 0;
   output.algorithm = ''; % Not known at this stage
   output.firstorderopt = [];
   output.cgiterations = []; 
   output.message = msg;
   if verbosity > 0
      disp(msg)
   end
   return
end

caller = 'quadprog';
% Check out H and make sure it isn't empty or all zeros
if isa(H,'double') && isempty(mtxmpy)
   if norm(H,'inf')==0 || isempty(H)
      % Really a lp problem
      warning('optim:quadprog:NullHessian', ...
              'Hessian is empty or all zero; calling LINPROG.')
      [X,fval,exitflag,output,lambda]=linprog(f,A,B,Aeq,Beq,lb,ub,X0,options);
      return
   else
      % Make sure it is symmetric
      if norm(H-H',inf) > eps
         if verbosity > -1
            warning('optim:quadprog:HessianNotSym', ...
                    'Your Hessian is not symmetric. Resetting H=(H+H'')/2.')
         end
         H = (H+H')*0.5;
      end
   end
end

% Use large-scale algorithm or not?
% Determine which algorithm and make sure problem matches.

%    If any inequalities, 
%    or both equalities and bounds, 
%    or more equalities than variables,
%    or no equalities and no bounds and no inequalities
%    or asked for active set (~largescale) then call qpsub
if ( (nineqcstr > 0) || ...
      ( neqcstr > 0 && (sum(~isinf(ub))>0 || sum(~isinf(lb)) > 0)) || ...
      (neqcstr > numberOfVariables) || ...
      (neqcstr==0 && nineqcstr==0 && ... 
          all(eq(ub, inf)) && all(eq(lb, -inf))) || ...  % unconstrained
      ~largescale)
   % (has linear inequalites  OR both equalities and bounds) OR 
   % ~largescale, then call active-set code
   output.algorithm = medium;
   if largescale  && ...
         (  issparse(H)  || issparse(A) || issparse(Aeq) )% asked for sparse
     warning('optim:quadprog:FullAndMedScale', ...
              ['This problem formulation not yet available for sparse matrices.\n', ...
               'Converting to full matrices and switching to medium-scale method.'])
   elseif largescale % and didn't ask for sparse
     warning('optim:quadprog:SwitchToMedScale', ...
             ['Large-scale method does not currently solve this problem formulation,\n' ...
              'switching to medium-scale method.'])
   end
   if ~isa(H,'double') || ( ~isempty(mtxmpy) ) 
      error('optim:quadprog:NoHessMult', ...
            'H must be specified explicitly for medium-scale algorithm: cannot use HessMult option.')
   end
   H = full(H); A = full(A); Aeq = full(Aeq);
else % call sqpmin when just bounds or just equalities
   output.algorithm = large;
   if isempty(mtxmpy) 
     H = sparse(H);
   end
   A = sparse(A); Aeq = sparse(Aeq);
end

if diagnostics 
   % Do diagnostics on information so far
   gradflag = []; hessflag = []; line_search=[];
   constflag = 0; gradconstflag = 0; non_eq=0;non_ineq=0;
   lin_eq=size(Aeq,1); lin_ineq=size(A,1); XOUT=ones(numberOfVariables,1);
   funfcn{1} = [];ff=[]; GRAD=[];HESS=[];
   confcn{1}=[];c=[];ceq=[];cGRAD=[];ceqGRAD=[];
   msg = diagnose('quadprog',output,gradflag,hessflag,constflag,gradconstflag,...
      line_search,options,defaultopt,XOUT,non_eq,...
      non_ineq,lin_eq,lin_ineq,lb,ub,funfcn,confcn,ff,GRAD,HESS,c,ceq,cGRAD,ceqGRAD);
end

% if any inequalities, or both equalities and bounds, or more equalities than bounds,
%    or asked for active set (~largescale) then call qpsub
if isequal(output.algorithm, medium)
   if isempty(X0), 
      X0=zeros(numberOfVariables,1); 
   end
   [X,lambdaqp,exitflag,output,dum1,dum2,msg]= ...
      qpsub(H,f,[Aeq;A],[Beq;B],lb,ub,X0,neqcstr,...
      verbosity,caller,ncstr,numberOfVariables,options,defaultopt); 
   output.algorithm = medium; % have to reset since call to qpsub obliterates
   
elseif isequal(output.algorithm,large)  % largescale: call sqpmin when just bounds or just equalities
    [X,fval,output,exitflag,lambda]=...
        sqpmin(f,H,X0,Aeq,Beq,lb,ub,verbosity,options,defaultopt,computeLambda,varargin{:});

    if exitflag == -10  % Problem not handled by sqpmin at this time: dependent rows
        warning('optim:quadprog:SwitchToMedScale', ...
            ['Large-scale method does not currently solve problems with dependent equalities,\n' ...
            'switching to medium-scale method.'])
        if isempty(X0),
            X0=zeros(numberOfVariables,1);
        end
        output.algorithm = medium;
        if ~isa(H,'double') || ( ~isempty(mtxmpy)  )
            error('optim:quadprog:NoHessMult', ...
                'H must be specified explicitly for medium-scale algorithm: cannot use HessMult option.')
        end
        H = full(H); A = full(A); Aeq = full(Aeq);

        [X,lambdaqp,exitflag,output,dum1,dum2,msg]= ...
            qpsub(H,f,[Aeq;A],[Beq;B],lb,ub,X0,neqcstr,...
            verbosity,caller,ncstr,numberOfVariables,options,defaultopt);
        output.algorithm = medium; % have to reset since call to qpsub obliterates
    end
end

if isequal(output.algorithm , medium)
   fval = 0.5*X'*(H*X)+f'*X; 
   if computeLambda
       llb = length(lb); 
       lub = length(ub);
       lambda.lower = zeros(llb,1);
       lambda.upper = zeros(lub,1);
       arglb = ~isinf(lb); lenarglb = nnz(arglb);
       argub = ~isinf(ub); lenargub = nnz(argub);
       lambda.eqlin = lambdaqp(1:neqcstr,1);
       lambda.ineqlin = lambdaqp(neqcstr+1:neqcstr+nineqcstr,1);
       lambda.lower(arglb) = lambdaqp(neqcstr+nineqcstr+1:neqcstr+nineqcstr+lenarglb);
       lambda.upper(argub) = lambdaqp(neqcstr+nineqcstr+lenarglb+1: ...
                                  neqcstr+nineqcstr+lenarglb+lenargub);
   end
   output.firstorderopt = []; 
   output.cgiterations = [];  

   if exitflag == 1
     normalTerminationMsg = sprintf('Optimization terminated.');  
     if verbosity > 0
       disp(normalTerminationMsg)
     end
     if isempty(msg)
       output.message = normalTerminationMsg;
     else
       % append normal termination msg to current output msg
       output.message = sprintf('%s\n%s',msg,normalTerminationMsg);
     end
   else
     output.message = msg;
   end
   
end





?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日韩欧美综合一区| 欧美视频在线一区二区三区| 欧美成人性战久久| 免费精品视频最新在线| 欧美一区二区三区影视| 美日韩黄色大片| 久久综合九色综合欧美98| 国产成人在线视频播放| 久久精品亚洲乱码伦伦中文 | 天天综合天天做天天综合| 欧美一卡二卡三卡| 国产成人在线视频网站| 亚洲日本乱码在线观看| 欧美丰满少妇xxxxx高潮对白 | 91精品办公室少妇高潮对白| 亚洲在线视频网站| 精品久久久网站| av成人免费在线观看| 亚洲超碰精品一区二区| 久久精品视频一区二区三区| 色婷婷精品大视频在线蜜桃视频| 亚洲成人免费在线观看| 欧美激情一区二区三区蜜桃视频| 成人午夜视频在线| 亚洲电影第三页| 久久久久久99精品| 91玉足脚交白嫩脚丫在线播放| 亚洲高清免费视频| 国产亚洲精品超碰| 欧美日韩免费一区二区三区| 国产成人鲁色资源国产91色综| 亚洲国产成人av好男人在线观看| 26uuu久久天堂性欧美| 91在线免费看| 奇米精品一区二区三区在线观看| 国产精品青草久久| 日韩美女一区二区三区| 一本高清dvd不卡在线观看| 久久99精品久久久| 亚洲一区二区在线播放相泽| 国产午夜精品久久久久久久| 欧美日本在线一区| 91色.com| 国产成人精品影院| 美女www一区二区| 一区二区三区在线观看动漫| 国产欧美视频在线观看| 欧美一区二区三区免费大片| 91福利在线播放| caoporn国产一区二区| 精品一区二区三区久久| 午夜精品一区在线观看| 亚洲精品欧美专区| 国产精品久久久久一区| 久久久久国产免费免费| 日韩一区二区三区av| 色婷婷av一区| 91在线免费播放| 粉嫩av一区二区三区| 国产在线不卡一区| 水蜜桃久久夜色精品一区的特点| 一片黄亚洲嫩模| 亚洲乱码一区二区三区在线观看| 欧美激情一区二区三区在线| 久久综合一区二区| 精品三级av在线| 日韩女同互慰一区二区| 欧美一区二视频| 91精品国产麻豆国产自产在线 | 91久久精品一区二区三区| 国产91清纯白嫩初高中在线观看| 极品少妇xxxx精品少妇| 九九视频精品免费| 韩国一区二区三区| 国产一区二区三区在线观看免费视频| 奇米色777欧美一区二区| 午夜精品久久久久影视| 天天综合网天天综合色| 免费观看成人鲁鲁鲁鲁鲁视频| 轻轻草成人在线| 日本视频中文字幕一区二区三区| 日韩和欧美一区二区三区| 视频一区二区不卡| 日韩高清不卡一区| 麻豆精品久久精品色综合| 免费看精品久久片| 国产精品一级在线| 成人一区在线看| 91蝌蚪porny九色| 91高清视频免费看| 91精品国产综合久久蜜臀| 日韩精品一区二区三区视频播放| 日韩欧美在线一区二区三区| 久久久www成人免费无遮挡大片| 久久精品免视看| 亚洲人午夜精品天堂一二香蕉| 亚洲精品中文字幕在线观看| 午夜视频一区在线观看| 六月丁香综合在线视频| 国产精选一区二区三区| 99在线热播精品免费| 一本色道a无线码一区v| 在线成人av影院| 久久久另类综合| 伊人一区二区三区| 全部av―极品视觉盛宴亚洲| 国产精品亚洲一区二区三区妖精| 99久久夜色精品国产网站| 欧美三级三级三级爽爽爽| 欧美xxxxx裸体时装秀| 中文在线一区二区| 亚洲动漫第一页| 国产裸体歌舞团一区二区| 色综合天天综合给合国产| 在线成人小视频| 中文在线一区二区| 日韩电影一二三区| 成人精品国产福利| 在线观看日韩电影| www一区二区| 午夜亚洲国产au精品一区二区| 国产乱国产乱300精品| 在线免费亚洲电影| 国产日韩欧美一区二区三区综合| 亚洲猫色日本管| 精品午夜久久福利影院 | 激情小说欧美图片| 欧美性感一区二区三区| 精品少妇一区二区三区视频免付费 | 日韩美女久久久| 久久疯狂做爰流白浆xx| 在线观看免费亚洲| 日本一区二区久久| 久久精品久久99精品久久| av电影在线不卡| 久久综合色之久久综合| 亚洲韩国精品一区| jizz一区二区| 久久久久久久久久看片| 亚洲午夜视频在线观看| 国产成人亚洲综合a∨婷婷| 欧美日韩一区二区三区在线| 国产精品电影一区二区| 国产在线播精品第三| 欧美一区二区视频在线观看| 一级中文字幕一区二区| 99国产欧美另类久久久精品 | 欧美日韩高清一区二区不卡| 综合久久给合久久狠狠狠97色| 国产一区二区0| 欧美不卡123| 久久精品国产77777蜜臀| 欧美肥大bbwbbw高潮| 亚洲成人久久影院| 91成人免费网站| 亚洲欧美另类久久久精品| 成人精品鲁一区一区二区| 久久久久久久久久久久久女国产乱| 免费一级片91| 日韩三级电影网址| 免费观看一级特黄欧美大片| 日韩一级免费观看| 美女网站在线免费欧美精品| 欧美区在线观看| 亚洲第一在线综合网站| 欧美高清www午色夜在线视频| 亚洲在线免费播放| 欧美日韩国产精选| 午夜精品福利在线| 欧美电影一区二区三区| 日韩专区在线视频| 日韩一区二区视频| 精品一区二区日韩| 久久嫩草精品久久久精品| 国产在线精品一区二区三区不卡| 日韩精品一区二区三区视频| 国内精品久久久久影院一蜜桃| 久久众筹精品私拍模特| 国产不卡免费视频| 国产精品国产三级国产普通话蜜臀 | 亚洲日本电影在线| 99久久精品免费看| 亚洲午夜日本在线观看| 51久久夜色精品国产麻豆| 美女精品一区二区| 国产清纯在线一区二区www| 成人黄色网址在线观看| 亚洲欧美日韩一区二区 | 97se亚洲国产综合自在线观| 亚洲精品视频在线观看网站| 欧美在线观看你懂的| 奇米精品一区二区三区在线观看一 | 婷婷国产在线综合| 欧美电视剧在线看免费| 国产aⅴ综合色| 亚洲午夜免费福利视频| 欧美一级日韩免费不卡| 国产一区二区三区日韩| 中文字幕一区二区三区四区| 欧美视频你懂的|