00001
00002
00003
00004
00005
00006 #ifndef ClpEventHandler_H
00007 #define ClpEventHandler_H
00008
00009 #include "ClpSimplex.hpp"
00027 class ClpEventHandler {
00028
00029 public:
00034 enum Event {
00035 endOfIteration = 100,
00036 endOfFactorization,
00037 endOfValuesPass,
00038 node,
00039 treeStatus,
00040 solution,
00041 theta,
00042 pivotRow,
00043 presolveStart,
00044 presolveSize,
00045 presolveInfeasible,
00046 presolveBeforeSolve,
00047 presolveAfterFirstSolve,
00048 presolveAfterSolve,
00049 presolveEnd,
00050 goodFactorization,
00051 complicatedPivotIn,
00052 noCandidateInPrimal,
00053 looksEndInPrimal,
00054 endInPrimal,
00055 beforeStatusOfProblemInPrimal,
00056 startOfStatusOfProblemInPrimal,
00057 complicatedPivotOut,
00058 noCandidateInDual,
00059 looksEndInDual,
00060 endInDual,
00061 beforeStatusOfProblemInDual,
00062 startOfStatusOfProblemInDual,
00063 startOfIterationInDual,
00064 updateDualsInDual,
00065 endOfCreateRim,
00066 slightlyInfeasible,
00067 modifyMatrixInMiniPresolve,
00068 moreMiniPresolve,
00069 modifyMatrixInMiniPostsolve,
00070 noTheta
00071 };
00082 virtual int event(Event whichEvent);
00086 virtual int eventWithInfo(Event whichEvent, void * info) ;
00088
00089
00094 ClpEventHandler(ClpSimplex * model = NULL);
00096 virtual ~ClpEventHandler();
00097
00098 ClpEventHandler(const ClpEventHandler&);
00099
00100 ClpEventHandler& operator=(const ClpEventHandler&);
00102 virtual ClpEventHandler * clone() const;
00103
00105
00110 void setSimplex(ClpSimplex * model);
00112 inline ClpSimplex * simplex() const {
00113 return model_;
00114 }
00116
00117
00118 protected:
00122
00123 ClpSimplex * model_;
00125 };
00133 class ClpDisasterHandler {
00134
00135 public:
00139
00140 virtual void intoSimplex() = 0;
00142 virtual bool check() const = 0;
00144 virtual void saveInfo() = 0;
00146 virtual int typeOfDisaster();
00148
00149
00154 ClpDisasterHandler(ClpSimplex * model = NULL);
00156 virtual ~ClpDisasterHandler();
00157
00158 ClpDisasterHandler(const ClpDisasterHandler&);
00159
00160 ClpDisasterHandler& operator=(const ClpDisasterHandler&);
00162 virtual ClpDisasterHandler * clone() const = 0;
00163
00165
00170 void setSimplex(ClpSimplex * model);
00172 inline ClpSimplex * simplex() const {
00173 return model_;
00174 }
00176
00177
00178 protected:
00182
00183 ClpSimplex * model_;
00185 };
00186 #endif