00001
00002
00003
00004 #ifndef ClpEventHandler_H
00005 #define ClpEventHandler_H
00006
00007 #include "ClpSimplex.hpp"
00025 class ClpEventHandler {
00026
00027 public:
00032 enum Event {
00033 endOfIteration = 100,
00034 endOfFactorization,
00035 endOfValuesPass,
00036 node,
00037 treeStatus,
00038 solution,
00039 theta,
00040 pivotRow,
00041 presolveStart,
00042 presolveSize,
00043 presolveInfeasible,
00044 presolveBeforeSolve,
00045 presolveAfterFirstSolve,
00046 presolveAfterSolve,
00047 presolveEnd
00048 };
00059 virtual int event(Event whichEvent);
00061
00062
00067 ClpEventHandler(ClpSimplex * model = NULL);
00069 virtual ~ClpEventHandler();
00070
00071 ClpEventHandler(const ClpEventHandler&);
00072
00073 ClpEventHandler& operator=(const ClpEventHandler&);
00075 virtual ClpEventHandler * clone() const;
00076
00078
00083 void setSimplex(ClpSimplex * model);
00085 inline ClpSimplex * simplex() const {
00086 return model_;
00087 }
00089
00090
00091 protected:
00095
00096 ClpSimplex * model_;
00098 };
00106 class ClpDisasterHandler {
00107
00108 public:
00112
00113 virtual void intoSimplex() = 0;
00115 virtual bool check() const = 0;
00117 virtual void saveInfo() = 0;
00119 virtual int typeOfDisaster();
00121
00122
00127 ClpDisasterHandler(ClpSimplex * model = NULL);
00129 virtual ~ClpDisasterHandler();
00130
00131 ClpDisasterHandler(const ClpDisasterHandler&);
00132
00133 ClpDisasterHandler& operator=(const ClpDisasterHandler&);
00135 virtual ClpDisasterHandler * clone() const = 0;
00136
00138
00143 void setSimplex(ClpSimplex * model);
00145 inline ClpSimplex * simplex() const {
00146 return model_;
00147 }
00149
00150
00151 protected:
00155
00156 ClpSimplex * model_;
00158 };
00159 #endif