Changeset 1610
- Timestamp:
- Sep 23, 2010 11:11:23 AM (11 years ago)
- Location:
- trunk/Clp/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Clp/src/ClpEventHandler.hpp
r1533 r1610 38 38 solution, // for Cbc 39 39 theta, // hit in parametrics 40 pivotRow // used to choose pivot row 40 pivotRow, // used to choose pivot row 41 presolveStart, // ClpSolve presolve start 42 presolveSize, // sees if ClpSolve presolve too big or too small 43 presolveInfeasible, // ClpSolve presolve infeasible 44 presolveBeforeSolve, // ClpSolve presolve before solve 45 presolveAfterFirstSolve, // ClpSolve presolve after solve 46 presolveAfterSolve, // ClpSolve presolve after solve 47 presolveEnd // ClpSolve presolve end 41 48 }; 42 /**@name Virtual method that the derived classe should provide.49 /**@name Virtual method that the derived classes should provide. 43 50 The base class instance does nothing and as event() is only useful method 44 51 it would not be very useful NOT providing one! … … 47 54 /** This can do whatever it likes. If return code -1 then carries on 48 55 if 0 sets ClpModel::status() to 5 (stopped by event) and will return to user. 49 At present if <-1 carries on and if >0 acts as if 0 - this may change 56 At present if <-1 carries on and if >0 acts as if 0 - this may change. 57 For ClpSolve 2 -> too big return status of -2 and -> too small 3 50 58 */ 51 59 virtual int event(Event whichEvent); -
trunk/Clp/src/ClpSolve.cpp
r1525 r1610 25 25 #include "ClpNetworkMatrix.hpp" 26 26 #endif 27 #include "ClpEventHandler.hpp" 27 28 #include "ClpLinearObjective.hpp" 28 29 #include "ClpSolve.hpp" … … 435 436 double timeIdiot = 0.0; 436 437 double timeCore = 0.0; 438 eventHandler()->event(ClpEventHandler::presolveStart); 437 439 int savePerturbation = perturbation_; 438 440 int saveScaling = scalingFlag_; … … 489 491 << CoinMessageEol; 490 492 model2 = this; 493 eventHandler()->event(ClpEventHandler::presolveStart); 491 494 problemStatus_ = 1; // may be unbounded but who cares 492 495 if (options.infeasibleReturn() || (moreSpecialOptions_ & 1) != 0) { … … 494 497 } 495 498 presolve = ClpSolve::presolveOff; 496 } 499 } else { 500 model2->eventHandler()->setSimplex(model2); 501 int rcode=model2->eventHandler()->event(ClpEventHandler::presolveSize); 502 // see if too big or small 503 if (rcode==2) { 504 delete model2; 505 return -2; 506 } else if (rcode==3) { 507 delete model2; 508 return -3; 509 } 510 } 511 model2->eventHandler()->setSimplex(model2); 497 512 // We may be better off using original (but if dual leave because of bounds) 498 513 if (presolve != ClpSolve::presolveOff && … … 516 531 int doSlp = 0; 517 532 int primalStartup = 1; 533 model2->eventHandler()->event(ClpEventHandler::presolveBeforeSolve); 518 534 bool tryItSave = false; 519 535 // switch to primal from automatic if just one cost entry … … 2467 2483 // checkSolution(); already done by postSolve 2468 2484 setLogLevel(saveLevel); 2469 if (finalStatus != 3 && (finalStatus || status() == -1)) { 2485 setProblemStatus(finalStatus); 2486 setSecondaryStatus(finalSecondaryStatus); 2487 int rcode=eventHandler()->event(ClpEventHandler::presolveAfterFirstSolve); 2488 if (finalStatus != 3 && rcode < 0 && (finalStatus || status() == -1)) { 2470 2489 int savePerturbation = perturbation(); 2471 2490 if (!finalStatus || (moreSpecialOptions_ & 2) == 0) { … … 2496 2515 << CoinMessageEol; 2497 2516 timeX = time2; 2498 } else { 2517 } else if (rcode >= 0) { 2518 primal(1); 2519 } else { 2499 2520 secondaryStatus_ = finalSecondaryStatus; 2500 2521 } … … 2554 2575 finalStatus = status(); 2555 2576 } 2577 eventHandler()->event(ClpEventHandler::presolveEnd); 2556 2578 return finalStatus; 2557 2579 }
Note: See TracChangeset
for help on using the changeset viewer.