1 | /* $Id: ClpEventHandler.cpp 1665 2011-01-04 17:55:54Z lou $ */ |
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 | #include "CoinPragma.hpp" |
7 | |
8 | #include "ClpEventHandler.hpp" |
9 | #include "ClpSimplex.hpp" |
10 | |
11 | //############################################################################# |
12 | // Constructors / Destructor / Assignment |
13 | //############################################################################# |
14 | |
15 | //------------------------------------------------------------------- |
16 | // Default Constructor |
17 | //------------------------------------------------------------------- |
18 | ClpEventHandler::ClpEventHandler (ClpSimplex * model) : |
19 | model_(model) |
20 | { |
21 | |
22 | } |
23 | |
24 | //------------------------------------------------------------------- |
25 | // Copy constructor |
26 | //------------------------------------------------------------------- |
27 | ClpEventHandler::ClpEventHandler (const ClpEventHandler & rhs) |
28 | : model_(rhs.model_) |
29 | { |
30 | } |
31 | |
32 | //------------------------------------------------------------------- |
33 | // Destructor |
34 | //------------------------------------------------------------------- |
35 | ClpEventHandler::~ClpEventHandler () |
36 | { |
37 | } |
38 | |
39 | //---------------------------------------------------------------- |
40 | // Assignment operator |
41 | //------------------------------------------------------------------- |
42 | ClpEventHandler & |
43 | ClpEventHandler::operator=(const ClpEventHandler& rhs) |
44 | { |
45 | if (this != &rhs) { |
46 | model_ = rhs.model_; |
47 | } |
48 | return *this; |
49 | } |
50 | // Clone |
51 | ClpEventHandler * |
52 | ClpEventHandler::clone() const |
53 | { |
54 | return new ClpEventHandler(*this); |
55 | } |
56 | // Event |
57 | int |
58 | ClpEventHandler::event(Event whichEvent) |
59 | { |
60 | if (whichEvent != theta) |
61 | return -1; // do nothing |
62 | else |
63 | return 0; // say normal exit |
64 | } |
65 | /* set model. */ |
66 | void |
67 | ClpEventHandler::setSimplex(ClpSimplex * model) |
68 | { |
69 | model_ = model; |
70 | } |
71 | //############################################################################# |
72 | // Constructors / Destructor / Assignment |
73 | //############################################################################# |
74 | |
75 | //------------------------------------------------------------------- |
76 | // Default Constructor |
77 | //------------------------------------------------------------------- |
78 | ClpDisasterHandler::ClpDisasterHandler (ClpSimplex * model) : |
79 | model_(model) |
80 | { |
81 | |
82 | } |
83 | |
84 | //------------------------------------------------------------------- |
85 | // Copy constructor |
86 | //------------------------------------------------------------------- |
87 | ClpDisasterHandler::ClpDisasterHandler (const ClpDisasterHandler & rhs) |
88 | : model_(rhs.model_) |
89 | { |
90 | } |
91 | |
92 | //------------------------------------------------------------------- |
93 | // Destructor |
94 | //------------------------------------------------------------------- |
95 | ClpDisasterHandler::~ClpDisasterHandler () |
96 | { |
97 | } |
98 | |
99 | //---------------------------------------------------------------- |
100 | // Assignment operator |
101 | //------------------------------------------------------------------- |
102 | ClpDisasterHandler & |
103 | ClpDisasterHandler::operator=(const ClpDisasterHandler& rhs) |
104 | { |
105 | if (this != &rhs) { |
106 | model_ = rhs.model_; |
107 | } |
108 | return *this; |
109 | } |
110 | /* set model. */ |
111 | void |
112 | ClpDisasterHandler::setSimplex(ClpSimplex * model) |
113 | { |
114 | model_ = model; |
115 | } |
116 | // Type of disaster 0 can fix, 1 abort |
117 | int |
118 | ClpDisasterHandler::typeOfDisaster() |
119 | { |
120 | return 0; |
121 | } |
122 | |