12 #ifndef CglMixedIntegerRounding_H
13 #define CglMixedIntegerRounding_H
89 const std::string mpdDir);
143 const int preproc = -1);
175 throw CoinError(
"Unallowable value. maxaggr must be > 0",
176 "gutsOfConstruct",
"CglMixedIntegerRounding");
191 if ((criterion >= 1) && (criterion <= 3)) {
195 throw CoinError(
"Unallowable value. criterion must be 1, 2 or 3",
196 "gutsOfConstruct",
"CglMixedIntegerRounding");
235 const int rowLen,
const int* ind,
236 const double* coef,
const char sense,
237 const double rhs)
const;
242 const double* colUpperBound,
243 const double* colLowerBound,
246 const double* coefByRow,
248 const int* rowStarts,
249 const int* rowLengths,
251 const double* coefByCol,
253 const int* colStarts,
254 const int* colLengths,
259 const int rowSelected,
260 std::set<int>& setRowsAggregated,
261 int* listRowsAggregated,
268 double& rhsToAggregate)
const;
273 const double* colUpperBound,
274 const double* colLowerBound,
275 const std::set<int>& setRowsAggregated,
276 const double* xlp,
const double* coefByCol,
277 const int* rowInds,
const int* colStarts,
278 const int* colLengths,
280 int& colSelected )
const;
287 double& rhsAggregated )
const;
294 const double UB)
const;
300 const double* xlpExtra,
301 const double* colUpperBound,
302 const double* colLowerBound,
304 double& rhsMixedKnapsack,
double& sStar,
311 const int* listRowsAggregated,
312 const char* sense,
const double*
RHS,
316 const double* xlp,
const double sStar,
317 const double* colUpperBound,
318 const double* colLowerBound,
320 const double& rhsMixedKnapsack,
327 const double numeratorBeta,
328 const int *knapsackIndices,
329 const double* knapsackElements,
332 const double* colUpperBound,
333 const std::set<int>& setC,
337 double& violation)
const;
340 inline double functionG(
const double d,
const double f )
const;
344 std::ofstream & fout,
348 const double& rhsAggregated,
const double* xlp,
349 const double* xlpExtra,
350 const int* listRowsAggregated,
351 const int* listColsSelected,
353 const double* colUpperBound,
354 const double* colLowerBound )
const;
427 const std::string mpdDir);
CglMixIntRoundVUB(const CglMixIntRoundVUB &source)
RowType determineRowType(const OsiSolverInterface &si, const int rowLen, const int *ind, const double *coef, const char sense, const double rhs) const
int getMAXAGGR_() const
Get MAXAGGR_.
void generateMirCuts(const OsiSolverInterface &si, const double *xlp, const double *colUpperBound, const double *colLowerBound, const CoinPackedMatrix &matrixByRow, const double *LHS, const double *coefByRow, const int *colInds, const int *rowStarts, const int *rowLengths, const double *coefByCol, const int *rowInds, const int *colStarts, const int *colLengths, OsiCuts &cs) const
void aggregateRow(const int colSelected, CoinPackedVector &rowToAggregate, double rhs, CoinPackedVector &rowAggregated, double &rhsAggregated) const
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())
Generate Mixed Integer Rounding cuts for the model data contained in si.
void setMAXAGGR_(int maxaggr)
Set MAXAGGR_.
CglMixIntRoundVUB & operator=(const CglMixIntRoundVUB &rhs)
Mixed Integer Rounding Cut Generator Class.
After the row is flipped to 'L', the row has exactly two variables: one is positive binary and the ot...
Sparse Matrix Base Class.
void setMULTIPLY_(bool multiply)
Set MULTIPLY_.
Collections of row cuts and column cuts.
void cMirInequality(const int numInt, const double delta, const double numeratorBeta, const int *knapsackIndices, const double *knapsackElements, const double *xlp, const double sStar, const double *colUpperBound, const std::set< int > &setC, CoinPackedVector &cMIR, double &rhscMIR, double &sCoef, double &violation) const
#define RHS(cust_num, weight, capacity)
int doPreproc_
Controls the preprocessing of the matrix to identify rows suitable for cut generation.
void printStats(std::ofstream &fout, const bool hasCut, const OsiSolverInterface &si, const CoinPackedVector &rowAggregated, const double &rhsAggregated, const double *xlp, const double *xlpExtra, const int *listRowsAggregated, const int *listColsSelected, const int level, const double *colUpperBound, const double *colLowerBound) const
bool boundSubstitution(const OsiSolverInterface &si, const CoinPackedVector &rowAggregated, const double *xlp, const double *xlpExtra, const double *colUpperBound, const double *colLowerBound, CoinPackedVector &mixedKnapsack, double &rhsMixedKnapsack, double &sStar, CoinPackedVector &contVariablesInS) const
virtual CglCutGenerator * clone() const
Clone.
CglMixIntRoundVUB CglMixIntRoundVLB
void mixIntRoundPreprocess(const OsiSolverInterface &si)
virtual ~CglMixedIntegerRounding()
Destructor.
bool cMirSeparation(const OsiSolverInterface &si, const CoinPackedMatrix &matrixByRow, const CoinPackedVector &rowAggregated, const int *listRowsAggregated, const char *sense, const double *RHS, const double *xlp, const double sStar, const double *colUpperBound, const double *colLowerBound, const CoinPackedVector &mixedKnapsack, const double &rhsMixedKnapsack, const CoinPackedVector &contVariablesInS, OsiRowCut &flowCut) const
void copyRowSelected(const int iAggregate, const int rowSelected, std::set< int > &setRowsAggregated, int *listRowsAggregated, double *xlpExtra, const char sen, const double rhs, const double lhs, const CoinPackedMatrix &matrixByRow, CoinPackedVector &rowToAggregate, double &rhsToAggregate) const
int getCRITERION_() const
Get CRITERION_.
virtual std::string generateCpp(FILE *fp)
Create C++ lines to get to current state.
The row sense is 'E', the row has exactly two variables: one is binary and the other is a continous...
Abstract Base Class for describing an interface to a solver.
bool isLowerSubst(const double inf, const double aj, const double xlp, const double LB, const double UB) const
Cut Generator Base Class.
virtual void refreshSolver(OsiSolverInterface *solver)
This can be used to refresh any inforamtion.
void gutsOfCopy(const CglMixedIntegerRounding &rhs)
bool getDoPreproc() const
Get doPreproc.
CglMixIntRoundVUB * vubs_
Error Class thrown by an exception.
void setDoPreproc(int value)
Set doPreproc.
CglMixIntRoundVLB * vlbs_
int UNDEFINED_
There is no variable upper bound or variable lower bound defined.
double functionG(const double d, const double f) const
CglMixedIntegerRounding()
Default constructor.
void setCRITERION_(int criterion)
Set CRITERION_.
bool selectRowToAggregate(const OsiSolverInterface &si, const CoinPackedVector &rowAggregated, const double *colUpperBound, const double *colLowerBound, const std::set< int > &setRowsAggregated, const double *xlp, const double *coefByCol, const int *rowInds, const int *colStarts, const int *colLengths, int &rowSelected, int &colSelected) const
friend void CglMixedIntegerRoundingUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
Information about where the cut generator is invoked from.
void CglMixedIntegerRoundingUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
bool getMULTIPLY_() const
Get MULTIPLY_.
void gutsOfConstruct(const int maxaggr, const bool multiply, const int criterion, const int preproc)
After the row is flipped to 'L', the row has exactly two variables: one is negative binary and the ot...
void setVal(const double v)
CglMixedIntegerRounding & operator=(const CglMixedIntegerRounding &rhs)
Assignment operator.