Go to the documentation of this file.
14 #ifndef CglFlowCover_H
15 #define CglFlowCover_H
19 #include "CoinError.hpp"
150 const std::string mpdDir );
171 virtual void generateCuts(
const OsiSolverInterface & si, OsiCuts & cs,
222 bool generateOneFlowCut(
const OsiSolverInterface & si,
233 void flipRow(
int rowLen,
double* coef,
double& rhs)
const;
236 void flipRow(
int rowLen,
double* coef,
char& sen,
double& rhs)
const;
240 int rowLen,
int* ind,
241 double* coef,
char sen,
244 void liftMinus(
double &movement,
254 bool liftPlus(
double &alpha,
269 {
return rowTypes_; }
271 {
return rowTypes_[i]; }
274 { rowTypes_ = rt; rt = 0; }
279 std::cout <<
"ERROR: Should allocate memory for rowType_ before "
280 <<
"using it " << std::endl;
281 throw CoinError(
"Forgot to allocate memory for rowType_",
282 "setRowType",
"CglFlowCover");
290 inline const CglFlowVUB* getVubs()
const {
return vubs_; }
291 inline const CglFlowVUB& getVubs(
int i)
const {
return vubs_[i]; }
293 inline void setVubs(
CglFlowVUB* vubs) { vubs_ = vubs; vubs = 0; }
294 inline void setVubs(
const CglFlowVUB& vub,
int i) {
298 std::cout <<
"ERROR: Should allocate memory for vubs_ before "
299 <<
"using it " << std::endl;
300 throw CoinError(
"Forgot to allocate memory for vubs_",
"setVubs",
304 inline void printVubs(std::ostream& os)
const {
305 for (
int i = 0; i < numCols_; ++i) {
306 os <<
"ix: " << i <<
", " << vubs_[i];
314 inline const CglFlowVLB* getVlbs()
const {
return vlbs_; }
315 inline const CglFlowVLB& getVlbs(
int i)
const {
return vlbs_[i]; }
317 inline void setVlbs(
CglFlowVLB* vlbs) { vlbs_ = vlbs; vlbs = 0; }
318 inline void setVlbs(
const CglFlowVLB& vlb,
int i) {
322 std::cout <<
"ERROR: Should allocate memory for vlbs_ before "
323 <<
"using it " << std::endl;
324 throw CoinError(
"Forgot to allocate memory for vlbs_",
"setVlbs",
369 const std::string mpdDir );
CglFlowColType
This enumerative constant describes the various col types.
CglFlowVUB(const CglFlowVUB &source)
Information about where the cut generator is invoked from.
After the row is flipped to 'L', the row has exactly two variables: one is negative binary and the ot...
Rows can not be classfied into other types and the row sense is NOT 'E'.
double upper_
The index of the associated 0-1 variable.
The column is a secondary candidate.
virtual std::string generateCpp(FILE *fp)
Create C++ lines to get to current state.
Lifed Simple Generalized Flow Cover Cut Generator Class.
void setVal(const double v)
friend void CglFlowCoverUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests the methods in the CglFlowCover class.
The column is decided to be in cover.
void setMaxNumCuts(int mc)
This enumerative constant describes the various stati of vars in determining the cover.
std::ostream & operator<<(std::ostream &os, const CglFlowVUB &v)
Overloaded operator<< for printing VUB and VLB.
CglFlowColCut
This enumerative constant describes the various stati of vars in a cut or not.
The row sense is 'E', the row has exactly two variables: one is binary and the other is a continous,...
CglFlowVUB & operator=(const CglFlowVUB &rhs)
The column is in cover now.
Cut Generator Base Class.
Variable upper bound class.
CglFlowCover & operator=(const CglFlowCover &rhs)
Assignment operator.
All variables are binary.
All variables are NOT binary and the row sense is NOT 'E'.
The column is a negative continous variable.
void setNumFlowCuts(int fc)
The row has one binary and 2 or more other types of variables and the row sense is 'E'.
CglFlowCover()
Default constructor.
All variables are NOT binary and the row sense is 'E'.
The row has one binary and 2 or more other types of variables and the row sense is NOT 'E'.
int getMaxNumCuts() const
void incNumFlowCuts(int fc=1)
Rows can not be classfied into other types and the row sense is 'E'.
virtual CglCutGenerator * clone() const
Clone.
The row type of this row is NOT defined yet.
virtual ~CglFlowCover()
Destructor.
CglFlowVUB CglFlowVLB
Variable lower bound class, which is the same as vub.
The column is a positive continous variable.
CglFlowRowType
This enumerative constant describes the various row types.
The column is NOT in cover.
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.
void flowPreprocess(const OsiSolverInterface &si)
Do the following tasks:
After the row is flipped to 'L', the row has exactlytwo variables: one is positive binary and the oth...
void CglFlowCoverUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests the methods in the CglFlowCover class.
The column(variable) is a negative binary variable.
The column is a positive binary variable.
The column is decided to be in L-.
CglFlowVUB()
The Value of the associated upper bound.