DyLP
1.10.4
|
Abstract base class of all presolve routines. More...
#include <CoinPresolveMatrix.hpp>
Public Member Functions | |
CoinPresolveAction (const CoinPresolveAction *next) | |
Construct a postsolve object and add it to the transformation list. More... | |
void | setNext (const CoinPresolveAction *nextAction) |
modify next (when building rather than passing) More... | |
virtual const char * | name () const =0 |
A name for debug printing. More... | |
virtual void | postsolve (CoinPostsolveMatrix *prob) const =0 |
Apply the postsolve transformation for this particular presolve action. More... | |
virtual | ~CoinPresolveAction () |
Virtual destructor. More... | |
Static Public Member Functions | |
static void | throwCoinError (const char *error, const char *ps_routine) |
Stub routine to throw exceptions. More... | |
Public Attributes | |
const CoinPresolveAction * | next |
The next presolve transformation. More... | |
Abstract base class of all presolve routines.
The details will make more sense after a quick overview of the grand plan: A presolve object is handed a problem object, which it is expected to modify in some useful way. Assuming that it succeeds, the presolve object should create a postsolve object, i.e., an object that contains instructions for backing out the presolve transform to recover the original problem. These postsolve objects are accumulated in a linked list, with each successive presolve action adding its postsolve action to the head of the list. The end result of all this is a presolved problem object, and a list of postsolve objects. The presolved problem object is then handed to a solver for optimization, and the problem object augmented with the results. The list of postsolve objects is then traversed. Each of them (un)modifies the problem object, with the end result being the original problem, augmented with solution information.
The problem object representation is CoinPrePostsolveMatrix and subclasses. Check there for details. The CoinPresolveAction
class and subclasses represent the presolve and postsolve objects.
In spite of the name, the only information held in a CoinPresolveAction
object is the information needed to postsolve (i.e., the information needed to back out the presolve transformation). This information is not expected to change, so the fields are all const
.
A subclass of CoinPresolveAction
, implementing a specific pre/postsolve action, is expected to declare a static function that attempts to perform a presolve transformation. This function will be handed a CoinPresolveMatrix to transform, and a pointer to the head of the list of postsolve objects. If the transform is successful, the function will create a new CoinPresolveAction
object, link it at the head of the list of postsolve objects, and return a pointer to the postsolve object it has just created. Otherwise, it should return 0. It is expected that these static functions will be the only things that can create new CoinPresolveAction
objects; this is expressed by making each subclass' constructor(s) private.
Every subclass must also define a postsolve
method. This function will be handed a CoinPostsolveMatrix to transform.
It is the client's responsibility to implement presolve and postsolve driver routines. See OsiPresolve for examples.
CoinPresolveAction
are const
, anything one can do with a variable declared CoinPresolveAction*
can also be done with a variable declared const
CoinPresolveAction*
It is expected that all derived subclasses of CoinPresolveAction
also have this property. Definition at line 163 of file CoinPresolveMatrix.hpp.
|
inline |
Construct a postsolve object and add it to the transformation list.
This is an `add to head' operation. This object will point to the one passed as the parameter.
Definition at line 187 of file CoinPresolveMatrix.hpp.
|
inlinevirtual |
Virtual destructor.
Definition at line 209 of file CoinPresolveMatrix.hpp.
|
inlinestatic |
Stub routine to throw exceptions.
Exceptions are inefficient, particularly with g++. Even with xlC, the use of exceptions adds a long prologue to a routine. Therefore, rather than use throw directly in the routine, I use it in a stub routine.
Definition at line 171 of file CoinPresolveMatrix.hpp.
|
inline |
modify next (when building rather than passing)
Definition at line 192 of file CoinPresolveMatrix.hpp.
|
pure virtual |
A name for debug printing.
It is expected that the name is not stored in the transform itself.
Implemented in twoxtwo_action, gubrow_action, duprow3_action, make_fixed_action, duprow_action, drop_empty_rows_action, slack_singleton_action, subst_constraint_action, doubleton_action, dupcol_action, drop_empty_cols_action, tripleton_action, forcing_constraint_action, remove_fixed_action, implied_free_action, slack_doubleton_action, drop_zero_coefficients_action, do_tighten_action, isolated_constraint_action, remove_dual_action, and useless_constraint_action.
|
pure virtual |
Apply the postsolve transformation for this particular presolve action.
Implemented in twoxtwo_action, gubrow_action, duprow3_action, make_fixed_action, duprow_action, drop_empty_rows_action, slack_singleton_action, subst_constraint_action, doubleton_action, remove_fixed_action, dupcol_action, drop_empty_cols_action, slack_doubleton_action, tripleton_action, forcing_constraint_action, implied_free_action, remove_dual_action, drop_zero_coefficients_action, isolated_constraint_action, do_tighten_action, and useless_constraint_action.
const CoinPresolveAction* CoinPresolveAction::next |
The next presolve transformation.
Set at object construction.
Definition at line 180 of file CoinPresolveMatrix.hpp.