6 #ifndef CglKnapsackCover_H
7 #define CglKnapsackCover_H
17 const std::string mpdDir );
99 const double * element);
238 int minimumSize=2,
int maximumSize=100,
bool extendCliques=
false);
272 unsigned int equality:1;
308 const std::string mpdDir );
int numberColumns_
Number of columns.
int findLPMostViolatedMinCover(int nCols, int row, CoinPackedVector &krow, double &b, double *xstar, CoinPackedVector &cover, CoinPackedVector &remainder)
Find the most violate minimum cover by solving the lp-relaxation of the most-violate-min-cover proble...
int numRowsToCheck_
which rows to look at.
void setMaxInKnapsack(int value)
Set limit on number in knapsack.
virtual std::string generateCpp(FILE *fp)
Create C++ lines to get to current state.
int * rowsToCheck_
epsilon
int * zeroFixStart_
Start of zeroFixes cliques for a column in matrix or -1 if not in any clique.
int liftCoverCut(double &b, int nRowElem, CoinPackedVector &cover, CoinPackedVector &remainder, CoinPackedVector &cut)
lift the cover inequality
CglKnapsackCover()
Default constructor.
CliqueEntry * cliqueEntry_
Entries for clique.
int * whichClique_
Clique numbers for one or zero fixes.
int maxInKnapsack_
Maximum in knapsack.
void setTestedRowIndices(int num, const int *ind)
A method to set which rows should be tested for knapsack covers.
int findJohnAndEllisCover(int row, CoinPackedVector &krow, double &b, double *xstar, CoinPackedVector &fracCover, CoinPackedVector &atOnes, CoinPackedVector &remainder)
find a cover using the basic logic found in OSL (w/o SOS)
int numberCliques_
Number of cliques.
int gubifyCut(CoinPackedVector &cut)
For testing gub stuff.
friend void CglKnapsackCoverUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests the methods in the CglKnapsackCover class.
void switchOnExpensive()
Switch on expensive cuts.
CliqueType * cliqueType_
epsilon
double epsilon2_
Tolerance to use for violation - bigger than epsilon_.
Collections of row cuts and column cuts.
int getMaxInKnapsack() const
get limit on number in knapsack
Abstract base class for various sparse vectors.
int * cliqueStart_
Start of each clique.
int findPseudoJohnAndEllisCover(int row, CoinPackedVector &krow, double &b, double *xstar, CoinPackedVector &cover, CoinPackedVector &remainder)
find a cover using a variation of the logic found in OSL (w/o SOS)
bool atOne(int i, unsigned int *array)
void CglKnapsackCoverUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests the methods in the CglKnapsackCover class.
void switchOffExpensive()
Switch off expensive cuts.
int * endFixStart_
End of fixes for a column.
int findExactMostViolatedMinCover(int nCols, int row, CoinPackedVector &krow, double b, double *xstar, CoinPackedVector &cover, CoinPackedVector &remainder)
Find a violated minimal cover from a canonical form knapsack inequality by solving the -most- viol...
int * oneFixStart_
Start of oneFixes cliques for a column in matrix or -1 if not in any clique.
Abstract Base Class for describing an interface to a solver.
Cut Generator Base Class.
int deriveAKnapsack(const OsiSolverInterface &si, OsiCuts &cs, CoinPackedVector &krow, bool treatAsLRow, double &b, int *complement, double *xstar, int rowIndex, int numberElements, const int *index, const double *element)
deriveAKnapsack returns 1 if it is able to derive a (canonical) knapsack inequality in binary variabl...
Knapsack Cover Cut Generator Class.
virtual CglCutGenerator * clone() const
Clone.
virtual void refreshSolver(OsiSolverInterface *solver)
This can be used to refresh any information.
int findGreedyCover(int row, CoinPackedVector &krow, double &b, double *xstar, CoinPackedVector &cover, CoinPackedVector &remainder)
find a minimum cover by a simple greedy approach
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())
Generate knapsack cover cuts for the model of the solver interface, si.
int exactSolveKnapsack(int n, double c, double const *pp, double const *ww, double &z, int *x)
A C-style implementation of the Horowitz-Sahni exact solution procedure for solving knapsack problem...
void seqLiftAndUncomplementAndAdd(int nCols, double *xstar, int *complement, int row, int nRowElem, double &b, CoinPackedVector &cover, CoinPackedVector &remainder, OsiCuts &cs)
sequence-dependent lift, uncomplement and add the resulting cut to the cut set
CglKnapsackCover & operator=(const CglKnapsackCover &rhs)
Assignment operator.
Derived class to pick up probing info.
void liftUpDownAndUncomplementAndAdd(int nCols, double *xstar, int *complement, int row, int nRowElem, double &b, CoinPackedVector &fracCover, CoinPackedVector &atOne, CoinPackedVector &remainder, OsiCuts &cs)
sequence-dependent lift binary variables either up or down, uncomplement and add to the cut set ...
Information about where the cut generator is invoked from.
bool expensiveCuts_
exactKnapsack can be expensive - this switches off some
double * elements_
epsilon
const OsiSolverInterface * solver_
Cliques **** TEMP so can reference from listing.
int liftAndUncomplementAndAdd(double rowub, CoinPackedVector &krow, double &b, int *complement, int row, CoinPackedVector &cover, CoinPackedVector &remainder, OsiCuts &cs)
sequence-independent lift and uncomplement and add the resulting cut to the cut set ...
void deleteCliques()
Delete all clique information.
int createCliques(OsiSolverInterface &si, int minimumSize=2, int maximumSize=100, bool extendCliques=false)
Creates cliques for use by probing.
virtual ~CglKnapsackCover()
Destructor.