00001
00002
00003
00004
00005 #ifndef CoinPresolveFixed_H
00006 #define CoinPresolveFixed_H
00007 #define FIXED_VARIABLE 1
00008
00024 class remove_fixed_action : public CoinPresolveAction {
00025 public:
00029 struct action {
00030 int col;
00031 int start;
00032 double sol;
00033 };
00035 int *colrows_;
00037 double *colels_;
00039 int nactions_;
00041 action *actions_;
00042
00043 private:
00045 remove_fixed_action(int nactions,
00046 action *actions,
00047 double * colels,
00048 int * colrows,
00049 const CoinPresolveAction *next);
00050
00051 public:
00053 const char *name() const;
00054
00062 static const remove_fixed_action *presolve(CoinPresolveMatrix *prob,
00063 int *fcols,
00064 int nfcols,
00065 const CoinPresolveAction *next);
00066
00067 void postsolve(CoinPostsolveMatrix *prob) const;
00068
00070 ~remove_fixed_action();
00071 };
00072
00073
00081 const CoinPresolveAction *remove_fixed(CoinPresolveMatrix *prob,
00082 const CoinPresolveAction *next);
00083
00084
00094 class make_fixed_action : public CoinPresolveAction {
00095
00097 struct action {
00098 double bound;
00099 int col ;
00100 };
00101
00103 int nactions_;
00105 const action *actions_;
00106
00111 const bool fix_to_lower_;
00112
00114 const remove_fixed_action *faction_;
00115
00117 make_fixed_action(int nactions,
00118 const action *actions,
00119 bool fix_to_lower,
00120 const remove_fixed_action *faction,
00121 const CoinPresolveAction *next) :
00122 CoinPresolveAction(next),
00123 nactions_(nactions), actions_(actions),
00124 fix_to_lower_(fix_to_lower),
00125 faction_(faction)
00126 {}
00127
00128 public:
00130 const char *name() const;
00131
00139 static const CoinPresolveAction *presolve(CoinPresolveMatrix *prob,
00140 int *fcols,
00141 int nfcols,
00142 bool fix_to_lower,
00143 const CoinPresolveAction *next);
00144
00149 void postsolve(CoinPostsolveMatrix *prob) const;
00150
00152 ~make_fixed_action() {
00153 deleteAction(actions_,action*);
00154 delete faction_;
00155 }
00156 };
00157
00165 const CoinPresolveAction *make_fixed(CoinPresolveMatrix *prob,
00166 const CoinPresolveAction *next);
00168 void transferCosts(CoinPresolveMatrix * prob);
00169 #endif