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

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# CoinPresolveAction Class Reference

Abstract base class of all presolve routines. More...

`#include <CoinPresolveMatrix.hpp>`

Inheritance diagram for CoinPresolveAction:

[legend]
Collaboration diagram for CoinPresolveAction:

[legend]
List of all members.

## Public Member Functions
| CoinPresolveAction (const CoinPresolveAction *next)
| Construct a postsolve object and add it to the transformation list.
void | setNext (const CoinPresolveAction *nextAction)
| modify next (when building rather than passing)
virtual const char * | name () const =0
| A name for debug printing.
virtual void | postsolve (CoinPostsolveMatrix *prob) const =0
| Apply the postsolve transformation for this particular presolve action.
virtual | ~CoinPresolveAction ()
| Virtual destructor.
## Static Public Member Functions
static void | throwCoinError (const char *error, const char *ps_routine)
| Stub routine to throw exceptions.
## Public Attributes
const CoinPresolveAction * | next
| The next presolve transformation.

## Detailed Description

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.

Note:
  Since the only fields in a `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 137 of file CoinPresolveMatrix.hpp.

## Constructor & Destructor Documentation

CoinPresolveAction::CoinPresolveAction | ( | const CoinPresolveAction * | next | ) | `[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 161 of file CoinPresolveMatrix.hpp.

virtual CoinPresolveAction::~CoinPresolveAction | ( |  | ) | `[inline, virtual]`

Virtual destructor.

Definition at line 178 of file CoinPresolveMatrix.hpp.

## Member Function Documentation

static void CoinPresolveAction::throwCoinError | ( | const char * | error,
|  | const char * | ps_routine |
| ) |  |  | `[inline, static]`

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 146 of file CoinPresolveMatrix.hpp.

void CoinPresolveAction::setNext | ( | const CoinPresolveAction * | nextAction | ) | `[inline]`

modify next (when building rather than passing)

Definition at line 163 of file CoinPresolveMatrix.hpp.

References next.

virtual const char* CoinPresolveAction::name | ( |  | ) | const`[pure virtual]`

A name for debug printing.

It is expected that the name is not stored in the transform itself.

Implemented in doubleton_action, dupcol_action, duprow_action, gubrow_action, drop_empty_cols_action, drop_empty_rows_action, remove_fixed_action, make_fixed_action, forcing_constraint_action, implied_free_action, isolated_constraint_action, slack_doubleton_action, slack_singleton_action, subst_constraint_action, do_tighten_action, tripleton_action, useless_constraint_action, and drop_zero_coefficients_action.

virtual void CoinPresolveAction::postsolve | ( | CoinPostsolveMatrix * | prob | ) | const`[pure virtual]`

Apply the postsolve transformation for this particular presolve action.

Implemented in doubleton_action, dupcol_action, duprow_action, gubrow_action, drop_empty_cols_action, drop_empty_rows_action, remove_fixed_action, make_fixed_action, forcing_constraint_action, implied_free_action, isolated_constraint_action, slack_doubleton_action, slack_singleton_action, subst_constraint_action, do_tighten_action, tripleton_action, useless_constraint_action, and drop_zero_coefficients_action.

## Member Data Documentation

const CoinPresolveAction* CoinPresolveAction::next

The next presolve transformation.

Set at object construction.

Definition at line 154 of file CoinPresolveMatrix.hpp.

Referenced by setNext().

The documentation for this class was generated from the following file:

- /home/coin/SVN-release/Blis-0.92.0/CoinUtils/src/CoinPresolveMatrix.hpp