1 /* $Id: CoinPresolveUseless.hpp 2083 2019-01-06 19:38:09Z unxusr $ */
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 CoinPresolveUseless_H
7 #define CoinPresolveUseless_H
8 #define USELESS 20
9 
10 class useless_constraint_action : public CoinPresolveAction {
11   struct action {
12     double rlo;
13     double rup;
14     const int *rowcols;
15     const double *rowels;
16     int row;
17     int ninrow;
18   };
19 
20   const int nactions_;
21   const action *const actions_;
22 
23   useless_constraint_action(int nactions,
24     const action *actions,
25     const CoinPresolveAction *next);
26 
27 public:
28   const char *name() const;
29 
30   // These rows are asserted to be useless,
31   // that is, given a solution the row activity
32   // must be in range.
33   static const CoinPresolveAction *presolve(CoinPresolveMatrix *prob,
34     const int *useless_rows,
35     int nuseless_rows,
36     const CoinPresolveAction *next);
37 
38   void postsolve(CoinPostsolveMatrix *prob) const;
39 
40   virtual ~useless_constraint_action();
41 };
42 
43 /*! \relates useless_constraint_action
44     \brief Scan constraints looking for useless constraints
45 
46   A front end to identify useless constraints and hand them to
47   useless_constraint_action::presolve() for processing.
48 
49   In a bit more detail, the routine implements a greedy algorithm that
50   identifies a set of necessary constraints. A constraint is necessary if it
51   implies a tighter bound on a variable than the original column bound. These
52   tighter column bounds are then used to calculate row activity and identify
53   constraints that are useless given the presence of the necessary
54   constraints.
55 */
56 
57 const CoinPresolveAction *testRedundant(CoinPresolveMatrix *prob,
58   const CoinPresolveAction *next);
59 
60 #endif
61 
62 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
63 */
64