Changeset 1791 for trunk/Cbc/src


Ignore:
Timestamp:
Jun 8, 2012 11:15:10 AM (7 years ago)
Author:
stefan
Message:

merge r1790 from stable/2.7 (correct message if iterlim reached) and introduce secondaryStatus 8 for stop at iteration limit

Location:
trunk/Cbc
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc

  • trunk/Cbc/src/CbcMessage.cpp

    r1650 r1791  
    6969    {CBC_FATHOM_CHANGE, 49, 1, "Complete fathoming at depth >= %d"},
    7070#endif
     71    {CBC_MAXITERS, 50, 1, "Exiting on maximum number of iterations"},
    7172    {CBC_NOINT, 3007, 1, "No integer variables - nothing to do"},
    7273    {CBC_WARNING_STRONG, 3008, 1, "Strong branching is fixing too many variables, too expensively!"},
  • trunk/Cbc/src/CbcMessage.hpp

    r1650 r1791  
    2828    CBC_MAXSOLS,
    2929    CBC_EVENT,
     30    CBC_MAXITERS,
    3031    CBC_SOLUTION,
    3132    CBC_END_SOLUTION,
  • trunk/Cbc/src/CbcModel.cpp

    r1784 r1791  
    39183918    */
    39193919    if (!(numberNodes_ < intParam_[CbcMaxNumNode] &&
    3920             numberSolutions_ < intParam_[CbcMaxNumSol] &&
    3921             !maximumSecondsReached() &&
    3922             !stoppedOnGap_ && !eventHappened_ && (maximumNumberIterations_ < 0 ||
    3923                                                   numberIterations_ < maximumNumberIterations_))) {
     3920          numberSolutions_ < intParam_[CbcMaxNumSol] &&
     3921          !maximumSecondsReached() &&
     3922          !stoppedOnGap_ &&
     3923          !eventHappened_ &&
     3924          (maximumNumberIterations_ < 0 || numberIterations_ < maximumNumberIterations_))
     3925         ) {
    39243926        if (tree_->size()) {
    39253927            double dummyBest;
     
    39533955            secondaryStatus_ = 3;
    39543956            status_ = 1 ;
     3957        } else if (maximumNumberIterations_ >= 0 && numberIterations_ >= maximumNumberIterations_) {
     3958            handler_->message(CBC_MAXITERS, messages_) << CoinMessageEol ;
     3959            secondaryStatus_ = 8;
     3960            status_ = 1 ;
    39553961        } else {
     3962            assert(numberSolutions_ >= intParam_[CbcMaxNumSol]);
    39563963            handler_->message(CBC_MAXSOLS, messages_) << CoinMessageEol ;
    39573964            secondaryStatus_ = 6;
  • trunk/Cbc/src/CbcModel.hpp

    r1778 r1791  
    932932        6 stopped on solutions
    933933        7 linear relaxation unbounded
     934        8 stopped on iteration limit
    934935    */
    935936    inline int secondaryStatus() const {
  • trunk/Cbc/src/CbcSolver.cpp

    r1780 r1791  
    27192719                                   6 stopped on solutions
    27202720                                   7 linear relaxation unbounded
     2721                                   8 stopped on iterations limit
    27212722                                */
    27222723                                int iStatus = model2->status();
     
    27392740                                } else if (iStatus == 3) {
    27402741                                    iStatus = 1;
    2741                                     if (iStatus2 == 9)
     2742                                    if (iStatus2 == 9)  // what does 9 mean ?????????????
    27422743                                        iStatus2 = 4;
    27432744                                    else
     
    27522753                                    !noPrinting_) {
    27532754                                   std::string statusName[] = {"", "Stopped on ", "Run abandoned", "", "", "User ctrl-c"};
    2754                                    std::string minor[] = {"Optimal solution found", "Linear relaxation infeasible", "Optimal solution found (within gap tolerance)", "node limit", "time limit", "user ctrl-c", "solution limit", "Linear relaxation unbounded", "Problem proven infeasible"};
     2755                                   std::string minor[] = {"Optimal solution found", "Linear relaxation infeasible", "Optimal solution found (within gap tolerance)", "node limit", "time limit", "user ctrl-c", "solution limit", "Linear relaxation unbounded", "iterations limit", "Problem proven infeasible"};
    27552756                                   sprintf(generalPrint, "\nResult - %s%s\n\n",
    27562757                                           statusName[iStatus].c_str(),
Note: See TracChangeset for help on using the changeset viewer.