# AbcCutGenerator Class Reference

Interface between Abc and Cut Generation Library. More...

`#include <AbcCutGenerator.h>`

Collaboration diagram for AbcCutGenerator:
[legend]

List of all members.

## Public Member Functions
Generate Cuts
bool | generateCuts (OsiCuts &cs, bool fullScan)
| Generate cuts for the client model.
Constructors and destructors
| AbcCutGenerator ()
| Default constructor.
| AbcCutGenerator (AbcModel *model, CglCutGenerator *generator, int howOften=1, const char *name=NULL, bool normal=true, bool atSolution=false, bool infeasible=false)
| Normal constructor.
| AbcCutGenerator (const AbcCutGenerator &)
| Copy constructor.
AbcCutGenerator & | operator= (const AbcCutGenerator &rhs)
| Assignment operator.
| ~AbcCutGenerator ()
| Destructor.
Gets and sets
void | refreshModel (AbcModel *model)
| Set the client model.
const char * | cutGeneratorName () const
| return name of generator
void | setHowOften (int value)
| Set the cut generation interval.
int | howOften () const
| Get the cut generation interval.
bool | normal () const
| Get whether the cut generator should be called in the normal place.
void | setNormal (bool value)
| Set whether the cut generator should be called in the normal place.
bool | atSolution () const
| Get whether the cut generator should be called when a solution is found.
void | setAtSolution (bool value)
| Set whether the cut generator should be called when a solution is found.
bool | whenInfeasible () const
| Get whether the cut generator should be called when the subproblem is found to be infeasible.
void | setWhenInfeasible (bool value)
| Set whether the cut generator should be called when the subproblem is found to be infeasible.
CglCutGenerator * | generator () const
| Get the `CglCutGenerator` bound to this `AbcCutGenerator`.
## Private Attributes
AbcModel * | model_
| The client model.
CglCutGenerator * | generator_
int | whenCutGenerator_
| Number of nodes between calls to the CglCutGenerator::generateCuts routine.
char * | generatorName_
| Name of generator.
bool | normal_
| Whether to call the generator in the normal place.
bool | atSolution_
| Whether to call the generator when a new solution is found.
bool | whenInfeasible_
| Whether to call generator when a subproblem is found to be infeasible.

## Detailed Description

Interface between Abc and Cut Generation Library.

`AbcCutGenerator` is intended to provide an intelligent interface between Abc and the cutting plane algorithms in the CGL. A `AbcCutGenerator` is bound to a `CglCutGenerator` and to an `AbcModel`. It contains parameters which control when and how the `generateCuts` method of the `CglCutGenerator` will be called.

The builtin decision criteria available to use when deciding whether to generate cuts are limited: every X nodes, when a solution is found, and when a subproblem is found to be infeasible. The idea is that the class will grow more intelligent with time.

Todo:
  Add a pointer to function member which will allow a client to install their own decision algorithm to decide whether or not to call the CGL `generateCuts` method. Create a default decision method that looks at the builtin criteria.

Todo:
  It strikes me as not good that generateCuts contains code specific to individual CGL algorithms. Another set of pointer to function members, so that the client can specify the cut generation method as well as pre- and post-generation methods? Taken a bit further, should this class contain a bunch of pointer to function members, one for each of the places where the cut generator might be referenced? Initialization, root node, search tree node, discovery of solution, and termination all come to mind. Initialization and termination would also be useful for instrumenting sbb.

Definition at line 69 of file AbcCutGenerator.h.

## Constructor & Destructor Documentation

AbcCutGenerator::AbcCutGenerator | ( |  | ) |

Default constructor.

AbcCutGenerator::AbcCutGenerator | ( | AbcModel * | model,
|  | CglCutGenerator * | generator,
|  | int | howOften = `1`,
|  | const char * | name = `NULL`,
|  | bool | normal = `true`,
|  | bool | atSolution = `false`,
|  | bool | infeasible = `false` |
| ) |  |  |

Normal constructor.

AbcCutGenerator::AbcCutGenerator | ( | const AbcCutGenerator & |  | ) |

Copy constructor.

AbcCutGenerator::~AbcCutGenerator | ( |  | ) |

Destructor.

## Member Function Documentation

