Minor changes
authorathos
Fri, 24 Jun 2005 21:02:47 +0000
changeset 1513b2a79aaa6867
parent 1512 e54392395480
child 1514 c9b9bc63db4e
Minor changes
demo/lp_demo.cc
     1.1 --- a/demo/lp_demo.cc	Fri Jun 24 18:16:12 2005 +0000
     1.2 +++ b/demo/lp_demo.cc	Fri Jun 24 21:02:47 2005 +0000
     1.3 @@ -26,9 +26,12 @@
     1.4    LpDefault lp;
     1.5    typedef LpDefault::Row Row;
     1.6    typedef LpDefault::Col Col;
     1.7 +  
     1.8  
     1.9 +  //This will be a maximization
    1.10    lp.max();
    1.11  
    1.12 +  //We add coloumns (variables) to our problem
    1.13    Col x1 = lp.addCol();
    1.14    Col x2 = lp.addCol();
    1.15    Col x3 = lp.addCol();
    1.16 @@ -53,8 +56,10 @@
    1.17    //Objective function
    1.18    lp.setObj(10*x1+6*x2+4*x3);
    1.19    
    1.20 +  //Call the routine of the underlying LP solver
    1.21    lp.solve();
    1.22  
    1.23 +  //Print results
    1.24    if (lp.primalStatus()==LpSolverBase::OPTIMAL){
    1.25      printf("Z = %g; x1 = %g; x2 = %g; x3 = %g\n", 
    1.26  	   lp.primalValue(),