Interface between Blis and Cut Generation Library. More...
#include <BlisConGenerator.h>
Public Member Functions | |
Constructors and destructors | |
BlisConGenerator () | |
Default constructor. More... | |
BlisConGenerator (BlisModel *model, CglCutGenerator *generator, const char *name=NULL, int strategy=0, bool normal=true, bool atSolution=false, bool infeasible=false) | |
Useful constructor. More... | |
BlisConGenerator (const BlisConGenerator &) | |
Copy constructor. More... | |
BlisConGenerator & | operator= (const BlisConGenerator &rhs) |
Assignment operator. More... | |
~BlisConGenerator () | |
Destructor. More... | |
Generate Cons | |
bool | generateCons (OsiCuts &cs, bool fullScan) |
Generate cons for the client model. More... | |
Gets and sets | |
void | refreshModel (BlisModel *model) |
Set the client model. More... | |
const char * | name () const |
return name of generator. More... | |
void | setStrategy (int value) |
Set the con generation strategy. More... | |
int | strategy () const |
Get the con generation interval. More... | |
bool | normal () const |
Get whether the con generator should be called in the normal place. More... | |
void | setNormal (bool value) |
Set whether the con generator should be called in the normal place. More... | |
bool | atSolution () const |
Get whether the con generator should be called when a solution is found. More... | |
void | setAtSolution (bool value) |
Set whether the con generator should be called when a solution is found. More... | |
bool | whenInfeasible () const |
Get whether the con generator should be called when the subproblem is found to be infeasible. More... | |
void | setWhenInfeasible (bool value) |
Set whether the con generator should be called when the subproblem is found to be infeasible. More... | |
CglCutGenerator * | generator () const |
Get the CglCutGenerator bound to this BlisConGenerator . More... | |
int | numConsGenerated () |
Get number of generated cons. More... | |
void | addNumConsGenerated (int n) |
Increase the number of generated cons. More... | |
int | numConsUsed () |
Get number of used cons. More... | |
void | addNumConsUsed (int n) |
Increase the number of generated cons. More... | |
double | time () |
Cpu time used. More... | |
void | addTime (double t) |
Increase Cpu time used. More... | |
int | calls () |
Number called. More... | |
void | addCalls (int n=1) |
Increase the number of called. More... | |
int | noConsCalls () |
Number called and no cons found. More... | |
void | addNoConsCalls (int n=1) |
Increase the number of no cons called. More... | |
Private Attributes | |
BlisModel * | model_ |
The client model. More... | |
CglCutGenerator * | generator_ |
The CglCutGenerator object. More... | |
int | strategy_ |
When to call CglCutGenerator::generateCuts routine. More... | |
char * | name_ |
Name of generator. More... | |
bool | normal_ |
Whether to call the generator in the normal place. More... | |
bool | atSolution_ |
Whether to call the generator when a new solution is found. More... | |
bool | whenInfeasible_ |
Whether to call generator when a subproblem is found to be infeasible. More... | |
int | numConsGenerated_ |
Number of cons generated. More... | |
int | numConsUsed_ |
Number of cons used. More... | |
double | time_ |
Used CPU/User time. More... | |
int | calls_ |
The times of calling this generator. More... | |
int | noConsCalls_ |
The times of calling this generator and no cons found. More... | |
Interface between Blis and Cut Generation Library.
BlisConGenerator
is intended to provide an intelligent interface between Blis and the cutting plane algorithms in the CGL. A BlisConGenerator
is bound to a CglCutGenerator
and to an BlisModel
. 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 cons are: at root, autmatic, every X nodes, when a solution is found, and when a subproblem is found to be infeasible.
Definition at line 56 of file BlisConGenerator.h.
|
inline |
Default constructor.
Definition at line 114 of file BlisConGenerator.h.
BlisConGenerator::BlisConGenerator | ( | BlisModel * | model, |
CglCutGenerator * | generator, | ||
const char * | name = NULL , |
||
int | strategy = 0 , |
||
bool | normal = true , |
||
bool | atSolution = false , |
||
bool | infeasible = false |
||
) |
Useful constructor.
BlisConGenerator::BlisConGenerator | ( | const BlisConGenerator & | ) |
Copy constructor.
|
inline |
Destructor.
Definition at line 146 of file BlisConGenerator.h.
BlisConGenerator& BlisConGenerator::operator= | ( | const BlisConGenerator & | rhs | ) |
Assignment operator.
bool BlisConGenerator::generateCons | ( | OsiCuts & | cs, |
bool | fullScan | ||
) |
Generate cons for the client model.
Evaluate the state of the client model and decide whether to generate cons. The generated cons are inserted into and returned in the collection of cons 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 strategy_
to decide.
The routine returns true if reoptimisation is needed (because the state of the solver interface has been modified).
Set the client model.
In addition to setting the client model, refreshModel also calls the refreshSolver
method of the CglCutGenerator object.
|
inline |
return name of generator.
Definition at line 184 of file BlisConGenerator.h.
|
inline |
Set the con generation strategy.
Definition at line 187 of file BlisConGenerator.h.
|
inline |
Get the con generation interval.
Definition at line 190 of file BlisConGenerator.h.
|
inline |
Get whether the con generator should be called in the normal place.
Definition at line 193 of file BlisConGenerator.h.
|
inline |
Set whether the con generator should be called in the normal place.
Definition at line 196 of file BlisConGenerator.h.
|
inline |
Get whether the con generator should be called when a solution is found.
Definition at line 200 of file BlisConGenerator.h.
|
inline |
Set whether the con generator should be called when a solution is found.
Definition at line 204 of file BlisConGenerator.h.
|
inline |
Get whether the con generator should be called when the subproblem is found to be infeasible.
Definition at line 208 of file BlisConGenerator.h.
|
inline |
Set whether the con generator should be called when the subproblem is found to be infeasible.
Definition at line 212 of file BlisConGenerator.h.
|
inline |
Get the CglCutGenerator
bound to this BlisConGenerator
.
Definition at line 215 of file BlisConGenerator.h.
|
inline |
Get number of generated cons.
Definition at line 218 of file BlisConGenerator.h.
|
inline |
Increase the number of generated cons.
Definition at line 221 of file BlisConGenerator.h.
|
inline |
Get number of used cons.
Definition at line 224 of file BlisConGenerator.h.
|
inline |
Increase the number of generated cons.
Definition at line 227 of file BlisConGenerator.h.
|
inline |
Cpu time used.
Definition at line 230 of file BlisConGenerator.h.
|
inline |
Increase Cpu time used.
Definition at line 233 of file BlisConGenerator.h.
|
inline |
Number called.
Definition at line 236 of file BlisConGenerator.h.
|
inline |
Increase the number of called.
Definition at line 239 of file BlisConGenerator.h.
|
inline |
Number called and no cons found.
Definition at line 242 of file BlisConGenerator.h.
|
inline |
Increase the number of no cons called.
Definition at line 245 of file BlisConGenerator.h.
|
private |
The client model.
Definition at line 60 of file BlisConGenerator.h.
|
private |
The CglCutGenerator object.
Definition at line 63 of file BlisConGenerator.h.
|
private |
When to call CglCutGenerator::generateCuts routine.
-2: disable -1: just root 0: automatically decided by BLIS any positive integer: the node interval between the call
Definition at line 75 of file BlisConGenerator.h.
|
private |
Name of generator.
Definition at line 78 of file BlisConGenerator.h.
|
private |
Whether to call the generator in the normal place.
Definition at line 81 of file BlisConGenerator.h.
|
private |
Whether to call the generator when a new solution is found.
Definition at line 84 of file BlisConGenerator.h.
|
private |
Whether to call generator when a subproblem is found to be infeasible.
Definition at line 88 of file BlisConGenerator.h.
|
private |
Number of cons generated.
Definition at line 95 of file BlisConGenerator.h.
|
private |
Number of cons used.
Definition at line 98 of file BlisConGenerator.h.
|
private |
Used CPU/User time.
Definition at line 101 of file BlisConGenerator.h.
|
private |
The times of calling this generator.
Definition at line 104 of file BlisConGenerator.h.
|
private |
The times of calling this generator and no cons found.
Definition at line 107 of file BlisConGenerator.h.