home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 4.ddi / OPTIM.DI$ / QPNEGDEF.M < prev    next >
Encoding:
Text File  |  1993-02-05  |  835 b   |  25 lines

  1. function [x,lambda] = qpnegdef(H,f,A,B,vlb,vub,X,neqcstr,verbosity,negdef)
  2. %QPNEGDEF QP solution when Hessian in not positive definite
  3. %    (i.e the Hessian has any zero or negative eigenvalues). 
  4. %
  5. %    Has the same syntax as QP, i.e:    X=QP(H,f,A,b,VLB,VUB,X0).
  6. %    Uses CONSTR. 
  7.  
  8. %    Copyright (c) 1993 by the MathWorks, Inc.
  9. %    Andy Grace 22-Jan-92.
  10.  
  11.  
  12. % Handle missing arguments
  13. if nargin<9, verbosity = [];
  14.        if nargin<8, neqcstr=0;
  15.                if nargin < 7, X=[];
  16.                        if nargin<6, vub=[];
  17.                                if nargin<5, vlb=[];
  18. end, end, end, end, end
  19. options(1) = 1; % Display intermediate results
  20. options(13) = neqcstr;  
  21. [x,options,lambda] = constr('costqp',X,options,vlb,vub,'costqpg',H,f,A,B);
  22.  
  23. % To solve your problem use:
  24. %x=qp2(hess,em1,qpcon,qprhs,vlb,vub,d0,neq,0,1)
  25.