CoinPresolveFixed.hpp
Go to the documentation of this file.
1 /* $Id: CoinPresolveFixed.hpp 1215 2009-11-05 11:03:04Z forrest $ */
2 // Copyright (C) 2002, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 
5 #ifndef CoinPresolveFixed_H
6 #define CoinPresolveFixed_H
7 #define FIXED_VARIABLE 1
8 
25  public:
29  struct action {
30  int col;
31  int start;
32  double sol;
33  };
35  int *colrows_;
37  double *colels_;
39  int nactions_;
42 
43  private:
45  remove_fixed_action(int nactions,
46  action *actions,
47  double * colels,
48  int * colrows,
49  const CoinPresolveAction *next);
50 
51  public:
53  const char *name() const;
54 
63  int *fcols,
64  int nfcols,
65  const CoinPresolveAction *next);
66 
67  void postsolve(CoinPostsolveMatrix *prob) const;
68 
71 };
72 
73 
82  const CoinPresolveAction *next);
83 
84 
95 
97  struct action {
98  double bound;
99  int col ;
100  };
101 
105  const action *actions_;
106 
111  const bool fix_to_lower_;
112 
115 
117  make_fixed_action(int nactions,
118  const action *actions,
119  bool fix_to_lower,
120  const remove_fixed_action *faction,
121  const CoinPresolveAction *next) :
122  CoinPresolveAction(next),
123  nactions_(nactions), actions_(actions),
124  fix_to_lower_(fix_to_lower),
125  faction_(faction)
126  {}
127 
128  public:
130  const char *name() const;
131 
139  static const CoinPresolveAction *presolve(CoinPresolveMatrix *prob,
140  int *fcols,
141  int nfcols,
142  bool fix_to_lower,
143  const CoinPresolveAction *next);
144 
149  void postsolve(CoinPostsolveMatrix *prob) const;
150 
154  delete faction_;
155  }
156 };
157 
166  const CoinPresolveAction *next);
168 void transferCosts(CoinPresolveMatrix * prob);
169 #endif
void postsolve(CoinPostsolveMatrix *prob) const
Apply the postsolve transformation for this particular presolve action.
Structure to preserve the bound overwritten when fixing a variable.
const CoinPresolveAction * remove_fixed(CoinPresolveMatrix *prob, const CoinPresolveAction *next)
Scan the problem for fixed columns and remove them.
Excise fixed variables from the model.
Augments CoinPrePostsolveMatrix with information about the problem that is only needed during postsol...
Augments CoinPrePostsolveMatrix with information about the problem that is only needed during presolv...
action * actions_
Vector specifying variable(s) affected by this object.
~make_fixed_action()
Destructor.
int col
column index of variable
double bound
Value of bound overwritten to fix variable.
#define deleteAction(array, type)
int start
start of coefficients in colels_ and colrows_
const bool fix_to_lower_
True to fix at lower bound, false to fix at upper bound.
const char * name() const
Returns string "remove_fixed_action".
const CoinPresolveAction * make_fixed(CoinPresolveMatrix *prob, const CoinPresolveAction *next)
Scan variables and fix any with equal bounds.
int * colrows_
Array of row indices for coefficients of excised columns.
void postsolve(CoinPostsolveMatrix *prob) const
Postsolve (unfix variables)
const char * name() const
Returns string "make_fixed_action".
int col
column index of variable
make_fixed_action(int nactions, const action *actions, bool fix_to_lower, const remove_fixed_action *faction, const CoinPresolveAction *next)
Constructor.
Abstract base class of all presolve routines.
double * colels_
Array of coefficients of excised columns.
double sol
value of variable
int nactions_
Number of entries in actions_.
Fix a variable at a specified bound.
const action * actions_
Vector of preserved bounds, one for each variable fixed in this object.
remove_fixed_action(int nactions, action *actions, double *colels, int *colrows, const CoinPresolveAction *next)
Constructor.
int nactions_
Number of preserved bounds.
~remove_fixed_action()
Destructor.
const remove_fixed_action * faction_
The postsolve object with information to undo the fix(es).
static const remove_fixed_action * presolve(CoinPresolveMatrix *prob, int *fcols, int nfcols, const CoinPresolveAction *next)
Excise the specified columns.
void transferCosts(CoinPresolveMatrix *prob)
Transfers costs.
Structure to hold information necessary to reintroduce a column into the problem representation.
const CoinPresolveAction * next
The next presolve transformation.
static const CoinPresolveAction * presolve(CoinPresolveMatrix *prob, int *fcols, int nfcols, bool fix_to_lower, const CoinPresolveAction *next)
Perform actions to fix variables and return postsolve object.