diff --git a/src/Attic/CbcSolver.cpp b/src/Attic/CbcSolver.cpp index d8a20f8be..ada1ec170 100644 --- a/src/Attic/CbcSolver.cpp +++ b/src/Attic/CbcSolver.cpp @@ -9348,7 +9348,7 @@ int CbcMain1(int argc, const char *argv[], int nBadDir = 0; int nBadPri = 0; int nBadName = 0; - int nBadLine = 0; + //int nBadLine = 0; int nLine = 0; iColumn = -1; int lowestPriority = -COIN_INT_MAX; @@ -9392,7 +9392,7 @@ int CbcMain1(int argc, const char *argv[], if (comma) { *comma = '\0'; } else if (i < nAcross - 1) { - nBadLine++; + //nBadLine++; break; } switch (order[i]) { diff --git a/src/CbcCutGenerator.cpp b/src/CbcCutGenerator.cpp index 16d31783c..e6e09c121 100644 --- a/src/CbcCutGenerator.cpp +++ b/src/CbcCutGenerator.cpp @@ -1027,7 +1027,7 @@ bool CbcCutGenerator::generateCuts(OsiCuts &cs, int fullScan, OsiSolverInterface int nEls = 0; int nCuts = numberRowCutsAfter - numberRowCutsBefore; // Remove NULL cuts! - int nNull = 0; + //int nNull = 0; const double *solution = solver->getColSolution(); bool feasible = true; double primalTolerance = 1.0e-7; @@ -1058,7 +1058,7 @@ bool CbcCutGenerator::generateCuts(OsiCuts &cs, int fullScan, OsiSolverInterface } else { sum = 0.0; cs.eraseRowCut(k); - nNull++; + //nNull++; } } } @@ -1232,7 +1232,7 @@ bool CbcCutGenerator::generateCuts(OsiCuts &cs, int fullScan, OsiSolverInterface } CoinSort_2(sort, sort + nCuts, which); // Now see which ones are too similar - int nParallel = 0; + //int nParallel = 0; double testValue = (depth > 1) ? 0.99 : 0.999999; for (k = 0; k < nCuts; k++) { int j = which[k]; @@ -1284,7 +1284,7 @@ bool CbcCutGenerator::generateCuts(OsiCuts &cs, int fullScan, OsiSolverInterface if (fabs(ub - ubB) > tolerance) parallel = false; if (parallel) { - nParallel++; + //nParallel++; sort[k] = 0.0; break; } diff --git a/src/CbcFollowOn.cpp b/src/CbcFollowOn.cpp index 2bd236083..ee408189e 100644 --- a/src/CbcFollowOn.cpp +++ b/src/CbcFollowOn.cpp @@ -189,7 +189,9 @@ int CbcFollowOn::gutsOfFollowOn(int &otherRow, int &preferredWay) const #endif for (int k = 0; k < nSort - 1; k++) { i = sort[k]; +#if defined(COUNT) || !defined(NDEBUG) int numberUnsatisfied = 0; +#endif int n = 0; CoinBigIndex j; for (j = rowStart[i]; j < rowStart[i] + rowLength[i]; j++) { @@ -197,7 +199,9 @@ int CbcFollowOn::gutsOfFollowOn(int &otherRow, int &preferredWay) const if (columnLower[iColumn] != columnUpper[iColumn]) { double solValue = solution[iColumn] - columnLower[iColumn]; if (solValue < 1.0 - integerTolerance && solValue > integerTolerance) { +#if defined(COUNT) || !defined(NDEBUG) numberUnsatisfied++; +#endif for (CoinBigIndex jj = columnStart[iColumn]; jj < columnStart[iColumn] + columnLength[iColumn]; jj++) { int iRow = row[jj]; if (rhs_[iRow]) { diff --git a/src/CbcHeuristic.cpp b/src/CbcHeuristic.cpp index cf89c7ab4..2f1d64245 100644 --- a/src/CbcHeuristic.cpp +++ b/src/CbcHeuristic.cpp @@ -1822,9 +1822,11 @@ CbcHeuristicNode::distance(const CbcHeuristicNode *node) const const double disjointWeight = 1; const double overlapWeight = 0.4; const double subsetWeight = 0.2; +#ifdef COIN_DETAIL int countDisjointWeight = 0; int countOverlapWeight = 0; int countSubsetWeight = 0; +#endif int i = 0; int j = 0; double dist = 0.0; @@ -1856,11 +1858,15 @@ CbcHeuristicNode::distance(const CbcHeuristicNode *node) const const int brComp = compare3BranchingObjects(br0, br1); if (brComp < 0) { dist += subsetWeight; +#ifdef COIN_DETAIL countSubsetWeight++; +#endif ++i; } else if (brComp > 0) { dist += subsetWeight; +#ifdef COIN_DETAIL countSubsetWeight++; +#endif ++j; } else { const int comp = br0->compareBranchingObject(br1, false); @@ -1870,16 +1876,22 @@ CbcHeuristicNode::distance(const CbcHeuristicNode *node) const break; case CbcRangeDisjoint: // disjoint decisions dist += disjointWeight; +#ifdef COIN_DETAIL countDisjointWeight++; +#endif break; case CbcRangeSubset: // subset one way or another case CbcRangeSuperset: dist += subsetWeight; +#ifdef COIN_DETAIL countSubsetWeight++; +#endif break; case CbcRangeOverlap: // overlap dist += overlapWeight; +#ifdef COIN_DETAIL countOverlapWeight++; +#endif break; } ++i; @@ -1887,7 +1899,9 @@ CbcHeuristicNode::distance(const CbcHeuristicNode *node) const } } dist += subsetWeight * (numObjects_ - i + node->numObjects_ - j); +#ifdef COIN_DETAIL countSubsetWeight += (numObjects_ - i + node->numObjects_ - j); +#endif COIN_DETAIL_PRINT(printf("subset = %i, overlap = %i, disjoint = %i\n", countSubsetWeight, countOverlapWeight, countDisjointWeight)); return dist; diff --git a/src/CbcHeuristicDive.cpp b/src/CbcHeuristicDive.cpp index 2d08a1b77..2c6b77c2a 100644 --- a/src/CbcHeuristicDive.cpp +++ b/src/CbcHeuristicDive.cpp @@ -404,7 +404,9 @@ int CbcHeuristicDive::solution(double &solutionValue, int &numberNodes, int iteration = 0; int numberAtBoundFixed = 0; +#if DIVE_PRINT > 1 int numberGeneralFixed = 0; // fixed as satisfied but not at bound +#endif int numberReducedCostFixed = 0; while (numberFractionalVariables) { iteration++; @@ -512,7 +514,9 @@ int CbcHeuristicDive::solution(double &solutionValue, int &numberNodes, #endif numberAtBoundFixed = 0; +#if DIVE_PRINT > 1 numberGeneralFixed = 0; // fixed as satisfied but not at bound +#endif #ifdef DIVE_FIX_BINARY_VARIABLES // fix binary variables based on pseudo reduced cost if (binVarIndex_.size()) { @@ -703,7 +707,9 @@ int CbcHeuristicDive::solution(double &solutionValue, int &numberNodes, solver->setColUpper(iColumn, lower[iColumn]); } else { // fix to interior value +#if DIVE_PRINT > 1 numberGeneralFixed++; +#endif double fixValue = floor(value + 0.5); columnFixed[numberAtBoundFixed] = iColumn; originalBound[numberAtBoundFixed] = upper[iColumn]; @@ -1519,14 +1525,18 @@ int CbcHeuristicDive::fixOtherVariables(OsiSolverInterface *solver, } int nOverGap = 0; #endif +#ifdef CLP_INVESTIGATE4 int numberFree = 0; int numberFixedAlready = 0; +#endif for (int i = 0; i < numberIntegers; i++) { int iColumn = integerVariable[i]; if (!isHeuristicInteger(solver, iColumn)) continue; if (upper[iColumn] > lower[iColumn]) { +#ifdef CLP_INVESTIGATE4 numberFree++; +#endif double value = solution[iColumn]; if (fabs(floor(value + 0.5) - value) <= integerTolerance) { candidate[cnt].var = iColumn; @@ -1537,7 +1547,9 @@ int CbcHeuristicDive::fixOtherVariables(OsiSolverInterface *solver, #endif } } else { +#ifdef CLP_INVESTIGATE4 numberFixedAlready++; +#endif } } #ifdef GAP diff --git a/src/CbcHeuristicDivePseudoCost.cpp b/src/CbcHeuristicDivePseudoCost.cpp index 6c34bbf0d..2df8dd8da 100644 --- a/src/CbcHeuristicDivePseudoCost.cpp +++ b/src/CbcHeuristicDivePseudoCost.cpp @@ -208,14 +208,18 @@ int CbcHeuristicDivePseudoCost::fixOtherVariables(OsiSolverInterface *solver, bool fixGeneralIntegers = (switches_ & 65536) != 0; // fix other integer variables that are at their bounds int cnt = 0; +#ifdef CLP_INVESTIGATE int numberFree = 0; int numberFixedAlready = 0; +#endif for (int i = 0; i < numberIntegers; i++) { int iColumn = integerVariable[i]; if (!isHeuristicInteger(solver, iColumn)) continue; if (upper[iColumn] > lower[iColumn]) { +#ifdef CLP_INVESTIGATE numberFree++; +#endif double value = solution[iColumn]; if (value - lower[iColumn] <= integerTolerance) { candidate[cnt].var = iColumn; @@ -234,7 +238,9 @@ int CbcHeuristicDivePseudoCost::fixOtherVariables(OsiSolverInterface *solver, * random[i]; } } else { +#ifdef CLP_INVESTIGATE numberFixedAlready++; +#endif } } #ifdef CLP_INVESTIGATE diff --git a/src/CbcHeuristicGreedy.cpp b/src/CbcHeuristicGreedy.cpp index 5b27802f3..354e38ffc 100644 --- a/src/CbcHeuristicGreedy.cpp +++ b/src/CbcHeuristicGreedy.cpp @@ -244,7 +244,7 @@ int CbcHeuristicGreedyCover::solution(double &solutionValue, // use current upper or original upper if (value + 0.99 < originalUpper[iColumn]) { double sum = 0.0; - int numberExact = 0; + //int numberExact = 0; for (j = columnStart[iColumn]; j < columnStart[iColumn] + columnLength[iColumn]; j++) { int iRow = row[j]; @@ -252,8 +252,8 @@ int CbcHeuristicGreedyCover::solution(double &solutionValue, double elementValue = allOnes ? 1.0 : element[j]; if (gap > 1.0e-7) { sum += CoinMin(elementValue, gap); - if (fabs(elementValue - gap) < 1.0e-7) - numberExact++; + //if (fabs(elementValue - gap) < 1.0e-7) + // numberExact++; } } // could bias if exact @@ -1258,7 +1258,10 @@ int CbcHeuristicGreedySOS::solution(double &solutionValue, CoinSort_2(contribution, contribution + numberColumns, which); // Go through columns int nAdded = 0; + //#define REPORT 1 +#ifdef REPORT int nSlacks = 0; +#endif for (int jColumn = 0; jColumn < numberColumns; jColumn++) { if (contribution[jColumn] >= 1.0e30) break; @@ -1280,7 +1283,6 @@ int CbcHeuristicGreedySOS::solution(double &solutionValue, } } if (possible) { - //#define REPORT 1 #ifdef REPORT if ((nAdded % 1000) == 0) { double gap = 0.0; @@ -1294,8 +1296,10 @@ int CbcHeuristicGreedySOS::solution(double &solutionValue, } #endif nAdded++; +#ifdef REPORT if (columnLength[iColumn] == 1) nSlacks++; +#endif // Increase chosen column newSolution[iColumn] = 1.0; double cost = modifiedCost[iColumn]; @@ -1374,8 +1378,10 @@ int CbcHeuristicGreedySOS::solution(double &solutionValue, // get list of columns which can go down without making // things much worse int nPossible = 0; +#ifdef REPORT int nEasyDown = 0; int nSlackDown = 0; +#endif for (int iColumn = 0; iColumn < numberColumns; iColumn++) { if (newSolution[iColumn] && columnUpper[iColumn] > columnLower[iColumn]) { bool canGoDown = true; @@ -1428,12 +1434,14 @@ int CbcHeuristicGreedySOS::solution(double &solutionValue, int iRow = row[j]; rowActivity[iRow] += element[j]; } +#ifdef REPORT nEasyDown++; if (columnLength[iColumn] > 1) { //printf("%d is easy down\n",iColumn); } else { nSlackDown++; } +#endif } } else if (modifiedCost[iColumn] > 0.0) { // easy down @@ -1445,7 +1453,9 @@ int CbcHeuristicGreedySOS::solution(double &solutionValue, int iRow = row[j]; rowActivity[iRow] -= element[j]; } +#ifdef REPORT nEasyDown++; +#endif } } else { which[nPossible++] = iColumn; diff --git a/src/CbcHeuristicRENS.cpp b/src/CbcHeuristicRENS.cpp index 4ebae3732..e4541f0ea 100644 --- a/src/CbcHeuristicRENS.cpp +++ b/src/CbcHeuristicRENS.cpp @@ -728,8 +728,10 @@ int CbcHeuristicRENS::solution(double &solutionValue, solver->getDblParam(OsiPrimalTolerance, primalTolerance); int i; +#ifdef CLP_INVESTIGATE2 int numberTightened = 0; int numberAtBound = 0; +#endif int numberContinuous = numberColumns - numberIntegers; /* 0 - allow fixing @@ -783,13 +785,19 @@ int CbcHeuristicRENS::solution(double &solutionValue, if (dontFix) { continue; } +#ifdef CLP_INVESTIGATE2 if (value == lower || value == upper) numberAtBound++; +#endif newSolver->setColLower(iColumn, value); newSolver->setColUpper(iColumn, value); +#ifdef CLP_INVESTIGATE2 numberFixed++; +#endif } else if (colUpper[iColumn] - colLower[iColumn] >= 2.0) { +#ifdef CLP_INVESTIGATE2 numberTightened++; +#endif newSolver->setColLower(iColumn, floor(value)); newSolver->setColUpper(iColumn, ceil(value)); } @@ -799,7 +807,9 @@ int CbcHeuristicRENS::solution(double &solutionValue, continue; } value = floor(value + 0.5); +#ifdef CLP_INVESTIGATE2 numberAtBound++; +#endif newSolver->setColLower(iColumn, value); newSolver->setColUpper(iColumn, value); numberFixed++; @@ -808,12 +818,16 @@ int CbcHeuristicRENS::solution(double &solutionValue, if (dontFix) { continue; } +#ifdef CLP_INVESTIGATE2 numberAtBound++; +#endif newSolver->setColLower(iColumn, value); newSolver->setColUpper(iColumn, value); numberFixed++; } else if (colUpper[iColumn] - colLower[iColumn] >= 2.0 && djTolerance < 0.0) { +#ifdef CLP_INVESTIGATE2 numberTightened++; +#endif if (fabs(value - floor(value + 0.5)) < 1.0e-8) { value = floor(value + 0.5); if (value < upper) { @@ -955,8 +969,10 @@ int CbcHeuristicRENS::solution(double &solutionValue, #endif for (int iPass = 0; iPass < RENS_PASS; iPass++) { int nFixed = 0; +#ifdef CLP_INVESTIGATE2 int nFixedAlready = 0; int nFixedContinuous = 0; +#endif for (int iColumn = 0; iColumn < numberColumns; iColumn++) { if (colUpper[iColumn] > colLower[iColumn]) { if (newSolver->isInteger(iColumn)) { @@ -969,10 +985,12 @@ int CbcHeuristicRENS::solution(double &solutionValue, newSolver->setColUpper(iColumn, fixTo); } } +#ifdef CLP_INVESTIGATE2 } else if (newSolver->isInteger(iColumn)) { nFixedAlready++; } else { nFixedContinuous++; +#endif } } #ifdef CLP_INVESTIGATE2 diff --git a/src/CbcLinked.cpp b/src/CbcLinked.cpp index d60d45c2d..0e84c4dc9 100644 --- a/src/CbcLinked.cpp +++ b/src/CbcLinked.cpp @@ -528,13 +528,17 @@ void OsiSolverLink::resolve() } else if (satisfied == 2) { // is there anything left to do? int i; +#if 0 int numberContinuous = 0; +#endif double gap = 0.0; for (i = 0; i < numberObjects_; i++) { OsiBiLinear *obj = dynamic_cast< OsiBiLinear * >(object_[i]); if (obj) { if (obj->xMeshSize() < 1.0 && obj->yMeshSize() < 1.0) { +#if 0 numberContinuous++; +#endif int xColumn = obj->xColumn(); double gapX = upper[xColumn] - lower[xColumn]; int yColumn = obj->yColumn(); @@ -986,7 +990,6 @@ void OsiSolverLink::load(CoinModel &coinModelOriginal, bool tightenBounds, int l for (iColumn = 0; iColumn < numberColumns; iColumn++) { CoinModelLink triple = coinModelOriginal.firstInColumn(iColumn); bool linear = true; - int n = 0; // See if quadratic objective const char *expr = coinModelOriginal.getColumnObjectiveAsString(iColumn); if (strcmp(expr, "Numeric")) { @@ -999,7 +1002,6 @@ void OsiSolverLink::load(CoinModel &coinModelOriginal, bool tightenBounds, int l linear = false; } triple = coinModelOriginal.next(triple); - n++; } if (!linear) { which[numberVariables_++] = iColumn; @@ -1471,7 +1473,6 @@ void OsiSolverLink::load(CoinModel &coinModelOriginal, bool tightenBounds, int l } } // See if there are any quadratic bounds - int nQ = 0; const CoinPackedMatrix *rowCopy = getMatrixByRow(); //const double * element = rowCopy->getElements(); //const int * column = rowCopy->getIndices(); @@ -1485,7 +1486,6 @@ void OsiSolverLink::load(CoinModel &coinModelOriginal, bool tightenBounds, int l int xyRow = obj->xyRow(); if (rowLength[xyRow] == 4 && false) { // we have simple bound - nQ++; double coefficient = obj->coefficient(); double lo = rowLower[xyRow]; double up = rowUpper[xyRow]; @@ -1862,7 +1862,6 @@ OsiSolverLink::nonlinearSLP(int numberPasses, double deltaTolerance) for (iColumn = 0; iColumn < numberColumns; iColumn++) { CoinModelLink triple = coinModel.firstInColumn(iColumn); bool linear = true; - int n = 0; // See if nonlinear objective const char *expr = coinModel.getColumnObjectiveAsString(iColumn); if (strcmp(expr, "Numeric")) { @@ -1912,7 +1911,6 @@ OsiSolverLink::nonlinearSLP(int numberPasses, double deltaTolerance) } } triple = coinModel.next(triple); - n++; } if (!linear) { markNonlinear[iColumn] = 1; @@ -2225,8 +2223,10 @@ OsiSolverLink::nonlinearSLP(int numberPasses, double deltaTolerance) } double maxGap = 0.0; int numberSmaller = 0; +#ifdef CLP_DEBUG int numberSmaller2 = 0; int numberLarger = 0; +#endif for (jNon = 0; jNon < numberNonLinearColumns; jNon++) { iColumn = listNonLinearColumn[jNon]; maxDelta = CoinMax(maxDelta, @@ -2235,11 +2235,15 @@ OsiSolverLink::nonlinearSLP(int numberPasses, double deltaTolerance) if (last[0][jNon] * last[1][jNon] < 0) { // halve trust[jNon] *= 0.5; +#ifdef CLP_DEBUG numberSmaller2++; +#endif } else { if (last[0][jNon] == last[1][jNon] && last[0][jNon] == last[2][jNon]) trust[jNon] = CoinMin(1.5 * trust[jNon], 1.0e6); +#ifdef CLP_DEBUG numberLarger++; +#endif } } else if (goodMove != -2 && trust[jNon] > 10.0 * deltaTolerance) { trust[jNon] *= 0.2; diff --git a/src/CbcModel.cpp b/src/CbcModel.cpp index e1522e3f2..58bf82350 100644 --- a/src/CbcModel.cpp +++ b/src/CbcModel.cpp @@ -988,12 +988,16 @@ void CbcModel::analyzeObjective() // now look at continuous bool allGood = true; double direction = solver_->getObjSense(); +#if COIN_DEVELOP > 1 int numberObj = 0; +#endif for (iColumn = 0; iColumn < numberColumns; iColumn++) { if (upper[iColumn] > lower[iColumn]) { double objValue = objective[iColumn] * direction; if (objValue && !solver_->isInteger(iColumn)) { +#if COIN_DEVELOP > 1 numberObj++; +#endif CoinBigIndex start = columnStart[iColumn]; CoinBigIndex end = start + columnLength[iColumn]; if (objValue > 0.0) { @@ -8182,13 +8186,13 @@ int CbcModel::addCuts(CbcNode *node, CoinWarmStartBasis *&lastws) { int i1 = 0; int i2 = 0; int nDiff = 0; - int nSame = 0; + //int nSame = 0; if (lastNumberCuts2_ == numberToAdd) { for (int i = 0; i < numberToCheck; i++) { if (lastCut_[i1++] != addCuts[i2++]) { nDiff++; } else { - nSame++; + //nSame++; } } } else if (lastNumberCuts2_ > numberToAdd) { @@ -8200,14 +8204,14 @@ int CbcModel::addCuts(CbcNode *node, CoinWarmStartBasis *&lastws) { i1++; nDiff2--; if (lastCut_[i1] == addCuts[i2]) { - nSame++; + //nSame++; break; } else { nDiff++; } } } else { - nSame++; + //nSame++; } } nDiff += nDiff2; @@ -8220,14 +8224,14 @@ int CbcModel::addCuts(CbcNode *node, CoinWarmStartBasis *&lastws) { i2++; nDiff2--; if (lastCut_[i1] == addCuts[i2]) { - nSame++; + //nSame++; break; } else { nDiff++; } } } else { - nSame++; + //nSame++; } } nDiff += nDiff2; diff --git a/src/CbcNode.cpp b/src/CbcNode.cpp index 1e4f06a1d..c67167ec2 100644 --- a/src/CbcNode.cpp +++ b/src/CbcNode.cpp @@ -583,23 +583,25 @@ int CbcNode::chooseBranch(CbcModel *model, CbcNode *lastNode, int numberPassesLe numberStrong = 0; if ((model->moreSpecialOptions() & 1024) != 0 || true) { int nBad = 0; +#ifdef CLP_INVESTIGATE int nUnsat = 0; int nDiff = 0; +#endif for (int i = 0; i < numberObjects; i++) { OsiObject *object = model->modifiableObject(i); const CbcSimpleInteger *thisOne = dynamic_cast< const CbcSimpleInteger * >(object); if (thisOne) { int iColumn = thisOne->columnNumber(); double targetValue = hotstartSolution[iColumn]; +#ifdef CLP_INVESTIGATE double value = saveSolution[iColumn]; if (fabs(value - floor(value + 0.5)) > 1.0e-6) { nUnsat++; -#ifdef CLP_INVESTIGATE printf("H %d is %g target %g\n", iColumn, value, targetValue); -#endif } else if (fabs(targetValue - value) > 1.0e-6) { nDiff++; } +#endif if (targetValue < saveLower[iColumn] || targetValue > saveUpper[iColumn]) { #ifdef CLP_INVESTIGATE printf("%d has target %g and current bounds %g and %g\n", @@ -622,7 +624,7 @@ int CbcNode::chooseBranch(CbcModel *model, CbcNode *lastNode, int numberPassesLe } } int numberStrongDone = 0; - int numberUnfinished = 0; + //int numberUnfinished = 0; int numberStrongInfeasible = 0; int numberStrongIterations = 0; int saveNumberStrong = numberStrong; @@ -649,7 +651,7 @@ int CbcNode::chooseBranch(CbcModel *model, CbcNode *lastNode, int numberPassesLe estimatedDegradation = 0.0; //int numberIntegerInfeasibilities=0; // without odd ones numberStrongDone = 0; - numberUnfinished = 0; + //numberUnfinished = 0; numberStrongInfeasible = 0; numberStrongIterations = 0; @@ -1228,7 +1230,7 @@ int CbcNode::chooseBranch(CbcModel *model, CbcNode *lastNode, int numberPassesLe } else { // Can't say much as we did not finish choice[i].finishedDown = false; - numberUnfinished++; + //numberUnfinished++; } choice[i].downMovement = objectiveChange; @@ -1335,7 +1337,7 @@ int CbcNode::chooseBranch(CbcModel *model, CbcNode *lastNode, int numberPassesLe } else { // Can't say much as we did not finish choice[i].finishedUp = false; - numberUnfinished++; + //numberUnfinished++; } choice[i].upMovement = objectiveChange; @@ -1782,23 +1784,25 @@ int CbcNode::chooseDynamicBranch(CbcModel *model, CbcNode *lastNode, if (hotstartSolution) { if ((model->moreSpecialOptions() & 1024) != 0 || true) { int nBad = 0; +#ifdef CLP_INVESTIGATE int nUnsat = 0; int nDiff = 0; +#endif for (int i = 0; i < numberObjects; i++) { OsiObject *object = model->modifiableObject(i); const CbcSimpleInteger *thisOne = dynamic_cast< const CbcSimpleInteger * >(object); if (thisOne) { int iColumn = thisOne->columnNumber(); double targetValue = hotstartSolution[iColumn]; +#ifdef CLP_INVESTIGATE double value = saveSolution[iColumn]; if (fabs(value - floor(value + 0.5)) > 1.0e-6) { nUnsat++; -#ifdef CLP_INVESTIGATE printf("H %d is %g target %g\n", iColumn, value, targetValue); -#endif } else if (fabs(targetValue - value) > 1.0e-6) { nDiff++; } +#endif if (targetValue < saveLower[iColumn] || targetValue > saveUpper[iColumn]) { #ifdef CLP_INVESTIGATE printf("%d has target %g and current bounds %g and %g\n", @@ -1827,7 +1831,7 @@ int CbcNode::chooseDynamicBranch(CbcModel *model, CbcNode *lastNode, CbcBranchDecision *decision = model->branchingMethod(); if (!decision) decision = new CbcBranchDynamicDecision(); - int xMark = 0; + //int xMark = 0; // Get arrays to sort double *sort = new double[numberObjects]; #ifndef CBC_HAS_NAUTY @@ -2558,9 +2562,11 @@ int CbcNode::chooseDynamicBranch(CbcModel *model, CbcNode *lastNode, const int *row = model->solver()->getMatrixByCol()->getIndices(); const CoinBigIndex *columnStart = model->solver()->getMatrixByCol()->getVectorStarts(); const int *columnLength = model->solver()->getMatrixByCol()->getVectorLengths(); +#ifdef CLP_INVESTIGATE int nFree = 0; - int nFreeNon = 0; int nFixedNon = 0; +#endif + int nFreeNon = 0; double mostAway = 0.0; int whichAway = -1; const double *columnLower = solver->getColLower(); @@ -2583,10 +2589,14 @@ int CbcNode::chooseDynamicBranch(CbcModel *model, CbcNode *lastNode, whichAway = i; } } else { +#ifdef CLP_INVESTIGATE nFree++; +#endif } } else if (solution[i] != saveSolution[i]) { +#ifdef CLP_INVESTIGATE nFixedNon++; +#endif } } const double *lower = solver->getRowLower(); @@ -2883,7 +2893,7 @@ int CbcNode::chooseDynamicBranch(CbcModel *model, CbcNode *lastNode, #endif } doneHotStart = true; - xMark++; + //xMark++; kPass++; const double *upCost = osiclp->upRange(); const double *downCost = osiclp->downRange(); @@ -3408,7 +3418,7 @@ int CbcNode::chooseDynamicBranch(CbcModel *model, CbcNode *lastNode, skipAll = -2; canSkip = 1; } - xMark++; + //xMark++; } } if (!canSkip) { @@ -3688,7 +3698,7 @@ int CbcNode::chooseDynamicBranch(CbcModel *model, CbcNode *lastNode, skipAll = -2; canSkip = 1; } - xMark++; + //xMark++; } #if 0 //def DO_ALL_AT_ROOT if (strongType) @@ -3941,7 +3951,7 @@ int CbcNode::chooseDynamicBranch(CbcModel *model, CbcNode *lastNode, skipAll = -2; canSkip = 1; } - xMark++; + //xMark++; } #if 0 //def DO_ALL_AT_ROOT @@ -4123,7 +4133,7 @@ int CbcNode::chooseDynamicBranch(CbcModel *model, CbcNode *lastNode, skipAll = -2; canSkip = 1; } - xMark++; + //xMark++; // may be infeasible (if other way stopped on iterations) if (goneInfeasible) { // neither side feasible @@ -4199,7 +4209,7 @@ int CbcNode::chooseDynamicBranch(CbcModel *model, CbcNode *lastNode, skipAll = -2; canSkip = 1; } - xMark++; + //xMark++; // may be infeasible (if other way stopped on iterations) if (goneInfeasible) { // neither side feasible diff --git a/src/CbcSolverAnalyze.cpp b/src/CbcSolverAnalyze.cpp index fddd45ead..0fc41ade5 100644 --- a/src/CbcSolverAnalyze.cpp +++ b/src/CbcSolverAnalyze.cpp @@ -70,11 +70,11 @@ int *analyze(OsiClpSolverInterface *solverMod, int &numberChanged, memset(changeRhs, 0, numberRows * sizeof(double)); memset(ignore, 0, numberRows); numberChanged = 0; - int numberInteger = 0; - for (iColumn = 0; iColumn < numberColumns; iColumn++) { - if (upper[iColumn] > lower[iColumn] + 1.0e-8 && solver->isInteger(iColumn)) - numberInteger++; - } + //int numberInteger = 0; + //for (iColumn = 0; iColumn < numberColumns; iColumn++) { + // if (upper[iColumn] > lower[iColumn] + 1.0e-8 && solver->isInteger(iColumn)) + // numberInteger++; + //} bool finished = false; while (!finished) { int saveNumberChanged = numberChanged; diff --git a/src/CbcStrategy.cpp b/src/CbcStrategy.cpp index 13a513cae..7f9531ce7 100644 --- a/src/CbcStrategy.cpp +++ b/src/CbcStrategy.cpp @@ -382,7 +382,9 @@ void CbcStrategyDefault::setupOther(CbcModel &model) //const int * row = matrix->getIndices(); const CoinBigIndex *columnStart = matrix->getVectorStarts(); const int *columnLength = matrix->getVectorLengths(); +#ifdef COIN_DETAIL int numberInt = 0; +#endif int numberNon = 0; int numberClose = 0; int numberColumns = clpSolver->getNumCols(); @@ -396,13 +398,17 @@ void CbcStrategyDefault::setupOther(CbcModel &model) if (value > 1.0e7) { if (value != floor(value)) numberNon++; +#ifdef COIN_DETAIL else numberInt++; +#endif } else { int iValue = static_cast< int >(100 * (value + 0.005)); double value2 = iValue; if (value2 == 100.0 * value) { +#ifdef COIN_DETAIL numberInt++; +#endif } else if (fabs(value2 - 100.0 * value) < 1.0e-5) { numberClose++; } else { diff --git a/src/CbcSymmetry.cpp b/src/CbcSymmetry.cpp index cebfca07c..b6d9f3ac1 100644 --- a/src/CbcSymmetry.cpp +++ b/src/CbcSymmetry.cpp @@ -93,7 +93,9 @@ static void userautomproc(int numGenerators, int firstL=-1; for (int i = 0; i < n; ++i) { if (workperm[i] == 0 && perm[i] != i) { +#ifndef NDEBUG int nRow=0; +#endif int nCol=0; int l = i; if (l