1 | /* $Id: CoinWarmStart.hpp 1372 2011-01-03 23:31:00Z lou $ */ |
2 | // Copyright (C) 2000, 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 CoinWarmStart_H |
7 | #define CoinWarmStart_H |
8 | |
9 | //############################################################################# |
10 | |
11 | class CoinWarmStartDiff; |
12 | |
13 | /** Abstract base class for warm start information. |
14 | |
15 | Really nothing can be generalized for warm start information --- all we |
16 | know is that it exists. Hence the abstract base class contains only a |
17 | virtual destructor and a virtual clone function (a virtual constructor), |
18 | so that derived classes can provide these functions. |
19 | */ |
20 | |
21 | class CoinWarmStart { |
22 | public: |
23 | |
24 | /// Abstract destructor |
25 | virtual ~CoinWarmStart() {} |
26 | |
27 | /// `Virtual constructor' |
28 | virtual CoinWarmStart *clone() const = 0 ; |
29 | |
30 | virtual CoinWarmStartDiff* |
31 | generateDiff (const CoinWarmStart *const ) const { return nullptr; } |
32 | |
33 | |
34 | virtual void |
35 | applyDiff (const CoinWarmStartDiff *const ) {} |
36 | |
37 | }; |
38 | |
39 | |
40 | /*! \class CoinWarmStartDiff |
41 | \brief Abstract base class for warm start `diff' objects |
42 | |
43 | For those types of warm start objects where the notion of a `diff' makes |
44 | sense, this virtual base class is provided. As with CoinWarmStart, its sole |
45 | reason for existence is to make it possible to write solver-independent code. |
46 | */ |
47 | |
48 | class CoinWarmStartDiff { |
49 | public: |
50 | |
51 | /// Abstract destructor |
52 | virtual ~CoinWarmStartDiff() {} |
53 | |
54 | /// `Virtual constructor' |
55 | virtual CoinWarmStartDiff *clone() const = 0 ; |
56 | }; |
57 | |
58 | #endif |
59 | |