14 #ifndef CglFlowCover_H
15 #define CglFlowCover_H
150 const std::string mpdDir );
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,
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");
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",
305 for (
int i = 0; i <
numCols_; ++i) {
306 os <<
"ix: " << i <<
", " <<
vubs_[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 );
All variables are NOT binary and the row sense is NOT 'E'.
double TOLERANCE_
If violation of a cut is greater that this number, the cut is useful.
The row has one binary and 2 or more other types of variables and the row sense is 'E'...
bool firstProcess_
First time preprocessing.
void setVlbs(const CglFlowVLB &vlb, int i)
Set CglFlowVLBs,take over the ownership.
void flipRow(int rowLen, double *coef, double &rhs) const
Transform a row from ">=" to "<=", and vice versa.
Rows can not be classfied into other types and the row sense is 'E'.
This enumerative constant describes the various stati of vars in determining the cover.
void setNumFlowCuts(int fc)
void setVubs(const CglFlowVUB &vub, int i)
Set CglFlowVUBs,take over the ownership.
const CglFlowVUB * getVubs() const
Set CglFlowVUBs,take over the ownership.
void printVubs(std::ostream &os) const
Set CglFlowVUBs,take over the ownership.
The column is a positive binary variable.
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...
The column is a secondary candidate.
double upper_
The index of the associated 0-1 variable.
The column is decided to be in L-.
void setVal(const double v)
CglFlowVUB & operator=(const CglFlowVUB &rhs)
CglFlowColCut
This enumerative constant describes the various stati of vars in a cut or not.
void setMaxNumCuts(int mc)
The column is decided to be in cover.
CglFlowVUB(const CglFlowVUB &source)
void CglFlowCoverUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests the methods in the CglFlowCover class.
friend void CglFlowCoverUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests the methods in the CglFlowCover class.
The row type of this row is NOT defined yet.
void setRowTypes(const CglFlowRowType rt, const int i)
Set rowtypes, take over the ownership.
double INFTY_
Very large number.
Collections of row cuts and column cuts.
Lifed Simple Generalized Flow Cover Cut Generator Class.
void setRowTypes(CglFlowRowType *rt)
Set rowtypes, take over the ownership.
CglFlowVUB()
The Value of the associated upper bound.
void liftMinus(double &movement, int t, int r, double z, double dPrimePrime, double lambda, double ml, double *M, double *rho) const
Lift functions.
int numFlowCuts_
The number flow cuts found.
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 li...
CglFlowColType
This enumerative constant describes the various col types.
virtual std::string generateCpp(FILE *fp)
Create C++ lines to get to current state.
CglFlowRowType * rowTypes_
CglFlowRowType of the rows in model.
int maxNumCuts_
The maximum number of flow cuts to be generated.
int getMaxNumCuts() const
CglFlowCover & operator=(const CglFlowCover &rhs)
Assignment operator.
After the row is flipped to 'L', the row has exactly two variables: one is negative binary and the ot...
CglFlowVUB * vubs_
The array of CglFlowVUBs.
void setVubs(CglFlowVUB *vubs)
Set CglFlowVUBs,take over the ownership.
Abstract Base Class for describing an interface to a solver.
int UNDEFINED_
The variable upper bound of a flow is not indentified yet.
Cut Generator Base Class.
double EPSILON_
Tolerance used for numerical purpose.
const CglFlowVLB * getVlbs() const
Set CglFlowVLBs,take over the ownership.
All variables are NOT binary and the row sense is 'E'.
CglFlowRowType
This enumerative constant describes the various row types.
std::ostream & operator<<(std::ostream &s, const CoinParam ¶m)
A stream output function for a CoinParam object.
bool liftPlus(double &alpha, double &beta, int r, double m_j, double lambda, double y_j, double x_j, double dPrimePrime, double *M) const
CglFlowVUB CglFlowVLB
Variable lower bound class, which is the same as vub.
Error Class thrown by an exception.
The column is a positive continous variable.
bool doneInitPre_
Indicate whether initial flow preprecessing has been done.
CglFlowRowType determineOneRowType(const OsiSolverInterface &si, int rowLen, int *ind, double *coef, char sen, double rhs) const
Determine the type of a given row.
void incNumFlowCuts(int fc=1)
const CglFlowVLB & getVlbs(int i) const
Set CglFlowVLBs,take over the ownership.
After the row is flipped to 'L', the row has exactlytwo variables: one is positive binary and the oth...
const CglFlowRowType * getRowTypes() const
Set rowtypes, take over the ownership.
The row sense is 'E', the row has exactly two variables: one is binary and the other is a continous...
virtual CglCutGenerator * clone() const
Clone.
const CglFlowVUB & getVubs(int i) const
Set CglFlowVUBs,take over the ownership.
virtual ~CglFlowCover()
Destructor.
Variable upper bound class.
CglFlowVLB * vlbs_
The array of CglFlowVLBs.
int numCols_
The number columns of the problem.
All variables are binary.
void setVlbs(CglFlowVLB *vlbs)
Set CglFlowVLBs,take over the ownership.
Information about where the cut generator is invoked from.
The column is in cover now.
The column is NOT in cover.
Rows can not be classfied into other types and the row sense is NOT 'E'.
The row has one binary and 2 or more other types of variables and the row sense is NOT 'E'...
int numRows_
The number rows of the problem.
The column(variable) is a negative binary variable.
CglFlowCover()
Default constructor.
CglFlowRowType getRowType(const int i) const
Set rowtypes, take over the ownership.
void flowPreprocess(const OsiSolverInterface &si)
Do the following tasks:
The column is a negative continous variable.