Go to the documentation of this file.
12 #ifndef CglMixedIntegerRounding2_H
13 #define CglMixedIntegerRounding2_H
19 #include "CoinError.hpp"
22 #include "CoinIndexedVector.hpp"
90 const std::string mpdDir);
130 virtual void generateCuts(
const OsiSolverInterface & si, OsiCuts & cs,
144 const int preproc = -1);
176 throw CoinError(
"Unallowable value. maxaggr must be > 0",
177 "gutsOfConstruct",
"CglMixedIntegerRounding2");
192 if ((criterion >= 1) && (criterion <= 3)) {
196 throw CoinError(
"Unallowable value. criterion must be 1, 2 or 3",
197 "gutsOfConstruct",
"CglMixedIntegerRounding2");
234 const int rowLen,
const int* ind,
235 const double* coef,
const char sense,
236 const double rhs)
const;
241 const double* colUpperBound,
242 const double* colLowerBound,
243 const CoinPackedMatrix& matrixByRow,
249 const double* coefByCol,
251 const CoinBigIndex* colStarts,
256 const int rowSelected,
257 CoinIndexedVector& setRowsAggregated,
258 int* listRowsAggregated,
263 const CoinPackedMatrix& matrixByRow,
264 CoinIndexedVector& rowToAggregate,
265 double& rhsToAggregate)
const;
269 const CoinIndexedVector& rowAggregated,
270 const double* colUpperBound,
271 const double* colLowerBound,
272 const CoinIndexedVector& setRowsAggregated,
273 const double* xlp,
const double* coefByCol,
274 const int* rowInds,
const CoinBigIndex* colStarts,
276 int& colSelected )
const;
281 CoinIndexedVector& rowToAggregate,
double rhs,
282 CoinIndexedVector& rowAggregated,
283 double& rhsAggregated )
const;
290 const double UB)
const;
294 const CoinIndexedVector& rowAggregated,
296 const double* xlpExtra,
297 const double* colUpperBound,
298 const double* colLowerBound,
299 CoinIndexedVector& mixedKnapsack,
300 double& rhsMixedKnapsack,
double& sStar,
301 CoinIndexedVector& contVariablesInS )
const;
305 const CoinPackedMatrix& matrixByRow,
306 const CoinIndexedVector& rowAggregated,
307 const int* listRowsAggregated,
308 const char* sense,
const double* RHS,
311 const double* xlp,
const double sStar,
312 const double* colUpperBound,
313 const double* colLowerBound,
314 const CoinIndexedVector& mixedKnapsack,
315 const double& rhsMixedKnapsack,
316 const CoinIndexedVector& contVariablesInS,
317 CoinIndexedVector * workVector,
318 OsiRowCut& flowCut )
const;
323 const double numeratorBeta,
324 const int *knapsackIndices,
325 const double* knapsackElements,
328 const double* colUpperBound,
329 const CoinIndexedVector& setC,
330 CoinIndexedVector& cMIR,
333 double& violation)
const;
336 inline double functionG(
const double d,
const double f )
const;
340 std::ofstream & fout,
342 const OsiSolverInterface& si,
343 const CoinIndexedVector& rowAggregated,
344 const double& rhsAggregated,
const double* xlp,
345 const double* xlpExtra,
346 const int* listRowsAggregated,
347 const int* listColsSelected,
349 const double* colUpperBound,
350 const double* colLowerBound )
const;
425 const std::string mpdDir);
void generateMirCuts(const OsiSolverInterface &si, const double *xlp, const double *colUpperBound, const double *colLowerBound, const CoinPackedMatrix &matrixByRow, const double *LHS, const double *coefByCol, const int *rowInds, const CoinBigIndex *colStarts, OsiCuts &cs) const
CglMixIntRoundVUB2(const CglMixIntRoundVUB2 &source)
int UNDEFINED_
There is no variable upper bound or variable lower bound defined.
CglMixIntRoundVUB2 CglMixIntRoundVLB2
void setDoPreproc(int value)
Set doPreproc.
@ ROW_VARUB
After the row is flipped to 'L', the row has exactly two variables: one is negative binary and the ot...
Information about where the cut generator is invoked from.
bool isLowerSubst(const double inf, const double aj, const double xlp, const double LB, const double UB) const
bool cMirSeparation(const OsiSolverInterface &si, const CoinPackedMatrix &matrixByRow, const CoinIndexedVector &rowAggregated, const int *listRowsAggregated, const char *sense, const double *RHS, const double *xlp, const double sStar, const double *colUpperBound, const double *colLowerBound, const CoinIndexedVector &mixedKnapsack, const double &rhsMixedKnapsack, const CoinIndexedVector &contVariablesInS, CoinIndexedVector *workVector, OsiRowCut &flowCut) const
int getCRITERION_() const
Get CRITERION_.
void CglMixedIntegerRounding2UnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
CglMixIntRoundVUB2 * vubs_
void mixIntRoundPreprocess(const OsiSolverInterface &si)
bool boundSubstitution(const OsiSolverInterface &si, const CoinIndexedVector &rowAggregated, const double *xlp, const double *xlpExtra, const double *colUpperBound, const double *colLowerBound, CoinIndexedVector &mixedKnapsack, double &rhsMixedKnapsack, double &sStar, CoinIndexedVector &contVariablesInS) const
Mixed Integer Rounding Cut Generator Class.
virtual CglCutGenerator * clone() const
Clone.
virtual ~CglMixedIntegerRounding2()
Destructor.
CglMixIntRoundVLB2 * vlbs_
void printStats(std::ofstream &fout, const bool hasCut, const OsiSolverInterface &si, const CoinIndexedVector &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
Cut Generator Base Class.
CglMixIntRoundVUB2 & operator=(const CglMixIntRoundVUB2 &rhs)
void gutsOfConstruct(const int maxaggr, const bool multiply, const int criterion, const int preproc)
int doPreproc_
Controls the preprocessing of the matrix to identify rows suitable for cut generation.
bool getDoPreproc() const
Get doPreproc.
@ ROW_VAREQ
The row sense is 'E', the row has exactly two variables: one is binary and the other is a continous,...
RowType determineRowType(const int rowLen, const int *ind, const double *coef, const char sense, const double rhs) const
int getMAXAGGR_() const
Get MAXAGGR_.
CglMixedIntegerRounding2 & operator=(const CglMixedIntegerRounding2 &rhs)
Assignment operator.
bool selectRowToAggregate(const CoinIndexedVector &rowAggregated, const double *colUpperBound, const double *colLowerBound, const CoinIndexedVector &setRowsAggregated, const double *xlp, const double *coefByCol, const int *rowInds, const CoinBigIndex *colStarts, int &rowSelected, int &colSelected) const
friend void CglMixedIntegerRounding2UnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())
Generate Mixed Integer Rounding cuts for the model data contained in si.
bool getMULTIPLY_() const
Get MULTIPLY_.
void setMAXAGGR_(int maxaggr)
Set MAXAGGR_.
void copyRowSelected(const int iAggregate, const int rowSelected, CoinIndexedVector &setRowsAggregated, int *listRowsAggregated, double *xlpExtra, const char sen, const double rhs, const double lhs, const CoinPackedMatrix &matrixByRow, CoinIndexedVector &rowToAggregate, double &rhsToAggregate) const
void setVal(const double v)
@ ROW_VARLB
After the row is flipped to 'L', the row has exactly two variables: one is positive binary and the ot...
virtual void refreshSolver(OsiSolverInterface *solver)
This can be used to refresh any inforamtion.
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 CoinIndexedVector &setC, CoinIndexedVector &cMIR, double &rhscMIR, double &sCoef, double &violation) const
double functionG(const double d, const double f) const
void setCRITERION_(int criterion)
Set CRITERION_.
void aggregateRow(const int colSelected, CoinIndexedVector &rowToAggregate, double rhs, CoinIndexedVector &rowAggregated, double &rhsAggregated) const
void gutsOfCopy(const CglMixedIntegerRounding2 &rhs)
virtual std::string generateCpp(FILE *fp)
Create C++ lines to get to current state.
void setMULTIPLY_(bool multiply)
Set MULTIPLY_.
CglMixedIntegerRounding2()
Default constructor.