12 #ifndef CglMixedIntegerRounding_H 13 #define CglMixedIntegerRounding_H 19 #include "CoinError.hpp" 66 void setVar(
const int v) { var_ = v; }
67 void setVal(
const double v) { val_ = v; }
89 const std::string mpdDir);
129 virtual void generateCuts(
const OsiSolverInterface & si, OsiCuts & cs,
143 const int preproc = -1);
161 virtual void refreshSolver(OsiSolverInterface * solver);
163 virtual std::string generateCpp( FILE * fp);
169 inline void setMAXAGGR_ (
int maxaggr) {
175 throw CoinError(
"Unallowable value. maxaggr must be > 0",
176 "gutsOfConstruct",
"CglMixedIntegerRounding");
191 if ((criterion >= 1) && (criterion <= 3)) {
192 CRITERION_ = criterion;
195 throw CoinError(
"Unallowable value. criterion must be 1, 2 or 3",
196 "gutsOfConstruct",
"CglMixedIntegerRounding");
205 void setDoPreproc(
int value);
207 bool getDoPreproc()
const;
216 void gutsOfConstruct (
const int maxaggr,
231 void mixIntRoundPreprocess(
const OsiSolverInterface& si);
234 RowType determineRowType(
const OsiSolverInterface& si,
235 const int rowLen,
const int* ind,
236 const double* coef,
const char sense,
237 const double rhs)
const;
240 void generateMirCuts(
const OsiSolverInterface& si,
242 const double* colUpperBound,
243 const double* colLowerBound,
244 const CoinPackedMatrix& matrixByRow,
246 const double* coefByRow,
248 const int* rowStarts,
249 const int* rowLengths,
251 const double* coefByCol,
253 const int* colStarts,
254 const int* colLengths,
258 void copyRowSelected(
const int iAggregate,
259 const int rowSelected,
260 std::set<int>& setRowsAggregated,
261 int* listRowsAggregated,
266 const CoinPackedMatrix& matrixByRow,
267 CoinPackedVector& rowToAggregate,
268 double& rhsToAggregate)
const;
271 bool selectRowToAggregate(
const OsiSolverInterface& si,
272 const CoinPackedVector& rowAggregated,
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;
284 void aggregateRow(
const int colSelected,
285 CoinPackedVector& rowToAggregate,
double rhs,
286 CoinPackedVector& rowAggregated,
287 double& rhsAggregated )
const;
290 inline bool isLowerSubst(
const double inf,
294 const double UB)
const;
297 bool boundSubstitution(
const OsiSolverInterface& si,
298 const CoinPackedVector& rowAggregated,
300 const double* xlpExtra,
301 const double* colUpperBound,
302 const double* colLowerBound,
303 CoinPackedVector& mixedKnapsack,
304 double& rhsMixedKnapsack,
double& sStar,
305 CoinPackedVector& contVariablesInS )
const;
308 bool cMirSeparation (
const OsiSolverInterface& si,
309 const CoinPackedMatrix& matrixByRow,
310 const CoinPackedVector& rowAggregated,
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,
319 const CoinPackedVector& mixedKnapsack,
320 const double& rhsMixedKnapsack,
321 const CoinPackedVector& contVariablesInS,
322 OsiRowCut& flowCut )
const;
325 void cMirInequality(
const int numInt,
327 const double numeratorBeta,
328 const int *knapsackIndices,
329 const double* knapsackElements,
332 const double* colUpperBound,
333 const std::set<int>& setC,
334 CoinPackedVector& cMIR,
337 double& violation)
const;
340 inline double functionG(
const double d,
const double f )
const;
344 std::ofstream & fout,
346 const OsiSolverInterface& si,
347 const CoinPackedVector& rowAggregated,
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);
void setMULTIPLY_(bool multiply)
Set MULTIPLY_.
void setCRITERION_(int criterion)
Set CRITERION_.
void setVal(const double v)
Information about where the cut generator is invoked from.
CglMixIntRoundVUB & operator=(const CglMixIntRoundVUB &rhs)
Mixed Integer Rounding Cut Generator Class.
int getCRITERION_() const
Get CRITERION_.
Cut Generator Base Class.
CglMixIntRoundVUB(const CglMixIntRoundVUB &source)
void CglMixedIntegerRoundingUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
bool getMULTIPLY_() const
Get MULTIPLY_.
CglMixIntRoundVUB CglMixIntRoundVLB
int getMAXAGGR_() const
Get MAXAGGR_.