ClpEventHandler.hpp
Go to the documentation of this file.
1 /* $Id: ClpEventHandler.hpp 1533 2010-03-23 15:26:32Z forrest $ */
2 // Copyright (C) 2004, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 #ifndef ClpEventHandler_H
5 #define ClpEventHandler_H
6 
7 #include "ClpSimplex.hpp"
26 
27 public:
32  enum Event {
33  endOfIteration = 100, // used to set secondary status
36  node, // for Cbc
37  treeStatus, // for Cbc
38  solution, // for Cbc
39  theta, // hit in parametrics
40  pivotRow // used to choose pivot row
41  };
51  virtual int event(Event whichEvent);
53 
54 
59  ClpEventHandler(ClpSimplex * model = NULL);
61  virtual ~ClpEventHandler();
62  // Copy
64  // Assignment
67  virtual ClpEventHandler * clone() const;
68 
70 
75  void setSimplex(ClpSimplex * model);
77  inline ClpSimplex * simplex() const {
78  return model_;
79  }
81 
82 
83 protected:
90 };
99 
100 public:
104  virtual void intoSimplex() = 0;
107  virtual bool check() const = 0;
109  virtual void saveInfo() = 0;
111  virtual int typeOfDisaster();
113 
114 
119  ClpDisasterHandler(ClpSimplex * model = NULL);
121  virtual ~ClpDisasterHandler();
122  // Copy
124  // Assignment
127  virtual ClpDisasterHandler * clone() const = 0;
128 
130 
135  void setSimplex(ClpSimplex * model);
137  inline ClpSimplex * simplex() const {
138  return model_;
139  }
141 
142 
143 protected:
147  ClpSimplex * model_;
150 };
151 #endif
virtual void saveInfo()=0
saves information for next attempt
ClpSimplex * model_
Pointer to simplex.
virtual bool check() const =0
Checks if disaster.
virtual ~ClpEventHandler()
Destructor.
ClpSimplex * model_
Pointer to simplex.
Event
enums for what sort of event.
ClpSimplex * simplex() const
Get model.
ClpDisasterHandler & operator=(const ClpDisasterHandler &)
Default constructor.
void setSimplex(ClpSimplex *model)
set model.
Base class for Clp disaster handling.
virtual int typeOfDisaster()
Type of disaster 0 can fix, 1 abort.
ClpEventHandler & operator=(const ClpEventHandler &)
Default constructor.
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:49
virtual void intoSimplex()=0
Into simplex.
Base class for Clp event handling.
void setSimplex(ClpSimplex *model)
set model.
virtual ClpDisasterHandler * clone() const =0
Clone.
virtual int event(Event whichEvent)
This can do whatever it likes.
ClpDisasterHandler(ClpSimplex *model=NULL)
Default constructor.
ClpEventHandler(ClpSimplex *model=NULL)
Default constructor.
virtual ~ClpDisasterHandler()
Destructor.
ClpSimplex * simplex() const
Get model.
virtual ClpEventHandler * clone() const
Clone.