00001
00002
00003
00004 #ifndef CoinPresolveFixed_H
00005 #define CoinPresolveFixed_H
00006 #define FIXED_VARIABLE 1
00007
00008 class remove_fixed_action : public CoinPresolveAction {
00009 public:
00010 struct action {
00011 int col;
00012 int start;
00013
00014 double sol;
00015 };
00016 int *colrows_;
00017 double *colels_;
00018
00019 int nactions_;
00020 action *actions_;
00021
00022 private:
00023 remove_fixed_action(int nactions,
00024 action *actions,
00025 double * colels,
00026 int * colrows,
00027 const CoinPresolveAction *next);
00028
00029 public:
00030 const char *name() const;
00031
00032 static const remove_fixed_action *presolve(CoinPresolveMatrix *prob,
00033 int *fcols,
00034 int nfcols,
00035 const CoinPresolveAction *next);
00036
00037 void postsolve(CoinPostsolveMatrix *prob) const;
00038
00039 ~remove_fixed_action();
00040 };
00041
00042
00043 const CoinPresolveAction *remove_fixed(CoinPresolveMatrix *prob,
00044 const CoinPresolveAction *next);
00045
00046
00047
00048 class make_fixed_action : public CoinPresolveAction {
00049 struct action {
00050 double bound;
00051 };
00052
00053 int nactions_;
00054 const action *actions_;
00055
00056 const bool fix_to_lower_;
00057 const remove_fixed_action *faction_;
00058
00059 make_fixed_action(int nactions,
00060 const action *actions,
00061 bool fix_to_lower,
00062 const remove_fixed_action *faction,
00063 const CoinPresolveAction *next) :
00064 CoinPresolveAction(next),
00065 nactions_(nactions), actions_(actions),
00066 fix_to_lower_(fix_to_lower),
00067 faction_(faction)
00068 {}
00069
00070 public:
00071 const char *name() const;
00072
00073 static const CoinPresolveAction *presolve(CoinPresolveMatrix *prob,
00074 int *fcols,
00075 int hfcols,
00076 bool fix_to_lower,
00077 const CoinPresolveAction *next);
00078
00079 void postsolve(CoinPostsolveMatrix *prob) const;
00080
00081 ~make_fixed_action() {
00082 deleteAction(actions_,action*);
00083 delete faction_;
00084 };
00085 };
00086
00087
00088 const CoinPresolveAction *make_fixed(CoinPresolveMatrix *prob,
00089 const CoinPresolveAction *next);
00090 #endif