Changeset 1321 for trunk/Clp/src/ClpNode.cpp
 Timestamp:
 Jan 14, 2009 4:14:09 PM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Clp/src/ClpNode.cpp
r1287 r1321 183 183 sequence_=1; 184 184 double integerTolerance = stuff>integerTolerance_; 185 double mostAway= integerTolerance;185 double mostAway=0.0; 186 186 sumInfeasibilities_ = 0.0; 187 187 numberInfeasibilities_ = 0; … … 251 251 if (integerType[iColumn]) { 252 252 double value = solution[iColumn]; 253 value = CoinMax(value, (double) lower[iColumn]);254 value = CoinMin(value, (double) upper[iColumn]);253 value = CoinMax(value,static_cast<double> (lower[iColumn])); 254 value = CoinMin(value,static_cast<double> (upper[iColumn])); 255 255 double nearest = floor(value+0.5); 256 256 if (fabs(valuenearest)>integerTolerance) { … … 295 295 0.9*CoinMin(upValue,downValue) + integerTolerance; 296 296 #elif PSEUDO==3 297 double upValue = (ceil(value)value)*(upPseudo[iInteger]/(1.0+numberUp[iInteger]+numberUpInfeasible[iInteger])); 298 double downValue = (valuefloor(value))*(downPseudo[iInteger]/(1.0+numberDown[iInteger]+numberDownInfeasible[iInteger])); 297 // Extra 100% for infeasible branches 298 double upValue = (ceil(value)value)*(upPseudo[iInteger]/ 299 (1.0+numberUp[iInteger])); 300 if (numberUp[iInteger]) { 301 double ratio = 1.0+static_cast<double>(numberUpInfeasible[iInteger])/ 302 static_cast<double>(numberUp[iInteger]); 303 upValue *= ratio; 304 } 305 double downValue = (valuefloor(value))*(downPseudo[iInteger]/ 306 (1.0+numberDown[iInteger])); 307 if (numberDown[iInteger]) { 308 double ratio = 1.0+static_cast<double>(numberDownInfeasible[iInteger])/ 309 static_cast<double>(numberDown[iInteger]); 310 downValue *= ratio; 311 } 299 312 double infeasibility; 300 313 if (depth>1000) … … 307 320 double infeasibility = fabs(valuenearest); 308 321 #endif 322 assert (infeasibility>0.0); 309 323 if (infeasibility>mostAway) { 310 324 mostAway=infeasibility; … … 373 387 for (iColumn=0;iColumn<numberColumns;iColumn++) { 374 388 if (integerType[iColumn]) { 375 lower_[iInteger]= (int) lower[iColumn];376 upper_[iInteger]= (int) upper[iColumn];389 lower_[iInteger]=static_cast<int> (lower[iColumn]); 390 upper_[iInteger]=static_cast<int> (upper[iColumn]); 377 391 iInteger++; 378 392 } … … 509 523 if (integerType[iColumn]) { 510 524 iInteger++; 511 if (lower_[iInteger]!= (int) lower[iColumn])525 if (lower_[iInteger]!=static_cast<int> (lower[iColumn])) 512 526 model>setColumnLower(iColumn,lower_[iInteger]); 513 if (upper_[iInteger]!= (int) upper[iColumn])527 if (upper_[iInteger]!=static_cast<int> (upper[iColumn])) 514 528 model>setColumnUpper(iColumn,upper_[iInteger]); 515 529 } … … 772 786 for (int i=0;i<number;i++) { 773 787 int n; 774 n = numberDown_[i] +numberDownInfeasible_[i];788 n = numberDown_[i]; 775 789 if (n) 776 790 downPseudo_[i] *= n; 777 n = numberUp_[i] +numberUpInfeasible_[i];791 n = numberUp_[i]; 778 792 if (n) 779 793 upPseudo_[i] *= n; … … 784 798 ClpNodeStuff::update(int way,int sequence,double change,bool feasible) 785 799 { 800 assert (numberDown_[sequence]>=numberDownInfeasible_[sequence]); 801 assert (numberUp_[sequence]>=numberUpInfeasible_[sequence]); 786 802 if (way<0) { 787 if (feasible) 788 numberDown_[sequence]++; 789 else 803 numberDown_[sequence]++; 804 if (!feasible) 790 805 numberDownInfeasible_[sequence]++; 791 806 downPseudo_[sequence] += CoinMax(change,1.0e12); 792 807 } else { 793 if (feasible) 794 numberUp_[sequence]++; 795 else 808 numberUp_[sequence]++; 809 if (!feasible) 796 810 numberUpInfeasible_[sequence]++; 797 811 upPseudo_[sequence] += CoinMax(change,1.0e12);
Note: See TracChangeset
for help on using the changeset viewer.