- Timestamp:
- Sep 24, 2014 5:54:25 AM (4 years ago)
- Location:
- stable/2.8/Cbc/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
stable/2.8/Cbc/src/CbcModel.cpp
r2056 r2079 2761 2761 */ 2762 2762 int iObject ; 2763 int preferredWay ;2764 2763 int numberUnsatisfied = 0 ; 2765 2764 delete [] currentSolution_; … … 2773 2772 for (iObject = 0 ; iObject < numberObjects_ ; iObject++) { 2774 2773 double infeasibility = 2775 object_[iObject]-> infeasibility(&usefulInfo, preferredWay) ;2774 object_[iObject]->checkInfeasibility(&usefulInfo) ; 2776 2775 if (infeasibility ) numberUnsatisfied++ ; 2777 2776 } … … 8527 8526 OsiBranchingInformation usefulInfo = usefulInformation(); 8528 8527 for (int i = 0; i < numberObjects_ && integerFeasible; i++) { 8529 int preferredWay; 8530 double infeasibility = object_[i]->infeasibility(&usefulInfo, preferredWay); 8528 double infeasibility = object_[i]->checkInfeasibility(&usefulInfo); 8531 8529 if (infeasibility) 8532 8530 integerFeasible = false; … … 12373 12371 int numberUnsatisfied = 0; 12374 12372 //double sumUnsatisfied=0.0; 12375 int preferredWay;12376 12373 int j; 12377 12374 // Point to current solution … … 12394 12391 #ifndef SIMPLE_INTEGER 12395 12392 const OsiObject * object = object_[j]; 12396 double infeasibility = object-> infeasibility(&usefulInfo, preferredWay);12393 double infeasibility = object->checkInfeasibility(&usefulInfo); 12397 12394 if (infeasibility) { 12398 12395 assert (infeasibility > 0); … … 12414 12411 for (; j < numberObjects_; j++) { 12415 12412 const OsiObject * object = object_[j]; 12416 double infeasibility = object-> infeasibility(&usefulInfo, preferredWay);12413 double infeasibility = object->checkInfeasibility(&usefulInfo); 12417 12414 if (infeasibility) { 12418 12415 assert (infeasibility > 0); … … 13908 13905 // again 13909 13906 //std::cout<<solver_<<std::endl; 13907 13908 OsiCuts feasCuts; 13909 13910 for (int i = 0; i < numberCutGenerators_ && (feasCuts.sizeRowCuts () == 0); i++) { 13911 if (generator_ [i] -> normal () && 13912 (!generator_ [i] -> needsOptimalBasis () || solver_ -> basisIsAvailable ())) 13913 generator_ [i] -> generateCuts (feasCuts, 1 /* = fullscan */, solver_, NULL); 13914 } 13915 solver_ -> applyCuts (feasCuts); 13916 13910 13917 resolve(solver_); 13911 13918 double objval = solver_->getObjValue(); … … 14932 14939 if (feasible) { 14933 14940 int iObject ; 14934 int preferredWay ;14935 14941 int numberUnsatisfied = 0 ; 14936 14942 memcpy(currentSolution_, solver_->getColSolution(), … … 14941 14947 for (iObject = 0 ; iObject < numberObjects_ ; iObject++) { 14942 14948 double infeasibility = 14943 object_[iObject]-> infeasibility(&usefulInfo, preferredWay) ;14949 object_[iObject]->checkInfeasibility(&usefulInfo) ; 14944 14950 if (infeasibility ) numberUnsatisfied++ ; 14945 14951 } … … 17346 17352 { 17347 17353 int iObject ; 17348 int preferredWay ;17349 17354 int numberUnsatisfied = 0 ; 17350 17355 memcpy(currentSolution_, solver_->getColSolution(), … … 17355 17360 for (iObject = 0 ; iObject < numberObjects_ ; iObject++) { 17356 17361 double infeasibility = 17357 object_[iObject]-> infeasibility(&usefulInfo, preferredWay) ;17362 object_[iObject]->checkInfeasibility(&usefulInfo) ; 17358 17363 if (infeasibility) numberUnsatisfied++ ; 17359 17364 } -
stable/2.8/Cbc/src/CbcNode.cpp
r2055 r2079 1412 1412 choice[i].possibleBranch = NULL; 1413 1413 const OsiObject * object = model->object(thisChoice.objectNumber); 1414 int preferredWay; 1415 double infeasibility = object->infeasibility(&usefulInfo, preferredWay); 1414 double infeasibility = object->checkInfeasibility(&usefulInfo); 1416 1415 if (!infeasibility) { 1417 1416 // take out … … 1626 1625 CbcObject * obj = dynamic_cast <CbcObject *>(object) ; 1627 1626 if (!obj || !obj->optionalObject()) { 1628 int preferredWay; 1629 double infeasibility = object->infeasibility(&usefulInfo, preferredWay); 1627 double infeasibility = object->checkInfeasibility(&usefulInfo); 1630 1628 if (infeasibility) { 1631 1629 useOldWay = true; … … 2047 2045 CbcSimpleIntegerDynamicPseudoCost * dynamicObject = 2048 2046 dynamic_cast <CbcSimpleIntegerDynamicPseudoCost *>(object) ; 2049 int preferredWay; 2050 double infeasibility = object->infeasibility(&usefulInfo, preferredWay); 2047 double infeasibility = object->checkInfeasibility(&usefulInfo); 2051 2048 int priorityLevel = object->priority(); 2052 2049 if (hotstartSolution) { … … 2075 2072 //else 2076 2073 infeasibility = fabs(value - targetValue); 2077 //if (targetValue==1.0)2078 //infeasibility += 1.0;2079 if (value > targetValue) {2080 preferredWay = -1;2081 } else {2082 preferredWay = 1;2083 }2084 2074 priorityLevel = CoinAbs(priorityLevel); 2085 2075 } else if (priorityLevel < 0) { 2086 2076 priorityLevel = CoinAbs(priorityLevel); 2087 if (targetValue == saveLower[iColumn]) { 2077 if (targetValue == saveLower[iColumn] || 2078 targetValue == saveUpper[iColumn]) { 2088 2079 infeasibility = integerTolerance + 1.0e-12; 2089 preferredWay = -1;2090 } else if (targetValue == saveUpper[iColumn]) {2091 infeasibility = integerTolerance + 1.0e-12;2092 preferredWay = 1;2093 2080 } else { 2094 2081 // can't … … 3588 3575 if (branch_) { 3589 3576 const OsiObject * object = model->object(bestChoice); 3590 int preferredWay; 3591 double infeasibility = object->infeasibility(&usefulInfo, preferredWay); 3577 double infeasibility = object->checkInfeasibility(&usefulInfo); 3592 3578 if (!infeasibility) { 3593 3579 // take out … … 3595 3581 branch_ = NULL; 3596 3582 } else { 3583 // get preferred way 3584 int preferredWay; 3585 object->infeasibility(&usefulInfo, preferredWay); 3597 3586 CbcBranchingObject * branchObj = 3598 3587 dynamic_cast <CbcBranchingObject *>(branch_) ; … … 3829 3818 if (!dynamicObject) 3830 3819 continue; 3831 int preferredWay; 3832 double infeasibility = object->infeasibility(&usefulInfo, preferredWay); 3820 double infeasibility = object->checkInfeasibility(&usefulInfo); 3833 3821 int iColumn = dynamicObject->columnNumber(); 3834 3822 if (saveUpper[iColumn] == saveLower[iColumn])
Note: See TracChangeset
for help on using the changeset viewer.