COIN-OR::LEMON - Graph Library

Changeset 1530:d99c3c84f797 in lemon-0.x for demo/lp_demo.cc


Ignore:
Timestamp:
07/04/05 15:08:31 (14 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2021
Message:

Doc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • demo/lp_demo.cc

    r1513 r1530  
    2424 //The following example is taken from the documentation of the GLPK library.
    2525 //See it in the GLPK reference manual and among the GLPK sample files (sample.c)
     26
     27  //A default solver is taken
    2628  LpDefault lp;
    2729  typedef LpDefault::Row Row;
     
    3739  Col x3 = lp.addCol();
    3840
    39   //One solution
    40   //   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 one
    4841  //Constraints
    4942  lp.addRow(x1+x2+x3 <=100); 
     
    7063  }
    7164
     65  //End of LEMON style code
    7266
    7367  //Here comes the same problem written in C using GLPK API routines
Note: See TracChangeset for help on using the changeset viewer.