ruby-cbc 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- 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,60 @@
|
|
1
|
+
/* $Id: CoinPresolveZeros.hpp 1498 2011-11-02 15:25:35Z mjs $ */
|
2
|
+
// Copyright (C) 2002, 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 CoinPresolveZeros_H
|
7
|
+
#define CoinPresolveZeros_H
|
8
|
+
|
9
|
+
/*! \file
|
10
|
+
|
11
|
+
Drop/reintroduce explicit zeros.
|
12
|
+
*/
|
13
|
+
|
14
|
+
#define DROP_ZERO 8
|
15
|
+
|
16
|
+
/*! \brief Tracking information for an explicit zero coefficient
|
17
|
+
|
18
|
+
\todo Why isn't this a nested class in drop_zero_coefficients_action?
|
19
|
+
That would match the structure of other presolve classes.
|
20
|
+
*/
|
21
|
+
|
22
|
+
struct dropped_zero {
|
23
|
+
int row;
|
24
|
+
int col;
|
25
|
+
};
|
26
|
+
|
27
|
+
/*! \brief Removal of explicit zeros
|
28
|
+
|
29
|
+
The presolve action for this class removes explicit zeros from the constraint
|
30
|
+
matrix. The postsolve action puts them back.
|
31
|
+
*/
|
32
|
+
class drop_zero_coefficients_action : public CoinPresolveAction {
|
33
|
+
|
34
|
+
const int nzeros_;
|
35
|
+
const dropped_zero *const zeros_;
|
36
|
+
|
37
|
+
drop_zero_coefficients_action(int nzeros,
|
38
|
+
const dropped_zero *zeros,
|
39
|
+
const CoinPresolveAction *next) :
|
40
|
+
CoinPresolveAction(next),
|
41
|
+
nzeros_(nzeros), zeros_(zeros)
|
42
|
+
{}
|
43
|
+
|
44
|
+
public:
|
45
|
+
const char *name() const { return ("drop_zero_coefficients_action"); }
|
46
|
+
|
47
|
+
static const CoinPresolveAction *presolve(CoinPresolveMatrix *prob,
|
48
|
+
int *checkcols,
|
49
|
+
int ncheckcols,
|
50
|
+
const CoinPresolveAction *next);
|
51
|
+
|
52
|
+
void postsolve(CoinPostsolveMatrix *prob) const;
|
53
|
+
|
54
|
+
virtual ~drop_zero_coefficients_action() { deleteAction(zeros_,dropped_zero*); }
|
55
|
+
};
|
56
|
+
|
57
|
+
const CoinPresolveAction *drop_zero_coefficients(CoinPresolveMatrix *prob,
|
58
|
+
const CoinPresolveAction *next);
|
59
|
+
|
60
|
+
#endif
|
@@ -0,0 +1,44 @@
|
|
1
|
+
// Authors: Matthew Saltzman and Ted Ralphs
|
2
|
+
// Copyright 2015, Matthew Saltzman and Ted Ralphs
|
3
|
+
// Licensed under the Eclipse Public License 1.0
|
4
|
+
|
5
|
+
#ifndef CoinRational_H
|
6
|
+
#define CoinRational_H
|
7
|
+
|
8
|
+
#include <cmath>
|
9
|
+
|
10
|
+
//Small class for rational numbers
|
11
|
+
class CoinRational
|
12
|
+
{
|
13
|
+
|
14
|
+
public :
|
15
|
+
long getDenominator() { return denominator_; }
|
16
|
+
long getNumerator() { return numerator_; }
|
17
|
+
|
18
|
+
CoinRational():
|
19
|
+
numerator_(0),
|
20
|
+
denominator_(1)
|
21
|
+
{};
|
22
|
+
|
23
|
+
CoinRational(long n, long d):
|
24
|
+
numerator_(n),
|
25
|
+
denominator_(d)
|
26
|
+
{};
|
27
|
+
|
28
|
+
CoinRational(double val, double maxdelta, long maxdnom)
|
29
|
+
{
|
30
|
+
if (!nearestRational_(val, maxdelta, maxdnom)){
|
31
|
+
numerator_ = 0;
|
32
|
+
denominator_ = 1;
|
33
|
+
}
|
34
|
+
};
|
35
|
+
|
36
|
+
private :
|
37
|
+
|
38
|
+
long numerator_;
|
39
|
+
long denominator_;
|
40
|
+
|
41
|
+
bool nearestRational_(double val, double maxdelta, long maxdnom);
|
42
|
+
};
|
43
|
+
|
44
|
+
#endif
|
@@ -0,0 +1,465 @@
|
|
1
|
+
/* $Id: CoinSearchTree.hpp 1824 2015-04-04 16:27:28Z tkr $ */
|
2
|
+
// Copyright (C) 2006, 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 CoinSearchTree_H
|
7
|
+
#define CoinSearchTree_H
|
8
|
+
|
9
|
+
#include <vector>
|
10
|
+
#include <algorithm>
|
11
|
+
#include <cmath>
|
12
|
+
#include <string>
|
13
|
+
|
14
|
+
#include "CoinFinite.hpp"
|
15
|
+
#include "CoinHelperFunctions.hpp"
|
16
|
+
|
17
|
+
// #define DEBUG_PRINT
|
18
|
+
|
19
|
+
//#############################################################################
|
20
|
+
|
21
|
+
class BitVector128 {
|
22
|
+
friend bool operator<(const BitVector128& b0, const BitVector128& b1);
|
23
|
+
private:
|
24
|
+
unsigned int bits_[4];
|
25
|
+
public:
|
26
|
+
BitVector128();
|
27
|
+
BitVector128(unsigned int bits[4]);
|
28
|
+
~BitVector128() {}
|
29
|
+
void set(unsigned int bits[4]);
|
30
|
+
void setBit(int i);
|
31
|
+
void clearBit(int i);
|
32
|
+
std::string str() const;
|
33
|
+
};
|
34
|
+
|
35
|
+
bool operator<(const BitVector128& b0, const BitVector128& b1);
|
36
|
+
|
37
|
+
//#############################################################################
|
38
|
+
|
39
|
+
/** A class from which the real tree nodes should be derived from. Some of the
|
40
|
+
data that undoubtedly exist in the real tree node is replicated here for
|
41
|
+
fast access. This class is used in the various comparison functions. */
|
42
|
+
class CoinTreeNode {
|
43
|
+
protected:
|
44
|
+
CoinTreeNode() :
|
45
|
+
depth_(-1),
|
46
|
+
fractionality_(-1),
|
47
|
+
quality_(-COIN_DBL_MAX),
|
48
|
+
true_lower_bound_(-COIN_DBL_MAX),
|
49
|
+
preferred_() {}
|
50
|
+
CoinTreeNode(int d,
|
51
|
+
int f = -1,
|
52
|
+
double q = -COIN_DBL_MAX,
|
53
|
+
double tlb = -COIN_DBL_MAX,
|
54
|
+
BitVector128 p = BitVector128()) :
|
55
|
+
depth_(d),
|
56
|
+
fractionality_(f),
|
57
|
+
quality_(q),
|
58
|
+
true_lower_bound_(tlb),
|
59
|
+
preferred_(p) {}
|
60
|
+
CoinTreeNode(const CoinTreeNode& x) :
|
61
|
+
depth_(x.depth_),
|
62
|
+
fractionality_(x.fractionality_),
|
63
|
+
quality_(x.quality_),
|
64
|
+
true_lower_bound_(x.true_lower_bound_),
|
65
|
+
preferred_(x.preferred_) {}
|
66
|
+
CoinTreeNode& operator=(const CoinTreeNode& x) {
|
67
|
+
if (this != &x) {
|
68
|
+
depth_ = x.depth_;
|
69
|
+
fractionality_ = x.fractionality_;
|
70
|
+
quality_ = x.quality_;
|
71
|
+
true_lower_bound_ = x.true_lower_bound_;
|
72
|
+
preferred_ = x.preferred_;
|
73
|
+
}
|
74
|
+
return *this;
|
75
|
+
}
|
76
|
+
private:
|
77
|
+
/// The depth of the node in the tree
|
78
|
+
int depth_;
|
79
|
+
/** A measure of fractionality, e.g., the number of unsatisfied
|
80
|
+
integrality requirements */
|
81
|
+
int fractionality_;
|
82
|
+
/** Some quality for the node. For normal branch-and-cut problems the LP
|
83
|
+
relaxation value will do just fine. It is probably an OK approximation
|
84
|
+
even if column generation is done. */
|
85
|
+
double quality_;
|
86
|
+
/** A true lower bound on the node. May be -infinity. For normal
|
87
|
+
branch-and-cut problems the LP relaxation value is OK. It is different
|
88
|
+
when column generation is done. */
|
89
|
+
double true_lower_bound_;
|
90
|
+
/** */
|
91
|
+
BitVector128 preferred_;
|
92
|
+
public:
|
93
|
+
virtual ~CoinTreeNode() {}
|
94
|
+
|
95
|
+
inline int getDepth() const { return depth_; }
|
96
|
+
inline int getFractionality() const { return fractionality_; }
|
97
|
+
inline double getQuality() const { return quality_; }
|
98
|
+
inline double getTrueLB() const { return true_lower_bound_; }
|
99
|
+
inline BitVector128 getPreferred() const { return preferred_; }
|
100
|
+
|
101
|
+
inline void setDepth(int d) { depth_ = d; }
|
102
|
+
inline void setFractionality(int f) { fractionality_ = f; }
|
103
|
+
inline void setQuality(double q) { quality_ = q; }
|
104
|
+
inline void setTrueLB(double tlb) { true_lower_bound_ = tlb; }
|
105
|
+
inline void setPreferred(BitVector128 p) { preferred_ = p; }
|
106
|
+
};
|
107
|
+
|
108
|
+
//==============================================================================
|
109
|
+
|
110
|
+
class CoinTreeSiblings {
|
111
|
+
private:
|
112
|
+
CoinTreeSiblings();
|
113
|
+
CoinTreeSiblings& operator=(const CoinTreeSiblings&);
|
114
|
+
private:
|
115
|
+
int current_;
|
116
|
+
int numSiblings_;
|
117
|
+
CoinTreeNode** siblings_;
|
118
|
+
public:
|
119
|
+
CoinTreeSiblings(const int n, CoinTreeNode** nodes) :
|
120
|
+
current_(0), numSiblings_(n), siblings_(new CoinTreeNode*[n])
|
121
|
+
{
|
122
|
+
CoinDisjointCopyN(nodes, n, siblings_);
|
123
|
+
}
|
124
|
+
CoinTreeSiblings(const CoinTreeSiblings& s) :
|
125
|
+
current_(s.current_),
|
126
|
+
numSiblings_(s.numSiblings_),
|
127
|
+
siblings_(new CoinTreeNode*[s.numSiblings_])
|
128
|
+
{
|
129
|
+
CoinDisjointCopyN(s.siblings_, s.numSiblings_, siblings_);
|
130
|
+
}
|
131
|
+
~CoinTreeSiblings() { delete[] siblings_; }
|
132
|
+
inline CoinTreeNode* currentNode() const { return siblings_[current_]; }
|
133
|
+
/** returns false if cannot be advanced */
|
134
|
+
inline bool advanceNode() { return ++current_ != numSiblings_; }
|
135
|
+
inline int toProcess() const { return numSiblings_ - current_; }
|
136
|
+
inline int size() const { return numSiblings_; }
|
137
|
+
inline void printPref() const {
|
138
|
+
for (int i = 0; i < numSiblings_; ++i) {
|
139
|
+
std::string pref = siblings_[i]->getPreferred().str();
|
140
|
+
printf("prefs of sibligs: sibling[%i]: %s\n", i, pref.c_str());
|
141
|
+
}
|
142
|
+
}
|
143
|
+
};
|
144
|
+
|
145
|
+
//#############################################################################
|
146
|
+
|
147
|
+
/** Function objects to compare search tree nodes. The comparison function
|
148
|
+
must return true if the first argument is "better" than the second one,
|
149
|
+
i.e., it should be processed first. */
|
150
|
+
/*@{*/
|
151
|
+
/** Depth First Search. */
|
152
|
+
struct CoinSearchTreeComparePreferred {
|
153
|
+
static inline const char* name() { return "CoinSearchTreeComparePreferred"; }
|
154
|
+
inline bool operator()(const CoinTreeSiblings* x,
|
155
|
+
const CoinTreeSiblings* y) const {
|
156
|
+
register const CoinTreeNode* xNode = x->currentNode();
|
157
|
+
register const CoinTreeNode* yNode = y->currentNode();
|
158
|
+
const BitVector128 xPref = xNode->getPreferred();
|
159
|
+
const BitVector128 yPref = yNode->getPreferred();
|
160
|
+
bool retval = true;
|
161
|
+
if (xPref < yPref) {
|
162
|
+
retval = true;
|
163
|
+
} else if (yPref < xPref) {
|
164
|
+
retval = false;
|
165
|
+
} else {
|
166
|
+
retval = xNode->getQuality() < yNode->getQuality();
|
167
|
+
}
|
168
|
+
#ifdef DEBUG_PRINT
|
169
|
+
printf("Comparing xpref (%s) and ypref (%s) : %s\n",
|
170
|
+
xpref.str().c_str(), ypref.str().c_str(), retval ? "T" : "F");
|
171
|
+
#endif
|
172
|
+
return retval;
|
173
|
+
}
|
174
|
+
};
|
175
|
+
|
176
|
+
//-----------------------------------------------------------------------------
|
177
|
+
/** Depth First Search. */
|
178
|
+
struct CoinSearchTreeCompareDepth {
|
179
|
+
static inline const char* name() { return "CoinSearchTreeCompareDepth"; }
|
180
|
+
inline bool operator()(const CoinTreeSiblings* x,
|
181
|
+
const CoinTreeSiblings* y) const {
|
182
|
+
#if 1
|
183
|
+
return x->currentNode()->getDepth() >= y->currentNode()->getDepth();
|
184
|
+
#else
|
185
|
+
if(x->currentNode()->getDepth() > y->currentNode()->getDepth())
|
186
|
+
return 1;
|
187
|
+
if(x->currentNode()->getDepth() == y->currentNode()->getDepth() &&
|
188
|
+
x->currentNode()->getQuality() <= y->currentNode()->getQuality())
|
189
|
+
return 1;
|
190
|
+
return 0;
|
191
|
+
#endif
|
192
|
+
}
|
193
|
+
};
|
194
|
+
|
195
|
+
//-----------------------------------------------------------------------------
|
196
|
+
/* Breadth First Search */
|
197
|
+
struct CoinSearchTreeCompareBreadth {
|
198
|
+
static inline const char* name() { return "CoinSearchTreeCompareBreadth"; }
|
199
|
+
inline bool operator()(const CoinTreeSiblings* x,
|
200
|
+
const CoinTreeSiblings* y) const {
|
201
|
+
return x->currentNode()->getDepth() < y->currentNode()->getDepth();
|
202
|
+
}
|
203
|
+
};
|
204
|
+
|
205
|
+
//-----------------------------------------------------------------------------
|
206
|
+
/** Best first search */
|
207
|
+
struct CoinSearchTreeCompareBest {
|
208
|
+
static inline const char* name() { return "CoinSearchTreeCompareBest"; }
|
209
|
+
inline bool operator()(const CoinTreeSiblings* x,
|
210
|
+
const CoinTreeSiblings* y) const {
|
211
|
+
return x->currentNode()->getQuality() < y->currentNode()->getQuality();
|
212
|
+
}
|
213
|
+
};
|
214
|
+
|
215
|
+
//#############################################################################
|
216
|
+
|
217
|
+
class CoinSearchTreeBase
|
218
|
+
{
|
219
|
+
private:
|
220
|
+
CoinSearchTreeBase(const CoinSearchTreeBase&);
|
221
|
+
CoinSearchTreeBase& operator=(const CoinSearchTreeBase&);
|
222
|
+
|
223
|
+
protected:
|
224
|
+
std::vector<CoinTreeSiblings*> candidateList_;
|
225
|
+
int numInserted_;
|
226
|
+
int size_;
|
227
|
+
|
228
|
+
protected:
|
229
|
+
CoinSearchTreeBase() : candidateList_(), numInserted_(0), size_(0) {}
|
230
|
+
|
231
|
+
virtual void realpop() = 0;
|
232
|
+
virtual void realpush(CoinTreeSiblings* s) = 0;
|
233
|
+
virtual void fixTop() = 0;
|
234
|
+
|
235
|
+
public:
|
236
|
+
virtual ~CoinSearchTreeBase() {}
|
237
|
+
virtual const char* compName() const = 0;
|
238
|
+
|
239
|
+
inline const std::vector<CoinTreeSiblings*>& getCandidates() const {
|
240
|
+
return candidateList_;
|
241
|
+
}
|
242
|
+
inline bool empty() const { return candidateList_.empty(); }
|
243
|
+
inline int size() const { return size_; }
|
244
|
+
inline int numInserted() const { return numInserted_; }
|
245
|
+
inline CoinTreeNode* top() const {
|
246
|
+
if (size_ == 0 || candidateList_.size() == 0)
|
247
|
+
return NULL;
|
248
|
+
#ifdef DEBUG_PRINT
|
249
|
+
char output[44];
|
250
|
+
output[43] = 0;
|
251
|
+
candidateList_.front()->currentNode()->getPreferred().print(output);
|
252
|
+
printf("top's pref: %s\n", output);
|
253
|
+
#endif
|
254
|
+
return candidateList_.front()->currentNode();
|
255
|
+
}
|
256
|
+
/** pop will advance the \c next pointer among the siblings on the top and
|
257
|
+
then moves the top to its correct position. #realpop is the method
|
258
|
+
that actually removes the element from the heap */
|
259
|
+
inline void pop() {
|
260
|
+
CoinTreeSiblings* s = candidateList_.front();
|
261
|
+
if (!s->advanceNode()) {
|
262
|
+
realpop();
|
263
|
+
delete s;
|
264
|
+
} else {
|
265
|
+
fixTop();
|
266
|
+
}
|
267
|
+
--size_;
|
268
|
+
}
|
269
|
+
inline void push(int numNodes, CoinTreeNode** nodes,
|
270
|
+
const bool incrInserted = true) {
|
271
|
+
CoinTreeSiblings* s = new CoinTreeSiblings(numNodes, nodes);
|
272
|
+
realpush(s);
|
273
|
+
if (incrInserted) {
|
274
|
+
numInserted_ += numNodes;
|
275
|
+
}
|
276
|
+
size_ += numNodes;
|
277
|
+
}
|
278
|
+
inline void push(const CoinTreeSiblings& sib,
|
279
|
+
const bool incrInserted = true) {
|
280
|
+
CoinTreeSiblings* s = new CoinTreeSiblings(sib);
|
281
|
+
#ifdef DEBUG_PRINT
|
282
|
+
s->printPref();
|
283
|
+
#endif
|
284
|
+
realpush(s);
|
285
|
+
if (incrInserted) {
|
286
|
+
numInserted_ += sib.toProcess();
|
287
|
+
}
|
288
|
+
size_ += sib.toProcess();
|
289
|
+
}
|
290
|
+
};
|
291
|
+
|
292
|
+
//#############################################################################
|
293
|
+
|
294
|
+
// #define CAN_TRUST_STL_HEAP
|
295
|
+
#ifdef CAN_TRUST_STL_HEAP
|
296
|
+
|
297
|
+
template <class Comp>
|
298
|
+
class CoinSearchTree : public CoinSearchTreeBase
|
299
|
+
{
|
300
|
+
private:
|
301
|
+
Comp comp_;
|
302
|
+
protected:
|
303
|
+
virtual void realpop() {
|
304
|
+
candidateList_.pop_back();
|
305
|
+
}
|
306
|
+
virtual void fixTop() {
|
307
|
+
CoinTreeSiblings* s = top();
|
308
|
+
realpop();
|
309
|
+
push(s, false);
|
310
|
+
}
|
311
|
+
virtual void realpush(CoinTreeSiblings* s) {
|
312
|
+
nodes_.push_back(s);
|
313
|
+
std::push_heap(candidateList_.begin(), candidateList_.end(), comp_);
|
314
|
+
}
|
315
|
+
public:
|
316
|
+
CoinSearchTree() : CoinSearchTreeBase(), comp_() {}
|
317
|
+
CoinSearchTree(const CoinSearchTreeBase& t) :
|
318
|
+
CoinSearchTreeBase(), comp_() {
|
319
|
+
candidateList_ = t.getCandidates();
|
320
|
+
std::make_heap(candidateList_.begin(), candidateList_.end(), comp_);
|
321
|
+
numInserted_ = t.numInserted_;
|
322
|
+
size_ = t.size_;
|
323
|
+
}
|
324
|
+
~CoinSearchTree() {}
|
325
|
+
const char* compName() const { return Comp::name(); }
|
326
|
+
};
|
327
|
+
|
328
|
+
#else
|
329
|
+
|
330
|
+
template <class Comp>
|
331
|
+
class CoinSearchTree : public CoinSearchTreeBase
|
332
|
+
{
|
333
|
+
private:
|
334
|
+
Comp comp_;
|
335
|
+
|
336
|
+
protected:
|
337
|
+
virtual void realpop() {
|
338
|
+
candidateList_[0] = candidateList_.back();
|
339
|
+
candidateList_.pop_back();
|
340
|
+
fixTop();
|
341
|
+
}
|
342
|
+
/** After changing data in the top node, fix the heap */
|
343
|
+
virtual void fixTop() {
|
344
|
+
const size_t size = candidateList_.size();
|
345
|
+
if (size > 1) {
|
346
|
+
CoinTreeSiblings** candidates = &candidateList_[0];
|
347
|
+
CoinTreeSiblings* s = candidates[0];
|
348
|
+
--candidates;
|
349
|
+
size_t pos = 1;
|
350
|
+
size_t ch;
|
351
|
+
for (ch = 2; ch < size; pos = ch, ch *= 2) {
|
352
|
+
if (comp_(candidates[ch+1], candidates[ch]))
|
353
|
+
++ch;
|
354
|
+
if (comp_(s, candidates[ch]))
|
355
|
+
break;
|
356
|
+
candidates[pos] = candidates[ch];
|
357
|
+
}
|
358
|
+
if (ch == size) {
|
359
|
+
if (comp_(candidates[ch], s)) {
|
360
|
+
candidates[pos] = candidates[ch];
|
361
|
+
pos = ch;
|
362
|
+
}
|
363
|
+
}
|
364
|
+
candidates[pos] = s;
|
365
|
+
}
|
366
|
+
}
|
367
|
+
virtual void realpush(CoinTreeSiblings* s) {
|
368
|
+
candidateList_.push_back(s);
|
369
|
+
CoinTreeSiblings** candidates = &candidateList_[0];
|
370
|
+
--candidates;
|
371
|
+
size_t pos = candidateList_.size();
|
372
|
+
size_t ch;
|
373
|
+
for (ch = pos/2; ch != 0; pos = ch, ch /= 2) {
|
374
|
+
if (comp_(candidates[ch], s))
|
375
|
+
break;
|
376
|
+
candidates[pos] = candidates[ch];
|
377
|
+
}
|
378
|
+
candidates[pos] = s;
|
379
|
+
}
|
380
|
+
|
381
|
+
public:
|
382
|
+
CoinSearchTree() : CoinSearchTreeBase(), comp_() {}
|
383
|
+
CoinSearchTree(const CoinSearchTreeBase& t) :
|
384
|
+
CoinSearchTreeBase(), comp_() {
|
385
|
+
candidateList_ = t.getCandidates();
|
386
|
+
std::sort(candidateList_.begin(), candidateList_.end(), comp_);
|
387
|
+
numInserted_ = t.numInserted();
|
388
|
+
size_ = t.size();
|
389
|
+
}
|
390
|
+
virtual ~CoinSearchTree() {}
|
391
|
+
const char* compName() const { return Comp::name(); }
|
392
|
+
};
|
393
|
+
|
394
|
+
#endif
|
395
|
+
|
396
|
+
//#############################################################################
|
397
|
+
|
398
|
+
enum CoinNodeAction {
|
399
|
+
CoinAddNodeToCandidates,
|
400
|
+
CoinTestNodeForDiving,
|
401
|
+
CoinDiveIntoNode
|
402
|
+
};
|
403
|
+
|
404
|
+
class CoinSearchTreeManager
|
405
|
+
{
|
406
|
+
private:
|
407
|
+
CoinSearchTreeManager(const CoinSearchTreeManager&);
|
408
|
+
CoinSearchTreeManager& operator=(const CoinSearchTreeManager&);
|
409
|
+
private:
|
410
|
+
CoinSearchTreeBase* candidates_;
|
411
|
+
int numSolution;
|
412
|
+
/** Whether there is an upper bound or not. The upper bound may have come
|
413
|
+
as input, not necessarily from a solution */
|
414
|
+
bool hasUB_;
|
415
|
+
|
416
|
+
/** variable used to test whether we need to reevaluate search strategy */
|
417
|
+
bool recentlyReevaluatedSearchStrategy_;
|
418
|
+
|
419
|
+
public:
|
420
|
+
CoinSearchTreeManager() :
|
421
|
+
candidates_(NULL),
|
422
|
+
numSolution(0),
|
423
|
+
recentlyReevaluatedSearchStrategy_(true)
|
424
|
+
{}
|
425
|
+
virtual ~CoinSearchTreeManager() {
|
426
|
+
delete candidates_;
|
427
|
+
}
|
428
|
+
|
429
|
+
inline void setTree(CoinSearchTreeBase* t) {
|
430
|
+
delete candidates_;
|
431
|
+
candidates_ = t;
|
432
|
+
}
|
433
|
+
inline CoinSearchTreeBase* getTree() const {
|
434
|
+
return candidates_;
|
435
|
+
}
|
436
|
+
|
437
|
+
inline bool empty() const { return candidates_->empty(); }
|
438
|
+
inline size_t size() const { return candidates_->size(); }
|
439
|
+
inline size_t numInserted() const { return candidates_->numInserted(); }
|
440
|
+
inline CoinTreeNode* top() const { return candidates_->top(); }
|
441
|
+
inline void pop() { candidates_->pop(); }
|
442
|
+
inline void push(CoinTreeNode* node, const bool incrInserted = true) {
|
443
|
+
candidates_->push(1, &node, incrInserted);
|
444
|
+
}
|
445
|
+
inline void push(const CoinTreeSiblings& s, const bool incrInserted=true) {
|
446
|
+
candidates_->push(s, incrInserted);
|
447
|
+
}
|
448
|
+
inline void push(const int n, CoinTreeNode** nodes,
|
449
|
+
const bool incrInserted = true) {
|
450
|
+
candidates_->push(n, nodes, incrInserted);
|
451
|
+
}
|
452
|
+
|
453
|
+
inline CoinTreeNode* bestQualityCandidate() const {
|
454
|
+
return candidates_->top();
|
455
|
+
}
|
456
|
+
inline double bestQuality() const {
|
457
|
+
return candidates_->top()->getQuality();
|
458
|
+
}
|
459
|
+
void newSolution(double solValue);
|
460
|
+
void reevaluateSearchStrategy();
|
461
|
+
};
|
462
|
+
|
463
|
+
//#############################################################################
|
464
|
+
|
465
|
+
#endif
|