COIN-OR::LEMON - Graph Library

Changeset 1092:2eebc8f7dca5 in lemon


Ignore:
Timestamp:
11/01/11 08:24:30 (12 years ago)
Author:
Gabor Retvari <retvari@…>
Branch:
default
Children:
1093:472b7885ae46, 1094:140facbd1d7c, 1095:9a716871028e, 1102:17e36e175725
Phase:
public
Message:

Fix LpBase::Constr two-side limit bug (#430)

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/lp_base.h

    r631 r1092  
    16051605  inline LpBase::Constr operator<=(const LpBase::Expr &e,
    16061606                                   const LpBase::Expr &f) {
    1607     return LpBase::Constr(0, f - e, LpBase::INF);
     1607    return LpBase::Constr(0, f - e, LpBase::NaN);
    16081608  }
    16091609
     
    16231623  inline LpBase::Constr operator<=(const LpBase::Expr &e,
    16241624                                   const LpBase::Value &f) {
    1625     return LpBase::Constr(- LpBase::INF, e, f);
     1625    return LpBase::Constr(LpBase::NaN, e, f);
    16261626  }
    16271627
     
    16321632  inline LpBase::Constr operator>=(const LpBase::Expr &e,
    16331633                                   const LpBase::Expr &f) {
    1634     return LpBase::Constr(0, e - f, LpBase::INF);
     1634    return LpBase::Constr(0, e - f, LpBase::NaN);
    16351635  }
    16361636
     
    16521652  inline LpBase::Constr operator>=(const LpBase::Expr &e,
    16531653                                   const LpBase::Value &f) {
    1654     return LpBase::Constr(f, e, LpBase::INF);
     1654    return LpBase::Constr(f, e, LpBase::NaN);
    16551655  }
    16561656
  • test/lp_test.cc

    r678 r1092  
    167167    c = ((2 >= p1) >= 3);
    168168
     169    { //Tests for #430
     170      LP::Col v=lp.addCol();
     171      LP::Constr c = v >= -3;
     172      c = c <= 4;
     173      LP::Constr c2;
     174      c2 = -3 <= v <= 4;
     175    }
     176
    169177    e[x[3]]=2;
    170178    e[x[3]]=4;
Note: See TracChangeset for help on using the changeset viewer.