home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 4.ddi / OPTIM.DI$ / LP.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  1.2 KB  |  35 lines

  1. function [x,lambda,how]=lp(f,A,B,vlb,vub,x,neqcstr,verbosity)
  2. %LP       Linear programming.                   
  3. %    X=LP(f,A,b) solves the linear programming problem:
  4. %        
  5. %            min f'x    subject to:   Ax <= b 
  6. %             x
  7. %   
  8. %    [x,LAMBDA]=LP(f,A,b) returns the set of Lagrangian multipliers,
  9. %    LAMBDA, at the solution. 
  10. %    
  11. %    X=LP(f,A,b,VLB,VUB) defines a set of lower and upper
  12. %    bounds on the design variables, X, so that the solution is always in
  13. %    the range VLB < X < VUB.
  14. %
  15. %    X=LP(f,A,b,VLB,VUB,X0) sets the initial starting point to X0.
  16. %
  17. %    X=LP(f,A,b,VLB,VUB,X0,N) indicates that the first N constraints defined
  18. %    by A and b are equality constraints.
  19. %
  20. %    LP produces warning messages when the solution is either unbounded
  21. %    or infeasible. Warning messages can be turned off with the calling
  22. %    syntax: X=LP(f,A,b,VLB,VUB,X0,N,-1).
  23.  
  24. %    Copyright (c) 1990 by the MathWorks, Inc.
  25. %    Andy Grace 7-9-90.
  26.          
  27. if nargin<8, verbosity = 0; 
  28.     if nargin<7, neqcstr=0; 
  29.         if nargin<6, x=[]; 
  30.             if nargin<5, vub=[];
  31.                 if nargin<4, vlb=[];
  32. end, end, end, end, end
  33. [x,lambda,how]=qp([],f(:),A,B(:),vlb, vub, x(:),neqcstr,verbosity);                                
  34.           
  35.