Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcSimpleInteger.cpp

    r1902 r1943  
    2222#include "CbcMessage.hpp"
    2323#include "CbcSimpleInteger.hpp"
     24#include "CbcSimpleIntegerDynamicPseudoCost.hpp"
    2425#include "CbcBranchActual.hpp"
    2526#include "CoinSort.hpp"
     
    145146    solver->setColLower(columnNumber_, newValue);
    146147    solver->setColUpper(columnNumber_, newValue);
     148#ifdef SWITCH_VARIABLES
     149    const CbcSwitchingBinary * sObject = dynamic_cast<const CbcSwitchingBinary *> (this);
     150    if (sObject)
     151      sObject->setAssociatedBounds(solver,1);
     152#endif
    147153    return fabs(value - newValue);
    148154}
     
    309315    up_[0] = ceil(value_);
    310316    up_[1] = model_->getColUpper()[iColumn];
     317    // fix extreme cases
     318    if (up_[0]==1.0)
     319      down_[1]=0.0;
     320    if (down_[1]==0.0)
     321      up_[0]=1.0;
    311322}
    312323// Useful constructor for fixing
     
    555566    if (nlb < olb + 1.0e-8 && nub > oub - 1.0e-8 && false)
    556567        printf("bad null change for column %d - bounds %g,%g\n", iColumn, olb, oub);
     568#endif
     569#ifdef SWITCH_VARIABLES
     570    if (model_->logLevel()>2)
     571      printf("for column %d - old bounds %g,%g - new %g,%g\n", iColumn, olb, oub,
     572             nlb,nub);
     573    CbcSwitchingBinary * sObject = dynamic_cast<CbcSwitchingBinary *> (originalCbcObject_);
     574    if (sObject)
     575      sObject->setAssociatedBounds();
     576    //(dynamic_cast<CbcSimpleInteger *>(originalCbcObject_))->setAssociatedBounds();
    557577#endif
    558578    return 0.0;
Note: See TracChangeset for help on using the changeset viewer.