diff --git a/src/CbcParam.hpp b/src/CbcParam.hpp index d2cd22d9f..e4bcb7db6 100644 --- a/src/CbcParam.hpp +++ b/src/CbcParam.hpp @@ -201,6 +201,7 @@ class CBCLIB_EXPORT CbcParam : public CoinParam { // Integer Parameters FIRSTINTPARAM, + AGGREGATEMIXED, BKPIVOTINGSTRATEGY, BKMAXCALLS, BKCLQEXTMETHOD, diff --git a/src/CbcParamUtils.cpp b/src/CbcParamUtils.cpp index 5d1a97e3c..fe1ae7a51 100644 --- a/src/CbcParamUtils.cpp +++ b/src/CbcParamUtils.cpp @@ -1,4 +1,5 @@ /* + Copyright (C) 2007, Lou Hafer, International Business Machines Corporation and others. All Rights Reserved. @@ -246,6 +247,10 @@ int pushCbcSolverIntParam(CoinParam ¶m) Figure out what we're doing and set the relevant field. */ switch (cbcParamCode) { + case CbcParam::AGGREGATEMIXED: { + parameters->setMixedRoundStrategy(val); + break; + } case CbcParam::BKPIVOTINGSTRATEGY: { parameters->setBkPivotStrategy(val); break; diff --git a/src/CbcParameters.cpp b/src/CbcParameters.cpp index a4a4f883f..8f3239837 100644 --- a/src/CbcParameters.cpp +++ b/src/CbcParameters.cpp @@ -386,6 +386,7 @@ void CbcParameters::setDefaults(int strategy) { parameters_[CbcParam::FAKEINCREMENT]->setDefault(0.0); parameters_[CbcParam::SMALLBAB]->setDefault(0.5); parameters_[CbcParam::TIGHTENFACTOR]->setDefault(0.0); + parameters_[CbcParam::AGGREGATEMIXED]->setDefault(1); parameters_[CbcParam::BKPIVOTINGSTRATEGY]->setDefault(3); parameters_[CbcParam::BKMAXCALLS]->setDefault(1000); parameters_[CbcParam::BKCLQEXTMETHOD]->setDefault(4); @@ -1392,6 +1393,13 @@ void CbcParameters::addCbcSolverIntParams() { getParam(code)->setPushFunc(CbcParamUtils::pushCbcSolverIntParam); } + parameters_[CbcParam::AGGREGATEMIXED]->setup( + "agg!regatelevel", "Level of aggregation used in CglMixedRounding", -1, 5, + "MixedIntegerRounding2 can work on constraints created by aggregating " + "constraints in model. Although the coding for this has been in for " + "some time, it is being modified and the user may wish to play with this. " + "-1 varies the level at various times."); + parameters_[CbcParam::BKPIVOTINGSTRATEGY]->setup( "bkpivot!ing", "Pivoting strategy used in Bron-Kerbosch algorithm", 0, 6); diff --git a/src/CbcParameters.hpp b/src/CbcParameters.hpp index 406484d3f..9ebaf6b50 100644 --- a/src/CbcParameters.hpp +++ b/src/CbcParameters.hpp @@ -1277,6 +1277,14 @@ class CBCLIB_EXPORT CbcParameters { //@{ + /*! \brief Get MixedRoundStrategy setting */ + inline int getMixedRoundStrategy() { return mixedRoundStrategy_; } + + /*! \brief Set MixedRoundStrategy setting */ + inline void setMixedRoundStrategy(int mixedRoundStrategy) { + mixedRoundStrategy_ = mixedRoundStrategy; + } + /*! \brief Get BkPivotStrategy setting */ inline int getBkPivotStrategy() { return bkPivotStrategy_; } @@ -2420,6 +2428,7 @@ class CBCLIB_EXPORT CbcParameters { */ //@{ + int mixedRoundStrategy_; int bkPivotStrategy_; int bkMaxCalls_; int bkClqExtMethod_; diff --git a/src/CbcSolver.cpp b/src/CbcSolver.cpp index bef9d5c70..9be1427d4 100644 --- a/src/CbcSolver.cpp +++ b/src/CbcSolver.cpp @@ -1009,6 +1009,7 @@ void CbcMain0(CbcModel &model, CbcParameters ¶meters) { parameters[CbcParam::ODDWHEELCUTS]->setVal("ifmove"); parameters[CbcParam::CLQSTRENGTHENING]->setVal("after"); parameters[CbcParam::USECGRAPH]->setVal("on"); + parameters[CbcParam::AGGREGATEMIXED]->setVal(1); parameters[CbcParam::BKPIVOTINGSTRATEGY]->setVal(3); parameters[CbcParam::BKMAXCALLS]->setVal(1000); parameters[CbcParam::BKCLQEXTMETHOD]->setVal(4); @@ -1446,6 +1447,7 @@ int CbcMain1(std::deque inputQueue, CbcModel &model, CglMixedIntegerRounding2 mixedGen(1, true, 1); // set default action (0=off,1=on,2=root,3=ifmove) int mixedMode = CbcParameters::CGIfMove; + int mixedRoundStrategy = 1; assert (parameters[CbcParam::MIRCUTS]->modeVal()==mixedMode); mixedGen.setDoPreproc(1); // safer (and better) @@ -2200,6 +2202,8 @@ int CbcMain1(std::deque inputQueue, CbcModel &model, } else if (cbcParamCode == CbcParam::FPUMPTUNE || cbcParamCode == CbcParam::FPUMPTUNE2 || cbcParamCode == CbcParam::FPUMPITS) { pumpChanged = true; + } else if (cbcParamCode == CbcParam::AGGREGATEMIXED) { + mixedRoundStrategy = iValue; } else if (cbcParamCode == CbcParam::BKPIVOTINGSTRATEGY) { bkPivotingStrategy = iValue; } else if (cbcParamCode == CbcParam::BKMAXCALLS) { @@ -6157,6 +6161,8 @@ int CbcMain1(std::deque inputQueue, CbcModel &model, } assert (parameters[CbcParam::MIRCUTS]->modeVal()==mixedMode); if (mixedMode) { + if (mixedRoundStrategy != 1) + mixedGen.setMAXAGGR_(mixedRoundStrategy); babModel_->addCutGenerator(&mixedGen, translate[mixedMode], "MixedIntegerRounding2"); accuracyFlag[numberGenerators] = 2;