bool AbcCutGenerator::generateCuts | ( | OsiCuts & | cs,
|  | bool | fullScan |
| ) |  |  |

Generate cuts for the client model.

Evaluate the state of the client model and decide whether to generate cuts. The generated cuts are inserted into and returned in the collection of cuts `cs`.

If `fullScan` is true, the generator is obliged to call the CGL `generateCuts` routine. Otherwise, it is free to make a local decision. The current implementation uses `whenCutGenerator_` to decide.

The routine returns true if reoptimisation is needed (because the state of the solver interface has been modified).

AbcCutGenerator& AbcCutGenerator::operator= | ( | const AbcCutGenerator & | rhs | ) |

Assignment operator.

void AbcCutGenerator::refreshModel | ( | AbcModel * | model | ) |

Set the client model.

In addition to setting the client model, refreshModel also calls the `refreshSolver` method of the CglCutGenerator object.

const char* AbcCutGenerator::cutGeneratorName | ( |  | ) | const`[inline]`

return name of generator

Definition at line 124 of file AbcCutGenerator.h.

void AbcCutGenerator::setHowOften | ( | int | value | ) |

Set the cut generation interval.

Set the number of nodes evaluated between calls to the Cgl object's `generateCuts` routine.

If `value` is positive, cuts will always be generated at the specified interval. If `value` is negative, cuts will initially be generated at the specified interval, but Abc may adjust the value depending on the success of cuts produced by this generator.

A value of -100 disables the generator, while a value of -99 means just at root.

int AbcCutGenerator::howOften | ( |  | ) | const`[inline]`

Get the cut generation interval.

Definition at line 146 of file AbcCutGenerator.h.

bool AbcCutGenerator::normal | ( |  | ) | const`[inline]`

Get whether the cut generator should be called in the normal place.

Definition at line 150 of file AbcCutGenerator.h.

void AbcCutGenerator::setNormal | ( | bool | value | ) | `[inline]`

Set whether the cut generator should be called in the normal place.

Definition at line 153 of file AbcCutGenerator.h.

bool AbcCutGenerator::atSolution | ( |  | ) | const`[inline]`

Get whether the cut generator should be called when a solution is found.

Definition at line 156 of file AbcCutGenerator.h.

void AbcCutGenerator::setAtSolution | ( | bool | value | ) | `[inline]`

Set whether the cut generator should be called when a solution is found.

Definition at line 159 of file AbcCutGenerator.h.

bool AbcCutGenerator::whenInfeasible | ( |  | ) | const`[inline]`

Get whether the cut generator should be called when the subproblem is found to be infeasible.

Definition at line 164 of file AbcCutGenerator.h.

void AbcCutGenerator::setWhenInfeasible | ( | bool | value | ) | `[inline]`

Set whether the cut generator should be called when the subproblem is found to be infeasible.

Definition at line 169 of file AbcCutGenerator.h.

CglCutGenerator* AbcCutGenerator::generator | ( |  | ) | const`[inline]`

Get the `CglCutGenerator` bound to this `AbcCutGenerator`.

Definition at line 172 of file AbcCutGenerator.h.

## Member Data Documentation

AbcModel* AbcCutGenerator::model_`[private]`

The client model.

Definition at line 178 of file AbcCutGenerator.h.

CglCutGenerator* AbcCutGenerator::generator_`[private]`

Definition at line 181 of file AbcCutGenerator.h.

int AbcCutGenerator::whenCutGenerator_`[private]`

Number of nodes between calls to the CglCutGenerator::generateCuts routine.

Definition at line 186 of file AbcCutGenerator.h.

char* AbcCutGenerator::generatorName_`[private]`

Name of generator.

Definition at line 189 of file AbcCutGenerator.h.

bool AbcCutGenerator::normal_`[private]`

Whether to call the generator in the normal place.

Definition at line 192 of file AbcCutGenerator.h.

bool AbcCutGenerator::atSolution_`[private]`

Whether to call the generator when a new solution is found.

Definition at line 195 of file AbcCutGenerator.h.

bool AbcCutGenerator::whenInfeasible_`[private]`

Whether to call generator when a subproblem is found to be infeasible.

Definition at line 198 of file AbcCutGenerator.h.

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

- /home/coin/svn-release/Blis-0.93.10/Alps/examples/Abc/AbcCutGenerator.h