CoinUtils
trunk
|
00001 /* $Id$ */ 00002 // Copyright (C) 2002, International Business Machines 00003 // Corporation and others. All Rights Reserved. 00004 // This code is licensed under the terms of the Eclipse Public License (EPL). 00005 00006 #ifndef CoinPresolveDupcol_H 00007 #define CoinPresolveDupcol_H 00008 00009 #include "CoinPresolveMatrix.hpp" 00010 00015 #define DUPCOL 10 00016 00032 class dupcol_action : public CoinPresolveAction { 00033 dupcol_action(); 00034 dupcol_action(const dupcol_action& rhs); 00035 dupcol_action& operator=(const dupcol_action& rhs); 00036 00037 struct action { 00038 double thislo; 00039 double thisup; 00040 double lastlo; 00041 double lastup; 00042 int ithis; 00043 int ilast; 00044 00045 double *colels; 00046 int nincol; 00047 }; 00048 00049 const int nactions_; 00050 // actions_ is owned by the class and must be deleted at destruction 00051 const action *const actions_; 00052 00053 dupcol_action(int nactions, const action *actions, 00054 const CoinPresolveAction *next) : 00055 CoinPresolveAction(next), 00056 nactions_(nactions), 00057 actions_(actions) {} 00058 00059 public: 00060 const char *name() const; 00061 00062 static const CoinPresolveAction *presolve(CoinPresolveMatrix *prob, 00063 const CoinPresolveAction *next); 00064 00065 void postsolve(CoinPostsolveMatrix *prob) const; 00066 00067 virtual ~dupcol_action(); 00068 00069 }; 00070 00071 00087 class duprow_action : public CoinPresolveAction { 00088 struct action { 00089 int row; 00090 double lbound; 00091 double ubound; 00092 }; 00093 00094 const int nactions_; 00095 const action *const actions_; 00096 00097 duprow_action():CoinPresolveAction(NULL),nactions_(0),actions_(NULL) {} 00098 duprow_action(int nactions, 00099 const action *actions, 00100 const CoinPresolveAction *next) : 00101 CoinPresolveAction(next), 00102 nactions_(nactions), actions_(actions) {} 00103 00104 public: 00105 const char *name() const; 00106 00107 static const CoinPresolveAction *presolve(CoinPresolveMatrix *prob, 00108 const CoinPresolveAction *next); 00109 00110 void postsolve(CoinPostsolveMatrix *prob) const; 00111 00112 //~duprow_action() { delete[]actions_; } 00113 }; 00114 00125 class gubrow_action : public CoinPresolveAction { 00126 struct action { 00127 int row; 00128 double lbound; 00129 double ubound; 00130 }; 00131 00132 const int nactions_; 00133 const action *const actions_; 00134 00135 gubrow_action():CoinPresolveAction(NULL),nactions_(0),actions_(NULL) {} 00136 gubrow_action(int nactions, 00137 const action *actions, 00138 const CoinPresolveAction *next) : 00139 CoinPresolveAction(next), 00140 nactions_(nactions), actions_(actions) {} 00141 00142 public: 00143 const char *name() const; 00144 00145 static const CoinPresolveAction *presolve(CoinPresolveMatrix *prob, 00146 const CoinPresolveAction *next); 00147 00148 void postsolve(CoinPostsolveMatrix *prob) const; 00149 00150 //~gubrow_action() { delete[]actions_; } 00151 }; 00152 00163 class twoxtwo_action : public CoinPresolveAction { 00164 struct action { 00165 double lbound_row; 00166 double ubound_row; 00167 double lbound_col; 00168 double ubound_col; 00169 double cost_col; 00170 double cost_othercol; 00171 int row; 00172 int col; 00173 int othercol; 00174 }; 00175 00176 const int nactions_; 00177 const action *const actions_; 00178 00179 twoxtwo_action():CoinPresolveAction(NULL),nactions_(0),actions_(NULL) {} 00180 twoxtwo_action(int nactions, 00181 const action *actions, 00182 const CoinPresolveAction *next) : 00183 CoinPresolveAction(next), 00184 nactions_(nactions), actions_(actions) {} 00185 00186 public: 00187 const char *name() const; 00188 00189 static const CoinPresolveAction *presolve(CoinPresolveMatrix *prob, 00190 const CoinPresolveAction *next); 00191 00192 void postsolve(CoinPostsolveMatrix *prob) const; 00193 00194 ~twoxtwo_action() { delete [] actions_; } 00195 }; 00196 00197 #endif 00198