| 1 | /* $Id: CoinPresolveSubst.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 CoinPresolveSubst_H |
| 7 | #define CoinPresolveSubst_H |
| 8 | #define SUBST_ROW 21 |
| 9 | |
| 10 | #include "CoinPresolveMatrix.hpp" |
| 11 | |
| 12 | class subst_constraint_action : public CoinPresolveAction { |
| 13 | private: |
| 14 | subst_constraint_action(); |
| 15 | subst_constraint_action(const subst_constraint_action& rhs); |
| 16 | subst_constraint_action& operator=(const subst_constraint_action& rhs); |
| 17 | |
| 18 | struct action { |
| 19 | double *rlos; |
| 20 | double *rups; |
| 21 | |
| 22 | double *coeffxs; |
| 23 | int *rows; |
| 24 | |
| 25 | int *ninrowxs; |
| 26 | /*const*/ int *rowcolsxs; |
| 27 | /*const*/ double *rowelsxs; |
| 28 | |
| 29 | const double *costsx; |
| 30 | int col; |
| 31 | int rowy; |
| 32 | |
| 33 | int nincol; |
| 34 | }; |
| 35 | |
| 36 | const int nactions_; |
| 37 | // actions_ is owned by the class and must be deleted at destruction |
| 38 | const action *const actions_; |
| 39 | |
| 40 | subst_constraint_action(int nactions, |
| 41 | action *actions, |
| 42 | const CoinPresolveAction *next) : |
| 43 | CoinPresolveAction(next), |
| 44 | nactions_(nactions), actions_(actions) {} |
| 45 | |
| 46 | public: |
| 47 | const char *name() const override; |
| 48 | |
| 49 | static const CoinPresolveAction *presolve(CoinPresolveMatrix * prob, |
| 50 | const int *implied_free, |
| 51 | const int * which, |
| 52 | int numberFree, |
| 53 | const CoinPresolveAction *next, |
| 54 | int & fill_level); |
| 55 | static const CoinPresolveAction *presolveX(CoinPresolveMatrix * prob, |
| 56 | const CoinPresolveAction *next, |
| 57 | int fillLevel); |
| 58 | |
| 59 | void postsolve(CoinPostsolveMatrix *prob) const override; |
| 60 | |
| 61 | ~subst_constraint_action(); |
| 62 | }; |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | /*static*/ void implied_bounds(const double *els, |
| 69 | const double *clo, const double *cup, |
| 70 | const int *hcol, |
| 71 | CoinBigIndex krs, CoinBigIndex kre, |
| 72 | double *maxupp, double *maxdownp, |
| 73 | int jcol, |
| 74 | double rlo, double rup, |
| 75 | double *iclb, double *icub); |
| 76 | #endif |
| 77 | |