Ignore:
Timestamp:
Jun 19, 2011 1:23:14 PM (8 years ago)
Author:
stefan
Message:

sync with trunk rev1674

Location:
stable/2.7
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable/2.7

    • Property svn:externals
      •  

        old new  
        1 BuildTools  https://projects.coin-or.org/svn/BuildTools/stable/0.7
        2 ThirdParty/ASL  https://projects.coin-or.org/svn/BuildTools/ThirdParty/ASL/stable/1.2
        3 ThirdParty/Blas  https://projects.coin-or.org/svn/BuildTools/ThirdParty/Blas/stable/1.2
        4 ThirdParty/Lapack  https://projects.coin-or.org/svn/BuildTools/ThirdParty/Lapack/stable/1.3
        5 ThirdParty/Glpk  https://projects.coin-or.org/svn/BuildTools/ThirdParty/Glpk/stable/1.8
        6 Data/Sample  https://projects.coin-or.org/svn/Data/Sample/stable/1.2
        7 CoinUtils  https://projects.coin-or.org/svn/CoinUtils/stable/2.8/CoinUtils
        8 Cgl  https://projects.coin-or.org/svn/Cgl/stable/0.57/Cgl
        9 Clp  https://projects.coin-or.org/svn/Clp/stable/1.14/Clp
        10 Osi  https://projects.coin-or.org/svn/Osi/stable/0.105/Osi
         1BuildTools        https://projects.coin-or.org/svn/BuildTools/stable/0.7
         2ThirdParty/ASL    https://projects.coin-or.org/svn/BuildTools/ThirdParty/ASL/stable/1.2
         3ThirdParty/Blas   https://projects.coin-or.org/svn/BuildTools/ThirdParty/Blas/stable/1.2
         4ThirdParty/Lapack https://projects.coin-or.org/svn/BuildTools/ThirdParty/Lapack/stable/1.3
         5ThirdParty/Glpk   https://projects.coin-or.org/svn/BuildTools/ThirdParty/Glpk/stable/1.8
         6ThirdParty/Metis  https://projects.coin-or.org/svn/BuildTools/ThirdParty/Metis/stable/1.2
         7ThirdParty/Mumps  https://projects.coin-or.org/svn/BuildTools/ThirdParty/Mumps/stable/1.4
         8Data/Sample       https://projects.coin-or.org/svn/Data/Sample/stable/1.2
         9Data/miplib3      https://projects.coin-or.org/svn/Data/miplib3/stable/1.2
         10CoinUtils         https://projects.coin-or.org/svn/CoinUtils/stable/2.8/CoinUtils
         11Cgl               https://projects.coin-or.org/svn/Cgl/stable/0.57/Cgl
         12Clp               https://projects.coin-or.org/svn/Clp/stable/1.14/Clp
         13Osi               https://projects.coin-or.org/svn/Osi/stable/0.105/Osi
    • Property svn:mergeinfo changed
      /trunk (added)merged: 1578,​1582-1587,​1589-1600,​1603-1614,​1620-1626,​1631-1633,​1635-1636,​1638-1646,​1650-1652,​1654-1658,​1660-1663,​1665-1671,​1673-1674
  • stable/2.7/Cbc

  • stable/2.7/Cbc/src/CbcSimpleInteger.cpp

    r1573 r1675  
    424424    olb = model_->solver()->getColLower()[iColumn] ;
    425425    oub = model_->solver()->getColUpper()[iColumn] ;
    426     //#define TIGHTEN_BOUNDS
    427 #ifndef TIGHTEN_BOUNDS
     426    //#define CBCSIMPLE_TIGHTEN_BOUNDS
     427#ifndef CBCSIMPLE_TIGHTEN_BOUNDS
    428428#ifdef COIN_DEVELOP
    429429    if (olb != down_[0] || oub != up_[1]) {
     
    446446        }
    447447#endif
    448 #ifndef TIGHTEN_BOUNDS
     448#ifndef CBCSIMPLE_TIGHTEN_BOUNDS
    449449        model_->solver()->setColLower(iColumn, down_[0]);
    450450#else
     
    452452#endif
    453453        model_->solver()->setColUpper(iColumn, down_[1]);
    454         //#define CBC_PRINT2
     454        //#define CBC_PRINT2
    455455#ifdef CBC_PRINT2
    456456        printf("%d branching down has bounds %g %g", iColumn, down_[0], down_[1]);
     
    496496#endif
    497497        model_->solver()->setColLower(iColumn, up_[0]);
    498 #ifndef TIGHTEN_BOUNDS
     498#ifndef CBCSIMPLE_TIGHTEN_BOUNDS
    499499        model_->solver()->setColUpper(iColumn, up_[1]);
    500500#else
     
    538538    double nub = model_->solver()->getColUpper()[iColumn];
    539539    if (nlb < olb) {
    540 #ifndef NDEBUG
     540#ifdef CBC_PRINT2
    541541        printf("bad lb change for column %d from %g to %g\n", iColumn, olb, nlb);
    542542#endif
     543        //abort();
    543544        model_->solver()->setColLower(iColumn, CoinMin(olb, nub));
    544545        nlb = olb;
    545546    }
    546547    if (nub > oub) {
    547 #ifndef NDEBUG
     548#ifdef CBC_PRINT2
    548549        printf("bad ub change for column %d from %g to %g\n", iColumn, oub, nub);
    549550#endif
     551        //abort();
    550552        model_->solver()->setColUpper(iColumn, CoinMax(oub, nlb));
    551553    }
    552 #ifndef NDEBUG
     554#ifdef CBC_PRINT2
    553555    if (nlb < olb + 1.0e-8 && nub > oub - 1.0e-8 && false)
    554556        printf("bad null change for column %d - bounds %g,%g\n", iColumn, olb, oub);
     
    576578        upper[iColumn] = up_[1];
    577579    }
     580}
     581// Change (tighten) bounds in object to reflect bounds in solver.
     582// Return true if now fixed
     583bool
     584CbcIntegerBranchingObject::tighten(OsiSolverInterface * solver)
     585{
     586    double lower = solver->getColLower()[variable_];
     587    double upper = solver->getColUpper()[variable_];
     588    assert (upper>lower);
     589    down_[0] = CoinMax(down_[0],lower);
     590    up_[0] = CoinMax(up_[0],lower);
     591    down_[1] = CoinMin(down_[1],upper);
     592    up_[1] = CoinMin(up_[1],upper);
     593    return (down_[0]==up_[1]);
    578594}
    579595#ifdef FUNNY_BRANCHING
Note: See TracChangeset for help on using the changeset viewer.