 Timestamp:
 Oct 31, 2016 12:54:20 PM (3 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Cbc/src/CbcModel.cpp
r2286 r2309 12343 12343 for (i = 0; i < numberObjects_; i++) 12344 12344 object_[i]>feasibleRegion(solver_, &usefulInfo); 12345 // If SOS then might have been declared infeasible (bad heuristic) 12346 { 12347 int numberColumns = solver_>getNumCols(); 12348 const double * columnLower = solver_>getColLower(); 12349 const double * columnUpper = solver_>getColUpper(); 12350 bool looksGood=true; 12351 for (int i = 0; i < numberColumns; i++) { 12352 if (columnUpper[i]<columnLower[i]) 12353 looksGood=false; 12354 } 12355 if (!looksGood) { 12356 // not good 12357 messageHandler()>message(CBC_FPUMP2, messages()) 12358 << "On closer inspection  solution discarded" 12359 << CoinMessageEol ; 12360 objectiveValue = 1.0e50 ; 12361 for (int iColumn = 0 ; iColumn < numberColumns ; iColumn++) { 12362 solver_>setColLower(iColumn, saveLower[iColumn]) ; 12363 solver_>setColUpper(iColumn, saveUpper[iColumn]) ; 12364 } 12365 delete [] saveLower; 12366 delete [] saveUpper; 12367 12368 solver_>setColSolution(saveSolution); 12369 delete [] saveSolution; 12370 solver_>setWarmStart(basis); 12371 delete basis ; 12372 /* 12373 Restore the usual solver. 12374 */ 12375 solver_ = saveSolver; 12376 testSolution_ = save; 12377 #ifdef COIN_HAS_CLP 12378 if (modifiedTolerances) { 12379 // Restore 12380 ClpSimplex * clp = clpContinuousSolver>getModelPtr(); 12381 #ifndef CBC_LEAVE_TOLERANCE_ON_CHECK_SOLUTION 12382 clp>setPrimalTolerance(savePrimalTolerance); 12383 #endif 12384 #ifndef CBC_LEAVE_PERTURBATION_ON_CHECK_SOLUTION 12385 clp>setPerturbation(savePerturbation); 12386 #endif 12387 #ifndef CBC_LEAVE_SCALING_ON_CHECK_SOLUTION 12388 clp>scaling(saveScaling); 12389 #endif 12390 } 12391 #endif 12392 return objectiveValue; 12393 } 12394 } 12345 12395 #if CBC_USEFUL_PRINTING>14 12346 12396 {
Note: See TracChangeset
for help on using the changeset viewer.