Changeset 1465


Ignore:
Timestamp:
Mar 11, 2019 1:30:45 PM (5 weeks ago)
Author:
stefan
Message:

use solvers infinity instead of (COIN_)DBL_MAX for absent bounds/sides

  • fixes #33
  • fix suggested in #36
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cgl/src/CglTwomir/CglTwomir.cpp

    r1409 r1465  
    146146      for (int i=0;i<numberColumns;i++) {
    147147        if (colLower[i]<-1.0e20&&colUpper[i]>1.0e20) {
    148           double lower=-COIN_DBL_MAX;
    149           double upper=COIN_DBL_MAX;
     148          double lower=-si.getInfinity();
     149          double upper=si.getInfinity();
    150150          if (solution[i]>0.0)
    151151            lower=-1.0e10;
     
    262262      clpSolver->setBasis(*warm);
    263263      delete warm;
    264       simplex->setDualObjectiveLimit(COIN_DBL_MAX);
     264      simplex->setDualObjectiveLimit(COIN_DBL_MAX);  //FIXME should this be si->getInfinity()?
    265265      simplex->setLogLevel(0);
    266266      clpSolver->resolve();
     
    396396        if (largest<5.0e9*smallest&&goodCut) {
    397397          rowcut.setRow(number, cutIndex, packed);
    398           rowcut.setUb(COIN_DBL_MAX);
     398          rowcut.setUb(si.getInfinity());
    399399          rowcut.setLb(rhs);
    400400          cs.insert(rowcut);
     
    402402#else
    403403        rowcut.setRow(cut->nz, cut->index, cut->coeff);
    404         rowcut.setUb(DBL_MAX);
     404        rowcut.setUb(si->getInfinity());
    405405        rowcut.setLb(cut->rhs);
    406406        cs.insert(rowcut);
     
    741741     
    742742      /* check if the row is bounded above/below and define variable bounds */
    743       if ( rowUpper[i] < COIN_DBL_MAX )
     743      if ( rowUpper[i] < si->getInfinity() )
    744744        DGG_setIsConstraintBoundedAbove(data,j);
    745       if ( rowLower[i] > -1*COIN_DBL_MAX )
     745      if ( rowLower[i] > -si->getInfinity() )
    746746        DGG_setIsConstraintBoundedBelow(data,j);
    747747
     
    750750          data->ub[j] = rowUpper[i] - rowLower[i];
    751751      else
    752           data->ub[j] = COIN_DBL_MAX;
     752          data->ub[j] = si->getInfinity();
    753753
    754754      /* compute row activity. for this we need to go to the row in question,
Note: See TracChangeset for help on using the changeset viewer.