Loading...
Searching...
No Matches
ClpEventHandler Class Reference

Base class for Clp event handling. More...

`#include <ClpEventHandler.hpp>`

Inheritance diagram for ClpEventHandler:
[legend]
Collaboration diagram for ClpEventHandler:
[legend]

## Public Types

enum

Event {
endOfIteration = 100 , endOfFactorization , endOfValuesPass , node ,
treeStatus , solution , theta , pivotRow ,
presolveStart , presolveSize , presolveInfeasible , presolveBeforeSolve ,
presolveAfterFirstSolve , presolveAfterSolve , presolveEnd , goodFactorization ,
complicatedPivotIn , noCandidateInPrimal , looksEndInPrimal , endInPrimal ,
beforeStatusOfProblemInPrimal , startOfStatusOfProblemInPrimal , complicatedPivotOut , noCandidateInDual ,
looksEndInDual , endInDual , beforeStatusOfProblemInDual , startOfStatusOfProblemInDual ,
startOfIterationInDual , updateDualsInDual , beforeDeleteRim , endOfCreateRim ,
slightlyInfeasible , modifyMatrixInMiniPresolve , moreMiniPresolve , modifyMatrixInMiniPostsolve ,
beforeChooseIncoming , afterChooseIncoming , beforeCreateNonLinear , afterCreateNonLinear ,
startOfCrossover , noTheta
}

| enums for what sort of event. More...

## Public Member Functions

Virtual method that the derived classes should provide.
The base class instance does nothing and as event() is only useful method it would not be very useful NOT providing one!
virtual int | event (Event whichEvent)
| This can do whatever it likes.
virtual int | eventWithInfo (Event whichEvent, void *info)
| This can do whatever it likes.
Constructors, destructor
| ClpEventHandler (ClpSimplex *model=NULL)
| Default constructor.
virtual | ~ClpEventHandler ()
| Destructor.
| ClpEventHandler (const ClpEventHandler &)
ClpEventHandler & | operator= (const ClpEventHandler &)
virtual ClpEventHandler * | clone () const
| Clone.
Sets/gets
void | setSimplex (ClpSimplex *model)
| set model.
ClpSimplex * | simplex () const
| Get model.

## Protected Attributes

Data members
The data members are protected to allow access for derived classes.
ClpSimplex * | model_
| Pointer to simplex.

## Detailed Description

Base class for Clp event handling.

This is just here to allow for event handling. By event I mean a Clp event e.g. end of values pass.

One use would be to let a user handle a system event e.g. Control-C. This could be done by deriving a class MyEventHandler which knows about such events. If one occurs MyEventHandler::event() could clear event status and return 3 (stopped).

Clp would then return to user code.

As it is called every iteration this should be fine grained enough.

User can derive and construct from CbcModel - not pretty

Definition at line 27 of file ClpEventHandler.hpp.

## Member Enumeration Documentation

## Event

enum ClpEventHandler::Event

enums for what sort of event.

These will also be returned in ClpModel::secondaryStatus() as int

Enumerator
endOfIteration |
endOfFactorization |
endOfValuesPass |
node |
treeStatus |
solution |
theta |
pivotRow |
presolveStart |
presolveSize |
presolveInfeasible |
presolveBeforeSolve |
presolveAfterFirstSolve |
presolveAfterSolve |
presolveEnd |
goodFactorization |
complicatedPivotIn |
noCandidateInPrimal |
looksEndInPrimal |
endInPrimal |
beforeStatusOfProblemInPrimal |
startOfStatusOfProblemInPrimal |
complicatedPivotOut |
noCandidateInDual |
looksEndInDual |
endInDual |
beforeStatusOfProblemInDual |
startOfStatusOfProblemInDual |
startOfIterationInDual |
updateDualsInDual |
beforeDeleteRim |
endOfCreateRim |
slightlyInfeasible |
modifyMatrixInMiniPresolve |
moreMiniPresolve |
modifyMatrixInMiniPostsolve |
beforeChooseIncoming |
afterChooseIncoming |
beforeCreateNonLinear |
afterCreateNonLinear |
startOfCrossover |
noTheta |

Definition at line 34 of file ClpEventHandler.hpp.

## Constructor & Destructor Documentation

## ClpEventHandler() [1/2]

ClpEventHandler::ClpEventHandler | ( | ClpSimplex * | model = NULL | ) |

Default constructor.

## ~ClpEventHandler()

virtual ClpEventHandler::~ClpEventHandler | ( |  | ) |

virtual

Destructor.

## ClpEventHandler() [2/2]

ClpEventHandler::ClpEventHandler | ( | const ClpEventHandler & |  | ) |

## Member Function Documentation

## event()

virtual int ClpEventHandler::event | ( | Event | whichEvent | ) |

virtual

This can do whatever it likes.

If return code -1 then carries on if 0 sets ClpModel::status() to 5 (stopped by event) and will return to user. At present if <-1 carries on and if >0 acts as if 0 - this may change. For ClpSolve 2 -> too big return status of -2 and -> too small 3

Reimplemented in MyEventHandler.

## eventWithInfo()

virtual int ClpEventHandler::eventWithInfo | ( | Event | whichEvent,
|  | void * | info )

virtual

This can do whatever it likes.

Return code -1 means no action. This passes in something

## operator=()

ClpEventHandler & ClpEventHandler::operator= | ( | const ClpEventHandler & |  | ) |

## clone()

virtual ClpEventHandler * ClpEventHandler::clone | ( |  | ) | const

virtual

Clone.

Reimplemented in MyEventHandler.

## setSimplex()

void ClpEventHandler::setSimplex | ( | ClpSimplex * | model | ) |

set model.

## simplex()

ClpSimplex * ClpEventHandler::simplex | ( |  | ) | const

inline

Get model.

Definition at line 117 of file ClpEventHandler.hpp.

## Member Data Documentation

## model_

ClpSimplex* ClpEventHandler::model_

protected

Pointer to simplex.

Definition at line 128 of file ClpEventHandler.hpp.

The documentation for this class was generated from the following file:

- Clp/src/ClpEventHandler.hpp