Clp  1.16.6
ClpEventHandler.hpp
Go to the documentation of this file.
1 /* $Id: ClpEventHandler.hpp 1825 2011-11-20 16:02:57Z forrest $ */
2 // Copyright (C) 2004, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 #ifndef ClpEventHandler_H
7 #define ClpEventHandler_H
8 
9 #include "ClpSimplex.hpp"
28 
29 public:
34  enum Event {
35  endOfIteration = 100, // used to set secondary status
36  endOfFactorization, // after gutsOfSolution etc
38  node, // for Cbc
39  treeStatus, // for Cbc
40  solution, // for Cbc
41  theta, // hit in parametrics
42  pivotRow, // used to choose pivot row
43  presolveStart, // ClpSolve presolve start
44  presolveSize, // sees if ClpSolve presolve too big or too small
45  presolveInfeasible, // ClpSolve presolve infeasible
46  presolveBeforeSolve, // ClpSolve presolve before solve
47  presolveAfterFirstSolve, // ClpSolve presolve after solve
48  presolveAfterSolve, // ClpSolve presolve after solve
49  presolveEnd, // ClpSolve presolve end
50  goodFactorization, // before gutsOfSolution
51  complicatedPivotIn, // in modifyCoefficients
52  noCandidateInPrimal, // tentative end
53  looksEndInPrimal, // About to declare victory (or defeat)
54  endInPrimal, // Victory (or defeat)
57  complicatedPivotOut, // in modifyCoefficients
58  noCandidateInDual, // tentative end
59  looksEndInDual, // About to declare victory (or defeat)
60  endInDual, // Victory (or defeat)
70  noTheta // At end (because no pivot)
71  };
82  virtual int event(Event whichEvent);
86  virtual int eventWithInfo(Event whichEvent, void * info) ;
88 
89 
94  ClpEventHandler(ClpSimplex * model = NULL);
96  virtual ~ClpEventHandler();
97  // Copy
99  // Assignment
102  virtual ClpEventHandler * clone() const;
103 
105 
110  void setSimplex(ClpSimplex * model);
112  inline ClpSimplex * simplex() const {
113  return model_;
114  }
116 
117 
118 protected:
122  ClpSimplex * model_;
125 };
134 
135 public:
139  virtual void intoSimplex() = 0;
142  virtual bool check() const = 0;
144  virtual void saveInfo() = 0;
146  virtual int typeOfDisaster();
148 
149 
154  ClpDisasterHandler(ClpSimplex * model = NULL);
156  virtual ~ClpDisasterHandler();
157  // Copy
159  // Assignment
162  virtual ClpDisasterHandler * clone() const = 0;
163 
165 
170  void setSimplex(ClpSimplex * model);
172  inline ClpSimplex * simplex() const {
173  return model_;
174  }
176 
177 
178 protected:
182  ClpSimplex * model_;
185 };
186 #endif
ClpEventHandler(ClpSimplex *model=NULL)
Default constructor.
Event
enums for what sort of event.
ClpEventHandler & operator=(const ClpEventHandler &)
Base class for Clp disaster handling.
virtual ClpEventHandler * clone() const
Clone.
virtual ~ClpDisasterHandler()
Destructor.
virtual int typeOfDisaster()
Type of disaster 0 can fix, 1 abort.
ClpDisasterHandler(ClpSimplex *model=NULL)
Default constructor.
ClpSimplex * model_
Pointer to simplex.
virtual int event(Event whichEvent)
This can do whatever it likes.
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:70
void setSimplex(ClpSimplex *model)
set model.
virtual bool check() const =0
Checks if disaster.
virtual ~ClpEventHandler()
Destructor.
virtual void saveInfo()=0
saves information for next attempt
Base class for Clp event handling.
void setSimplex(ClpSimplex *model)
set model.
ClpSimplex * simplex() const
Get model.
ClpSimplex * simplex() const
Get model.
ClpDisasterHandler & operator=(const ClpDisasterHandler &)
virtual void intoSimplex()=0
Into simplex.
virtual ClpDisasterHandler * clone() const =0
Clone.
virtual int eventWithInfo(Event whichEvent, void *info)
This can do whatever it likes.
ClpSimplex * model_
Pointer to simplex.