Cgl  0.59.9
Classes | Public Member Functions | Friends | List of all members
CglKnapsackCover Class Reference

Knapsack Cover Cut Generator Class. More...

#include <CglKnapsackCover.hpp>

+ Inheritance diagram for CglKnapsackCover:
+ Collaboration diagram for CglKnapsackCover:

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 CglCutGeneratorclone () const
 Clone. More...
 
CglKnapsackCoveroperator= (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...
 
- Public Member Functions inherited from CglCutGenerator
 CglCutGenerator ()
 Default constructor. More...
 
 CglCutGenerator (const CglCutGenerator &)
 Copy constructor. More...
 
CglCutGeneratoroperator= (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

- Public Attributes inherited from CglCutGenerator
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...
 

Detailed Description

Knapsack Cover Cut Generator Class.

Definition at line 15 of file CglKnapsackCover.hpp.

Constructor & Destructor Documentation

CglKnapsackCover::CglKnapsackCover ( )

Default constructor.

CglKnapsackCover::CglKnapsackCover ( const CglKnapsackCover )

Copy constructor.

virtual CglKnapsackCover::~CglKnapsackCover ( )
virtual

Destructor.

Member Function Documentation

void CglKnapsackCover::setTestedRowIndices ( int  num,
const int *  ind 
)

A method to set which rows should be tested for knapsack covers.

virtual void CglKnapsackCover::generateCuts ( const OsiSolverInterface &  si,
OsiCuts &  cs,
const CglTreeInfo  info = CglTreeInfo() 
)
virtual

Generate knapsack cover cuts for the model of the solver interface, si.

Insert the generated cuts into OsiCut, cs.

Implements CglCutGenerator.

virtual CglCutGenerator* CglKnapsackCover::clone ( ) const
virtual

Clone.

Implements CglCutGenerator.

CglKnapsackCover& CglKnapsackCover::operator= ( const CglKnapsackCover rhs)

Assignment operator.

virtual std::string CglKnapsackCover::generateCpp ( FILE *  fp)
virtual

Create C++ lines to get to current state.

Reimplemented from CglCutGenerator.

virtual void CglKnapsackCover::refreshSolver ( OsiSolverInterface *  solver)
virtual

This can be used to refresh any information.

Reimplemented from CglCutGenerator.

void CglKnapsackCover::setMaxInKnapsack ( int  value)
inline

Set limit on number in knapsack.

Definition at line 62 of file CglKnapsackCover.hpp.

int CglKnapsackCover::getMaxInKnapsack ( ) const
inline

get limit on number in knapsack

Definition at line 65 of file CglKnapsackCover.hpp.

void CglKnapsackCover::switchOffExpensive ( )
inline

Switch off expensive cuts.

Definition at line 68 of file CglKnapsackCover.hpp.

void CglKnapsackCover::switchOnExpensive ( )
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.

Friends And Related Function Documentation

void CglKnapsackCoverUnitTest ( const OsiSolverInterface *  siP,
const std::string  mpdDir 
)
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.


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