Fix a variable at a specified bound. More...
#include <CoinPresolveFixed.hpp>
Classes | |
struct | action |
Structure to preserve the bound overwritten when fixing a variable. More... | |
Public Member Functions | |
const char * | name () const |
Returns string "make_fixed_action". | |
void | postsolve (CoinPostsolveMatrix *prob) const |
Postsolve (unfix variables). | |
~make_fixed_action () | |
Destructor. | |
Static Public Member Functions | |
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. | |
Private Member Functions | |
make_fixed_action (int nactions, const action *actions, bool fix_to_lower, const remove_fixed_action *faction, const CoinPresolveAction *next) | |
Constructor. | |
Private Attributes | |
int | nactions_ |
Number of preserved bounds. | |
const action * | actions_ |
Vector of preserved bounds, one for each variable fixed in this object. | |
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 information to undo the fix(es). | |
Related Functions | |
(Note that these are not member functions.) | |
const CoinPresolveAction * | make_fixed (CoinPresolveMatrix *prob, const CoinPresolveAction *next) |
Scan variables and fix any with equal bounds. |
Fix a variable at a specified bound.
Implements the action of fixing a variable by forcing both bounds to the same value and forcing the value of the variable to match.
If the bounds are already equal, and the value of the variable is already correct, consider remove_fixed_action.
Definition at line 93 of file CoinPresolveFixed.hpp.
make_fixed_action::make_fixed_action | ( | int | nactions, | |
const action * | actions, | |||
bool | fix_to_lower, | |||
const remove_fixed_action * | faction, | |||
const CoinPresolveAction * | next | |||
) | [inline, private] |
Constructor.
Definition at line 116 of file CoinPresolveFixed.hpp.
make_fixed_action::~make_fixed_action | ( | ) | [inline] |
Destructor.
Definition at line 151 of file CoinPresolveFixed.hpp.
const char* make_fixed_action::name | ( | ) | const [virtual] |
Returns string "make_fixed_action".
Implements CoinPresolveAction.
static const CoinPresolveAction* make_fixed_action::presolve | ( | CoinPresolveMatrix * | prob, | |
int * | fcols, | |||
int | nfcols, | |||
bool | fix_to_lower, | |||
const CoinPresolveAction * | next | |||
) | [static] |
Perform actions to fix variables and return postsolve object.
For each specified variable (nfcols
, fcols
), fix the variable to the specified bound (fix_to_lower
) by setting the variable's bounds to be equal in prob
. Create a postsolve object, link it at the head of the list of postsolve objects (next
), and return the object.
void make_fixed_action::postsolve | ( | CoinPostsolveMatrix * | prob | ) | const [virtual] |
Postsolve (unfix variables).
Back out the variables fixed by the presolve side of this object.
Implements CoinPresolveAction.
const CoinPresolveAction * make_fixed | ( | CoinPresolveMatrix * | prob, | |
const CoinPresolveAction * | next | |||
) | [related] |
Scan variables and fix any with equal bounds.
A front end to collect a list of columns with equal bounds and hand them to make_fixed_action::presolve() for processing.
int make_fixed_action::nactions_ [private] |
Number of preserved bounds.
Definition at line 102 of file CoinPresolveFixed.hpp.
const action* make_fixed_action::actions_ [private] |
Vector of preserved bounds, one for each variable fixed in this object.
Definition at line 104 of file CoinPresolveFixed.hpp.
const bool make_fixed_action::fix_to_lower_ [private] |
True to fix at lower bound, false to fix at upper bound.
Note that this applies to all variables fixed in this object.
Definition at line 110 of file CoinPresolveFixed.hpp.
const remove_fixed_action* make_fixed_action::faction_ [private] |
The postsolve object with information to undo the fix(es).
Definition at line 113 of file CoinPresolveFixed.hpp.