Cgl
0.59.10
|
Knapsack Cover Cut Generator Class. More...
#include <CglKnapsackCover.hpp>
Public Member Functions | |
void | setTestedRowIndices (int num, const int *ind) |
A method to set which rows should be tested for knapsack covers. More... | |
Generate Cuts | |
virtual void | generateCuts (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) |
Generate knapsack cover cuts for the model of the solver interface, si. More... | |
Constructors and destructors | |
CglKnapsackCover () | |
Default constructor. More... | |
CglKnapsackCover (const CglKnapsackCover &) | |
Copy constructor. More... | |
virtual CglCutGenerator * | clone () const |
Clone. More... | |
CglKnapsackCover & | operator= (const CglKnapsackCover &rhs) |
Assignment operator. More... | |
virtual | ~CglKnapsackCover () |
Destructor. More... | |
virtual std::string | generateCpp (FILE *fp) |
Create C++ lines to get to current state. More... | |
virtual void | refreshSolver (OsiSolverInterface *solver) |
This can be used to refresh any information. More... | |
Sets and gets | |
void | setMaxInKnapsack (int value) |
Set limit on number in knapsack. More... | |
int | getMaxInKnapsack () const |
get limit on number in knapsack More... | |
void | switchOffExpensive () |
Switch off expensive cuts. More... | |
void | switchOnExpensive () |
Switch on expensive cuts. More... | |
![]() | |
CglCutGenerator () | |
Default constructor. More... | |
CglCutGenerator (const CglCutGenerator &) | |
Copy constructor. More... | |
CglCutGenerator & | operator= (const CglCutGenerator &rhs) |
Assignment operator. More... | |
virtual | ~CglCutGenerator () |
Destructor. 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... | |
Friends | |
void | CglKnapsackCoverUnitTest (const OsiSolverInterface *siP, const std::string mpdDir) |
A function that tests the methods in the CglKnapsackCover class. More... | |
Private methods | |
int | createCliques (OsiSolverInterface &si, int minimumSize=2, int maximumSize=100, bool extendCliques=false) |
Creates cliques for use by probing. 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... | |
Knapsack Cover Cut Generator Class.
Definition at line 15 of file CglKnapsackCover.hpp.
CglKnapsackCover::CglKnapsackCover | ( | ) |
Default constructor.
CglKnapsackCover::CglKnapsackCover | ( | const CglKnapsackCover & | ) |
Copy constructor.
|
virtual |
Destructor.
void CglKnapsackCover::setTestedRowIndices | ( | int | num, |
const int * | ind | ||
) |
A method to set which rows should be tested for knapsack covers.
|
virtual |
Generate knapsack cover cuts for the model of the solver interface, si.
Insert the generated cuts into OsiCut, cs.
Implements CglCutGenerator.
|
virtual |
Clone.
Implements CglCutGenerator.
CglKnapsackCover& CglKnapsackCover::operator= | ( | const CglKnapsackCover & | rhs | ) |
Assignment operator.
|
virtual |
Create C++ lines to get to current state.
Reimplemented from CglCutGenerator.
|
virtual |
This can be used to refresh any information.
Reimplemented from CglCutGenerator.
|
inline |
Set limit on number in knapsack.
Definition at line 62 of file CglKnapsackCover.hpp.
|
inline |
get limit on number in knapsack
Definition at line 65 of file CglKnapsackCover.hpp.
|
inline |
Switch off expensive cuts.
Definition at line 68 of file CglKnapsackCover.hpp.
|
inline |
Switch on expensive cuts.
Definition at line 71 of file CglKnapsackCover.hpp.
int CglKnapsackCover::createCliques | ( | OsiSolverInterface & | si, |
int | minimumSize = 2 , |
||
int | maximumSize = 100 , |
||
bool | extendCliques = false |
||
) |
Creates cliques for use by probing.
Only cliques >= minimumSize and < maximumSize created Can also try and extend cliques as a result of probing (root node). Returns number of cliques found.
|
friend |
A function that tests the methods in the CglKnapsackCover 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.