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,62 @@
|
|
1
|
+
module Ilp
|
2
|
+
class Var
|
3
|
+
attr_accessor :kind, :name, :lower_bound, :upper_bound
|
4
|
+
|
5
|
+
BINARY_KIND = :binary
|
6
|
+
INTEGER_KIND = :integer
|
7
|
+
CONTINUOUS_KIND = :continuous
|
8
|
+
|
9
|
+
def initialize(name: nil, kind: INTEGER_KIND, lower_bound: nil, upper_bound: nil)
|
10
|
+
@kind = kind
|
11
|
+
@name = name
|
12
|
+
@name = ('a'..'z').to_a.shuffle[0,8].join if name.nil?
|
13
|
+
@lower_bound = lower_bound
|
14
|
+
@upper_bound = upper_bound
|
15
|
+
end
|
16
|
+
|
17
|
+
def bounds=(range)
|
18
|
+
@lower_bound = range.min
|
19
|
+
@upper_bound = range.max
|
20
|
+
end
|
21
|
+
|
22
|
+
def bounds
|
23
|
+
@lower_bound..@upper_bound
|
24
|
+
end
|
25
|
+
|
26
|
+
def +(vars)
|
27
|
+
Ilp::Term.new(self) + vars
|
28
|
+
end
|
29
|
+
|
30
|
+
def -(vars)
|
31
|
+
Ilp::Term.new(self) - vars
|
32
|
+
end
|
33
|
+
|
34
|
+
def -@
|
35
|
+
Ilp::Term.new(self, -1)
|
36
|
+
end
|
37
|
+
|
38
|
+
def *(mult)
|
39
|
+
Ilp::Term.new(self) * mult
|
40
|
+
end
|
41
|
+
|
42
|
+
def ==(vars)
|
43
|
+
Ilp::Term.new(self) == vars
|
44
|
+
end
|
45
|
+
|
46
|
+
def <=(vars)
|
47
|
+
Ilp::Term.new(self) <= vars
|
48
|
+
end
|
49
|
+
|
50
|
+
def >=(vars)
|
51
|
+
Ilp::Term.new(self) >= vars
|
52
|
+
end
|
53
|
+
|
54
|
+
def coerce(num)
|
55
|
+
[Ilp::Term.new(self), num]
|
56
|
+
end
|
57
|
+
|
58
|
+
def to_s
|
59
|
+
name
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,125 @@
|
|
1
|
+
require "set"
|
2
|
+
|
3
|
+
module Cbc
|
4
|
+
|
5
|
+
INF = 1.0 / 0.0 # Useful for ranges
|
6
|
+
|
7
|
+
class Model
|
8
|
+
|
9
|
+
|
10
|
+
attr_accessor :vars, :constraints, :objective, :name
|
11
|
+
|
12
|
+
def initialize(name: "ILP Problem")
|
13
|
+
@vars = Set.new
|
14
|
+
@constraints = Set.new
|
15
|
+
@objective = nil
|
16
|
+
@name = name
|
17
|
+
end
|
18
|
+
|
19
|
+
def int_var(range = nil, name: nil)
|
20
|
+
var(Ilp::Var::INTEGER_KIND, range, name)
|
21
|
+
end
|
22
|
+
|
23
|
+
def int_var_array(length, range = nil, names: nil)
|
24
|
+
array_var(length, Ilp::Var::INTEGER_KIND, range, names)
|
25
|
+
end
|
26
|
+
|
27
|
+
def bin_var(name: nil)
|
28
|
+
var(Ilp::Var::BINARY_KIND, nil, name)
|
29
|
+
end
|
30
|
+
|
31
|
+
def bin_var_array(length, names: nil)
|
32
|
+
array_var(length, Ilp::Var::BINARY_KIND, range, names)
|
33
|
+
end
|
34
|
+
|
35
|
+
def cont_var(range = nil, name: nil)
|
36
|
+
var(Ilp::Var::CONTINUOUS_KIND, range, name)
|
37
|
+
end
|
38
|
+
|
39
|
+
def cont_var_array(length, range = nil, name: nil)
|
40
|
+
array_var(length, Ilp::Var::CONTINUOUS_KIND, range, names)
|
41
|
+
end
|
42
|
+
|
43
|
+
def enforce(constraint)
|
44
|
+
constraints << constraint
|
45
|
+
end
|
46
|
+
|
47
|
+
def minimize(expression)
|
48
|
+
@objective = Ilp::Objective.new(expression, Ilp::Objective::MINIMIZE) if expression
|
49
|
+
self
|
50
|
+
end
|
51
|
+
|
52
|
+
def maximize(expression)
|
53
|
+
@objective = Ilp::Objective.new(expression, Ilp::Objective::MAXIMIZE) if expression
|
54
|
+
self
|
55
|
+
end
|
56
|
+
|
57
|
+
def to_problem
|
58
|
+
Cbc::Problem.new(self)
|
59
|
+
end
|
60
|
+
|
61
|
+
def to_s
|
62
|
+
str = ""
|
63
|
+
if objective
|
64
|
+
str << objective.to_s << "\n"
|
65
|
+
else
|
66
|
+
str << "Maximize\n 0 #{vars.first.to_s}\n"
|
67
|
+
end
|
68
|
+
str << "\nSubject To\n"
|
69
|
+
constraints.each do |cons|
|
70
|
+
str << " " << cons.to_s << "\n"
|
71
|
+
end
|
72
|
+
bounded_vars = vars.select{ |v| v.kind != Ilp::Var::BINARY_KIND }
|
73
|
+
if bounded_vars.any?
|
74
|
+
str << "\nBounds\n"
|
75
|
+
bounded_vars.each { |v| str << " #{lb_to_s(v.lower_bound)} <= #{v} <= #{ub_to_s(v.upper_bound)}\n" }
|
76
|
+
end
|
77
|
+
|
78
|
+
int_vars = vars.select{ |v| v.kind == Ilp::Var::INTEGER_KIND }
|
79
|
+
if int_vars.any?
|
80
|
+
str << "\nGenerals\n"
|
81
|
+
int_vars.each { |v| str << " #{v}\n" }
|
82
|
+
end
|
83
|
+
|
84
|
+
bin_vars = vars.select{ |v| v.kind == Ilp::Var::BINARY_KIND }
|
85
|
+
if bin_vars.any?
|
86
|
+
str << "\nBinaries\n"
|
87
|
+
bin_vars.each { |v| str << " #{v}\n" }
|
88
|
+
end
|
89
|
+
str << "\nEnd\n"
|
90
|
+
|
91
|
+
str
|
92
|
+
end
|
93
|
+
|
94
|
+
private
|
95
|
+
def array_var(length, kind, range, names)
|
96
|
+
ar = Array.new(length) { var(kind, range, nil) }
|
97
|
+
ar.zip(names).map{ |var, name| var.name = name } unless names.nil?
|
98
|
+
ar
|
99
|
+
end
|
100
|
+
|
101
|
+
def var(kind, range, name)
|
102
|
+
if range.nil?
|
103
|
+
v = Ilp::Var.new(kind: kind, name: name)
|
104
|
+
@vars << v
|
105
|
+
return v
|
106
|
+
end
|
107
|
+
v = Ilp::Var.new(kind: kind, name: name, lower_bound: range.min, upper_bound: range.max)
|
108
|
+
@vars << v
|
109
|
+
v
|
110
|
+
end
|
111
|
+
|
112
|
+
def lb_to_s(lb)
|
113
|
+
return "-inf" if ! lb || lb == -Cbc::INF
|
114
|
+
return "+inf" if lb == Cbc::INF
|
115
|
+
return "#{lb}"
|
116
|
+
end
|
117
|
+
|
118
|
+
def ub_to_s(ub)
|
119
|
+
return "+inf" if ! ub || ub == Cbc::INF
|
120
|
+
return "-inf" if ub == -Cbc::INF
|
121
|
+
return "#{ub}"
|
122
|
+
end
|
123
|
+
|
124
|
+
end
|
125
|
+
end
|
@@ -0,0 +1,170 @@
|
|
1
|
+
# require "../../ext/ruby-cbc/install/lib/cbc_wrapper"
|
2
|
+
|
3
|
+
module Cbc
|
4
|
+
class Problem
|
5
|
+
|
6
|
+
|
7
|
+
def initialize(model)
|
8
|
+
|
9
|
+
@int_arrays = []
|
10
|
+
@double_arrays = []
|
11
|
+
|
12
|
+
@variables = {}
|
13
|
+
vars = model.vars
|
14
|
+
vars_data = {}
|
15
|
+
vars.each_with_index do |v, idx|
|
16
|
+
@variables[v] = idx
|
17
|
+
vars_data[v] = VarData.new(v, idx, [], [])
|
18
|
+
end
|
19
|
+
|
20
|
+
model.constraints.each_with_index do |c, idx|
|
21
|
+
c.terms.each do |term|
|
22
|
+
v_data = vars_data[term.var]
|
23
|
+
v_data.constraints << idx
|
24
|
+
v_data.coefs << term.mult
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
indexes = []
|
29
|
+
rows = []
|
30
|
+
coefs = []
|
31
|
+
|
32
|
+
vars.each_with_index do |v, idx|
|
33
|
+
v_data = vars_data[v]
|
34
|
+
indexes[idx] = rows.count
|
35
|
+
rows += v_data.constraints
|
36
|
+
coefs += v_data.coefs
|
37
|
+
end
|
38
|
+
|
39
|
+
indexes << rows.count
|
40
|
+
|
41
|
+
objective = Array.new(vars.count, 0)
|
42
|
+
if model.objective
|
43
|
+
model.objective.terms.each do |term|
|
44
|
+
objective[vars_data[term.var].col_idx] = term.mult
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
@cbc_model = Cbc_wrapper.Cbc_newModel
|
49
|
+
Cbc_wrapper.Cbc_loadProblem(@cbc_model, model.vars.count, model.constraints.count,
|
50
|
+
to_int_array(indexes), to_int_array(rows),
|
51
|
+
to_double_array(coefs), nil, nil, to_double_array(objective),
|
52
|
+
nil, nil)
|
53
|
+
|
54
|
+
# Segmentation errors when setting name
|
55
|
+
# Cbc_wrapper.Cbc_setProblemName(@cbc_model, model.name) if model.name
|
56
|
+
|
57
|
+
if model.objective
|
58
|
+
obj_sense = model.objective.objective_function == Ilp::Objective::MINIMIZE ? 1 : -1
|
59
|
+
Cbc_wrapper.Cbc_setObjSense(@cbc_model, obj_sense)
|
60
|
+
end
|
61
|
+
|
62
|
+
model.constraints.each_with_index do |c, idx|
|
63
|
+
case c.type
|
64
|
+
when Ilp::Constraint::LESS_OR_EQ
|
65
|
+
Cbc_wrapper.Cbc_setRowUpper(@cbc_model, idx, c.bound)
|
66
|
+
when Ilp::Constraint::GREATER_OR_EQ
|
67
|
+
Cbc_wrapper.Cbc_setRowLower(@cbc_model, idx, c.bound)
|
68
|
+
when Ilp::Constraint::EQUALS
|
69
|
+
Cbc_wrapper.Cbc_setRowUpper(@cbc_model, idx, c.bound)
|
70
|
+
Cbc_wrapper.Cbc_setRowLower(@cbc_model, idx, c.bound)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
model.vars.each_with_index do |v, idx|
|
74
|
+
case v.kind
|
75
|
+
when Ilp::Var::INTEGER_KIND
|
76
|
+
Cbc_wrapper.Cbc_setInteger(@cbc_model, idx)
|
77
|
+
when Ilp::Var::BINARY_KIND
|
78
|
+
Cbc_wrapper.Cbc_setInteger(@cbc_model, idx)
|
79
|
+
v.bounds = 0..1
|
80
|
+
when Ilp::Var::CONTINUOUS_KIND
|
81
|
+
Cbc_wrapper.Cbc_setContinuous(@cbc_model, idx)
|
82
|
+
end
|
83
|
+
Cbc_wrapper.Cbc_setColLower(@cbc_model, idx, v.lower_bound) unless v.lower_bound.nil?
|
84
|
+
Cbc_wrapper.Cbc_setColUpper(@cbc_model, idx, v.upper_bound) unless v.upper_bound.nil?
|
85
|
+
end
|
86
|
+
|
87
|
+
ObjectSpace.define_finalizer(self, self.class.finalizer(@cbc_model, @int_arrays, @double_arrays))
|
88
|
+
|
89
|
+
@default_solve_params = {
|
90
|
+
log: 0,
|
91
|
+
}
|
92
|
+
|
93
|
+
end
|
94
|
+
|
95
|
+
def solve(params = {})
|
96
|
+
@default_solve_params.merge(params).each do |name, value|
|
97
|
+
Cbc_wrapper.Cbc_setParameter(@cbc_model, name.to_s, value.to_s)
|
98
|
+
end
|
99
|
+
Cbc_wrapper.Cbc_solve(@cbc_model)
|
100
|
+
@solution = Cbc_wrapper::DoubleArray.frompointer(Cbc_wrapper.Cbc_getColSolution(@cbc_model))
|
101
|
+
end
|
102
|
+
|
103
|
+
def value_of(var)
|
104
|
+
idx = @variables[var]
|
105
|
+
return nil if idx.nil?
|
106
|
+
@solution[idx]
|
107
|
+
end
|
108
|
+
|
109
|
+
def set_time_limit(seconds)
|
110
|
+
@default_solve_params[:sec] = seconds
|
111
|
+
end
|
112
|
+
|
113
|
+
def proven_optimal?
|
114
|
+
Cbc_wrapper.Cbc_isProvenOptimal(@cbc_model) == 1
|
115
|
+
end
|
116
|
+
|
117
|
+
def proven_infeasible?
|
118
|
+
Cbc_wrapper.Cbc_isProvenInfeasible(@cbc_model) == 1
|
119
|
+
end
|
120
|
+
|
121
|
+
def time_limit_reached?
|
122
|
+
Cbc_wrapper.Cbc_isSecondsLimitReached(@cbc_model)
|
123
|
+
end
|
124
|
+
|
125
|
+
def solution_limit_reached?
|
126
|
+
Cbc_wrapper.Cbc_isSolutionLimitReached(@cbc_model)
|
127
|
+
end
|
128
|
+
|
129
|
+
def objective_value
|
130
|
+
Cbc_wrapper.Cbc_getObjValue(@cbc_model)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Returns the best know bound so far
|
134
|
+
def best_bound
|
135
|
+
Cbc_wrapper.Cbc_getBestPossibleObjValue(@cbc_model)
|
136
|
+
end
|
137
|
+
|
138
|
+
def self.finalizer(cbc_model, int_arrays, double_arrays)
|
139
|
+
proc do
|
140
|
+
Cbc_wrapper.Cbc_deleteModel(cbc_model)
|
141
|
+
int_arrays.each { |ar| Cbc_wrapper.delete_intArray(ar) }
|
142
|
+
double_arrays.each { |ar| Cbc_wrapper.delete_doubleArray(ar) }
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
def write
|
147
|
+
Cbc_wrapper.Cbc_writeMps(@cbc_model, "test")
|
148
|
+
end
|
149
|
+
|
150
|
+
private
|
151
|
+
|
152
|
+
def to_int_array(array)
|
153
|
+
c_array = Cbc_wrapper::IntArray.new(array.count)
|
154
|
+
array.each_with_index { |value, idx| c_array[idx] = value }
|
155
|
+
@int_arrays << c_array
|
156
|
+
c_array
|
157
|
+
end
|
158
|
+
|
159
|
+
def to_double_array(array)
|
160
|
+
c_array = Cbc_wrapper::DoubleArray.new(array.count)
|
161
|
+
array.each_with_index { |value, idx| c_array[idx] = value }
|
162
|
+
@double_arrays << c_array
|
163
|
+
c_array
|
164
|
+
end
|
165
|
+
|
166
|
+
VarData = Struct.new(:variable, :col_idx, :constraints, :coefs)
|
167
|
+
end
|
168
|
+
|
169
|
+
|
170
|
+
end
|
data/lib/ruby-cbc.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require "ruby-cbc/version"
|
2
|
+
|
3
|
+
module Cbc
|
4
|
+
end
|
5
|
+
|
6
|
+
files = %w(
|
7
|
+
model
|
8
|
+
problem
|
9
|
+
version
|
10
|
+
ilp/constant
|
11
|
+
ilp/constraint
|
12
|
+
ilp/objective
|
13
|
+
ilp/term
|
14
|
+
ilp/term_array
|
15
|
+
ilp/var
|
16
|
+
)
|
17
|
+
|
18
|
+
require File.expand_path("../../ext/ruby-cbc/cbc_wrapper", __FILE__)
|
19
|
+
files.each do |file|
|
20
|
+
require File.expand_path("../ruby-cbc/#{file}", __FILE__)
|
21
|
+
end
|
data/ruby-cbc.gemspec
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'ruby-cbc/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "ruby-cbc"
|
8
|
+
spec.version = Cbc::VERSION
|
9
|
+
spec.authors = ["Guillaume Verger"]
|
10
|
+
spec.email = ["verger.guillaume@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = "Wrapper around Cbc Linear Programming Solver"
|
13
|
+
spec.description = "Wrapper around Cbc Linear Programming Solver"
|
14
|
+
spec.homepage = "https://github.com/gverger/ruby-cbc"
|
15
|
+
|
16
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
17
|
+
# delete this section to allow pushing this gem to any host.
|
18
|
+
if spec.respond_to?(:metadata)
|
19
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
20
|
+
else
|
21
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
22
|
+
end
|
23
|
+
|
24
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib", "ext"]
|
28
|
+
spec.extensions << "ext/ruby-cbc/extconf.rb"
|
29
|
+
|
30
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
31
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
32
|
+
spec.add_development_dependency "rspec"
|
33
|
+
spec.add_development_dependency "rake-compiler"
|
34
|
+
spec.add_development_dependency "pry"
|
35
|
+
spec.add_development_dependency "pry-byebug"
|
36
|
+
end
|