/build/buildd/clp-1.12.0/Clp/src/ClpEventHandler.hpp
Go to the documentation of this file.
00001 /* $Id: ClpEventHandler.hpp 1533 2010-03-23 15:26:32Z forrest $ */
00002 // Copyright (C) 2004, International Business Machines
00003 // Corporation and others.  All Rights Reserved.
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, // used to set secondary status
00034           endOfFactorization,
00035           endOfValuesPass,
00036           node, // for Cbc
00037           treeStatus, // for Cbc
00038           solution, // for Cbc
00039           theta, // hit in parametrics
00040           pivotRow // used to choose pivot row
00041      };
00051      virtual int event(Event whichEvent);
00053 
00054 
00059      ClpEventHandler(ClpSimplex * model = NULL);
00061      virtual ~ClpEventHandler();
00062      // Copy
00063      ClpEventHandler(const ClpEventHandler&);
00064      // Assignment
00065      ClpEventHandler& operator=(const ClpEventHandler&);
00067      virtual ClpEventHandler * clone() const;
00068 
00070 
00075      void setSimplex(ClpSimplex * model);
00077      inline ClpSimplex * simplex() const {
00078           return model_;
00079      }
00081 
00082 
00083 protected:
00087 
00088      ClpSimplex * model_;
00090 };
00098 class ClpDisasterHandler  {
00099 
00100 public:
00104 
00105      virtual void intoSimplex() = 0;
00107      virtual bool check() const = 0;
00109      virtual void saveInfo() = 0;
00111      virtual int typeOfDisaster();
00113 
00114 
00119      ClpDisasterHandler(ClpSimplex * model = NULL);
00121      virtual ~ClpDisasterHandler();
00122      // Copy
00123      ClpDisasterHandler(const ClpDisasterHandler&);
00124      // Assignment
00125      ClpDisasterHandler& operator=(const ClpDisasterHandler&);
00127      virtual ClpDisasterHandler * clone() const = 0;
00128 
00130 
00135      void setSimplex(ClpSimplex * model);
00137      inline ClpSimplex * simplex() const {
00138           return model_;
00139      }
00141 
00142 
00143 protected:
00147 
00148      ClpSimplex * model_;
00150 };
00151 #endif