Changeset 2254
 Timestamp:
 Jan 9, 2017 1:17:45 PM (3 years ago)
 Location:
 trunk/Clp/src
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Clp/src/ClpSimplexPrimal.cpp
r2235 r2254 986 986 numberThrownOut = gutsOfSolution(NULL, NULL, sayValuesPass); 987 987 double sumInfeasibility = nonLinearCost_>sumInfeasibilities(); 988 // have to use single criterion for primal infeasibilities989 assert (!sumPrimalInfeasibilities_);990 assert (!sumOfRelaxedPrimalInfeasibilities_);991 sumPrimalInfeasibilities_=sumInfeasibility;992 sumOfRelaxedPrimalInfeasibilities_=sumInfeasibility;993 988 int reason2 = 0; 994 989 #if CLP_CAUTION … … 1260 1255 double lastObj3 = progress>lastObjective(3); 1261 1256 lastObj3 += infeasibilityCost_ * 2.0 * lastInf3; 1257 assert (thisObj<=COIN_DBL_MAX); 1258 assert (lastObj<=COIN_DBL_MAX); 1259 assert (lastObj3<=COIN_DBL_MAX); 1262 1260 if (lastObj < thisObj  1.0e5 * CoinMax(fabs(thisObj), fabs(lastObj))  1.0e7 1263 1261 && firstFree_ < 0 && thisInf >= lastInf) { … … 1300 1298 if (sumOfRelaxedDualInfeasibilities_ == 0.0 && 1301 1299 sumOfRelaxedPrimalInfeasibilities_ == 0.0 && 1302 progress>objective_[CLP_PROGRESS1]> 1300 progress>objective_[CLP_PROGRESS1]>= 1303 1301 progress>objective_[CLP_PROGRESS2]1.0e9*(10.0+fabs(objectiveValue_))) { 1304 1302 // say optimal (with these bounds etc) … … 1345 1343 bool looksOptimal = (!numberDualInfeasibilities_&&!nonLinearCost_>sumInfeasibilities()); 1346 1344 // had (type==3&&problemStatus_!=5)  ??? why ???? 1347 if ((dualFeasible()  problemStatus_ == 4) && (!ifValuesPasslooksOptimal )) {1345 if ((dualFeasible()  problemStatus_ == 4) && (!ifValuesPasslooksOptimalfirstFree_<0)) { 1348 1346 // see if extra helps 1349 1347 if (nonLinearCost_>numberInfeasibilities() && 1350 1348 (nonLinearCost_>sumInfeasibilities() > 1.0e3  sumOfRelaxedPrimalInfeasibilities_) 1351 && !alwaysOptimal) {1349 /*&& alwaysOptimal*/) { 1352 1350 //may need infeasiblity cost changed 1353 1351 // we can see if we can construct a ray … … 1355 1353 double saveWeight = infeasibilityCost_; 1356 1354 // save nonlinear cost as we are going to switch off costs 1357 ClpNonLinearCost * nonLinear = nonLinearCost_;1355 //ClpNonLinearCost * nonLinear = nonLinearCost_; 1358 1356 // do twice to make sure Primal solution has settled 1359 1357 // put nonbasics to bounds in case tolerance moved … … 1363 1361 gutsOfSolution(NULL, NULL, ifValuesPass != 0); 1364 1362 1365 infeasibilityCost_ = 1.0e100;1363 //infeasibilityCost_ = 1.0e100; 1366 1364 // put back original costs 1367 1365 createRim(4); … … 1374 1372 nonLinearCost_>checkInfeasibilities(primalTolerance_); 1375 1373 } else { 1376 nonLinearCost_ = NULL; 1377 // scale 1378 int i; 1379 for (i = 0; i < numberRows_ + numberColumns_; i++) 1380 cost_[i] *= 1.0e95; 1381 gutsOfSolution(NULL, NULL, ifValuesPass != 0); 1382 nonLinearCost_ = nonLinear; 1374 infeasibilityCost_ = 1.0e30; 1375 gutsOfSolution(NULL, NULL, ifValuesPass != 0 && firstFree_>=0); 1383 1376 infeasibilityCost_ = saveWeight; 1384 1377 if ((infeasibilityCost_ >= 1.0e18  
trunk/Clp/src/ClpSolver.cpp
r2235 r2254 1230 1230 // i,simplex>directionOut(),value); 1231 1231 if (value<0.0) 1232 boundValue= columnLower[i];1232 boundValue=CoinMax(columnLower[i],1.0e20); 1233 1233 else 1234 boundValue= columnUpper[i];1234 boundValue=CoinMin(columnUpper[i],1.0e20); 1235 1235 } 1236 1236 } else if (fabs(value)>1.0e10) { … … 1246 1246 const double * rowLower = simplex>rowLower(); 1247 1247 const double * rowUpper = simplex>rowUpper(); 1248 bool printBad=simplex>logLevel()>3; 1248 1249 //int pivotRow = simplex>spareIntArray_[3]; 1249 1250 //bool badPivot=pivotRow<0; … … 1272 1273 } 1273 1274 effectiveRhs[i]=rhsValue; 1274 if (fabs(effectiveRhs[i])>1.0e10 )1275 if (fabs(effectiveRhs[i])>1.0e10&&printBad) 1275 1276 printf("Large rhs row %d %g\n", 1276 1277 i,effectiveRhs[i]); … … 1280 1281 for (int i=0;i<numberRows;i++) { 1281 1282 bSum += effectiveRhs[i]*ray[i]; 1282 if (fabs(effectiveRhs[i])>1.0e10 )1283 if (fabs(effectiveRhs[i])>1.0e10&&printBad) 1283 1284 printf("Large rhs row %d %g after\n", 1284 1285 i,effectiveRhs[i]); 1285 1286 } 1286 if ( numberBadbSum>1.0e6) {1287 if ((numberBadbSum>1.0e6)&&printBad) { 1287 1288 printf("Bad infeasibility ray %g  %d bad\n", 1288 1289 bSum,numberBad);
Note: See TracChangeset
for help on using the changeset viewer.