Changes in stable/2.9/Cbc/src [2175:2154]
- Location:
- stable/2.9/Cbc/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
stable/2.9/Cbc/src/CbcCutGenerator.cpp
r2175 r2154 430 430 printf("On optimal path CbcCut\n"); 431 431 int nCols = solver->getNumCols(); 432 int i; 432 433 const double * optimal = debugger->optimalSolution(); 433 434 const double * objective = solver->getObjCoefficients(); 434 435 double objval1 = 0.0, objval2 = 0.0; 435 for (int i = 0; i < nCols; i++) { 436 if (!solver->isInteger(i)) 437 continue; 436 for (i = 0; i < nCols; i++) { 438 437 #if CGL_DEBUG>1 439 438 printf("%d %g %g %g %g\n", i, lower[i], solution[i], upper[i], optimal[i]); … … 617 616 const OsiRowCutDebugger * debugger = solver->getRowCutDebugger(); 618 617 #endif 619 //#define WEAKEN_CUTS 1620 #ifdef WEAKEN_CUTS621 const double * lower = solver->getColLower();622 const double * upper = solver->getColUpper();623 const double * solution = solver->getColSolution();624 #endif625 618 for (k = numberRowCutsBefore; k < numberRowCutsAfter; k++) { 626 619 OsiRowCut * thisCut = cs.rowCutPtr(k) ; 627 #ifdef WEAKEN_CUTS628 // weaken cut if coefficients not integer629 double lb=thisCut->lb();630 double ub=thisCut->ub();631 if (lb<-1.0e100||ub>1.0e100) {632 // normal cut633 CoinPackedVector rpv = thisCut->row();634 const int n = rpv.getNumElements();635 const int * indices = rpv.getIndices();636 const double * elements = rpv.getElements();637 double bound=0.0;638 double sum=0.0;639 bool integral=true;640 int nInteger=0;641 for (int k=0; k<n; k++) {642 double value = fabs(elements[k]);643 int column=indices[k];644 sum += value;645 if (value!=floor(value+0.5))646 integral=false;647 if (solver->isInteger(column)) {648 nInteger++;649 double largerBound = CoinMax(fabs(lower[column]),650 fabs(upper[column]));651 double solutionBound=fabs(solution[column])+10.0;652 bound += CoinMin(largerBound,solutionBound);653 }654 }655 #if WEAKEN_CUTS ==1656 // leave if all 0-1657 if (nInteger==bound)658 integral=true;659 #elif WEAKEN_CUTS==4||WEAKEN_CUTS==5660 // leave if all 0-1661 if (nInteger==bound && n < 40)662 integral=true;663 #endif664 if (!integral) {665 double weakenBy=1.0e-7*(bound+sum);666 #if WEAKEN_CUTS==3||WEAKEN_CUTS==5667 weakenBy *= 10.0;668 #endif669 if (lb<-1.0e100)670 thisCut->setUb(ub+weakenBy);671 else672 thisCut->setLb(lb-weakenBy);673 }674 }675 #endif676 620 #ifdef CGL_DEBUG 677 621 if (debugger && debugger->onOptimalPath(*solver)) { 678 if(debugger->invalidCut(*thisCut)) { 622 assert(!debugger->invalidCut(*thisCut)); 623 if(debugger->invalidCut(*thisCut)) 679 624 abort(); 680 }681 625 } 682 626 #endif -
stable/2.9/Cbc/src/CbcHeuristic.cpp
r2175 r2154 2420 2420 way = -1.0; 2421 2421 improvement = downImprovement; 2422 if (isInteger&¤tValue<lowerValue+0.99)2423 continue; // no good2424 2422 } else if (upImprovement > 0.0 && currentValue < upperValue) { 2425 2423 way = 1.0; 2426 2424 improvement = upImprovement; 2427 if (isInteger&¤tValue>upperValue-0.99)2428 continue; // no good2429 2425 } 2430 2426 if (way) { -
stable/2.9/Cbc/src/CbcModel.cpp
r2175 r2154 2089 2089 } 2090 2090 originalContinuousObjective_ = COIN_DBL_MAX; 2091 if (bestSolution_ &&2092 ((specialOptions_&8388608)==0||(specialOptions_&2048)!=0)) {2093 // best solution found by various heuristics - set solution2094 char general[200];2095 sprintf(general,"Solution of %g already found by heuristic",2096 bestObjective_);2097 messageHandler()->message(CBC_GENERAL,2098 messages())2099 << general << CoinMessageEol ;2100 setCutoff(1.0e50) ; // As best solution should be worse than cutoff2101 // change cutoff as constraint if wanted2102 if (cutoffRowNumber_>=0) {2103 if (solver_->getNumRows()>cutoffRowNumber_)2104 solver_->setRowUpper(cutoffRowNumber_,1.0e50);2105 }2106 // also in continuousSolver_2107 if (continuousSolver_) {2108 // Solvers know about direction2109 double direction = solver_->getObjSense();2110 continuousSolver_->setDblParam(OsiDualObjectiveLimit, 1.0e50*direction);2111 } else {2112 continuousSolver_ = solver_->clone();2113 }2114 phase_ = 5;2115 double increment = getDblParam(CbcModel::CbcCutoffIncrement) ;2116 if ((specialOptions_&4) == 0)2117 bestObjective_ += 100.0 * increment + 1.0e-3; // only set if we are going to solve2118 setBestSolution(CBC_END_SOLUTION, bestObjective_, bestSolution_, 1) ;2119 continuousSolver_->resolve() ;2120 if (!continuousSolver_->isProvenOptimal()) {2121 continuousSolver_->messageHandler()->setLogLevel(2) ;2122 continuousSolver_->initialSolve() ;2123 }2124 delete solver_ ;2125 solver_ = continuousSolver_ ;2126 setPointers(solver_);2127 continuousSolver_ = NULL ;2128 }2129 2091 solverCharacteristics_ = NULL; 2130 2092 if (flipObjective) … … 4847 4809 double dummyBest; 4848 4810 tree_->cleanTree(this, -COIN_DBL_MAX, dummyBest) ; 4849 #if 0 // Does not seem to be neededdef CBC_THREAD4811 #ifdef CBC_THREAD 4850 4812 if (parallelMode() > 0 && master_) { 4851 4813 // see if any dangling nodes -
stable/2.9/Cbc/src/CbcNode.cpp
r2175 r2154 2367 2367 } 2368 2368 delete [] rowActivity; 2369 delete [] solution; 2369 2370 if (!satisfied) { 2370 2371 #ifdef CLP_INVESTIGATE … … 2393 2394 } 2394 2395 } 2395 delete [] solution;2396 2396 } 2397 2397 } else if (iPass == 1) { -
stable/2.9/Cbc/src/CbcSolver.cpp
r2175 r2154 1713 1713 gomoryGen.setLimit(50); 1714 1714 // set default action (0=off,1=on,2=root) 1715 #ifdef SWAP_GOMORY1716 int gomoryAction = 0;1717 #else1718 1715 int gomoryAction = 3; 1719 #endif1720 1716 1721 1717 CglProbing probingGen; … … 1758 1754 //GMIGen.setLimit(100); 1759 1755 // set default action (0=off,1=on,2=root) 1760 #ifdef SWAP_GOMORY1761 int GMIAction = 3;1762 #else1763 1756 // Off 1764 1757 int GMIAction = 0; 1765 #endif1766 1758 1767 1759 CglFakeClique cliqueGen(NULL, false); … … 2324 2316 generalMessageHandler->message(CLP_GENERAL, generalMessages) 2325 2317 << message << CoinMessageEol; 2326 #ifdef SWAP_GOMORY2327 GMIAction = 3;2328 message=parameters_[whichParam(CBC_PARAM_STR_GMICUTS, numberParameters_, parameters_)].setCurrentOptionWithMessage("ifmove");2329 #else2330 2318 GMIAction = 2; 2331 2319 message=parameters_[whichParam(CBC_PARAM_STR_GMICUTS, numberParameters_, parameters_)].setCurrentOptionWithMessage("root"); 2332 #endif2333 2320 if (!noPrinting_&&message) 2334 2321 generalMessageHandler->message(CLP_GENERAL, generalMessages) -
stable/2.9/Cbc/src/Makefile.in
r2175 r2154 249 249 COIN_HAS_CPX_FALSE = @COIN_HAS_CPX_FALSE@ 250 250 COIN_HAS_CPX_TRUE = @COIN_HAS_CPX_TRUE@ 251 COIN_HAS_DOXYGEN_FALSE = @COIN_HAS_DOXYGEN_FALSE@252 COIN_HAS_DOXYGEN_TRUE = @COIN_HAS_DOXYGEN_TRUE@253 251 COIN_HAS_DYLP_FALSE = @COIN_HAS_DYLP_FALSE@ 254 252 COIN_HAS_DYLP_TRUE = @COIN_HAS_DYLP_TRUE@ … … 257 255 COIN_HAS_GRB_FALSE = @COIN_HAS_GRB_FALSE@ 258 256 COIN_HAS_GRB_TRUE = @COIN_HAS_GRB_TRUE@ 259 COIN_HAS_LATEX_FALSE = @COIN_HAS_LATEX_FALSE@260 COIN_HAS_LATEX_TRUE = @COIN_HAS_LATEX_TRUE@261 257 COIN_HAS_MIPLIB3_FALSE = @COIN_HAS_MIPLIB3_FALSE@ 262 258 COIN_HAS_MIPLIB3_TRUE = @COIN_HAS_MIPLIB3_TRUE@ … … 478 474 coin_doxy_usedot = @coin_doxy_usedot@ 479 475 coin_have_doxygen = @coin_have_doxygen@ 480 coin_have_latex = @coin_have_latex@481 476 datadir = @datadir@ 482 477 exec_prefix = @exec_prefix@ -
stable/2.9/Cbc/src/OsiCbc/Makefile.in
r2175 r2154 175 175 COIN_HAS_CPX_FALSE = @COIN_HAS_CPX_FALSE@ 176 176 COIN_HAS_CPX_TRUE = @COIN_HAS_CPX_TRUE@ 177 COIN_HAS_DOXYGEN_FALSE = @COIN_HAS_DOXYGEN_FALSE@178 COIN_HAS_DOXYGEN_TRUE = @COIN_HAS_DOXYGEN_TRUE@179 177 COIN_HAS_DYLP_FALSE = @COIN_HAS_DYLP_FALSE@ 180 178 COIN_HAS_DYLP_TRUE = @COIN_HAS_DYLP_TRUE@ … … 183 181 COIN_HAS_GRB_FALSE = @COIN_HAS_GRB_FALSE@ 184 182 COIN_HAS_GRB_TRUE = @COIN_HAS_GRB_TRUE@ 185 COIN_HAS_LATEX_FALSE = @COIN_HAS_LATEX_FALSE@186 COIN_HAS_LATEX_TRUE = @COIN_HAS_LATEX_TRUE@187 183 COIN_HAS_MIPLIB3_FALSE = @COIN_HAS_MIPLIB3_FALSE@ 188 184 COIN_HAS_MIPLIB3_TRUE = @COIN_HAS_MIPLIB3_TRUE@ … … 404 400 coin_doxy_usedot = @coin_doxy_usedot@ 405 401 coin_have_doxygen = @coin_have_doxygen@ 406 coin_have_latex = @coin_have_latex@407 402 datadir = @datadir@ 408 403 exec_prefix = @exec_prefix@ -
stable/2.9/Cbc/src/config_cbc_default.h
r2175 r2154 6 6 7 7 /* Version number of project */ 8 #define CBC_VERSION "2.9. 4"8 #define CBC_VERSION "2.9.3" 9 9 10 10 /* Major Version number of project */ … … 15 15 16 16 /* Release Version number of project */ 17 #define CBC_VERSION_RELEASE 417 #define CBC_VERSION_RELEASE 3
Note: See TracChangeset
for help on using the changeset viewer.