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,764 @@
|
|
1
|
+
// $Id: OsiCbcSolverInterface.hpp 1899 2013-04-09 18:12:08Z stefan $
|
2
|
+
// Copyright (C) 2000, 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 OsiCbcSolverInterface_H
|
7
|
+
#define OsiCbcSolverInterface_H
|
8
|
+
|
9
|
+
#include <string>
|
10
|
+
#include <cfloat>
|
11
|
+
#include <map>
|
12
|
+
#include "CbcModel.hpp"
|
13
|
+
#include "CoinPackedMatrix.hpp"
|
14
|
+
#include "OsiSolverInterface.hpp"
|
15
|
+
#include "CbcStrategy.hpp"
|
16
|
+
#include "CoinWarmStartBasis.hpp"
|
17
|
+
|
18
|
+
class OsiRowCut;
|
19
|
+
class OsiClpSolverInterface;
|
20
|
+
static const double OsiCbcInfinity = COIN_DBL_MAX;
|
21
|
+
|
22
|
+
//#############################################################################
|
23
|
+
|
24
|
+
/** Cbc Solver Interface
|
25
|
+
|
26
|
+
Instantiation of OsiCbcSolverInterface for the Model Algorithm.
|
27
|
+
|
28
|
+
*/
|
29
|
+
|
30
|
+
class OsiCbcSolverInterface :
|
31
|
+
virtual public OsiSolverInterface {
|
32
|
+
friend void OsiCbcSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
|
33
|
+
|
34
|
+
public:
|
35
|
+
//---------------------------------------------------------------------------
|
36
|
+
/**@name Solve methods */
|
37
|
+
//@{
|
38
|
+
/// Solve initial LP relaxation
|
39
|
+
virtual void initialSolve();
|
40
|
+
|
41
|
+
/// Resolve an LP relaxation after problem modification
|
42
|
+
virtual void resolve();
|
43
|
+
|
44
|
+
/// Invoke solver's built-in enumeration algorithm
|
45
|
+
virtual void branchAndBound();
|
46
|
+
//@}
|
47
|
+
|
48
|
+
//---------------------------------------------------------------------------
|
49
|
+
/**@name Parameter set/get methods
|
50
|
+
|
51
|
+
The set methods return true if the parameter was set to the given value,
|
52
|
+
false otherwise. There can be various reasons for failure: the given
|
53
|
+
parameter is not applicable for the solver (e.g., refactorization
|
54
|
+
frequency for the cbc algorithm), the parameter is not yet implemented
|
55
|
+
for the solver or simply the value of the parameter is out of the range
|
56
|
+
the solver accepts. If a parameter setting call returns false check the
|
57
|
+
details of your solver.
|
58
|
+
|
59
|
+
The get methods return true if the given parameter is applicable for the
|
60
|
+
solver and is implemented. In this case the value of the parameter is
|
61
|
+
returned in the second argument. Otherwise they return false.
|
62
|
+
*/
|
63
|
+
//@{
|
64
|
+
// Set an integer parameter
|
65
|
+
bool setIntParam(OsiIntParam key, int value);
|
66
|
+
// Set an double parameter
|
67
|
+
bool setDblParam(OsiDblParam key, double value);
|
68
|
+
// Set a string parameter
|
69
|
+
bool setStrParam(OsiStrParam key, const std::string & value);
|
70
|
+
// Get an integer parameter
|
71
|
+
bool getIntParam(OsiIntParam key, int& value) const;
|
72
|
+
// Get an double parameter
|
73
|
+
bool getDblParam(OsiDblParam key, double& value) const;
|
74
|
+
// Get a string parameter
|
75
|
+
bool getStrParam(OsiStrParam key, std::string& value) const;
|
76
|
+
// Set a hint parameter - overrides OsiSolverInterface
|
77
|
+
virtual bool setHintParam(OsiHintParam key, bool yesNo=true,
|
78
|
+
OsiHintStrength strength=OsiHintTry,
|
79
|
+
void * otherInformation=NULL);
|
80
|
+
/// Get a hint parameter
|
81
|
+
virtual bool getHintParam(OsiHintParam key, bool& yesNo,
|
82
|
+
OsiHintStrength& strength,
|
83
|
+
void *& otherInformation) const;
|
84
|
+
|
85
|
+
using OsiSolverInterface::getHintParam ;
|
86
|
+
/// Get a hint parameter
|
87
|
+
virtual bool getHintParam(OsiHintParam key, bool& yesNo,
|
88
|
+
OsiHintStrength& strength) const;
|
89
|
+
//@}
|
90
|
+
|
91
|
+
//---------------------------------------------------------------------------
|
92
|
+
///@name Methods returning info on how the solution process terminated
|
93
|
+
//@{
|
94
|
+
/// Are there a numerical difficulties?
|
95
|
+
virtual bool isAbandoned() const;
|
96
|
+
/// Is optimality proven?
|
97
|
+
virtual bool isProvenOptimal() const;
|
98
|
+
/// Is primal infeasiblity proven?
|
99
|
+
virtual bool isProvenPrimalInfeasible() const;
|
100
|
+
/// Is dual infeasiblity proven?
|
101
|
+
virtual bool isProvenDualInfeasible() const;
|
102
|
+
/// Is the given primal objective limit reached?
|
103
|
+
virtual bool isPrimalObjectiveLimitReached() const;
|
104
|
+
/// Is the given dual objective limit reached?
|
105
|
+
virtual bool isDualObjectiveLimitReached() const;
|
106
|
+
/// Iteration limit reached?
|
107
|
+
virtual bool isIterationLimitReached() const;
|
108
|
+
//@}
|
109
|
+
|
110
|
+
//---------------------------------------------------------------------------
|
111
|
+
/**@name WarmStart related methods */
|
112
|
+
//@{
|
113
|
+
|
114
|
+
/*! \brief Get an empty warm start object
|
115
|
+
|
116
|
+
This routine returns an empty CoinWarmStartBasis object. Its purpose is
|
117
|
+
to provide a way to give a client a warm start basis object of the
|
118
|
+
appropriate type, which can resized and modified as desired.
|
119
|
+
*/
|
120
|
+
|
121
|
+
virtual CoinWarmStart *getEmptyWarmStart () const;
|
122
|
+
|
123
|
+
/// Get warmstarting information
|
124
|
+
virtual CoinWarmStart* getWarmStart() const;
|
125
|
+
/** Set warmstarting information. Return true/false depending on whether
|
126
|
+
the warmstart information was accepted or not. */
|
127
|
+
virtual bool setWarmStart(const CoinWarmStart* warmstart);
|
128
|
+
//@}
|
129
|
+
|
130
|
+
//---------------------------------------------------------------------------
|
131
|
+
/**@name Hotstart related methods (primarily used in strong branching). <br>
|
132
|
+
The user can create a hotstart (a snapshot) of the optimization process
|
133
|
+
then reoptimize over and over again always starting from there.<br>
|
134
|
+
<strong>NOTE</strong>: between hotstarted optimizations only
|
135
|
+
bound changes are allowed. */
|
136
|
+
//@{
|
137
|
+
/// Create a hotstart point of the optimization process
|
138
|
+
virtual void markHotStart();
|
139
|
+
/// Optimize starting from the hotstart
|
140
|
+
virtual void solveFromHotStart();
|
141
|
+
/// Delete the snapshot
|
142
|
+
virtual void unmarkHotStart();
|
143
|
+
//@}
|
144
|
+
|
145
|
+
//---------------------------------------------------------------------------
|
146
|
+
/**@name Problem information methods
|
147
|
+
|
148
|
+
These methods call the solver's query routines to return
|
149
|
+
information about the problem referred to by the current object.
|
150
|
+
Querying a problem that has no data associated with it result in
|
151
|
+
zeros for the number of rows and columns, and NULL pointers from
|
152
|
+
the methods that return vectors.
|
153
|
+
|
154
|
+
Const pointers returned from any data-query method are valid as
|
155
|
+
long as the data is unchanged and the solver is not called.
|
156
|
+
*/
|
157
|
+
//@{
|
158
|
+
/**@name Methods related to querying the input data */
|
159
|
+
//@{
|
160
|
+
/// Get number of columns
|
161
|
+
virtual int getNumCols() const;
|
162
|
+
|
163
|
+
/// Get number of rows
|
164
|
+
virtual int getNumRows() const;
|
165
|
+
|
166
|
+
/// Get number of nonzero elements
|
167
|
+
virtual int getNumElements() const ;
|
168
|
+
|
169
|
+
/// Get pointer to array[getNumCols()] of column lower bounds
|
170
|
+
virtual const double * getColLower() const;
|
171
|
+
|
172
|
+
/// Get pointer to array[getNumCols()] of column upper bounds
|
173
|
+
virtual const double * getColUpper() const;
|
174
|
+
|
175
|
+
/** Get pointer to array[getNumRows()] of row constraint senses.
|
176
|
+
<ul>
|
177
|
+
<li>'L' <= constraint
|
178
|
+
<li>'E' = constraint
|
179
|
+
<li>'G' >= constraint
|
180
|
+
<li>'R' ranged constraint
|
181
|
+
<li>'N' free constraint
|
182
|
+
</ul>
|
183
|
+
*/
|
184
|
+
virtual const char * getRowSense() const;
|
185
|
+
|
186
|
+
/** Get pointer to array[getNumRows()] of rows right-hand sides
|
187
|
+
<ul>
|
188
|
+
<li> if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
|
189
|
+
<li> if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
|
190
|
+
<li> if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
|
191
|
+
<li> if rowsense()[i] == 'N' then rhs()[i] == 0.0
|
192
|
+
</ul>
|
193
|
+
*/
|
194
|
+
virtual const double * getRightHandSide() const ;
|
195
|
+
|
196
|
+
/** Get pointer to array[getNumRows()] of row ranges.
|
197
|
+
<ul>
|
198
|
+
<li> if rowsense()[i] == 'R' then
|
199
|
+
rowrange()[i] == rowupper()[i] - rowlower()[i]
|
200
|
+
<li> if rowsense()[i] != 'R' then
|
201
|
+
rowrange()[i] is undefined
|
202
|
+
</ul>
|
203
|
+
*/
|
204
|
+
virtual const double * getRowRange() const ;
|
205
|
+
|
206
|
+
/// Get pointer to array[getNumRows()] of row lower bounds
|
207
|
+
virtual const double * getRowLower() const ;
|
208
|
+
|
209
|
+
/// Get pointer to array[getNumRows()] of row upper bounds
|
210
|
+
virtual const double * getRowUpper() const ;
|
211
|
+
|
212
|
+
/// Get pointer to array[getNumCols()] of objective function coefficients
|
213
|
+
virtual const double * getObjCoefficients() const;
|
214
|
+
|
215
|
+
/// Get objective function sense (1 for min (default), -1 for max)
|
216
|
+
virtual double getObjSense() const ;
|
217
|
+
|
218
|
+
/// Return true if column is continuous
|
219
|
+
virtual bool isContinuous(int colNumber) const;
|
220
|
+
|
221
|
+
|
222
|
+
/// Get pointer to row-wise copy of matrix
|
223
|
+
virtual const CoinPackedMatrix * getMatrixByRow() const;
|
224
|
+
|
225
|
+
/// Get pointer to column-wise copy of matrix
|
226
|
+
virtual const CoinPackedMatrix * getMatrixByCol() const;
|
227
|
+
|
228
|
+
/// Get solver's value for infinity
|
229
|
+
virtual double getInfinity() const;
|
230
|
+
//@}
|
231
|
+
|
232
|
+
/**@name Methods related to querying the solution */
|
233
|
+
//@{
|
234
|
+
/// Get pointer to array[getNumCols()] of primal solution vector
|
235
|
+
virtual const double * getColSolution() const;
|
236
|
+
|
237
|
+
/// Get pointer to array[getNumRows()] of dual prices
|
238
|
+
virtual const double * getRowPrice() const;
|
239
|
+
|
240
|
+
/// Get a pointer to array[getNumCols()] of reduced costs
|
241
|
+
virtual const double * getReducedCost() const;
|
242
|
+
|
243
|
+
/** Get pointer to array[getNumRows()] of row activity levels (constraint
|
244
|
+
matrix times the solution vector */
|
245
|
+
virtual const double * getRowActivity() const;
|
246
|
+
|
247
|
+
/// Get objective function value
|
248
|
+
virtual double getObjValue() const;
|
249
|
+
|
250
|
+
/** Get how many iterations it took to solve the problem (whatever
|
251
|
+
"iteration" mean to the solver. */
|
252
|
+
virtual int getIterationCount() const ;
|
253
|
+
|
254
|
+
/** Get as many dual rays as the solver can provide. (In case of proven
|
255
|
+
primal infeasibility there should be at least one.)
|
256
|
+
|
257
|
+
The first getNumRows() ray components will always be associated with
|
258
|
+
the row duals (as returned by getRowPrice()). If \c fullRay is true,
|
259
|
+
the final getNumCols() entries will correspond to the ray components
|
260
|
+
associated with the nonbasic variables. If the full ray is requested
|
261
|
+
and the method cannot provide it, it will throw an exception.
|
262
|
+
|
263
|
+
<strong>NOTE for implementers of solver interfaces:</strong> <br>
|
264
|
+
The double pointers in the vector should point to arrays of length
|
265
|
+
getNumRows() and they should be allocated via new[]. <br>
|
266
|
+
|
267
|
+
<strong>NOTE for users of solver interfaces:</strong> <br>
|
268
|
+
It is the user's responsibility to free the double pointers in the
|
269
|
+
vector using delete[].
|
270
|
+
*/
|
271
|
+
virtual std::vector<double*> getDualRays(int maxNumRays,
|
272
|
+
bool fullRay = false) const;
|
273
|
+
/** Get as many primal rays as the solver can provide. (In case of proven
|
274
|
+
dual infeasibility there should be at least one.)
|
275
|
+
|
276
|
+
<strong>NOTE for implementers of solver interfaces:</strong> <br>
|
277
|
+
The double pointers in the vector should point to arrays of length
|
278
|
+
getNumCols() and they should be allocated via new[]. <br>
|
279
|
+
|
280
|
+
<strong>NOTE for users of solver interfaces:</strong> <br>
|
281
|
+
It is the user's responsibility to free the double pointers in the
|
282
|
+
vector using delete[].
|
283
|
+
*/
|
284
|
+
virtual std::vector<double*> getPrimalRays(int maxNumRays) const;
|
285
|
+
|
286
|
+
//@}
|
287
|
+
|
288
|
+
/*! \name Methods for row and column names.
|
289
|
+
|
290
|
+
Because OsiCbc is a pass-through class, it's necessary to override any
|
291
|
+
virtual method in order to be sure we catch an override by the underlying
|
292
|
+
solver. See the OsiSolverInterface class documentation for detailed
|
293
|
+
descriptions.
|
294
|
+
*/
|
295
|
+
//@{
|
296
|
+
|
297
|
+
/*! \brief Generate a standard name of the form Rnnnnnnn or Cnnnnnnn */
|
298
|
+
|
299
|
+
virtual std::string dfltRowColName(char rc,
|
300
|
+
int ndx, unsigned digits = 7) const ;
|
301
|
+
|
302
|
+
/*! \brief Return the name of the objective function */
|
303
|
+
|
304
|
+
virtual std::string getObjName (unsigned maxLen = std::string::npos) const ;
|
305
|
+
|
306
|
+
/*! \brief Set the name of the objective function */
|
307
|
+
|
308
|
+
virtual void setObjName (std::string name) ;
|
309
|
+
|
310
|
+
/*! \brief Return the name of the row. */
|
311
|
+
|
312
|
+
virtual std::string getRowName(int rowIndex,
|
313
|
+
unsigned maxLen = std::string::npos) const ;
|
314
|
+
|
315
|
+
/*! \brief Return a pointer to a vector of row names */
|
316
|
+
|
317
|
+
virtual const OsiNameVec &getRowNames() ;
|
318
|
+
|
319
|
+
/*! \brief Set a row name */
|
320
|
+
|
321
|
+
virtual void setRowName(int ndx, std::string name) ;
|
322
|
+
|
323
|
+
/*! \brief Set multiple row names */
|
324
|
+
|
325
|
+
virtual void setRowNames(OsiNameVec &srcNames,
|
326
|
+
int srcStart, int len, int tgtStart) ;
|
327
|
+
|
328
|
+
/*! \brief Delete len row names starting at index tgtStart */
|
329
|
+
|
330
|
+
virtual void deleteRowNames(int tgtStart, int len) ;
|
331
|
+
|
332
|
+
/*! \brief Return the name of the column */
|
333
|
+
|
334
|
+
virtual std::string getColName(int colIndex,
|
335
|
+
unsigned maxLen = std::string::npos) const ;
|
336
|
+
|
337
|
+
/*! \brief Return a pointer to a vector of column names */
|
338
|
+
|
339
|
+
virtual const OsiNameVec &getColNames() ;
|
340
|
+
|
341
|
+
/*! \brief Set a column name */
|
342
|
+
|
343
|
+
virtual void setColName(int ndx, std::string name) ;
|
344
|
+
|
345
|
+
/*! \brief Set multiple column names */
|
346
|
+
|
347
|
+
virtual void setColNames(OsiNameVec &srcNames,
|
348
|
+
int srcStart, int len, int tgtStart) ;
|
349
|
+
|
350
|
+
/*! \brief Delete len column names starting at index tgtStart */
|
351
|
+
virtual void deleteColNames(int tgtStart, int len) ;
|
352
|
+
|
353
|
+
//@}
|
354
|
+
|
355
|
+
//@}
|
356
|
+
|
357
|
+
//---------------------------------------------------------------------------
|
358
|
+
|
359
|
+
/**@name Problem modifying methods */
|
360
|
+
//@{
|
361
|
+
//-------------------------------------------------------------------------
|
362
|
+
/**@name Changing bounds on variables and constraints */
|
363
|
+
//@{
|
364
|
+
/** Set an objective function coefficient */
|
365
|
+
virtual void setObjCoeff( int elementIndex, double elementValue );
|
366
|
+
|
367
|
+
using OsiSolverInterface::setColLower ;
|
368
|
+
/** Set a single column lower bound<br>
|
369
|
+
Use -DBL_MAX for -infinity. */
|
370
|
+
virtual void setColLower( int elementIndex, double elementValue );
|
371
|
+
|
372
|
+
using OsiSolverInterface::setColUpper ;
|
373
|
+
/** Set a single column upper bound<br>
|
374
|
+
Use DBL_MAX for infinity. */
|
375
|
+
virtual void setColUpper( int elementIndex, double elementValue );
|
376
|
+
|
377
|
+
/** Set a single column lower and upper bound */
|
378
|
+
virtual void setColBounds( int elementIndex,
|
379
|
+
double lower, double upper );
|
380
|
+
|
381
|
+
/** Set the bounds on a number of columns simultaneously<br>
|
382
|
+
The default implementation just invokes setColLower() and
|
383
|
+
setColUpper() over and over again.
|
384
|
+
@param indexFirst,indexLast pointers to the beginning and after the
|
385
|
+
end of the array of the indices of the variables whose
|
386
|
+
<em>either</em> bound changes
|
387
|
+
@param boundList the new lower/upper bound pairs for the variables
|
388
|
+
*/
|
389
|
+
virtual void setColSetBounds(const int* indexFirst,
|
390
|
+
const int* indexLast,
|
391
|
+
const double* boundList);
|
392
|
+
|
393
|
+
/** Set a single row lower bound<br>
|
394
|
+
Use -DBL_MAX for -infinity. */
|
395
|
+
virtual void setRowLower( int elementIndex, double elementValue );
|
396
|
+
|
397
|
+
/** Set a single row upper bound<br>
|
398
|
+
Use DBL_MAX for infinity. */
|
399
|
+
virtual void setRowUpper( int elementIndex, double elementValue ) ;
|
400
|
+
|
401
|
+
/** Set a single row lower and upper bound */
|
402
|
+
virtual void setRowBounds( int elementIndex,
|
403
|
+
double lower, double upper ) ;
|
404
|
+
|
405
|
+
/** Set the type of a single row<br> */
|
406
|
+
virtual void setRowType(int index, char sense, double rightHandSide,
|
407
|
+
double range);
|
408
|
+
|
409
|
+
/** Set the bounds on a number of rows simultaneously<br>
|
410
|
+
The default implementation just invokes setRowLower() and
|
411
|
+
setRowUpper() over and over again.
|
412
|
+
@param indexFirst,indexLast pointers to the beginning and after the
|
413
|
+
end of the array of the indices of the constraints whose
|
414
|
+
<em>either</em> bound changes
|
415
|
+
@param boundList the new lower/upper bound pairs for the constraints
|
416
|
+
*/
|
417
|
+
virtual void setRowSetBounds(const int* indexFirst,
|
418
|
+
const int* indexLast,
|
419
|
+
const double* boundList);
|
420
|
+
|
421
|
+
/** Set the type of a number of rows simultaneously<br>
|
422
|
+
The default implementation just invokes setRowType()
|
423
|
+
over and over again.
|
424
|
+
@param indexFirst,indexLast pointers to the beginning and after the
|
425
|
+
end of the array of the indices of the constraints whose
|
426
|
+
<em>any</em> characteristics changes
|
427
|
+
@param senseList the new senses
|
428
|
+
@param rhsList the new right hand sides
|
429
|
+
@param rangeList the new ranges
|
430
|
+
*/
|
431
|
+
virtual void setRowSetTypes(const int* indexFirst,
|
432
|
+
const int* indexLast,
|
433
|
+
const char* senseList,
|
434
|
+
const double* rhsList,
|
435
|
+
const double* rangeList);
|
436
|
+
//@}
|
437
|
+
|
438
|
+
//-------------------------------------------------------------------------
|
439
|
+
/**@name Integrality related changing methods */
|
440
|
+
//@{
|
441
|
+
/** Set the index-th variable to be a continuous variable */
|
442
|
+
virtual void setContinuous(int index);
|
443
|
+
/** Set the index-th variable to be an integer variable */
|
444
|
+
virtual void setInteger(int index);
|
445
|
+
/** Set the variables listed in indices (which is of length len) to be
|
446
|
+
continuous variables */
|
447
|
+
virtual void setContinuous(const int* indices, int len);
|
448
|
+
/** Set the variables listed in indices (which is of length len) to be
|
449
|
+
integer variables */
|
450
|
+
virtual void setInteger(const int* indices, int len);
|
451
|
+
//@}
|
452
|
+
|
453
|
+
//-------------------------------------------------------------------------
|
454
|
+
/// Set objective function sense (1 for min (default), -1 for max,)
|
455
|
+
virtual void setObjSense(double s );
|
456
|
+
|
457
|
+
/** Set the primal solution column values
|
458
|
+
|
459
|
+
colsol[numcols()] is an array of values of the problem column
|
460
|
+
variables. These values are copied to memory owned by the
|
461
|
+
solver object or the solver. They will be returned as the
|
462
|
+
result of colsol() until changed by another call to
|
463
|
+
setColsol() or by a call to any solver routine. Whether the
|
464
|
+
solver makes use of the solution in any way is
|
465
|
+
solver-dependent.
|
466
|
+
*/
|
467
|
+
virtual void setColSolution(const double * colsol);
|
468
|
+
|
469
|
+
/** Set dual solution vector
|
470
|
+
|
471
|
+
rowprice[numrows()] is an array of values of the problem row
|
472
|
+
dual variables. These values are copied to memory owned by the
|
473
|
+
solver object or the solver. They will be returned as the
|
474
|
+
result of rowprice() until changed by another call to
|
475
|
+
setRowprice() or by a call to any solver routine. Whether the
|
476
|
+
solver makes use of the solution in any way is
|
477
|
+
solver-dependent.
|
478
|
+
*/
|
479
|
+
virtual void setRowPrice(const double * rowprice);
|
480
|
+
|
481
|
+
//-------------------------------------------------------------------------
|
482
|
+
/**@name Methods to expand a problem.<br>
|
483
|
+
Note that if a column is added then by default it will correspond to a
|
484
|
+
continuous variable. */
|
485
|
+
//@{
|
486
|
+
using OsiSolverInterface::addCol ;
|
487
|
+
/** */
|
488
|
+
virtual void addCol(const CoinPackedVectorBase& vec,
|
489
|
+
const double collb, const double colub,
|
490
|
+
const double obj);
|
491
|
+
/** Add a column (primal variable) to the problem. */
|
492
|
+
virtual void addCol(int numberElements, const int * rows, const double * elements,
|
493
|
+
const double collb, const double colub,
|
494
|
+
const double obj) ;
|
495
|
+
|
496
|
+
using OsiSolverInterface::addCols ;
|
497
|
+
/** */
|
498
|
+
virtual void addCols(const int numcols,
|
499
|
+
const CoinPackedVectorBase * const * cols,
|
500
|
+
const double* collb, const double* colub,
|
501
|
+
const double* obj);
|
502
|
+
/** */
|
503
|
+
virtual void deleteCols(const int num, const int * colIndices);
|
504
|
+
|
505
|
+
using OsiSolverInterface::addRow ;
|
506
|
+
/** */
|
507
|
+
virtual void addRow(const CoinPackedVectorBase& vec,
|
508
|
+
const double rowlb, const double rowub);
|
509
|
+
/** */
|
510
|
+
virtual void addRow(const CoinPackedVectorBase& vec,
|
511
|
+
const char rowsen, const double rowrhs,
|
512
|
+
const double rowrng);
|
513
|
+
|
514
|
+
using OsiSolverInterface::addRows ;
|
515
|
+
/** */
|
516
|
+
virtual void addRows(const int numrows,
|
517
|
+
const CoinPackedVectorBase * const * rows,
|
518
|
+
const double* rowlb, const double* rowub);
|
519
|
+
/** */
|
520
|
+
virtual void addRows(const int numrows,
|
521
|
+
const CoinPackedVectorBase * const * rows,
|
522
|
+
const char* rowsen, const double* rowrhs,
|
523
|
+
const double* rowrng);
|
524
|
+
/** */
|
525
|
+
virtual void deleteRows(const int num, const int * rowIndices);
|
526
|
+
|
527
|
+
//-----------------------------------------------------------------------
|
528
|
+
/** Apply a collection of row cuts which are all effective.
|
529
|
+
applyCuts seems to do one at a time which seems inefficient.
|
530
|
+
*/
|
531
|
+
virtual void applyRowCuts(int numberCuts, const OsiRowCut * cuts);
|
532
|
+
/** Apply a collection of row cuts which are all effective.
|
533
|
+
applyCuts seems to do one at a time which seems inefficient.
|
534
|
+
This uses array of pointers
|
535
|
+
*/
|
536
|
+
virtual void applyRowCuts(int numberCuts, const OsiRowCut ** cuts);
|
537
|
+
//@}
|
538
|
+
//@}
|
539
|
+
|
540
|
+
//---------------------------------------------------------------------------
|
541
|
+
|
542
|
+
public:
|
543
|
+
|
544
|
+
/**@name Methods to input a problem */
|
545
|
+
//@{
|
546
|
+
/** Load in an problem by copying the arguments (the constraints on the
|
547
|
+
rows are given by lower and upper bounds). If a pointer is 0 then the
|
548
|
+
following values are the default:
|
549
|
+
<ul>
|
550
|
+
<li> <code>colub</code>: all columns have upper bound infinity
|
551
|
+
<li> <code>collb</code>: all columns have lower bound 0
|
552
|
+
<li> <code>rowub</code>: all rows have upper bound infinity
|
553
|
+
<li> <code>rowlb</code>: all rows have lower bound -infinity
|
554
|
+
<li> <code>obj</code>: all variables have 0 objective coefficient
|
555
|
+
</ul>
|
556
|
+
*/
|
557
|
+
virtual void loadProblem(const CoinPackedMatrix& matrix,
|
558
|
+
const double* collb, const double* colub,
|
559
|
+
const double* obj,
|
560
|
+
const double* rowlb, const double* rowub);
|
561
|
+
|
562
|
+
/** Load in an problem by assuming ownership of the arguments (the
|
563
|
+
constraints on the rows are given by lower and upper bounds). For
|
564
|
+
default values see the previous method. <br>
|
565
|
+
<strong>WARNING</strong>: The arguments passed to this method will be
|
566
|
+
freed using the C++ <code>delete</code> and <code>delete[]</code>
|
567
|
+
functions.
|
568
|
+
*/
|
569
|
+
virtual void assignProblem(CoinPackedMatrix*& matrix,
|
570
|
+
double*& collb, double*& colub, double*& obj,
|
571
|
+
double*& rowlb, double*& rowub);
|
572
|
+
|
573
|
+
/** Load in an problem by copying the arguments (the constraints on the
|
574
|
+
rows are given by sense/rhs/range triplets). If a pointer is 0 then the
|
575
|
+
following values are the default:
|
576
|
+
<ul>
|
577
|
+
<li> <code>colub</code>: all columns have upper bound infinity
|
578
|
+
<li> <code>collb</code>: all columns have lower bound 0
|
579
|
+
<li> <code>obj</code>: all variables have 0 objective coefficient
|
580
|
+
<li> <code>rowsen</code>: all rows are >=
|
581
|
+
<li> <code>rowrhs</code>: all right hand sides are 0
|
582
|
+
<li> <code>rowrng</code>: 0 for the ranged rows
|
583
|
+
</ul>
|
584
|
+
*/
|
585
|
+
virtual void loadProblem(const CoinPackedMatrix& matrix,
|
586
|
+
const double* collb, const double* colub,
|
587
|
+
const double* obj,
|
588
|
+
const char* rowsen, const double* rowrhs,
|
589
|
+
const double* rowrng);
|
590
|
+
|
591
|
+
/** Load in an problem by assuming ownership of the arguments (the
|
592
|
+
constraints on the rows are given by sense/rhs/range triplets). For
|
593
|
+
default values see the previous method. <br>
|
594
|
+
<strong>WARNING</strong>: The arguments passed to this method will be
|
595
|
+
freed using the C++ <code>delete</code> and <code>delete[]</code>
|
596
|
+
functions.
|
597
|
+
*/
|
598
|
+
virtual void assignProblem(CoinPackedMatrix*& matrix,
|
599
|
+
double*& collb, double*& colub, double*& obj,
|
600
|
+
char*& rowsen, double*& rowrhs,
|
601
|
+
double*& rowrng);
|
602
|
+
|
603
|
+
/** Just like the other loadProblem() methods except that the matrix is
|
604
|
+
given in a standard column major ordered format (without gaps). */
|
605
|
+
virtual void loadProblem(const int numcols, const int numrows,
|
606
|
+
const CoinBigIndex * start, const int* index,
|
607
|
+
const double* value,
|
608
|
+
const double* collb, const double* colub,
|
609
|
+
const double* obj,
|
610
|
+
const double* rowlb, const double* rowub);
|
611
|
+
|
612
|
+
/** Just like the other loadProblem() methods except that the matrix is
|
613
|
+
given in a standard column major ordered format (without gaps). */
|
614
|
+
virtual void loadProblem(const int numcols, const int numrows,
|
615
|
+
const CoinBigIndex * start, const int* index,
|
616
|
+
const double* value,
|
617
|
+
const double* collb, const double* colub,
|
618
|
+
const double* obj,
|
619
|
+
const char* rowsen, const double* rowrhs,
|
620
|
+
const double* rowrng);
|
621
|
+
|
622
|
+
using OsiSolverInterface::readMps ;
|
623
|
+
/** Read an mps file from the given filename (defaults to Osi reader) - returns
|
624
|
+
number of errors (see OsiMpsReader class) */
|
625
|
+
virtual int readMps(const char *filename,
|
626
|
+
const char *extension = "mps") ;
|
627
|
+
|
628
|
+
/** Write the problem into an mps file of the given filename.
|
629
|
+
If objSense is non zero then -1.0 forces the code to write a
|
630
|
+
maximization objective and +1.0 to write a minimization one.
|
631
|
+
If 0.0 then solver can do what it wants */
|
632
|
+
virtual void writeMps(const char *filename,
|
633
|
+
const char *extension = "mps",
|
634
|
+
double objSense=0.0) const;
|
635
|
+
/** Write the problem into an mps file of the given filename,
|
636
|
+
names may be null. formatType is
|
637
|
+
0 - normal
|
638
|
+
1 - extra accuracy
|
639
|
+
2 - IEEE hex (later)
|
640
|
+
|
641
|
+
Returns non-zero on I/O error
|
642
|
+
*/
|
643
|
+
virtual int writeMpsNative(const char *filename,
|
644
|
+
const char ** rowNames, const char ** columnNames,
|
645
|
+
int formatType=0,int numberAcross=2,
|
646
|
+
double objSense=0.0) const ;
|
647
|
+
//@}
|
648
|
+
|
649
|
+
/**@name Message handling (extra for Cbc messages).
|
650
|
+
Normally I presume you would want the same language.
|
651
|
+
If not then you could use underlying model pointer */
|
652
|
+
//@{
|
653
|
+
/// Set language
|
654
|
+
void newLanguage(CoinMessages::Language language);
|
655
|
+
void setLanguage(CoinMessages::Language language)
|
656
|
+
{newLanguage(language);}
|
657
|
+
//@}
|
658
|
+
//---------------------------------------------------------------------------
|
659
|
+
|
660
|
+
/**@name Cbc specific public interfaces */
|
661
|
+
//@{
|
662
|
+
/// Get pointer to Cbc model
|
663
|
+
inline CbcModel * getModelPtr() const
|
664
|
+
{ return modelPtr_;}
|
665
|
+
/// Get pointer to underlying solver
|
666
|
+
inline OsiSolverInterface * getRealSolverPtr() const
|
667
|
+
{ return modelPtr_->solver();}
|
668
|
+
/// Set cutoff bound on the objective function.
|
669
|
+
inline void setCutoff(double value)
|
670
|
+
{ modelPtr_->setCutoff(value);}
|
671
|
+
/// Get the cutoff bound on the objective function - always as minimize
|
672
|
+
inline double getCutoff() const
|
673
|
+
{ return modelPtr_->getCutoff();}
|
674
|
+
/// Set the CbcModel::CbcMaxNumNode maximum node limit
|
675
|
+
inline void setMaximumNodes( int value)
|
676
|
+
{ modelPtr_->setMaximumNodes(value);}
|
677
|
+
/// Get the CbcModel::CbcMaxNumNode maximum node limit
|
678
|
+
inline int getMaximumNodes() const
|
679
|
+
{ return modelPtr_->getMaximumNodes();}
|
680
|
+
/// Set the CbcModel::CbcMaxNumSol maximum number of solutions
|
681
|
+
inline void setMaximumSolutions( int value)
|
682
|
+
{ modelPtr_->setMaximumSolutions(value);}
|
683
|
+
/// Get the CbcModel::CbcMaxNumSol maximum number of solutions
|
684
|
+
inline int getMaximumSolutions() const
|
685
|
+
{ return modelPtr_->getMaximumSolutions();}
|
686
|
+
/// Set the CbcModel::CbcMaximumSeconds maximum number of seconds
|
687
|
+
inline void setMaximumSeconds( double value)
|
688
|
+
{ modelPtr_->setMaximumSeconds(value);}
|
689
|
+
/// Get the CbcModel::CbcMaximumSeconds maximum number of seconds
|
690
|
+
inline double getMaximumSeconds() const
|
691
|
+
{ return modelPtr_->getMaximumSeconds();}
|
692
|
+
/// Node limit reached?
|
693
|
+
inline bool isNodeLimitReached() const
|
694
|
+
{ return modelPtr_->isNodeLimitReached();}
|
695
|
+
/// Solution limit reached?
|
696
|
+
inline bool isSolutionLimitReached() const
|
697
|
+
{ return modelPtr_->isSolutionLimitReached();}
|
698
|
+
/// Get how many Nodes it took to solve the problem.
|
699
|
+
inline int getNodeCount() const
|
700
|
+
{ return modelPtr_->getNodeCount();}
|
701
|
+
/// Final status of problem - 0 finished, 1 stopped, 2 difficulties
|
702
|
+
inline int status() const
|
703
|
+
{ return modelPtr_->status();}
|
704
|
+
/** Pass in a message handler
|
705
|
+
|
706
|
+
It is the client's responsibility to destroy a message handler installed
|
707
|
+
by this routine; it will not be destroyed when the solver interface is
|
708
|
+
destroyed.
|
709
|
+
*/
|
710
|
+
virtual void passInMessageHandler(CoinMessageHandler * handler);
|
711
|
+
//@}
|
712
|
+
|
713
|
+
//---------------------------------------------------------------------------
|
714
|
+
|
715
|
+
/**@name Constructors and destructors */
|
716
|
+
//@{
|
717
|
+
/// Default Constructor
|
718
|
+
OsiCbcSolverInterface (OsiSolverInterface * solver=NULL,
|
719
|
+
CbcStrategy * strategy=NULL);
|
720
|
+
|
721
|
+
/// Clone
|
722
|
+
virtual OsiSolverInterface * clone(bool copyData = true) const;
|
723
|
+
|
724
|
+
/// Copy constructor
|
725
|
+
OsiCbcSolverInterface (const OsiCbcSolverInterface &);
|
726
|
+
#if 0
|
727
|
+
/// Borrow constructor - only delete one copy
|
728
|
+
OsiCbcSolverInterface (CbcModel * rhs, bool reallyOwn=false);
|
729
|
+
|
730
|
+
/// Releases so won't error
|
731
|
+
void releaseCbc();
|
732
|
+
#endif
|
733
|
+
/// Assignment operator
|
734
|
+
OsiCbcSolverInterface & operator=(const OsiCbcSolverInterface& rhs);
|
735
|
+
|
736
|
+
/// Destructor
|
737
|
+
virtual ~OsiCbcSolverInterface ();
|
738
|
+
|
739
|
+
//@}
|
740
|
+
//---------------------------------------------------------------------------
|
741
|
+
|
742
|
+
protected:
|
743
|
+
///@name Protected methods
|
744
|
+
//@{
|
745
|
+
/** Apply a row cut (append to constraint matrix). */
|
746
|
+
virtual void applyRowCut(const OsiRowCut& rc);
|
747
|
+
|
748
|
+
/** Apply a column cut (adjust one or more bounds). */
|
749
|
+
virtual void applyColCut(const OsiColCut& cc);
|
750
|
+
//@}
|
751
|
+
/**@name Protected member data */
|
752
|
+
//@{
|
753
|
+
/// Cbc model represented by this class instance
|
754
|
+
mutable CbcModel * modelPtr_;
|
755
|
+
//@}
|
756
|
+
};
|
757
|
+
// So unit test can find out if NDEBUG set
|
758
|
+
bool OsiCbcHasNDEBUG();
|
759
|
+
|
760
|
+
//#############################################################################
|
761
|
+
/** A function that tests the methods in the OsiCbcSolverInterface class. */
|
762
|
+
void OsiCbcSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
|
763
|
+
|
764
|
+
#endif
|