ruby-cbc 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.md +203 -0
- data/Rakefile +40 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/ext/ruby-cbc/cbc.i +15 -0
- data/ext/ruby-cbc/cbc_wrap.c +4618 -0
- data/ext/ruby-cbc/extconf.rb +60 -0
- data/ext/ruby-cbc/install/bin/cbc +0 -0
- data/ext/ruby-cbc/install/bin/clp +0 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchActual.hpp +24 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchAllDifferent.hpp +62 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchBase.hpp +78 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchCut.hpp +183 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchDecision.hpp +129 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchDefaultDecision.hpp +100 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchDynamic.hpp +206 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchLotsize.hpp +242 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchToFixLots.hpp +94 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchingObject.hpp +236 -0
- data/ext/ruby-cbc/install/include/coin/CbcClique.hpp +303 -0
- data/ext/ruby-cbc/install/include/coin/CbcCompare.hpp +39 -0
- data/ext/ruby-cbc/install/include/coin/CbcCompareActual.hpp +14 -0
- data/ext/ruby-cbc/install/include/coin/CbcCompareBase.hpp +142 -0
- data/ext/ruby-cbc/install/include/coin/CbcCompareDefault.hpp +120 -0
- data/ext/ruby-cbc/install/include/coin/CbcCompareDepth.hpp +47 -0
- data/ext/ruby-cbc/install/include/coin/CbcCompareEstimate.hpp +48 -0
- data/ext/ruby-cbc/install/include/coin/CbcCompareObjective.hpp +49 -0
- data/ext/ruby-cbc/install/include/coin/CbcConfig.h +14 -0
- data/ext/ruby-cbc/install/include/coin/CbcConsequence.hpp +49 -0
- data/ext/ruby-cbc/install/include/coin/CbcCountRowCut.hpp +168 -0
- data/ext/ruby-cbc/install/include/coin/CbcCutGenerator.hpp +482 -0
- data/ext/ruby-cbc/install/include/coin/CbcCutModifier.hpp +57 -0
- data/ext/ruby-cbc/install/include/coin/CbcCutSubsetModifier.hpp +66 -0
- data/ext/ruby-cbc/install/include/coin/CbcDummyBranchingObject.hpp +83 -0
- data/ext/ruby-cbc/install/include/coin/CbcEventHandler.hpp +245 -0
- data/ext/ruby-cbc/install/include/coin/CbcFathom.hpp +137 -0
- data/ext/ruby-cbc/install/include/coin/CbcFathomDynamicProgramming.hpp +169 -0
- data/ext/ruby-cbc/install/include/coin/CbcFeasibilityBase.hpp +56 -0
- data/ext/ruby-cbc/install/include/coin/CbcFixVariable.hpp +67 -0
- data/ext/ruby-cbc/install/include/coin/CbcFollowOn.hpp +207 -0
- data/ext/ruby-cbc/install/include/coin/CbcFullNodeInfo.hpp +161 -0
- data/ext/ruby-cbc/install/include/coin/CbcGeneral.hpp +60 -0
- data/ext/ruby-cbc/install/include/coin/CbcGeneralDepth.hpp +279 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristic.hpp +682 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDINS.hpp +96 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDW.hpp +309 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDive.hpp +192 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveCoefficient.hpp +52 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveFractional.hpp +52 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveGuided.hpp +55 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveLineSearch.hpp +52 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDivePseudoCost.hpp +60 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveVectorLength.hpp +52 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicFPump.hpp +340 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicGreedy.hpp +280 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicLocal.hpp +271 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicPivotAndFix.hpp +58 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicRENS.hpp +77 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicRINS.hpp +102 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicRandRound.hpp +58 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicVND.hpp +94 -0
- data/ext/ruby-cbc/install/include/coin/CbcLinked.hpp +1406 -0
- data/ext/ruby-cbc/install/include/coin/CbcMessage.hpp +94 -0
- data/ext/ruby-cbc/install/include/coin/CbcMipStartIO.hpp +26 -0
- data/ext/ruby-cbc/install/include/coin/CbcModel.hpp +2952 -0
- data/ext/ruby-cbc/install/include/coin/CbcNWay.hpp +166 -0
- data/ext/ruby-cbc/install/include/coin/CbcNode.hpp +351 -0
- data/ext/ruby-cbc/install/include/coin/CbcNodeInfo.hpp +349 -0
- data/ext/ruby-cbc/install/include/coin/CbcObject.hpp +272 -0
- data/ext/ruby-cbc/install/include/coin/CbcObjectUpdateData.hpp +64 -0
- data/ext/ruby-cbc/install/include/coin/CbcOrClpParam.cpp +4134 -0
- data/ext/ruby-cbc/install/include/coin/CbcOrClpParam.hpp +532 -0
- data/ext/ruby-cbc/install/include/coin/CbcParam.hpp +324 -0
- data/ext/ruby-cbc/install/include/coin/CbcPartialNodeInfo.hpp +110 -0
- data/ext/ruby-cbc/install/include/coin/CbcSOS.hpp +279 -0
- data/ext/ruby-cbc/install/include/coin/CbcSimpleInteger.hpp +286 -0
- data/ext/ruby-cbc/install/include/coin/CbcSimpleIntegerDynamicPseudoCost.hpp +564 -0
- data/ext/ruby-cbc/install/include/coin/CbcSimpleIntegerPseudoCost.hpp +114 -0
- data/ext/ruby-cbc/install/include/coin/CbcSolver.hpp +447 -0
- data/ext/ruby-cbc/install/include/coin/CbcStrategy.hpp +258 -0
- data/ext/ruby-cbc/install/include/coin/CbcSubProblem.hpp +83 -0
- data/ext/ruby-cbc/install/include/coin/CbcTree.hpp +490 -0
- data/ext/ruby-cbc/install/include/coin/CbcTreeLocal.hpp +372 -0
- data/ext/ruby-cbc/install/include/coin/Cbc_C_Interface.h +381 -0
- data/ext/ruby-cbc/install/include/coin/Cgl012cut.hpp +464 -0
- data/ext/ruby-cbc/install/include/coin/CglAllDifferent.hpp +115 -0
- data/ext/ruby-cbc/install/include/coin/CglClique.hpp +308 -0
- data/ext/ruby-cbc/install/include/coin/CglConfig.h +19 -0
- data/ext/ruby-cbc/install/include/coin/CglCutGenerator.hpp +121 -0
- data/ext/ruby-cbc/install/include/coin/CglDuplicateRow.hpp +189 -0
- data/ext/ruby-cbc/install/include/coin/CglFlowCover.hpp +371 -0
- data/ext/ruby-cbc/install/include/coin/CglGMI.hpp +364 -0
- data/ext/ruby-cbc/install/include/coin/CglGMIParam.hpp +313 -0
- data/ext/ruby-cbc/install/include/coin/CglGomory.hpp +204 -0
- data/ext/ruby-cbc/install/include/coin/CglKnapsackCover.hpp +310 -0
- data/ext/ruby-cbc/install/include/coin/CglLandP.hpp +306 -0
- data/ext/ruby-cbc/install/include/coin/CglLandPValidator.hpp +130 -0
- data/ext/ruby-cbc/install/include/coin/CglLiftAndProject.hpp +104 -0
- data/ext/ruby-cbc/install/include/coin/CglMessage.hpp +50 -0
- data/ext/ruby-cbc/install/include/coin/CglMixedIntegerRounding.hpp +429 -0
- data/ext/ruby-cbc/install/include/coin/CglMixedIntegerRounding2.hpp +427 -0
- data/ext/ruby-cbc/install/include/coin/CglOddHole.hpp +160 -0
- data/ext/ruby-cbc/install/include/coin/CglParam.hpp +93 -0
- data/ext/ruby-cbc/install/include/coin/CglPreProcess.hpp +492 -0
- data/ext/ruby-cbc/install/include/coin/CglProbing.hpp +543 -0
- data/ext/ruby-cbc/install/include/coin/CglRedSplit.hpp +448 -0
- data/ext/ruby-cbc/install/include/coin/CglRedSplit2.hpp +494 -0
- data/ext/ruby-cbc/install/include/coin/CglRedSplit2Param.hpp +495 -0
- data/ext/ruby-cbc/install/include/coin/CglRedSplitParam.hpp +272 -0
- data/ext/ruby-cbc/install/include/coin/CglResidualCapacity.hpp +240 -0
- data/ext/ruby-cbc/install/include/coin/CglSimpleRounding.hpp +174 -0
- data/ext/ruby-cbc/install/include/coin/CglStored.hpp +125 -0
- data/ext/ruby-cbc/install/include/coin/CglTreeInfo.hpp +180 -0
- data/ext/ruby-cbc/install/include/coin/CglTwomir.hpp +565 -0
- data/ext/ruby-cbc/install/include/coin/CglZeroHalf.hpp +133 -0
- data/ext/ruby-cbc/install/include/coin/ClpAmplObjective.hpp +113 -0
- data/ext/ruby-cbc/install/include/coin/ClpCholeskyBase.hpp +294 -0
- data/ext/ruby-cbc/install/include/coin/ClpCholeskyDense.hpp +162 -0
- data/ext/ruby-cbc/install/include/coin/ClpConfig.h +17 -0
- data/ext/ruby-cbc/install/include/coin/ClpConstraint.hpp +125 -0
- data/ext/ruby-cbc/install/include/coin/ClpConstraintAmpl.hpp +108 -0
- data/ext/ruby-cbc/install/include/coin/ClpConstraintLinear.hpp +110 -0
- data/ext/ruby-cbc/install/include/coin/ClpConstraintQuadratic.hpp +119 -0
- data/ext/ruby-cbc/install/include/coin/ClpDualRowDantzig.hpp +71 -0
- data/ext/ruby-cbc/install/include/coin/ClpDualRowPivot.hpp +129 -0
- data/ext/ruby-cbc/install/include/coin/ClpDualRowSteepest.hpp +153 -0
- data/ext/ruby-cbc/install/include/coin/ClpDummyMatrix.hpp +183 -0
- data/ext/ruby-cbc/install/include/coin/ClpDynamicExampleMatrix.hpp +186 -0
- data/ext/ruby-cbc/install/include/coin/ClpDynamicMatrix.hpp +381 -0
- data/ext/ruby-cbc/install/include/coin/ClpEventHandler.hpp +187 -0
- data/ext/ruby-cbc/install/include/coin/ClpFactorization.hpp +432 -0
- data/ext/ruby-cbc/install/include/coin/ClpGubDynamicMatrix.hpp +247 -0
- data/ext/ruby-cbc/install/include/coin/ClpGubMatrix.hpp +358 -0
- data/ext/ruby-cbc/install/include/coin/ClpInterior.hpp +570 -0
- data/ext/ruby-cbc/install/include/coin/ClpLinearObjective.hpp +103 -0
- data/ext/ruby-cbc/install/include/coin/ClpMatrixBase.hpp +524 -0
- data/ext/ruby-cbc/install/include/coin/ClpMessage.hpp +131 -0
- data/ext/ruby-cbc/install/include/coin/ClpModel.hpp +1307 -0
- data/ext/ruby-cbc/install/include/coin/ClpNetworkMatrix.hpp +229 -0
- data/ext/ruby-cbc/install/include/coin/ClpNode.hpp +349 -0
- data/ext/ruby-cbc/install/include/coin/ClpNonLinearCost.hpp +401 -0
- data/ext/ruby-cbc/install/include/coin/ClpObjective.hpp +134 -0
- data/ext/ruby-cbc/install/include/coin/ClpPackedMatrix.hpp +638 -0
- data/ext/ruby-cbc/install/include/coin/ClpParameters.hpp +126 -0
- data/ext/ruby-cbc/install/include/coin/ClpPdcoBase.hpp +103 -0
- data/ext/ruby-cbc/install/include/coin/ClpPlusMinusOneMatrix.hpp +290 -0
- data/ext/ruby-cbc/install/include/coin/ClpPresolve.hpp +299 -0
- data/ext/ruby-cbc/install/include/coin/ClpPrimalColumnDantzig.hpp +72 -0
- data/ext/ruby-cbc/install/include/coin/ClpPrimalColumnPivot.hpp +155 -0
- data/ext/ruby-cbc/install/include/coin/ClpPrimalColumnSteepest.hpp +247 -0
- data/ext/ruby-cbc/install/include/coin/ClpQuadraticObjective.hpp +155 -0
- data/ext/ruby-cbc/install/include/coin/ClpSimplex.hpp +1797 -0
- data/ext/ruby-cbc/install/include/coin/ClpSimplexDual.hpp +300 -0
- data/ext/ruby-cbc/install/include/coin/ClpSimplexNonlinear.hpp +117 -0
- data/ext/ruby-cbc/install/include/coin/ClpSimplexOther.hpp +277 -0
- data/ext/ruby-cbc/install/include/coin/ClpSimplexPrimal.hpp +244 -0
- data/ext/ruby-cbc/install/include/coin/ClpSolve.hpp +446 -0
- data/ext/ruby-cbc/install/include/coin/Clp_C_Interface.h +525 -0
- data/ext/ruby-cbc/install/include/coin/CoinAlloc.hpp +176 -0
- data/ext/ruby-cbc/install/include/coin/CoinBuild.hpp +149 -0
- data/ext/ruby-cbc/install/include/coin/CoinDenseFactorization.hpp +419 -0
- data/ext/ruby-cbc/install/include/coin/CoinDenseVector.hpp +383 -0
- data/ext/ruby-cbc/install/include/coin/CoinDistance.hpp +48 -0
- data/ext/ruby-cbc/install/include/coin/CoinError.hpp +257 -0
- data/ext/ruby-cbc/install/include/coin/CoinFactorization.hpp +2044 -0
- data/ext/ruby-cbc/install/include/coin/CoinFileIO.hpp +166 -0
- data/ext/ruby-cbc/install/include/coin/CoinFinite.hpp +34 -0
- data/ext/ruby-cbc/install/include/coin/CoinFloatEqual.hpp +177 -0
- data/ext/ruby-cbc/install/include/coin/CoinHelperFunctions.hpp +1111 -0
- data/ext/ruby-cbc/install/include/coin/CoinIndexedVector.hpp +1164 -0
- data/ext/ruby-cbc/install/include/coin/CoinLpIO.hpp +805 -0
- data/ext/ruby-cbc/install/include/coin/CoinMessage.hpp +96 -0
- data/ext/ruby-cbc/install/include/coin/CoinMessageHandler.hpp +666 -0
- data/ext/ruby-cbc/install/include/coin/CoinModel.hpp +1054 -0
- data/ext/ruby-cbc/install/include/coin/CoinModelUseful.hpp +441 -0
- data/ext/ruby-cbc/install/include/coin/CoinMpsIO.hpp +1056 -0
- data/ext/ruby-cbc/install/include/coin/CoinOslFactorization.hpp +280 -0
- data/ext/ruby-cbc/install/include/coin/CoinPackedMatrix.hpp +947 -0
- data/ext/ruby-cbc/install/include/coin/CoinPackedVector.hpp +657 -0
- data/ext/ruby-cbc/install/include/coin/CoinPackedVectorBase.hpp +269 -0
- data/ext/ruby-cbc/install/include/coin/CoinParam.hpp +644 -0
- data/ext/ruby-cbc/install/include/coin/CoinPragma.hpp +26 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveDoubleton.hpp +73 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveDual.hpp +85 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveDupcol.hpp +226 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveEmpty.hpp +116 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveFixed.hpp +181 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveForcing.hpp +61 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveImpliedFree.hpp +60 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveIsolated.hpp +51 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveMatrix.hpp +1842 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveMonitor.hpp +105 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolvePsdebug.hpp +166 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveSingleton.hpp +112 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveSubst.hpp +101 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveTighten.hpp +55 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveTripleton.hpp +66 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveUseless.hpp +63 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveZeros.hpp +60 -0
- data/ext/ruby-cbc/install/include/coin/CoinRational.hpp +44 -0
- data/ext/ruby-cbc/install/include/coin/CoinSearchTree.hpp +465 -0
- data/ext/ruby-cbc/install/include/coin/CoinShallowPackedVector.hpp +148 -0
- data/ext/ruby-cbc/install/include/coin/CoinSignal.hpp +117 -0
- data/ext/ruby-cbc/install/include/coin/CoinSimpFactorization.hpp +431 -0
- data/ext/ruby-cbc/install/include/coin/CoinSmartPtr.hpp +528 -0
- data/ext/ruby-cbc/install/include/coin/CoinSnapshot.hpp +476 -0
- data/ext/ruby-cbc/install/include/coin/CoinSort.hpp +678 -0
- data/ext/ruby-cbc/install/include/coin/CoinStructuredModel.hpp +247 -0
- data/ext/ruby-cbc/install/include/coin/CoinTime.hpp +310 -0
- data/ext/ruby-cbc/install/include/coin/CoinTypes.hpp +64 -0
- data/ext/ruby-cbc/install/include/coin/CoinUtility.hpp +19 -0
- data/ext/ruby-cbc/install/include/coin/CoinUtilsConfig.h +34 -0
- data/ext/ruby-cbc/install/include/coin/CoinWarmStart.hpp +58 -0
- data/ext/ruby-cbc/install/include/coin/CoinWarmStartBasis.hpp +456 -0
- data/ext/ruby-cbc/install/include/coin/CoinWarmStartDual.hpp +166 -0
- data/ext/ruby-cbc/install/include/coin/CoinWarmStartPrimalDual.hpp +211 -0
- data/ext/ruby-cbc/install/include/coin/CoinWarmStartVector.hpp +488 -0
- data/ext/ruby-cbc/install/include/coin/Coin_C_defines.h +115 -0
- data/ext/ruby-cbc/install/include/coin/Idiot.hpp +298 -0
- data/ext/ruby-cbc/install/include/coin/OsiAuxInfo.hpp +206 -0
- data/ext/ruby-cbc/install/include/coin/OsiBranchingObject.hpp +1005 -0
- data/ext/ruby-cbc/install/include/coin/OsiCbcSolverInterface.hpp +764 -0
- data/ext/ruby-cbc/install/include/coin/OsiChooseVariable.hpp +534 -0
- data/ext/ruby-cbc/install/include/coin/OsiClpSolverInterface.hpp +1509 -0
- data/ext/ruby-cbc/install/include/coin/OsiColCut.hpp +324 -0
- data/ext/ruby-cbc/install/include/coin/OsiCollections.hpp +35 -0
- data/ext/ruby-cbc/install/include/coin/OsiConfig.h +19 -0
- data/ext/ruby-cbc/install/include/coin/OsiCut.hpp +245 -0
- data/ext/ruby-cbc/install/include/coin/OsiCuts.hpp +474 -0
- data/ext/ruby-cbc/install/include/coin/OsiPresolve.hpp +252 -0
- data/ext/ruby-cbc/install/include/coin/OsiRowCut.hpp +331 -0
- data/ext/ruby-cbc/install/include/coin/OsiRowCutDebugger.hpp +187 -0
- data/ext/ruby-cbc/install/include/coin/OsiSolverBranch.hpp +152 -0
- data/ext/ruby-cbc/install/include/coin/OsiSolverInterface.hpp +2143 -0
- data/ext/ruby-cbc/install/include/coin/OsiSolverParameters.hpp +142 -0
- data/ext/ruby-cbc/install/include/coin/OsiUnitTests.hpp +374 -0
- data/ext/ruby-cbc/install/lib/libCbc.la +35 -0
- data/ext/ruby-cbc/install/lib/libCbc.so +0 -0
- data/ext/ruby-cbc/install/lib/libCbc.so.3 +0 -0
- data/ext/ruby-cbc/install/lib/libCbc.so.3.9.7 +0 -0
- data/ext/ruby-cbc/install/lib/libCbcSolver.la +35 -0
- data/ext/ruby-cbc/install/lib/libCbcSolver.so +0 -0
- data/ext/ruby-cbc/install/lib/libCbcSolver.so.3 +0 -0
- data/ext/ruby-cbc/install/lib/libCbcSolver.so.3.9.7 +0 -0
- data/ext/ruby-cbc/install/lib/libCgl.la +35 -0
- data/ext/ruby-cbc/install/lib/libCgl.so +0 -0
- data/ext/ruby-cbc/install/lib/libCgl.so.1 +0 -0
- data/ext/ruby-cbc/install/lib/libCgl.so.1.9.7 +0 -0
- data/ext/ruby-cbc/install/lib/libClp.la +35 -0
- data/ext/ruby-cbc/install/lib/libClp.so +0 -0
- data/ext/ruby-cbc/install/lib/libClp.so.1 +0 -0
- data/ext/ruby-cbc/install/lib/libClp.so.1.13.9 +0 -0
- data/ext/ruby-cbc/install/lib/libClpSolver.la +35 -0
- data/ext/ruby-cbc/install/lib/libClpSolver.so +0 -0
- data/ext/ruby-cbc/install/lib/libClpSolver.so.1 +0 -0
- data/ext/ruby-cbc/install/lib/libClpSolver.so.1.13.9 +0 -0
- data/ext/ruby-cbc/install/lib/libCoinUtils.la +35 -0
- data/ext/ruby-cbc/install/lib/libCoinUtils.so +0 -0
- data/ext/ruby-cbc/install/lib/libCoinUtils.so.3 +0 -0
- data/ext/ruby-cbc/install/lib/libCoinUtils.so.3.10.11 +0 -0
- data/ext/ruby-cbc/install/lib/libOsi.la +35 -0
- data/ext/ruby-cbc/install/lib/libOsi.so +0 -0
- data/ext/ruby-cbc/install/lib/libOsi.so.1 +0 -0
- data/ext/ruby-cbc/install/lib/libOsi.so.1.12.6 +0 -0
- data/ext/ruby-cbc/install/lib/libOsiCbc.la +35 -0
- data/ext/ruby-cbc/install/lib/libOsiCbc.so +0 -0
- data/ext/ruby-cbc/install/lib/libOsiCbc.so.3 +0 -0
- data/ext/ruby-cbc/install/lib/libOsiCbc.so.3.9.7 +0 -0
- data/ext/ruby-cbc/install/lib/libOsiClp.la +35 -0
- data/ext/ruby-cbc/install/lib/libOsiClp.so +0 -0
- data/ext/ruby-cbc/install/lib/libOsiClp.so.1 +0 -0
- data/ext/ruby-cbc/install/lib/libOsiClp.so.1.13.9 +0 -0
- data/ext/ruby-cbc/install/lib/libOsiCommonTests.la +35 -0
- data/ext/ruby-cbc/install/lib/libOsiCommonTests.so +0 -0
- data/ext/ruby-cbc/install/lib/libOsiCommonTests.so.1 +0 -0
- data/ext/ruby-cbc/install/lib/libOsiCommonTests.so.1.12.6 +0 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/cbc.pc +12 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/cgl.pc +12 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/clp.pc +12 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/coindatamiplib3.pc +9 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/coindatasample.pc +9 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/coinutils.pc +12 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/osi-cbc.pc +12 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/osi-clp.pc +12 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/osi-unittests.pc +12 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/osi.pc +12 -0
- data/lib/ruby-cbc/ilp/constant.rb +44 -0
- data/lib/ruby-cbc/ilp/constraint.rb +32 -0
- data/lib/ruby-cbc/ilp/objective.rb +26 -0
- data/lib/ruby-cbc/ilp/term.rb +47 -0
- data/lib/ruby-cbc/ilp/term_array.rb +80 -0
- data/lib/ruby-cbc/ilp/var.rb +62 -0
- data/lib/ruby-cbc/model.rb +125 -0
- data/lib/ruby-cbc/problem.rb +170 -0
- data/lib/ruby-cbc/version.rb +3 -0
- data/lib/ruby-cbc.rb +21 -0
- data/ruby-cbc.gemspec +36 -0
- metadata +431 -0
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
/* $Id: CbcSolver.hpp 1998 2013-12-19 18:11:05Z forrest $ */
|
|
2
|
+
// Copyright (C) 2007, International Business Machines
|
|
3
|
+
// Corporation and others. All Rights Reserved.
|
|
4
|
+
// This code is licensed under the terms of the Eclipse Public License (EPL).
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/*! \file CbcSolver.hpp
|
|
8
|
+
\brief Defines CbcSolver, the proposed top-level class for the new-style
|
|
9
|
+
cbc solver.
|
|
10
|
+
|
|
11
|
+
This class is currently an orphan. With the removal of all code flagged
|
|
12
|
+
with the NEW_STYLE_SOLVER, this class is never instantiated (and cannot
|
|
13
|
+
be instantiated). It is available to be coopted as a top-level object
|
|
14
|
+
wrapping the current CbcMain0 and CbcMain1, should that appear to be a
|
|
15
|
+
desireable path forward. -- lh, 091211 --
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
#ifndef CbcSolver_H
|
|
19
|
+
#define CbcSolver_H
|
|
20
|
+
|
|
21
|
+
#include <string>
|
|
22
|
+
#include <vector>
|
|
23
|
+
#include "CoinMessageHandler.hpp"
|
|
24
|
+
#include "OsiClpSolverInterface.hpp"
|
|
25
|
+
|
|
26
|
+
#if CBC_OTHER_SOLVER==1
|
|
27
|
+
#include "OsiCpxSolverInterface.hpp"
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
#include "CbcModel.hpp"
|
|
31
|
+
#include "CbcOrClpParam.hpp"
|
|
32
|
+
|
|
33
|
+
class CbcUser;
|
|
34
|
+
class CbcStopNow;
|
|
35
|
+
class CglCutGenerator;
|
|
36
|
+
|
|
37
|
+
//#############################################################################
|
|
38
|
+
|
|
39
|
+
/*! \brief This allows the use of the standalone solver in a flexible manner.
|
|
40
|
+
|
|
41
|
+
It has an original OsiClpSolverInterface and CbcModel which it can use
|
|
42
|
+
repeatedly, e.g., to get a heuristic solution and then start again.
|
|
43
|
+
|
|
44
|
+
So I [jjf] will need a primitive scripting language which can then call
|
|
45
|
+
solve and manipulate solution value and solution arrays.
|
|
46
|
+
|
|
47
|
+
Also provides for user callback functions. Currently two ideas in
|
|
48
|
+
gestation, CbcUser and CbcStopNow. The latter seems limited to deciding
|
|
49
|
+
whether or not to stop. The former seems completely general, with a notion
|
|
50
|
+
of importing and exporting, and a `solve', which should be interpreted as
|
|
51
|
+
`do whatever this user function does'.
|
|
52
|
+
|
|
53
|
+
Parameter initialisation is at last centralised in fillParameters().
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
class CbcSolver {
|
|
57
|
+
|
|
58
|
+
public:
|
|
59
|
+
///@name Solve method
|
|
60
|
+
//@{
|
|
61
|
+
/** This takes a list of commands, does "stuff" and returns
|
|
62
|
+
returnMode -
|
|
63
|
+
0 model and solver untouched - babModel updated
|
|
64
|
+
1 model updated - just with solution basis etc
|
|
65
|
+
2 model updated i.e. as babModel (babModel NULL) (only use without preprocessing)
|
|
66
|
+
*/
|
|
67
|
+
int solve(int argc, const char * argv[], int returnMode);
|
|
68
|
+
/** This takes a list of commands, does "stuff" and returns
|
|
69
|
+
returnMode -
|
|
70
|
+
0 model and solver untouched - babModel updated
|
|
71
|
+
1 model updated - just with solution basis etc
|
|
72
|
+
2 model updated i.e. as babModel (babModel NULL) (only use without preprocessing)
|
|
73
|
+
*/
|
|
74
|
+
int solve(const char * input, int returnMode);
|
|
75
|
+
//@}
|
|
76
|
+
///@name Constructors and destructors etc
|
|
77
|
+
//@{
|
|
78
|
+
/// Default Constructor
|
|
79
|
+
CbcSolver();
|
|
80
|
+
|
|
81
|
+
/// Constructor from solver
|
|
82
|
+
CbcSolver(const OsiClpSolverInterface &);
|
|
83
|
+
|
|
84
|
+
/// Constructor from model
|
|
85
|
+
CbcSolver(const CbcModel &);
|
|
86
|
+
|
|
87
|
+
/** Copy constructor .
|
|
88
|
+
*/
|
|
89
|
+
CbcSolver(const CbcSolver & rhs);
|
|
90
|
+
|
|
91
|
+
/// Assignment operator
|
|
92
|
+
CbcSolver & operator=(const CbcSolver& rhs);
|
|
93
|
+
|
|
94
|
+
/// Destructor
|
|
95
|
+
~CbcSolver ();
|
|
96
|
+
/// Fill with standard parameters
|
|
97
|
+
void fillParameters();
|
|
98
|
+
/*! \brief Set default values in solvers from parameters
|
|
99
|
+
|
|
100
|
+
Misleading. The current code actually reads default values from
|
|
101
|
+
the underlying solvers and installs them as default values for a subset of
|
|
102
|
+
parameters in #parameters_.
|
|
103
|
+
*/
|
|
104
|
+
void fillValuesInSolver();
|
|
105
|
+
/// Add user function
|
|
106
|
+
void addUserFunction(CbcUser * function);
|
|
107
|
+
/// Set user call back
|
|
108
|
+
void setUserCallBack(CbcStopNow * function);
|
|
109
|
+
/// Add cut generator
|
|
110
|
+
void addCutGenerator(CglCutGenerator * generator);
|
|
111
|
+
//@}
|
|
112
|
+
///@name miscellaneous methods to line up with old
|
|
113
|
+
//@{
|
|
114
|
+
// analyze model
|
|
115
|
+
int * analyze(OsiClpSolverInterface * solverMod, int & numberChanged, double & increment,
|
|
116
|
+
bool changeInt, CoinMessageHandler * generalMessageHandler);
|
|
117
|
+
/** 1 - add heuristics to model
|
|
118
|
+
2 - do heuristics (and set cutoff and best solution)
|
|
119
|
+
3 - for miplib test so skip some
|
|
120
|
+
(out model later)
|
|
121
|
+
*/
|
|
122
|
+
//int doHeuristics(CbcModel * model, int type);
|
|
123
|
+
/** Updates model_ from babModel_ according to returnMode
|
|
124
|
+
returnMode -
|
|
125
|
+
0 model and solver untouched - babModel updated
|
|
126
|
+
1 model updated - just with solution basis etc
|
|
127
|
+
2 model updated i.e. as babModel (babModel NULL) (only use without preprocessing)
|
|
128
|
+
*/
|
|
129
|
+
void updateModel(ClpSimplex * model2, int returnMode);
|
|
130
|
+
//@}
|
|
131
|
+
///@name useful stuff
|
|
132
|
+
//@{
|
|
133
|
+
/// Get int value
|
|
134
|
+
int intValue(CbcOrClpParameterType type) const;
|
|
135
|
+
/// Set int value
|
|
136
|
+
void setIntValue(CbcOrClpParameterType type, int value);
|
|
137
|
+
/// Get double value
|
|
138
|
+
double doubleValue(CbcOrClpParameterType type) const;
|
|
139
|
+
/// Set double value
|
|
140
|
+
void setDoubleValue(CbcOrClpParameterType type, double value);
|
|
141
|
+
/// User function (NULL if no match)
|
|
142
|
+
CbcUser * userFunction(const char * name) const;
|
|
143
|
+
/// Return original Cbc model
|
|
144
|
+
inline CbcModel * model() {
|
|
145
|
+
return &model_;
|
|
146
|
+
}
|
|
147
|
+
/// Return updated Cbc model
|
|
148
|
+
inline CbcModel * babModel() {
|
|
149
|
+
return babModel_;
|
|
150
|
+
}
|
|
151
|
+
/// Number of userFunctions
|
|
152
|
+
inline int numberUserFunctions() const {
|
|
153
|
+
return numberUserFunctions_;
|
|
154
|
+
}
|
|
155
|
+
/// User function array
|
|
156
|
+
inline CbcUser ** userFunctionArray() const {
|
|
157
|
+
return userFunction_;
|
|
158
|
+
}
|
|
159
|
+
/// Copy of model on initial load (will contain output solutions)
|
|
160
|
+
inline OsiClpSolverInterface * originalSolver() const {
|
|
161
|
+
return originalSolver_;
|
|
162
|
+
}
|
|
163
|
+
/// Copy of model on initial load
|
|
164
|
+
inline CoinModel * originalCoinModel() const {
|
|
165
|
+
return originalCoinModel_;
|
|
166
|
+
}
|
|
167
|
+
/// Copy of model on initial load (will contain output solutions)
|
|
168
|
+
void setOriginalSolver(OsiClpSolverInterface * originalSolver);
|
|
169
|
+
/// Copy of model on initial load
|
|
170
|
+
void setOriginalCoinModel(CoinModel * originalCoinModel);
|
|
171
|
+
/// Number of cutgenerators
|
|
172
|
+
inline int numberCutGenerators() const {
|
|
173
|
+
return numberCutGenerators_;
|
|
174
|
+
}
|
|
175
|
+
/// Cut generator array
|
|
176
|
+
inline CglCutGenerator ** cutGeneratorArray() const {
|
|
177
|
+
return cutGenerator_;
|
|
178
|
+
}
|
|
179
|
+
/// Start time
|
|
180
|
+
inline double startTime() const {
|
|
181
|
+
return startTime_;
|
|
182
|
+
}
|
|
183
|
+
/// Whether to print to std::cout
|
|
184
|
+
inline void setPrinting(bool onOff) {
|
|
185
|
+
noPrinting_ = !onOff;
|
|
186
|
+
}
|
|
187
|
+
/// Where to start reading commands
|
|
188
|
+
inline void setReadMode(int value) {
|
|
189
|
+
readMode_ = value;
|
|
190
|
+
}
|
|
191
|
+
//@}
|
|
192
|
+
private:
|
|
193
|
+
///@name Private member data
|
|
194
|
+
//@{
|
|
195
|
+
|
|
196
|
+
/// Reference model
|
|
197
|
+
CbcModel model_;
|
|
198
|
+
|
|
199
|
+
/// Updated model
|
|
200
|
+
CbcModel * babModel_;
|
|
201
|
+
|
|
202
|
+
/// User functions
|
|
203
|
+
CbcUser ** userFunction_;
|
|
204
|
+
/** Status of user functions
|
|
205
|
+
0 - not used
|
|
206
|
+
1 - needs cbc_load
|
|
207
|
+
2 - available - data in coinModel
|
|
208
|
+
3 - data loaded - can do cbc_save
|
|
209
|
+
*/
|
|
210
|
+
int * statusUserFunction_;
|
|
211
|
+
/// Copy of model on initial load (will contain output solutions)
|
|
212
|
+
OsiClpSolverInterface * originalSolver_;
|
|
213
|
+
/// Copy of model on initial load
|
|
214
|
+
CoinModel * originalCoinModel_;
|
|
215
|
+
/// Cut generators
|
|
216
|
+
CglCutGenerator ** cutGenerator_;
|
|
217
|
+
/// Number of user functions
|
|
218
|
+
int numberUserFunctions_;
|
|
219
|
+
/// Number of cut generators
|
|
220
|
+
int numberCutGenerators_;
|
|
221
|
+
/// Stop now stuff
|
|
222
|
+
CbcStopNow * callBack_;
|
|
223
|
+
/// Cpu time at instantiation
|
|
224
|
+
double startTime_;
|
|
225
|
+
/// Parameters and values
|
|
226
|
+
CbcOrClpParam * parameters_;
|
|
227
|
+
/// Number of parameters
|
|
228
|
+
int numberParameters_ ;
|
|
229
|
+
/// Whether to do miplib test
|
|
230
|
+
bool doMiplib_;
|
|
231
|
+
/// Whether to print to std::cout
|
|
232
|
+
bool noPrinting_;
|
|
233
|
+
/// Where to start reading commands
|
|
234
|
+
int readMode_;
|
|
235
|
+
//@}
|
|
236
|
+
};
|
|
237
|
+
//#############################################################################
|
|
238
|
+
|
|
239
|
+
/// Structure to hold useful arrays
|
|
240
|
+
typedef struct {
|
|
241
|
+
// Priorities
|
|
242
|
+
int * priorities_;
|
|
243
|
+
// SOS priorities
|
|
244
|
+
int * sosPriority_;
|
|
245
|
+
// Direction to branch first
|
|
246
|
+
int * branchDirection_;
|
|
247
|
+
// Input solution
|
|
248
|
+
double * primalSolution_;
|
|
249
|
+
// Down pseudo costs
|
|
250
|
+
double * pseudoDown_;
|
|
251
|
+
// Up pseudo costs
|
|
252
|
+
double * pseudoUp_;
|
|
253
|
+
} CbcSolverUsefulData2;
|
|
254
|
+
|
|
255
|
+
//#############################################################################
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
The CbcSolver class was taken out at a 9/12/09 meeting
|
|
259
|
+
This is a feeble replacement.
|
|
260
|
+
At present everything is public
|
|
261
|
+
*/
|
|
262
|
+
class CbcSolverUsefulData {
|
|
263
|
+
|
|
264
|
+
public:
|
|
265
|
+
///@name Constructors and destructors etc
|
|
266
|
+
//@{
|
|
267
|
+
/// Default Constructor
|
|
268
|
+
CbcSolverUsefulData();
|
|
269
|
+
|
|
270
|
+
/** Copy constructor .
|
|
271
|
+
*/
|
|
272
|
+
CbcSolverUsefulData(const CbcSolverUsefulData & rhs);
|
|
273
|
+
|
|
274
|
+
/// Assignment operator
|
|
275
|
+
CbcSolverUsefulData & operator=(const CbcSolverUsefulData& rhs);
|
|
276
|
+
|
|
277
|
+
/// Destructor
|
|
278
|
+
~CbcSolverUsefulData ();
|
|
279
|
+
//@}
|
|
280
|
+
|
|
281
|
+
///@name Member data
|
|
282
|
+
//@{
|
|
283
|
+
// For time
|
|
284
|
+
double totalTime_;
|
|
285
|
+
// Parameters
|
|
286
|
+
CbcOrClpParam parameters_[CBCMAXPARAMETERS];
|
|
287
|
+
// Printing
|
|
288
|
+
bool noPrinting_;
|
|
289
|
+
// Whether to use signal handler
|
|
290
|
+
bool useSignalHandler_;
|
|
291
|
+
// Number of Parameters
|
|
292
|
+
int numberParameters_;
|
|
293
|
+
// Default pump tuning
|
|
294
|
+
int initialPumpTune_;
|
|
295
|
+
//@}
|
|
296
|
+
};
|
|
297
|
+
/// And this uses it
|
|
298
|
+
// When we want to load up CbcModel with options first
|
|
299
|
+
void CbcMain0 (CbcModel & babSolver,CbcSolverUsefulData & solverData);
|
|
300
|
+
int CbcMain1 (int argc, const char *argv[], CbcModel & babSolver, int (CbcModel * currentSolver, int whereFrom),CbcSolverUsefulData & solverData);
|
|
301
|
+
|
|
302
|
+
//#############################################################################
|
|
303
|
+
|
|
304
|
+
/*! \brief A class to allow the use of unknown user functionality
|
|
305
|
+
|
|
306
|
+
For example, access to a modelling language (CbcAmpl).
|
|
307
|
+
*/
|
|
308
|
+
class CbcUser {
|
|
309
|
+
|
|
310
|
+
public:
|
|
311
|
+
///@name import/export methods
|
|
312
|
+
//@{
|
|
313
|
+
/*! \brief Import - gets full command arguments
|
|
314
|
+
|
|
315
|
+
\return
|
|
316
|
+
- -1 - no action
|
|
317
|
+
- 0 - data read in without error
|
|
318
|
+
- 1 - errors
|
|
319
|
+
*/
|
|
320
|
+
virtual int importData(CbcSolver * /*model*/, int & /*argc*/, char ** /*argv[]*/) {
|
|
321
|
+
return -1;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/*! \brief Export
|
|
325
|
+
|
|
326
|
+
Values for mode:
|
|
327
|
+
- 1 OsiClpSolver
|
|
328
|
+
- 2 CbcModel
|
|
329
|
+
- add 10 if infeasible from odd situation
|
|
330
|
+
*/
|
|
331
|
+
virtual void exportSolution(CbcSolver * /*model*/,
|
|
332
|
+
int /*mode*/, const char * /*message*/ = NULL) {}
|
|
333
|
+
|
|
334
|
+
/// Export Data (i.e. at very end)
|
|
335
|
+
virtual void exportData(CbcSolver * /*model*/) {}
|
|
336
|
+
|
|
337
|
+
/// Get useful stuff
|
|
338
|
+
virtual void fillInformation(CbcSolver * /*model*/,
|
|
339
|
+
CbcSolverUsefulData & /*info*/) {}
|
|
340
|
+
//@}
|
|
341
|
+
|
|
342
|
+
///@name usage methods
|
|
343
|
+
//@{
|
|
344
|
+
/// CoinModel if valid
|
|
345
|
+
inline CoinModel *coinModel() const {
|
|
346
|
+
return coinModel_;
|
|
347
|
+
}
|
|
348
|
+
/// Other info - needs expanding
|
|
349
|
+
virtual void * stuff() {
|
|
350
|
+
return NULL;
|
|
351
|
+
}
|
|
352
|
+
/// Name
|
|
353
|
+
inline std::string name() const {
|
|
354
|
+
return userName_;
|
|
355
|
+
}
|
|
356
|
+
/// Solve (whatever that means)
|
|
357
|
+
virtual void solve(CbcSolver * model, const char * options) = 0;
|
|
358
|
+
/// Returns true if function knows about option
|
|
359
|
+
virtual bool canDo(const char * options) = 0;
|
|
360
|
+
//@}
|
|
361
|
+
|
|
362
|
+
///@name Constructors and destructors etc
|
|
363
|
+
//@{
|
|
364
|
+
/// Default Constructor
|
|
365
|
+
CbcUser();
|
|
366
|
+
|
|
367
|
+
/// Copy constructor
|
|
368
|
+
CbcUser(const CbcUser & rhs);
|
|
369
|
+
|
|
370
|
+
/// Assignment operator
|
|
371
|
+
CbcUser & operator=(const CbcUser& rhs);
|
|
372
|
+
|
|
373
|
+
/// Clone
|
|
374
|
+
virtual CbcUser * clone() const = 0;
|
|
375
|
+
|
|
376
|
+
/// Destructor
|
|
377
|
+
virtual ~CbcUser ();
|
|
378
|
+
//@}
|
|
379
|
+
|
|
380
|
+
protected:
|
|
381
|
+
///@name Private member data
|
|
382
|
+
//@{
|
|
383
|
+
|
|
384
|
+
/// CoinModel
|
|
385
|
+
CoinModel * coinModel_;
|
|
386
|
+
|
|
387
|
+
/// Name of user function
|
|
388
|
+
std::string userName_;
|
|
389
|
+
|
|
390
|
+
//@}
|
|
391
|
+
};
|
|
392
|
+
//#############################################################################
|
|
393
|
+
|
|
394
|
+
/*! \brief Support the use of a call back class to decide whether to stop
|
|
395
|
+
|
|
396
|
+
Definitely under construction.
|
|
397
|
+
*/
|
|
398
|
+
|
|
399
|
+
class CbcStopNow {
|
|
400
|
+
|
|
401
|
+
public:
|
|
402
|
+
///@name Decision methods
|
|
403
|
+
//@{
|
|
404
|
+
/*! \brief Import
|
|
405
|
+
|
|
406
|
+
Values for whereFrom:
|
|
407
|
+
- 1 after initial solve by dualsimplex etc
|
|
408
|
+
- 2 after preprocessing
|
|
409
|
+
- 3 just before branchAndBound (so user can override)
|
|
410
|
+
- 4 just after branchAndBound (before postprocessing)
|
|
411
|
+
- 5 after postprocessing
|
|
412
|
+
- 6 after a user called heuristic phase
|
|
413
|
+
|
|
414
|
+
\return 0 if good
|
|
415
|
+
nonzero return code to stop
|
|
416
|
+
*/
|
|
417
|
+
virtual int callBack(CbcModel * /*currentSolver*/, int /*whereFrom*/) {
|
|
418
|
+
return 0;
|
|
419
|
+
}
|
|
420
|
+
//@}
|
|
421
|
+
|
|
422
|
+
///@name Constructors and destructors etc
|
|
423
|
+
//@{
|
|
424
|
+
/// Default Constructor
|
|
425
|
+
CbcStopNow();
|
|
426
|
+
|
|
427
|
+
/** Copy constructor .
|
|
428
|
+
*/
|
|
429
|
+
CbcStopNow(const CbcStopNow & rhs);
|
|
430
|
+
|
|
431
|
+
/// Assignment operator
|
|
432
|
+
CbcStopNow & operator=(const CbcStopNow& rhs);
|
|
433
|
+
|
|
434
|
+
/// Clone
|
|
435
|
+
virtual CbcStopNow * clone() const;
|
|
436
|
+
|
|
437
|
+
/// Destructor
|
|
438
|
+
virtual ~CbcStopNow ();
|
|
439
|
+
//@}
|
|
440
|
+
|
|
441
|
+
private:
|
|
442
|
+
///@name Private member data
|
|
443
|
+
//@{
|
|
444
|
+
//@}
|
|
445
|
+
};
|
|
446
|
+
#endif
|
|
447
|
+
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/* $Id: CbcStrategy.hpp 1573 2011-01-05 01:12:36Z lou $ */
|
|
2
|
+
// Copyright (C) 2005, International Business Machines
|
|
3
|
+
// Corporation and others. All Rights Reserved.
|
|
4
|
+
// This code is licensed under the terms of the Eclipse Public License (EPL).
|
|
5
|
+
|
|
6
|
+
#ifndef CbcStrategy_H
|
|
7
|
+
#define CbcStrategy_H
|
|
8
|
+
|
|
9
|
+
#include "CbcModel.hpp"
|
|
10
|
+
class CglPreProcess;
|
|
11
|
+
class CbcNodeInfo;
|
|
12
|
+
class CbcNode;
|
|
13
|
+
class CoinWarmStartDiff;
|
|
14
|
+
|
|
15
|
+
//#############################################################################
|
|
16
|
+
/** Strategy base class */
|
|
17
|
+
|
|
18
|
+
class CbcStrategy {
|
|
19
|
+
public:
|
|
20
|
+
// Default Constructor
|
|
21
|
+
CbcStrategy ();
|
|
22
|
+
|
|
23
|
+
virtual ~CbcStrategy();
|
|
24
|
+
|
|
25
|
+
/// Clone
|
|
26
|
+
virtual CbcStrategy * clone() const = 0;
|
|
27
|
+
|
|
28
|
+
/// Setup cut generators
|
|
29
|
+
virtual void setupCutGenerators(CbcModel & model) = 0;
|
|
30
|
+
/// Setup heuristics
|
|
31
|
+
virtual void setupHeuristics(CbcModel & model) = 0;
|
|
32
|
+
/// Do printing stuff
|
|
33
|
+
virtual void setupPrinting(CbcModel & model, int modelLogLevel) = 0;
|
|
34
|
+
/// Other stuff e.g. strong branching and preprocessing
|
|
35
|
+
virtual void setupOther(CbcModel & model) = 0;
|
|
36
|
+
/// Set model depth (i.e. how nested)
|
|
37
|
+
inline void setNested(int depth) {
|
|
38
|
+
depth_ = depth;
|
|
39
|
+
}
|
|
40
|
+
/// Get model depth (i.e. how nested)
|
|
41
|
+
inline int getNested() const {
|
|
42
|
+
return depth_;
|
|
43
|
+
}
|
|
44
|
+
/// Say preProcessing done
|
|
45
|
+
inline void setPreProcessState(int state) {
|
|
46
|
+
preProcessState_ = state;
|
|
47
|
+
}
|
|
48
|
+
/// See what sort of preprocessing was done
|
|
49
|
+
inline int preProcessState() const {
|
|
50
|
+
return preProcessState_;
|
|
51
|
+
}
|
|
52
|
+
/// Pre-processing object
|
|
53
|
+
inline CglPreProcess * process() const {
|
|
54
|
+
return process_;
|
|
55
|
+
}
|
|
56
|
+
/// Delete pre-processing object to save memory
|
|
57
|
+
void deletePreProcess();
|
|
58
|
+
/// Return a new Full node information pointer (descendant of CbcFullNodeInfo)
|
|
59
|
+
virtual CbcNodeInfo * fullNodeInfo(CbcModel * model, int numberRowsAtContinuous) const;
|
|
60
|
+
/// Return a new Partial node information pointer (descendant of CbcPartialNodeInfo)
|
|
61
|
+
virtual CbcNodeInfo * partialNodeInfo(CbcModel * model, CbcNodeInfo * parent, CbcNode * owner,
|
|
62
|
+
int numberChangedBounds, const int * variables,
|
|
63
|
+
const double * boundChanges,
|
|
64
|
+
const CoinWarmStartDiff *basisDiff) const;
|
|
65
|
+
/// Create C++ lines to get to current state
|
|
66
|
+
virtual void generateCpp( FILE * ) {}
|
|
67
|
+
/** After a CbcModel::resolve this can return a status
|
|
68
|
+
-1 no effect
|
|
69
|
+
0 treat as optimal
|
|
70
|
+
1 as 0 but do not do any more resolves (i.e. no more cuts)
|
|
71
|
+
2 treat as infeasible
|
|
72
|
+
*/
|
|
73
|
+
virtual int status(CbcModel * model, CbcNodeInfo * parent, int whereFrom);
|
|
74
|
+
private:
|
|
75
|
+
|
|
76
|
+
/// Illegal Assignment operator
|
|
77
|
+
CbcStrategy & operator=(const CbcStrategy& rhs);
|
|
78
|
+
protected:
|
|
79
|
+
// Data
|
|
80
|
+
/// Model depth
|
|
81
|
+
int depth_;
|
|
82
|
+
/** PreProcessing state -
|
|
83
|
+
-1 infeasible
|
|
84
|
+
0 off
|
|
85
|
+
1 was done (so need post-processing)
|
|
86
|
+
*/
|
|
87
|
+
int preProcessState_;
|
|
88
|
+
/// If preprocessing then this is object
|
|
89
|
+
CglPreProcess * process_;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/** Null class
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
class CbcStrategyNull : public CbcStrategy {
|
|
96
|
+
public:
|
|
97
|
+
|
|
98
|
+
// Default Constructor
|
|
99
|
+
CbcStrategyNull () {}
|
|
100
|
+
|
|
101
|
+
// Copy constructor
|
|
102
|
+
CbcStrategyNull ( const CbcStrategyNull & rhs) : CbcStrategy(rhs) {}
|
|
103
|
+
|
|
104
|
+
// Destructor
|
|
105
|
+
~CbcStrategyNull () {}
|
|
106
|
+
|
|
107
|
+
/// Clone
|
|
108
|
+
virtual CbcStrategy * clone() const {
|
|
109
|
+
return new CbcStrategyNull(*this);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/// Setup cut generators
|
|
113
|
+
virtual void setupCutGenerators(CbcModel & ) {}
|
|
114
|
+
/// Setup heuristics
|
|
115
|
+
virtual void setupHeuristics(CbcModel & ) {}
|
|
116
|
+
/// Do printing stuff
|
|
117
|
+
virtual void setupPrinting(CbcModel & , int ) {}
|
|
118
|
+
/// Other stuff e.g. strong branching
|
|
119
|
+
virtual void setupOther(CbcModel & ) {}
|
|
120
|
+
|
|
121
|
+
protected:
|
|
122
|
+
// Data
|
|
123
|
+
private:
|
|
124
|
+
/// Illegal Assignment operator
|
|
125
|
+
CbcStrategyNull & operator=(const CbcStrategyNull& rhs);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/** Default class
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
class CbcStrategyDefault : public CbcStrategy {
|
|
132
|
+
public:
|
|
133
|
+
|
|
134
|
+
// Default Constructor
|
|
135
|
+
CbcStrategyDefault (int cutsOnlyAtRoot = 1,
|
|
136
|
+
int numberStrong = 5,
|
|
137
|
+
int numberBeforeTrust = 0,
|
|
138
|
+
int printLevel = 0);
|
|
139
|
+
|
|
140
|
+
// Copy constructor
|
|
141
|
+
CbcStrategyDefault ( const CbcStrategyDefault &);
|
|
142
|
+
|
|
143
|
+
// Destructor
|
|
144
|
+
~CbcStrategyDefault ();
|
|
145
|
+
|
|
146
|
+
/// Clone
|
|
147
|
+
virtual CbcStrategy * clone() const;
|
|
148
|
+
|
|
149
|
+
/// Setup cut generators
|
|
150
|
+
virtual void setupCutGenerators(CbcModel & model);
|
|
151
|
+
/// Setup heuristics
|
|
152
|
+
virtual void setupHeuristics(CbcModel & model);
|
|
153
|
+
/// Do printing stuff
|
|
154
|
+
virtual void setupPrinting(CbcModel & model, int modelLogLevel) ;
|
|
155
|
+
/// Other stuff e.g. strong branching
|
|
156
|
+
virtual void setupOther(CbcModel & model);
|
|
157
|
+
/// Set up preProcessing - see below
|
|
158
|
+
inline void setupPreProcessing(int desired = 1, int passes = 10) {
|
|
159
|
+
desiredPreProcess_ = desired;
|
|
160
|
+
preProcessPasses_ = passes;
|
|
161
|
+
}
|
|
162
|
+
/// See what sort of preprocessing wanted
|
|
163
|
+
inline int desiredPreProcess() const {
|
|
164
|
+
return desiredPreProcess_;
|
|
165
|
+
}
|
|
166
|
+
/// See how many passes wanted
|
|
167
|
+
inline int preProcessPasses() const {
|
|
168
|
+
return preProcessPasses_;
|
|
169
|
+
}
|
|
170
|
+
/// Create C++ lines to get to current state
|
|
171
|
+
virtual void generateCpp( FILE * fp) ;
|
|
172
|
+
|
|
173
|
+
protected:
|
|
174
|
+
// Data
|
|
175
|
+
|
|
176
|
+
// Whether to do cuts only at root (-1 -> switch off totally)
|
|
177
|
+
int cutsOnlyAtRoot_;
|
|
178
|
+
|
|
179
|
+
// How much strong branching to do
|
|
180
|
+
int numberStrong_;
|
|
181
|
+
|
|
182
|
+
// Number branches needed to trust with dynamic pseudo costs
|
|
183
|
+
int numberBeforeTrust_;
|
|
184
|
+
|
|
185
|
+
// Print level 0 little, 1 medium
|
|
186
|
+
int printLevel_;
|
|
187
|
+
|
|
188
|
+
/** Desired pre-processing
|
|
189
|
+
0 - none
|
|
190
|
+
1 - ordinary
|
|
191
|
+
2 - find sos
|
|
192
|
+
3 - find cliques
|
|
193
|
+
4 - more aggressive sos
|
|
194
|
+
5 - add integer slacks
|
|
195
|
+
*/
|
|
196
|
+
int desiredPreProcess_;
|
|
197
|
+
/// Number of pre-processing passes
|
|
198
|
+
int preProcessPasses_;
|
|
199
|
+
|
|
200
|
+
private:
|
|
201
|
+
/// Illegal Assignment operator
|
|
202
|
+
CbcStrategyDefault & operator=(const CbcStrategyDefault& rhs);
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
/** Default class for sub trees
|
|
207
|
+
*/
|
|
208
|
+
|
|
209
|
+
class CbcStrategyDefaultSubTree : public CbcStrategy {
|
|
210
|
+
public:
|
|
211
|
+
|
|
212
|
+
// Default Constructor
|
|
213
|
+
CbcStrategyDefaultSubTree (CbcModel * parent = NULL, int cutsOnlyAtRoot = 1,
|
|
214
|
+
int numberStrong = 5,
|
|
215
|
+
int numberBeforeTrust = 0,
|
|
216
|
+
int printLevel = 0);
|
|
217
|
+
|
|
218
|
+
// Copy constructor
|
|
219
|
+
CbcStrategyDefaultSubTree ( const CbcStrategyDefaultSubTree &);
|
|
220
|
+
|
|
221
|
+
// Destructor
|
|
222
|
+
~CbcStrategyDefaultSubTree ();
|
|
223
|
+
|
|
224
|
+
/// Clone
|
|
225
|
+
virtual CbcStrategy * clone() const;
|
|
226
|
+
|
|
227
|
+
/// Setup cut generators
|
|
228
|
+
virtual void setupCutGenerators(CbcModel & model);
|
|
229
|
+
/// Setup heuristics
|
|
230
|
+
virtual void setupHeuristics(CbcModel & model);
|
|
231
|
+
/// Do printing stuff
|
|
232
|
+
virtual void setupPrinting(CbcModel & model, int modelLogLevel) ;
|
|
233
|
+
/// Other stuff e.g. strong branching
|
|
234
|
+
virtual void setupOther(CbcModel & model);
|
|
235
|
+
protected:
|
|
236
|
+
// Data
|
|
237
|
+
// Parent model
|
|
238
|
+
CbcModel * parentModel_;
|
|
239
|
+
// Whether to do cuts only at root (-1 -> switch off totally)
|
|
240
|
+
int cutsOnlyAtRoot_;
|
|
241
|
+
|
|
242
|
+
// How much strong branching to do
|
|
243
|
+
int numberStrong_;
|
|
244
|
+
|
|
245
|
+
// Number branches needed to trust with dynamic pseudo costs
|
|
246
|
+
int numberBeforeTrust_;
|
|
247
|
+
|
|
248
|
+
// Print level 0 little, 1 medium
|
|
249
|
+
int printLevel_;
|
|
250
|
+
|
|
251
|
+
private:
|
|
252
|
+
/// Illegal Assignment operator
|
|
253
|
+
CbcStrategyDefaultSubTree & operator=(const CbcStrategyDefaultSubTree& rhs);
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
#endif
|
|
258
|
+
|