1 | /* $Id: CoinPresolveImpliedFree.hpp 1372 2011-01-03 23:31:00Z lou $ */ |
2 | // Copyright (C) 2002, 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 CoinPresolveImpliedFree_H |
7 | #define CoinPresolveImpliedFree_H |
8 | |
9 | /*! |
10 | \file |
11 | */ |
12 | |
13 | #define IMPLIED_FREE 9 |
14 | |
15 | /*! \class implied_free_action |
16 | \brief Detect and process implied free variables |
17 | |
18 | Consider a singleton variable x (<i>i.e.</i>, a variable involved in only |
19 | one constraint). Suppose that the bounds on that constraint, combined with |
20 | the bounds on the other variables involved in the constraint, are such that |
21 | even the worst case values of the other variables still imply bounds for x |
22 | which are tighter than the variable's original bounds. Since x can never |
23 | reach its upper or lower bounds, it is an implied free variable. Both x and |
24 | the constraint can be deleted from the problem. |
25 | |
26 | The transform also handles more complicated variations, where x is not a |
27 | singleton. |
28 | */ |
29 | class implied_free_action : public CoinPresolveAction { |
30 | struct action { |
31 | int row, col; |
32 | double clo, cup; |
33 | double rlo, rup; |
34 | const double *rowels; |
35 | const double *costs; |
36 | int ninrow; |
37 | }; |
38 | |
39 | const int nactions_; |
40 | const action *const actions_; |
41 | |
42 | implied_free_action(int nactions, |
43 | const action *actions, |
44 | const CoinPresolveAction *next) : |
45 | CoinPresolveAction(next), |
46 | nactions_(nactions), actions_(actions) {} |
47 | |
48 | public: |
49 | const char *name() const; |
50 | |
51 | static const CoinPresolveAction *presolve(CoinPresolveMatrix * prob, |
52 | const CoinPresolveAction *next, |
53 | int & fillLevel); |
54 | |
55 | void postsolve(CoinPostsolveMatrix *prob) const; |
56 | |
57 | ~implied_free_action(); |
58 | }; |
59 | |
60 | #endif |
61 | |