COIN-OR::LEMON - Graph Library

Changeset 1338:b261caf79ce7 in lemon-0.x


Ignore:
Timestamp:
04/11/05 16:26:35 (15 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1777
Message:

A little modification: a call for primalStatus().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/athos/lp/lp_sample.cc

    r1318 r1338  
    3838 
    3939  lp.solve();
    40  
    41   printf("\nZ = %g; x1 = %g; x2 = %g; x3 = %g\n",
    42          lp.primalValue(),
    43          lp.primal(x1), lp.primal(x2), lp.primal(x3));
     40
     41  if (lp.primalStatus()==LpSolverBase::OPTIMAL){
     42    printf("Z = %g; x1 = %g; x2 = %g; x3 = %g\n",
     43           lp.primalValue(),
     44           lp.primal(x1), lp.primal(x2), lp.primal(x3));
     45  }
     46  else{
     47    std::cout<<"Optimal solution not found!"<<std::endl;
     48  }
     49
    4450
    4551  //Here comes the same problem written in C using GLPK API routines
Note: See TracChangeset for help on using the changeset viewer.