CoinUtils  2.11.4
CoinPresolveFixed.hpp
Go to the documentation of this file.
1 /* $Id: CoinPresolveFixed.hpp 2083 2019-01-06 19:38:09Z unxusr $ */
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 CoinPresolveFixed_H
7 #define CoinPresolveFixed_H
8 #define FIXED_VARIABLE 1
9 
26 public:
30  struct action {
31  int col;
32  int start;
33  double sol;
34  };
36  int *colrows_;
38  double *colels_;
40  int nactions_;
43 
44 private:
46  remove_fixed_action(int nactions,
47  action *actions,
48  double *colels,
49  int *colrows,
50  const CoinPresolveAction *next);
51 
52 public:
54  const char *name() const;
55 
64  int *fcols,
65  int nfcols,
66  const CoinPresolveAction *next);
67 
68  void postsolve(CoinPostsolveMatrix *prob) const;
69 
72 };
73 
82  const CoinPresolveAction *next);
83 
94 
96  struct action {
97  double bound;
98  int col;
99  };
100 
104  const action *actions_;
105 
110  const bool fix_to_lower_;
111 
116 
118  make_fixed_action(int nactions, const action *actions, bool fix_to_lower,
119  const remove_fixed_action *faction,
120  const CoinPresolveAction *next)
122  , nactions_(nactions)
123  , actions_(actions)
124  , fix_to_lower_(fix_to_lower)
125  , faction_(faction)
126  {
127  }
128 
129 public:
131  const char *name() const;
132 
141  int *fcols,
142  int nfcols,
143  bool fix_to_lower,
144  const CoinPresolveAction *next);
145 
150  void postsolve(CoinPostsolveMatrix *prob) const;
151 
154  {
156  delete faction_;
157  }
158 };
159 
168  const CoinPresolveAction *next);
169 
182 #endif
183 
184 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
185 */
#define deleteAction(array, type)
Augments CoinPrePostsolveMatrix with information about the problem that is only needed during postsol...
Abstract base class of all presolve routines.
const CoinPresolveAction * next
The next presolve transformation.
Augments CoinPrePostsolveMatrix with information about the problem that is only needed during presolv...
Fix a variable at a specified bound.
const char * name() const
Returns string "make_fixed_action".
void transferCosts(CoinPresolveMatrix *prob)
Transfer costs from singleton variables.
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.
virtual ~make_fixed_action()
Destructor.
const bool fix_to_lower_
True to fix at lower bound, false to fix at upper bound.
const remove_fixed_action * faction_
The postsolve object with the information required to repopulate the fixed columns.
void postsolve(CoinPostsolveMatrix *prob) const
Postsolve (unfix variables)
const CoinPresolveAction * make_fixed(CoinPresolveMatrix *prob, const CoinPresolveAction *next)
Scan variables and fix any with equal bounds.
make_fixed_action(int nactions, const action *actions, bool fix_to_lower, const remove_fixed_action *faction, const CoinPresolveAction *next)
Constructor.
int nactions_
Number of preserved bounds.
const action * actions_
Vector of preserved bounds, one for each variable fixed in this object.
Excise fixed variables from the model.
void postsolve(CoinPostsolveMatrix *prob) const
Apply the postsolve transformation for this particular presolve action.
int * colrows_
Array of row indices for coefficients of excised columns.
const char * name() const
Returns string "remove_fixed_action".
const CoinPresolveAction * remove_fixed(CoinPresolveMatrix *prob, const CoinPresolveAction *next)
Scan the problem for fixed columns and remove them.
remove_fixed_action(int nactions, action *actions, double *colels, int *colrows, const CoinPresolveAction *next)
Constructor.
action * actions_
Vector specifying variable(s) affected by this object.
virtual ~remove_fixed_action()
Destructor.
static const remove_fixed_action * presolve(CoinPresolveMatrix *prob, int *fcols, int nfcols, const CoinPresolveAction *next)
Excise the specified columns.
int nactions_
Number of entries in actions_.
double * colels_
Array of coefficients of excised columns.
Structure to preserve the bound overwritten when fixing a variable.
double bound
Value of bound overwritten to fix variable.
int col
column index of variable
Structure to hold information necessary to reintroduce a column into the problem representation.
double sol
value of variable
int col
column index of variable
int start
start of coefficients in colels_ and colrows_