Changeset 1530:d99c3c84f797 in lemon0.x for demo/lp_demo.cc
 Timestamp:
 07/04/05 15:08:31 (19 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@2021
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

demo/lp_demo.cc
r1513 r1530 24 24 //The following example is taken from the documentation of the GLPK library. 25 25 //See it in the GLPK reference manual and among the GLPK sample files (sample.c) 26 27 //A default solver is taken 26 28 LpDefault lp; 27 29 typedef LpDefault::Row Row; … … 37 39 Col x3 = lp.addCol(); 38 40 39 //One solution40 // Row p = lp.addRow();41 // Row q = lp.addRow();42 // Row r = lp.addRow();43 // lp.setRow(p,x1+x2+x3 <=100);44 // lp.setRow(q,10*x1+4*x2+5*x3<=600);45 // lp.setRow(r,2*x1+2*x2+6*x3<=300);46 47 //A more elegant one48 41 //Constraints 49 42 lp.addRow(x1+x2+x3 <=100); … … 70 63 } 71 64 65 //End of LEMON style code 72 66 73 67 //Here comes the same problem written in C using GLPK API routines
Note: See TracChangeset
for help on using the changeset viewer.