COIN-OR::LEMON - Graph Library

Changeset 2148:ab368e0ab662 in lemon-0.x for lemon/mip_glpk.cc


Ignore:
Timestamp:
07/17/06 13:56:17 (13 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2862
Message:

Modifications to the interface: colType() functions, though I left the old integer() functions, too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/mip_glpk.cc

    r2144 r2148  
    3030    lpx_set_class(lp,LPX_MIP);
    3131  }
    32  
    33   void MipGlpk::_integer(int i, bool enable){
    34     if(enable){
    35       lpx_set_col_kind(lp,i,LPX_IV);
    36     }else{
    37       lpx_set_col_kind(lp,i,LPX_CV);
     32
     33  void MipGlpk::_colType(int i, ColTypes col_type){
     34    switch (col_type){
     35      case INTEGER:
     36        lpx_set_col_kind(lp,i,LPX_IV);
     37        break;
     38      case REAL:
     39        lpx_set_col_kind(lp,i,LPX_CV);
     40        break;
     41      default:
     42        //FIXME problem
    3843    }
    3944  }
    4045 
    41   bool MipGlpk::_integer(int i){
    42     if(LPX_IV == lpx_get_col_kind(lp,i)){
    43       return true;
     46  ColTypes MipGlpk::_colType(int i){
     47    switch (lpx_get_col_kind(lp,i)){
     48    case LPX_IV:
     49      return INTEGER;//Or binary
     50    case LPX_CV:
     51      return REAL;
     52    default:
     53      return REAL;//Error!
    4454    }
    45     return false;
     55   
    4656  }
    4757 
Note: See TracChangeset for help on using the changeset viewer.