Changeset 1682 for trunk/Cbc/src


Ignore:
Timestamp:
Jun 29, 2011 5:05:37 AM (8 years ago)
Author:
forrest
Message:

take out COIN_HAS_BONMIN

File:
1 edited

Legend:

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

    r1663 r1682  
    23962396    if (numberObjects_)
    23972397        doHeuristicsAtRoot();
    2398 #ifdef COIN_HAS_BONMIN // With some heuristics solver needs a resolve here (don't know if this is bug in heuristics)
    2399     solver_->resolve();
    2400     if(!isProvenOptimal()){
    2401       solver_->initialSolve();
    2402     }
    2403 #endif
     2398    if (solverCharacteristics_->solutionAddsCuts()) {
     2399      // With some heuristics solver needs a resolve here
     2400      solver_->resolve();
     2401      if(!isProvenOptimal()){
     2402        solver_->initialSolve();
     2403      }
     2404    }
    24042405    /*
    24052406      Grepping through the code, it would appear that this is a command line
     
    25862587    }
    25872588    currentNumberCuts_ = numberNewCuts_ ;
     2589    if (solverCharacteristics_->solutionAddsCuts()) {
     2590      // With some heuristics solver needs a resolve here (don't know if this is bug in heuristics)
     2591      solver_->resolve();
     2592      if(!isProvenOptimal()){
     2593        solver_->initialSolve();
     2594      }
     2595    }
    25882596    // See if can stop on gap
    25892597    bestPossibleObjective_ = solver_->getObjValue() * solver_->getObjSense();
     
    70997107            << CoinMessageEol ;
    71007108        }
    7101 #ifdef COIN_HAS_BONMIN  //Is Necessary for Bonmin? Always keepGoing if cuts have been generated in last iteration (taken from similar code in Cbc-2.4)
     7109        //Is Necessary for Bonmin? Always keepGoing if cuts have been generated in last iteration (taken from similar code in Cbc-2.4)
    71027110        if (solverCharacteristics_->solutionAddsCuts()&&numberViolated) {
    71037111          for (i = 0;i<numberCutGenerators_;i++) {
     
    71097117        }
    71107118        if(!keepGoing){
    7111 #endif
    71127119        // Status for single pass of cut generation
    71137120        int status = 0;
     
    71327139        if (!feasible)
    71337140            violated = -2;
    7134 #ifdef COIN_HAS_BONMIN  //Is Necessary for Bonmin? Always keepGoing if cuts have been generated in last iteration (taken from similar code in Cbc-2.4)
    7135         }
    7136 #endif
     7141        }
    71377142        //if (!feasible)
    71387143        //break;
     
    1258912594#endif
    1259012595    currentNode_ = newNode; // so can be used elsewhere
    12591 #ifdef COIN_HAS_BONMIN // Remember number of rows to restore at the end of the loop
     12596// Remember number of rows to restore at the end of the loop
    1259212597    int saveNumberRows=solver_->getNumRows();
    12593 #endif
    1259412598    /*
    1259512599      Enough preparation. Get down to the business of choosing a branching
     
    1268512689            resolve(solver_);
    1268612690            double objval = solver_->getObjValue();
    12687 #ifndef COIN_HAS_BONMIN
    12688             int saveNumberRows = solver_->getNumRows();
    12689 #endif
    1269012691            lastHeuristic_ = NULL;
    1269112692            setBestSolution(CBC_SOLUTION, objval,
     
    1270512706                feasible = false; // pretend infeasible
    1270612707            }
    12707 #ifndef COIN_HAS_BONMIN
    12708             if( saveNumberRows<solver_->getNumRows()) {
    12709                 // delete rows - but leave solution
    12710                 int n = solver_->getNumRows();
    12711                 int * del = new int [n-saveNumberRows];
    12712                 for (int i=saveNumberRows;i<n;i++)
    12713                     del[i-saveNumberRows]=i;
    12714                 solver_->deleteRows(n-saveNumberRows,del);
    12715                 delete [] del;
    12716             }
    12717 #endif
    1271812708            if (feasible)
    1271912709                anyAction = -1;
     
    1275612746        }
    1275712747    }
    12758 #ifdef COIN_HAS_BONMIN //A candidate has been found; restore the subproblem.
     12748    //A candidate has been found; restore the subproblem.
    1275912749    if( saveNumberRows<solver_->getNumRows()) {
    1276012750        // delete rows - but leave solution
     
    1276612756        delete [] del;
    1276712757    }
    12768 #endif
    1276912758    /*
    1277012759      End main loop to choose a branching variable.
Note: See TracChangeset for help on using the changeset viewer.