Lifed Simple Generalized Flow Cover Cut Generator Class. More...
#include <CglFlowCover.hpp>
Public Member Functions | |
void | flowPreprocess (const OsiSolverInterface &si) |
Do the following tasks: More... | |
Generate Cuts | |
virtual void | generateCuts (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) |
Generate Lifed Simple Generalized flow cover cuts for the model data contained in si. More... | |
Functions to query and set maximum number of cuts can be | |
generated. | |
int | getMaxNumCuts () const |
void | setMaxNumCuts (int mc) |
Constructors and destructors | |
CglFlowCover () | |
Default constructor. More... | |
CglFlowCover (const CglFlowCover &) | |
Copy constructor. More... | |
virtual CglCutGenerator * | clone () const |
Clone. More... | |
CglFlowCover & | operator= (const CglFlowCover &rhs) |
Assignment operator. More... | |
virtual | ~CglFlowCover () |
Destructor. More... | |
virtual std::string | generateCpp (FILE *fp) |
Create C++ lines to get to current state. More... | |
![]() | |
CglCutGenerator () | |
Default constructor. More... | |
CglCutGenerator (const CglCutGenerator &) | |
Copy constructor. More... | |
CglCutGenerator & | operator= (const CglCutGenerator &rhs) |
Assignment operator. More... | |
virtual | ~CglCutGenerator () |
Destructor. More... | |
virtual void | refreshSolver (OsiSolverInterface *) |
This can be used to refresh any information. More... | |
int | getAggressiveness () const |
Get Aggressiveness - 0 = neutral, 100 is normal root node. More... | |
void | setAggressiveness (int value) |
Set Aggressiveness - 0 = neutral, 100 is normal root node. More... | |
void | setGlobalCuts (bool trueOrFalse) |
Set whether can do global cuts. More... | |
bool | canDoGlobalCuts () const |
Say whether can do global cuts. More... | |
virtual bool | mayGenerateRowCutsInTree () const |
Returns true if may generate Row cuts in tree (rather than root node). More... | |
virtual bool | needsOptimalBasis () const |
Return true if needs optimal basis to do cuts. More... | |
virtual int | maximumLengthOfCutInTree () const |
Return maximum length of cut in tree. More... | |
Static Public Member Functions | |
Functions to query and set the number of cuts have been | |
generated. | |
static int | getNumFlowCuts () |
static void | setNumFlowCuts (int fc) |
static void | incNumFlowCuts (int fc=1) |
Private Member Functions | |
bool | generateOneFlowCut (const OsiSolverInterface &si, const int rowLen, int *ind, double *coef, char sense, double rhs, OsiRowCut &flowCut, double &violation) |
Based a given row, a LP solution and other model data, this function tries to generate a violated lifted simple generalized flow cover. More... | |
void | flipRow (int rowLen, double *coef, double &rhs) const |
Transform a row from ">=" to "<=", and vice versa. More... | |
void | flipRow (int rowLen, double *coef, char &sen, double &rhs) const |
Transform a row from ">=" to "<=", and vice versa. More... | |
CglFlowRowType | determineOneRowType (const OsiSolverInterface &si, int rowLen, int *ind, double *coef, char sen, double rhs) const |
Determine the type of a given row. More... | |
void | liftMinus (double &movement, int t, int r, double z, double dPrimePrime, double lambda, double ml, double *M, double *rho) const |
Lift functions. More... | |
bool | liftPlus (double &alpha, double &beta, int r, double m_j, double lambda, double y_j, double x_j, double dPrimePrime, double *M) const |
const CglFlowRowType * | getRowTypes () const |
Set rowtypes, take over the ownership. More... | |
CglFlowRowType | getRowType (const int i) const |
Set rowtypes, take over the ownership. More... | |
void | setRowTypes (CglFlowRowType *rt) |
Set rowtypes, take over the ownership. More... | |
void | setRowTypes (const CglFlowRowType rt, const int i) |
Set rowtypes, take over the ownership. More... | |
const CglFlowVUB * | getVubs () const |
Set CglFlowVUBs,take over the ownership. More... | |
const CglFlowVUB & | getVubs (int i) const |
Set CglFlowVUBs,take over the ownership. More... | |
void | setVubs (CglFlowVUB *vubs) |
Set CglFlowVUBs,take over the ownership. More... | |
void | setVubs (const CglFlowVUB &vub, int i) |
Set CglFlowVUBs,take over the ownership. More... | |
void | printVubs (std::ostream &os) const |
Set CglFlowVUBs,take over the ownership. More... | |
const CglFlowVLB * | getVlbs () const |
Set CglFlowVLBs,take over the ownership. More... | |
const CglFlowVLB & | getVlbs (int i) const |
Set CglFlowVLBs,take over the ownership. More... | |
void | setVlbs (CglFlowVLB *vlbs) |
Set CglFlowVLBs,take over the ownership. More... | |
void | setVlbs (const CglFlowVLB &vlb, int i) |
Set CglFlowVLBs,take over the ownership. More... | |
Private Attributes | |
int | maxNumCuts_ |
The maximum number of flow cuts to be generated. More... | |
double | EPSILON_ |
Tolerance used for numerical purpose. More... | |
int | UNDEFINED_ |
The variable upper bound of a flow is not indentified yet. More... | |
double | INFTY_ |
Very large number. More... | |
double | TOLERANCE_ |
If violation of a cut is greater that this number, the cut is useful. More... | |
bool | firstProcess_ |
First time preprocessing. More... | |
int | numRows_ |
The number rows of the problem. More... | |
int | numCols_ |
The number columns of the problem. More... | |
bool | doneInitPre_ |
Indicate whether initial flow preprecessing has been done. More... | |
CglFlowVUB * | vubs_ |
The array of CglFlowVUBs. More... | |
CglFlowVLB * | vlbs_ |
The array of CglFlowVLBs. More... | |
CglFlowRowType * | rowTypes_ |
CglFlowRowType of the rows in model. More... | |
Static Private Attributes | |
static int | numFlowCuts_ |
The number flow cuts found. More... | |
Friends | |
void | CglFlowCoverUnitTest (const OsiSolverInterface *siP, const std::string mpdDir) |
A function that tests the methods in the CglFlowCover class. More... | |
Additional Inherited Members | |
![]() | |
int | aggressive_ |
Aggressiveness - 0 = neutral, 100 is normal root node. More... | |
bool | canDoGlobalCuts_ |
True if can do global cuts i.e. no general integers. More... | |
Lifed Simple Generalized Flow Cover Cut Generator Class.
Definition at line 148 of file CglFlowCover.hpp.
CglFlowCover::CglFlowCover | ( | ) |
Default constructor.
CglFlowCover::CglFlowCover | ( | const CglFlowCover & | ) |
Copy constructor.
|
virtual |
Destructor.
void CglFlowCover::flowPreprocess | ( | const OsiSolverInterface & | si | ) |
Do the following tasks:
This function is called by generateCuts(const OsiSolverInterface & si, OsiCuts & cs)
.
|
virtual |
Generate Lifed Simple Generalized flow cover cuts for the model data contained in si.
The generated cuts are inserted into and returned in the collection of cuts cs.
Implements CglCutGenerator.
|
inline |
Definition at line 178 of file CglFlowCover.hpp.
|
inline |
Definition at line 179 of file CglFlowCover.hpp.
|
inlinestatic |
Definition at line 185 of file CglFlowCover.hpp.
|
inlinestatic |
Definition at line 186 of file CglFlowCover.hpp.
|
inlinestatic |
Definition at line 187 of file CglFlowCover.hpp.
|
virtual |
Clone.
Implements CglCutGenerator.
CglFlowCover& CglFlowCover::operator= | ( | const CglFlowCover & | rhs | ) |
Assignment operator.
|
virtual |
Create C++ lines to get to current state.
Reimplemented from CglCutGenerator.
|
private |
Based a given row, a LP solution and other model data, this function tries to generate a violated lifted simple generalized flow cover.
|
private |
Transform a row from ">=" to "<=", and vice versa.
|
private |
Transform a row from ">=" to "<=", and vice versa.
Have 'sense'.
|
private |
Determine the type of a given row.
|
private |
Lift functions.
|
private |
|
inlineprivate |
Set rowtypes, take over the ownership.
Definition at line 268 of file CglFlowCover.hpp.
|
inlineprivate |
Set rowtypes, take over the ownership.
Definition at line 270 of file CglFlowCover.hpp.
|
inlineprivate |
Set rowtypes, take over the ownership.
Definition at line 273 of file CglFlowCover.hpp.
|
inlineprivate |
Set rowtypes, take over the ownership.
Definition at line 275 of file CglFlowCover.hpp.
|
inlineprivate |
Set CglFlowVUBs,take over the ownership.
Definition at line 290 of file CglFlowCover.hpp.
|
inlineprivate |
Set CglFlowVUBs,take over the ownership.
Definition at line 291 of file CglFlowCover.hpp.
|
inlineprivate |
Set CglFlowVUBs,take over the ownership.
Definition at line 293 of file CglFlowCover.hpp.
|
inlineprivate |
Set CglFlowVUBs,take over the ownership.
Definition at line 294 of file CglFlowCover.hpp.
|
inlineprivate |
Set CglFlowVUBs,take over the ownership.
Definition at line 304 of file CglFlowCover.hpp.
|
inlineprivate |
Set CglFlowVLBs,take over the ownership.
Definition at line 314 of file CglFlowCover.hpp.
|
inlineprivate |
Set CglFlowVLBs,take over the ownership.
Definition at line 315 of file CglFlowCover.hpp.
|
inlineprivate |
Set CglFlowVLBs,take over the ownership.
Definition at line 317 of file CglFlowCover.hpp.
|
inlineprivate |
Set CglFlowVLBs,take over the ownership.
Definition at line 318 of file CglFlowCover.hpp.
|
friend |
A function that tests the methods in the CglFlowCover class.
The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging.
|
private |
The maximum number of flow cuts to be generated.
Default is 1000.
Definition at line 335 of file CglFlowCover.hpp.
|
private |
Tolerance used for numerical purpose.
Definition at line 337 of file CglFlowCover.hpp.
|
private |
The variable upper bound of a flow is not indentified yet.
Definition at line 339 of file CglFlowCover.hpp.
|
private |
Very large number.
Definition at line 341 of file CglFlowCover.hpp.
|
private |
If violation of a cut is greater that this number, the cut is useful.
Definition at line 343 of file CglFlowCover.hpp.
|
private |
First time preprocessing.
Definition at line 345 of file CglFlowCover.hpp.
|
private |
The number rows of the problem.
Definition at line 347 of file CglFlowCover.hpp.
|
private |
The number columns of the problem.
Definition at line 349 of file CglFlowCover.hpp.
|
staticprivate |
The number flow cuts found.
Definition at line 351 of file CglFlowCover.hpp.
|
private |
Indicate whether initial flow preprecessing has been done.
Definition at line 353 of file CglFlowCover.hpp.
|
private |
The array of CglFlowVUBs.
Definition at line 355 of file CglFlowCover.hpp.
|
private |
The array of CglFlowVLBs.
Definition at line 357 of file CglFlowCover.hpp.
|
private |
CglFlowRowType of the rows in model.
Definition at line 359 of file CglFlowCover.hpp.