1 /* $Id: CoinPresolveForcing.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 CoinPresolveForcing_H 7 #define CoinPresolveForcing_H 8 9 #include "CoinPresolveMatrix.hpp" 10 11 /*! 12 \file 13 */ 14 15 #define IMPLIED_BOUND 7 16 17 /*! \class forcing_constraint_action 18 \brief Detect and process forcing constraints and useless constraints 19 20 A constraint is useless if the bounds on the variables prevent the constraint 21 from ever being violated. 22 23 A constraint is a forcing constraint if the bounds on the constraint force 24 the value of an involved variable to one of its bounds. A constraint can 25 force more than one variable. 26 */ 27 class forcing_constraint_action : public CoinPresolveAction { 28 forcing_constraint_action(); 29 forcing_constraint_action(const forcing_constraint_action &rhs); 30 forcing_constraint_action &operator=(const forcing_constraint_action &rhs); 31 32 public: 33 struct action { 34 const int *rowcols; 35 const double *bounds; 36 int row; 37 int nlo; 38 int nup; 39 }; 40 41 private: 42 const int nactions_; 43 // actions_ is owned by the class and must be deleted at destruction 44 const action *const actions_; 45 46 public: forcing_constraint_action(int nactions,const action * actions,const CoinPresolveAction * next)47 forcing_constraint_action(int nactions, 48 const action *actions, 49 const CoinPresolveAction *next) 50 : CoinPresolveAction(next) 51 , nactions_(nactions) 52 , actions_(actions) 53 { 54 } 55 56 const char *name() const; 57 58 static const CoinPresolveAction *presolve(CoinPresolveMatrix *prob, 59 const CoinPresolveAction *next); 60 61 void postsolve(CoinPostsolveMatrix *prob) const; 62 63 virtual ~forcing_constraint_action(); 64 }; 65 66 #endif 67 68 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2 69 */ 70