Osi 0.107.10

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CoinPresolveFixed.hpp
Go to the documentation of this file.
1 /* $Id: CoinPresolveFixed.hpp 1510 2011-12-08 23:56:01Z lou $ */
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
25 class remove_fixed_action : public CoinPresolveAction {
26 public:
30 struct action {
31 int col;
32 int start;
33 double sol;
34 };
36 int *colrows_;
38 double *colels_;
40 int nactions_;
42 action *actions_;
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
63 static const remove_fixed_action *presolve(CoinPresolveMatrix *prob,
64 int *fcols,
65 int nfcols,
66 const CoinPresolveAction *next);
67
68 void postsolve(CoinPostsolveMatrix *prob) const;
69
71 virtual ~remove_fixed_action();
72 };
73
74
82 const CoinPresolveAction *remove_fixed(CoinPresolveMatrix *prob,
83 const CoinPresolveAction *next);
84
85
95 class make_fixed_action : public CoinPresolveAction {
96
98 struct action {
99 double bound;
100 int col ;
101 };
102
104 int nactions_;
106 const action *actions_;
107
112 const bool fix_to_lower_;
113
117 const remove_fixed_action *faction_;
118
120 make_fixed_action(int nactions, const action *actions, bool fix_to_lower,
121 const remove_fixed_action *faction,
122 const CoinPresolveAction *next)
123 : CoinPresolveAction(next),
124 nactions_(nactions), actions_(actions),
125 fix_to_lower_(fix_to_lower),
126 faction_(faction)
127 {}
128
129 public:
131 const char *name() const;
132
140 static const CoinPresolveAction *presolve(CoinPresolveMatrix *prob,
141 int *fcols,
142 int nfcols,
143 bool fix_to_lower,
144 const CoinPresolveAction *next);
145
150 void postsolve(CoinPostsolveMatrix *prob) const;
151
153 virtual ~make_fixed_action() {
154 deleteAction(actions_,action*);
155 delete faction_;
156 }
157 };
158
166 const CoinPresolveAction *make_fixed(CoinPresolveMatrix *prob,
167 const CoinPresolveAction *next) ;
168
180 void transferCosts(CoinPresolveMatrix * prob);
181 #endif
remove_fixed_action::postsolve
void postsolve(CoinPostsolveMatrix *prob) const
Apply the postsolve transformation for this particular presolve action.
make_fixed_action::action
Structure to preserve the bound overwritten when fixing a variable.
Definition: CoinPresolveFixed.hpp:98
remove_fixed_action::remove_fixed
const CoinPresolveAction * remove_fixed(CoinPresolveMatrix *prob, const CoinPresolveAction *next)
Scan the problem for fixed columns and remove them.
remove_fixed_action
Excise fixed variables from the model.
Definition: CoinPresolveFixed.hpp:25
remove_fixed_action::actions_
action * actions_
Vector specifying variable(s) affected by this object.
Definition: CoinPresolveFixed.hpp:42
make_fixed_action::action::col
int col
column index of variable
Definition: CoinPresolveFixed.hpp:100
make_fixed_action::action::bound
double bound
Value of bound overwritten to fix variable.
Definition: CoinPresolveFixed.hpp:99
CoinPresolveAction
Abstract base class of all presolve routines.
Definition: CoinPresolveMatrix.hpp:155
remove_fixed_action::action::start
int start
start of coefficients in colels_ and colrows_
Definition: CoinPresolveFixed.hpp:32
make_fixed_action::fix_to_lower_
const bool fix_to_lower_
True to fix at lower bound, false to fix at upper bound.
Definition: CoinPresolveFixed.hpp:112
deleteAction
#define deleteAction(array, type)
Definition: CoinPresolveMatrix.hpp:38
remove_fixed_action::~remove_fixed_action
virtual ~remove_fixed_action()
Destructor.
remove_fixed_action::name
const char * name() const
Returns string &quot;remove_fixed_action&quot;.
make_fixed_action::make_fixed
const CoinPresolveAction * make_fixed(CoinPresolveMatrix *prob, const CoinPresolveAction *next)
Scan variables and fix any with equal bounds.
remove_fixed_action::colrows_
int * colrows_
Array of row indices for coefficients of excised columns.
Definition: CoinPresolveFixed.hpp:36
make_fixed_action::postsolve
void postsolve(CoinPostsolveMatrix *prob) const
Postsolve (unfix variables)
make_fixed_action::name
const char * name() const
Returns string &quot;make_fixed_action&quot;.
remove_fixed_action::action::col
int col
column index of variable
Definition: CoinPresolveFixed.hpp:31
CoinPresolveAction::next
const CoinPresolveAction * next
The next presolve transformation.
Definition: CoinPresolveMatrix.hpp:171
make_fixed_action::make_fixed_action
make_fixed_action(int nactions, const action *actions, bool fix_to_lower, const remove_fixed_action *faction, const CoinPresolveAction *next)
Constructor.
Definition: CoinPresolveFixed.hpp:120
CoinPostsolveMatrix
Augments CoinPrePostsolveMatrix with information about the problem that is only needed during postsol...
Definition: CoinPresolveMatrix.hpp:1421
make_fixed_action::transferCosts
void transferCosts(CoinPresolveMatrix *prob)
Transfer costs from singleton variables.
remove_fixed_action::colels_
double * colels_
Array of coefficients of excised columns.
Definition: CoinPresolveFixed.hpp:38
CoinPresolveMatrix
Augments CoinPrePostsolveMatrix with information about the problem that is only needed during presolv...
Definition: CoinPresolveMatrix.hpp:835
remove_fixed_action::action::sol
double sol
value of variable
Definition: CoinPresolveFixed.hpp:33
make_fixed_action::~make_fixed_action
virtual ~make_fixed_action()
Destructor.
Definition: CoinPresolveFixed.hpp:153
remove_fixed_action::nactions_
int nactions_
Number of entries in actions_.
Definition: CoinPresolveFixed.hpp:40
make_fixed_action
Fix a variable at a specified bound.
Definition: CoinPresolveFixed.hpp:95
make_fixed_action::actions_
const action * actions_
Vector of preserved bounds, one for each variable fixed in this object.
Definition: CoinPresolveFixed.hpp:106
remove_fixed_action::remove_fixed_action
remove_fixed_action(int nactions, action *actions, double *colels, int *colrows, const CoinPresolveAction *next)
Constructor.
make_fixed_action::nactions_
int nactions_
Number of preserved bounds.
Definition: CoinPresolveFixed.hpp:104
make_fixed_action::faction_
const remove_fixed_action * faction_
The postsolve object with the information required to repopulate the fixed columns.
Definition: CoinPresolveFixed.hpp:117
remove_fixed_action::presolve
static const remove_fixed_action * presolve(CoinPresolveMatrix *prob, int *fcols, int nfcols, const CoinPresolveAction *next)
Excise the specified columns.
remove_fixed_action::action
Structure to hold information necessary to reintroduce a column into the problem representation.
Definition: CoinPresolveFixed.hpp:30
make_fixed_action::presolve
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.