Changes in stable/2.8/Cbc/src/CbcModel.cpp [2056:2088]
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

stable/2.8/Cbc/src/CbcModel.cpp
r2056 r2088 1635 1635 dblParam_[CbcLargestChange] = 0.0; 1636 1636 intParam_[CbcNumberBranches] = 0; 1637 // when to check for restart 1638 int nextCheckRestart=50; 1637 1639 // Force minimization !!!! 1638 1640 bool flipObjective = (solver_>getObjSense()<0.0); … … 2761 2763 */ 2762 2764 int iObject ; 2763 int preferredWay ;2764 2765 int numberUnsatisfied = 0 ; 2765 2766 delete [] currentSolution_; … … 2773 2774 for (iObject = 0 ; iObject < numberObjects_ ; iObject++) { 2774 2775 double infeasibility = 2775 object_[iObject]> infeasibility(&usefulInfo, preferredWay) ;2776 object_[iObject]>checkInfeasibility(&usefulInfo) ; 2776 2777 if (infeasibility ) numberUnsatisfied++ ; 2777 2778 } … … 2852 2853 //rowCut.addCuts(globalCuts_); 2853 2854 int nTightened=0; 2854 bool feasible=true;2855 assert (feasible); 2855 2856 { 2856 2857 double tolerance=1.0e5; … … 2860 2861 if (tightBounds[2*i+0]>tightBounds[2*i+1]) { 2861 2862 feasible=false; 2862 printf("Bad bounds on %d %g,%g was %g,%g\n", 2863 i,tightBounds[2*i+0],tightBounds[2*i+1], 2864 lower[i],upper[i]); 2863 char general[200]; 2864 sprintf(general,"Solvers give infeasible bounds on %d %g,%g was %g,%g  search finished\n", 2865 i,tightBounds[2*i+0],tightBounds[2*i+1],lower[i],upper[i]); 2866 messageHandler()>message(CBC_GENERAL,messages()) 2867 << general << CoinMessageEol ; 2868 break; 2865 2869 } 2866 //int k=0;2867 2870 double oldLower=lower[i]; 2868 2871 double oldUpper=upper[i]; 2869 2872 if (tightBounds[2*i+0]>oldLower+tolerance) { 2870 2873 nTightened++; 2871 //k++;2872 2874 solver_>setColLower(i,tightBounds[2*i+0]); 2873 2875 } 2874 2876 if (tightBounds[2*i+1]<oldUppertolerance) { 2875 2877 nTightened++; 2876 //k++;2877 2878 solver_>setColUpper(i,tightBounds[2*i+1]); 2878 2879 } 2879 //if (k)2880 //printf("new bounds on %d %g,%g was %g,%g\n",2881 // i,tightBounds[2*i+0],tightBounds[2*i+1],2882 // oldLower,oldUpper);2883 2880 } 2884 if (!feasible)2885 abort(); // deal with later2886 2881 } 2887 2882 delete [] tightBounds; … … 2989 2984 } 2990 2985 } 2991 feasible = solveWithCuts(cuts, maximumCutPassesAtRoot_, 2986 if (feasible) 2987 feasible = solveWithCuts(cuts, maximumCutPassesAtRoot_, 2992 2988 NULL); 2993 2989 if (multipleRootTries_&& … … 4105 4101 unlockThread(); 4106 4102 } 4107 // If done 100 nodes see if worth trying reduction 4108 if (numberNodes_ == 50  numberNodes_ == 100) { 4103 // If done 50/100 nodes see if worth trying reduction 4104 if (numberNodes_ >= nextCheckRestart) { 4105 if (nextCheckRestart<100) 4106 nextCheckRestart=100; 4107 else 4108 nextCheckRestart=COIN_INT_MAX; 4109 4109 #ifdef COIN_HAS_CLP 4110 4110 OsiClpSolverInterface * clpSolver … … 8527 8527 OsiBranchingInformation usefulInfo = usefulInformation(); 8528 8528 for (int i = 0; i < numberObjects_ && integerFeasible; i++) { 8529 int preferredWay; 8530 double infeasibility = object_[i]>infeasibility(&usefulInfo, preferredWay); 8529 double infeasibility = object_[i]>checkInfeasibility(&usefulInfo); 8531 8530 if (infeasibility) 8532 8531 integerFeasible = false; … … 12373 12372 int numberUnsatisfied = 0; 12374 12373 //double sumUnsatisfied=0.0; 12375 int preferredWay;12376 12374 int j; 12377 12375 // Point to current solution … … 12394 12392 #ifndef SIMPLE_INTEGER 12395 12393 const OsiObject * object = object_[j]; 12396 double infeasibility = object> infeasibility(&usefulInfo, preferredWay);12394 double infeasibility = object>checkInfeasibility(&usefulInfo); 12397 12395 if (infeasibility) { 12398 12396 assert (infeasibility > 0); … … 12414 12412 for (; j < numberObjects_; j++) { 12415 12413 const OsiObject * object = object_[j]; 12416 double infeasibility = object> infeasibility(&usefulInfo, preferredWay);12414 double infeasibility = object>checkInfeasibility(&usefulInfo); 12417 12415 if (infeasibility) { 12418 12416 assert (infeasibility > 0); … … 13908 13906 // again 13909 13907 //std::cout<<solver_<<std::endl; 13908 13909 OsiCuts feasCuts; 13910 13911 for (int i = 0; i < numberCutGenerators_ && (feasCuts.sizeRowCuts () == 0); i++) { 13912 if (generator_ [i] > normal () && 13913 (!generator_ [i] > needsOptimalBasis ()  solver_ > basisIsAvailable ())) 13914 generator_ [i] > generateCuts (feasCuts, 1 /* = fullscan */, solver_, NULL); 13915 } 13916 solver_ > applyCuts (feasCuts); 13917 13910 13918 resolve(solver_); 13911 13919 double objval = solver_>getObjValue(); … … 14323 14331 bool exitNow = false; 14324 14332 for (i = 0; i < numberHeuristics_; i++) { 14333 heuristic_[i]>setModelOnly(this); 14325 14334 if (heuristic_[i]>exitNow(bestObjective_)) 14326 14335 exitNow = true; … … 14932 14941 if (feasible) { 14933 14942 int iObject ; 14934 int preferredWay ;14935 14943 int numberUnsatisfied = 0 ; 14936 14944 memcpy(currentSolution_, solver_>getColSolution(), … … 14941 14949 for (iObject = 0 ; iObject < numberObjects_ ; iObject++) { 14942 14950 double infeasibility = 14943 object_[iObject]> infeasibility(&usefulInfo, preferredWay) ;14951 object_[iObject]>checkInfeasibility(&usefulInfo) ; 14944 14952 if (infeasibility ) numberUnsatisfied++ ; 14945 14953 } … … 17346 17354 { 17347 17355 int iObject ; 17348 int preferredWay ;17349 17356 int numberUnsatisfied = 0 ; 17350 17357 memcpy(currentSolution_, solver_>getColSolution(), … … 17355 17362 for (iObject = 0 ; iObject < numberObjects_ ; iObject++) { 17356 17363 double infeasibility = 17357 object_[iObject]> infeasibility(&usefulInfo, preferredWay) ;17364 object_[iObject]>checkInfeasibility(&usefulInfo) ; 17358 17365 if (infeasibility) numberUnsatisfied++ ; 17359 17366 }
Note: See TracChangeset
for help on using the changeset viewer.