12 #ifndef CglMixedIntegerRounding2_H 13 #define CglMixedIntegerRounding2_H 19 #include "CoinError.hpp" 22 #include "CoinIndexedVector.hpp" 67 void setVar(
const int v) { var_ = v; }
68 void setVal(
const double v) { val_ = v; }
90 const std::string mpdDir);
130 virtual void generateCuts(
const OsiSolverInterface & si, OsiCuts & cs,
144 const int preproc = -1);
162 virtual void refreshSolver(OsiSolverInterface * solver);
164 virtual std::string generateCpp( FILE * fp);
170 inline void setMAXAGGR_ (
int maxaggr) {
176 throw CoinError(
"Unallowable value. maxaggr must be > 0",
177 "gutsOfConstruct",
"CglMixedIntegerRounding2");
192 if ((criterion >= 1) && (criterion <= 3)) {
193 CRITERION_ = criterion;
196 throw CoinError(
"Unallowable value. criterion must be 1, 2 or 3",
197 "gutsOfConstruct",
"CglMixedIntegerRounding2");
205 void setDoPreproc(
int value);
207 bool getDoPreproc()
const;
215 void gutsOfConstruct (
const int maxaggr,
230 void mixIntRoundPreprocess(
const OsiSolverInterface& si);
233 RowType determineRowType(
234 const int rowLen,
const int* ind,
235 const double* coef,
const char sense,
236 const double rhs)
const;
239 void generateMirCuts(
const OsiSolverInterface& si,
241 const double* colUpperBound,
242 const double* colLowerBound,
243 const CoinPackedMatrix& matrixByRow,
249 const double* coefByCol,
251 const int* colStarts,
255 void copyRowSelected(
const int iAggregate,
256 const int rowSelected,
257 CoinIndexedVector& setRowsAggregated,
258 int* listRowsAggregated,
263 const CoinPackedMatrix& matrixByRow,
264 CoinIndexedVector& rowToAggregate,
265 double& rhsToAggregate)
const;
268 bool selectRowToAggregate(
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 int* colStarts,
276 int& colSelected )
const;
280 void aggregateRow(
const int colSelected,
281 CoinIndexedVector& rowToAggregate,
double rhs,
282 CoinIndexedVector& rowAggregated,
283 double& rhsAggregated )
const;
286 inline bool isLowerSubst(
const double inf,
290 const double UB)
const;
293 bool boundSubstitution(
const OsiSolverInterface& si,
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;
304 bool cMirSeparation (
const OsiSolverInterface& si,
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;
321 void cMirInequality(
const int numInt,
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 CglMixedIntegerRounding2UnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
void setMULTIPLY_(bool multiply)
Set MULTIPLY_.
int getCRITERION_() const
Get CRITERION_.
Information about where the cut generator is invoked from.
void setCRITERION_(int criterion)
Set CRITERION_.
int getMAXAGGR_() const
Get MAXAGGR_.
Cut Generator Base Class.
void setVal(const double v)
CglMixIntRoundVUB2(const CglMixIntRoundVUB2 &source)
bool getMULTIPLY_() const
Get MULTIPLY_.
CglMixIntRoundVUB2 & operator=(const CglMixIntRoundVUB2 &rhs)
CglMixIntRoundVUB2 CglMixIntRoundVLB2
Mixed Integer Rounding Cut Generator Class.