ruby-cbc 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +4 -0
  5. data/Gemfile +4 -0
  6. data/README.md +203 -0
  7. data/Rakefile +40 -0
  8. data/bin/console +14 -0
  9. data/bin/setup +7 -0
  10. data/ext/ruby-cbc/cbc.i +15 -0
  11. data/ext/ruby-cbc/cbc_wrap.c +4618 -0
  12. data/ext/ruby-cbc/extconf.rb +60 -0
  13. data/ext/ruby-cbc/install/bin/cbc +0 -0
  14. data/ext/ruby-cbc/install/bin/clp +0 -0
  15. data/ext/ruby-cbc/install/include/coin/CbcBranchActual.hpp +24 -0
  16. data/ext/ruby-cbc/install/include/coin/CbcBranchAllDifferent.hpp +62 -0
  17. data/ext/ruby-cbc/install/include/coin/CbcBranchBase.hpp +78 -0
  18. data/ext/ruby-cbc/install/include/coin/CbcBranchCut.hpp +183 -0
  19. data/ext/ruby-cbc/install/include/coin/CbcBranchDecision.hpp +129 -0
  20. data/ext/ruby-cbc/install/include/coin/CbcBranchDefaultDecision.hpp +100 -0
  21. data/ext/ruby-cbc/install/include/coin/CbcBranchDynamic.hpp +206 -0
  22. data/ext/ruby-cbc/install/include/coin/CbcBranchLotsize.hpp +242 -0
  23. data/ext/ruby-cbc/install/include/coin/CbcBranchToFixLots.hpp +94 -0
  24. data/ext/ruby-cbc/install/include/coin/CbcBranchingObject.hpp +236 -0
  25. data/ext/ruby-cbc/install/include/coin/CbcClique.hpp +303 -0
  26. data/ext/ruby-cbc/install/include/coin/CbcCompare.hpp +39 -0
  27. data/ext/ruby-cbc/install/include/coin/CbcCompareActual.hpp +14 -0
  28. data/ext/ruby-cbc/install/include/coin/CbcCompareBase.hpp +142 -0
  29. data/ext/ruby-cbc/install/include/coin/CbcCompareDefault.hpp +120 -0
  30. data/ext/ruby-cbc/install/include/coin/CbcCompareDepth.hpp +47 -0
  31. data/ext/ruby-cbc/install/include/coin/CbcCompareEstimate.hpp +48 -0
  32. data/ext/ruby-cbc/install/include/coin/CbcCompareObjective.hpp +49 -0
  33. data/ext/ruby-cbc/install/include/coin/CbcConfig.h +14 -0
  34. data/ext/ruby-cbc/install/include/coin/CbcConsequence.hpp +49 -0
  35. data/ext/ruby-cbc/install/include/coin/CbcCountRowCut.hpp +168 -0
  36. data/ext/ruby-cbc/install/include/coin/CbcCutGenerator.hpp +482 -0
  37. data/ext/ruby-cbc/install/include/coin/CbcCutModifier.hpp +57 -0
  38. data/ext/ruby-cbc/install/include/coin/CbcCutSubsetModifier.hpp +66 -0
  39. data/ext/ruby-cbc/install/include/coin/CbcDummyBranchingObject.hpp +83 -0
  40. data/ext/ruby-cbc/install/include/coin/CbcEventHandler.hpp +245 -0
  41. data/ext/ruby-cbc/install/include/coin/CbcFathom.hpp +137 -0
  42. data/ext/ruby-cbc/install/include/coin/CbcFathomDynamicProgramming.hpp +169 -0
  43. data/ext/ruby-cbc/install/include/coin/CbcFeasibilityBase.hpp +56 -0
  44. data/ext/ruby-cbc/install/include/coin/CbcFixVariable.hpp +67 -0
  45. data/ext/ruby-cbc/install/include/coin/CbcFollowOn.hpp +207 -0
  46. data/ext/ruby-cbc/install/include/coin/CbcFullNodeInfo.hpp +161 -0
  47. data/ext/ruby-cbc/install/include/coin/CbcGeneral.hpp +60 -0
  48. data/ext/ruby-cbc/install/include/coin/CbcGeneralDepth.hpp +279 -0
  49. data/ext/ruby-cbc/install/include/coin/CbcHeuristic.hpp +682 -0
  50. data/ext/ruby-cbc/install/include/coin/CbcHeuristicDINS.hpp +96 -0
  51. data/ext/ruby-cbc/install/include/coin/CbcHeuristicDW.hpp +309 -0
  52. data/ext/ruby-cbc/install/include/coin/CbcHeuristicDive.hpp +192 -0
  53. data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveCoefficient.hpp +52 -0
  54. data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveFractional.hpp +52 -0
  55. data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveGuided.hpp +55 -0
  56. data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveLineSearch.hpp +52 -0
  57. data/ext/ruby-cbc/install/include/coin/CbcHeuristicDivePseudoCost.hpp +60 -0
  58. data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveVectorLength.hpp +52 -0
  59. data/ext/ruby-cbc/install/include/coin/CbcHeuristicFPump.hpp +340 -0
  60. data/ext/ruby-cbc/install/include/coin/CbcHeuristicGreedy.hpp +280 -0
  61. data/ext/ruby-cbc/install/include/coin/CbcHeuristicLocal.hpp +271 -0
  62. data/ext/ruby-cbc/install/include/coin/CbcHeuristicPivotAndFix.hpp +58 -0
  63. data/ext/ruby-cbc/install/include/coin/CbcHeuristicRENS.hpp +77 -0
  64. data/ext/ruby-cbc/install/include/coin/CbcHeuristicRINS.hpp +102 -0
  65. data/ext/ruby-cbc/install/include/coin/CbcHeuristicRandRound.hpp +58 -0
  66. data/ext/ruby-cbc/install/include/coin/CbcHeuristicVND.hpp +94 -0
  67. data/ext/ruby-cbc/install/include/coin/CbcLinked.hpp +1406 -0
  68. data/ext/ruby-cbc/install/include/coin/CbcMessage.hpp +94 -0
  69. data/ext/ruby-cbc/install/include/coin/CbcMipStartIO.hpp +26 -0
  70. data/ext/ruby-cbc/install/include/coin/CbcModel.hpp +2952 -0
  71. data/ext/ruby-cbc/install/include/coin/CbcNWay.hpp +166 -0
  72. data/ext/ruby-cbc/install/include/coin/CbcNode.hpp +351 -0
  73. data/ext/ruby-cbc/install/include/coin/CbcNodeInfo.hpp +349 -0
  74. data/ext/ruby-cbc/install/include/coin/CbcObject.hpp +272 -0
  75. data/ext/ruby-cbc/install/include/coin/CbcObjectUpdateData.hpp +64 -0
  76. data/ext/ruby-cbc/install/include/coin/CbcOrClpParam.cpp +4134 -0
  77. data/ext/ruby-cbc/install/include/coin/CbcOrClpParam.hpp +532 -0
  78. data/ext/ruby-cbc/install/include/coin/CbcParam.hpp +324 -0
  79. data/ext/ruby-cbc/install/include/coin/CbcPartialNodeInfo.hpp +110 -0
  80. data/ext/ruby-cbc/install/include/coin/CbcSOS.hpp +279 -0
  81. data/ext/ruby-cbc/install/include/coin/CbcSimpleInteger.hpp +286 -0
  82. data/ext/ruby-cbc/install/include/coin/CbcSimpleIntegerDynamicPseudoCost.hpp +564 -0
  83. data/ext/ruby-cbc/install/include/coin/CbcSimpleIntegerPseudoCost.hpp +114 -0
  84. data/ext/ruby-cbc/install/include/coin/CbcSolver.hpp +447 -0
  85. data/ext/ruby-cbc/install/include/coin/CbcStrategy.hpp +258 -0
  86. data/ext/ruby-cbc/install/include/coin/CbcSubProblem.hpp +83 -0
  87. data/ext/ruby-cbc/install/include/coin/CbcTree.hpp +490 -0
  88. data/ext/ruby-cbc/install/include/coin/CbcTreeLocal.hpp +372 -0
  89. data/ext/ruby-cbc/install/include/coin/Cbc_C_Interface.h +381 -0
  90. data/ext/ruby-cbc/install/include/coin/Cgl012cut.hpp +464 -0
  91. data/ext/ruby-cbc/install/include/coin/CglAllDifferent.hpp +115 -0
  92. data/ext/ruby-cbc/install/include/coin/CglClique.hpp +308 -0
  93. data/ext/ruby-cbc/install/include/coin/CglConfig.h +19 -0
  94. data/ext/ruby-cbc/install/include/coin/CglCutGenerator.hpp +121 -0
  95. data/ext/ruby-cbc/install/include/coin/CglDuplicateRow.hpp +189 -0
  96. data/ext/ruby-cbc/install/include/coin/CglFlowCover.hpp +371 -0
  97. data/ext/ruby-cbc/install/include/coin/CglGMI.hpp +364 -0
  98. data/ext/ruby-cbc/install/include/coin/CglGMIParam.hpp +313 -0
  99. data/ext/ruby-cbc/install/include/coin/CglGomory.hpp +204 -0
  100. data/ext/ruby-cbc/install/include/coin/CglKnapsackCover.hpp +310 -0
  101. data/ext/ruby-cbc/install/include/coin/CglLandP.hpp +306 -0
  102. data/ext/ruby-cbc/install/include/coin/CglLandPValidator.hpp +130 -0
  103. data/ext/ruby-cbc/install/include/coin/CglLiftAndProject.hpp +104 -0
  104. data/ext/ruby-cbc/install/include/coin/CglMessage.hpp +50 -0
  105. data/ext/ruby-cbc/install/include/coin/CglMixedIntegerRounding.hpp +429 -0
  106. data/ext/ruby-cbc/install/include/coin/CglMixedIntegerRounding2.hpp +427 -0
  107. data/ext/ruby-cbc/install/include/coin/CglOddHole.hpp +160 -0
  108. data/ext/ruby-cbc/install/include/coin/CglParam.hpp +93 -0
  109. data/ext/ruby-cbc/install/include/coin/CglPreProcess.hpp +492 -0
  110. data/ext/ruby-cbc/install/include/coin/CglProbing.hpp +543 -0
  111. data/ext/ruby-cbc/install/include/coin/CglRedSplit.hpp +448 -0
  112. data/ext/ruby-cbc/install/include/coin/CglRedSplit2.hpp +494 -0
  113. data/ext/ruby-cbc/install/include/coin/CglRedSplit2Param.hpp +495 -0
  114. data/ext/ruby-cbc/install/include/coin/CglRedSplitParam.hpp +272 -0
  115. data/ext/ruby-cbc/install/include/coin/CglResidualCapacity.hpp +240 -0
  116. data/ext/ruby-cbc/install/include/coin/CglSimpleRounding.hpp +174 -0
  117. data/ext/ruby-cbc/install/include/coin/CglStored.hpp +125 -0
  118. data/ext/ruby-cbc/install/include/coin/CglTreeInfo.hpp +180 -0
  119. data/ext/ruby-cbc/install/include/coin/CglTwomir.hpp +565 -0
  120. data/ext/ruby-cbc/install/include/coin/CglZeroHalf.hpp +133 -0
  121. data/ext/ruby-cbc/install/include/coin/ClpAmplObjective.hpp +113 -0
  122. data/ext/ruby-cbc/install/include/coin/ClpCholeskyBase.hpp +294 -0
  123. data/ext/ruby-cbc/install/include/coin/ClpCholeskyDense.hpp +162 -0
  124. data/ext/ruby-cbc/install/include/coin/ClpConfig.h +17 -0
  125. data/ext/ruby-cbc/install/include/coin/ClpConstraint.hpp +125 -0
  126. data/ext/ruby-cbc/install/include/coin/ClpConstraintAmpl.hpp +108 -0
  127. data/ext/ruby-cbc/install/include/coin/ClpConstraintLinear.hpp +110 -0
  128. data/ext/ruby-cbc/install/include/coin/ClpConstraintQuadratic.hpp +119 -0
  129. data/ext/ruby-cbc/install/include/coin/ClpDualRowDantzig.hpp +71 -0
  130. data/ext/ruby-cbc/install/include/coin/ClpDualRowPivot.hpp +129 -0
  131. data/ext/ruby-cbc/install/include/coin/ClpDualRowSteepest.hpp +153 -0
  132. data/ext/ruby-cbc/install/include/coin/ClpDummyMatrix.hpp +183 -0
  133. data/ext/ruby-cbc/install/include/coin/ClpDynamicExampleMatrix.hpp +186 -0
  134. data/ext/ruby-cbc/install/include/coin/ClpDynamicMatrix.hpp +381 -0
  135. data/ext/ruby-cbc/install/include/coin/ClpEventHandler.hpp +187 -0
  136. data/ext/ruby-cbc/install/include/coin/ClpFactorization.hpp +432 -0
  137. data/ext/ruby-cbc/install/include/coin/ClpGubDynamicMatrix.hpp +247 -0
  138. data/ext/ruby-cbc/install/include/coin/ClpGubMatrix.hpp +358 -0
  139. data/ext/ruby-cbc/install/include/coin/ClpInterior.hpp +570 -0
  140. data/ext/ruby-cbc/install/include/coin/ClpLinearObjective.hpp +103 -0
  141. data/ext/ruby-cbc/install/include/coin/ClpMatrixBase.hpp +524 -0
  142. data/ext/ruby-cbc/install/include/coin/ClpMessage.hpp +131 -0
  143. data/ext/ruby-cbc/install/include/coin/ClpModel.hpp +1307 -0
  144. data/ext/ruby-cbc/install/include/coin/ClpNetworkMatrix.hpp +229 -0
  145. data/ext/ruby-cbc/install/include/coin/ClpNode.hpp +349 -0
  146. data/ext/ruby-cbc/install/include/coin/ClpNonLinearCost.hpp +401 -0
  147. data/ext/ruby-cbc/install/include/coin/ClpObjective.hpp +134 -0
  148. data/ext/ruby-cbc/install/include/coin/ClpPackedMatrix.hpp +638 -0
  149. data/ext/ruby-cbc/install/include/coin/ClpParameters.hpp +126 -0
  150. data/ext/ruby-cbc/install/include/coin/ClpPdcoBase.hpp +103 -0
  151. data/ext/ruby-cbc/install/include/coin/ClpPlusMinusOneMatrix.hpp +290 -0
  152. data/ext/ruby-cbc/install/include/coin/ClpPresolve.hpp +299 -0
  153. data/ext/ruby-cbc/install/include/coin/ClpPrimalColumnDantzig.hpp +72 -0
  154. data/ext/ruby-cbc/install/include/coin/ClpPrimalColumnPivot.hpp +155 -0
  155. data/ext/ruby-cbc/install/include/coin/ClpPrimalColumnSteepest.hpp +247 -0
  156. data/ext/ruby-cbc/install/include/coin/ClpQuadraticObjective.hpp +155 -0
  157. data/ext/ruby-cbc/install/include/coin/ClpSimplex.hpp +1797 -0
  158. data/ext/ruby-cbc/install/include/coin/ClpSimplexDual.hpp +300 -0
  159. data/ext/ruby-cbc/install/include/coin/ClpSimplexNonlinear.hpp +117 -0
  160. data/ext/ruby-cbc/install/include/coin/ClpSimplexOther.hpp +277 -0
  161. data/ext/ruby-cbc/install/include/coin/ClpSimplexPrimal.hpp +244 -0
  162. data/ext/ruby-cbc/install/include/coin/ClpSolve.hpp +446 -0
  163. data/ext/ruby-cbc/install/include/coin/Clp_C_Interface.h +525 -0
  164. data/ext/ruby-cbc/install/include/coin/CoinAlloc.hpp +176 -0
  165. data/ext/ruby-cbc/install/include/coin/CoinBuild.hpp +149 -0
  166. data/ext/ruby-cbc/install/include/coin/CoinDenseFactorization.hpp +419 -0
  167. data/ext/ruby-cbc/install/include/coin/CoinDenseVector.hpp +383 -0
  168. data/ext/ruby-cbc/install/include/coin/CoinDistance.hpp +48 -0
  169. data/ext/ruby-cbc/install/include/coin/CoinError.hpp +257 -0
  170. data/ext/ruby-cbc/install/include/coin/CoinFactorization.hpp +2044 -0
  171. data/ext/ruby-cbc/install/include/coin/CoinFileIO.hpp +166 -0
  172. data/ext/ruby-cbc/install/include/coin/CoinFinite.hpp +34 -0
  173. data/ext/ruby-cbc/install/include/coin/CoinFloatEqual.hpp +177 -0
  174. data/ext/ruby-cbc/install/include/coin/CoinHelperFunctions.hpp +1111 -0
  175. data/ext/ruby-cbc/install/include/coin/CoinIndexedVector.hpp +1164 -0
  176. data/ext/ruby-cbc/install/include/coin/CoinLpIO.hpp +805 -0
  177. data/ext/ruby-cbc/install/include/coin/CoinMessage.hpp +96 -0
  178. data/ext/ruby-cbc/install/include/coin/CoinMessageHandler.hpp +666 -0
  179. data/ext/ruby-cbc/install/include/coin/CoinModel.hpp +1054 -0
  180. data/ext/ruby-cbc/install/include/coin/CoinModelUseful.hpp +441 -0
  181. data/ext/ruby-cbc/install/include/coin/CoinMpsIO.hpp +1056 -0
  182. data/ext/ruby-cbc/install/include/coin/CoinOslFactorization.hpp +280 -0
  183. data/ext/ruby-cbc/install/include/coin/CoinPackedMatrix.hpp +947 -0
  184. data/ext/ruby-cbc/install/include/coin/CoinPackedVector.hpp +657 -0
  185. data/ext/ruby-cbc/install/include/coin/CoinPackedVectorBase.hpp +269 -0
  186. data/ext/ruby-cbc/install/include/coin/CoinParam.hpp +644 -0
  187. data/ext/ruby-cbc/install/include/coin/CoinPragma.hpp +26 -0
  188. data/ext/ruby-cbc/install/include/coin/CoinPresolveDoubleton.hpp +73 -0
  189. data/ext/ruby-cbc/install/include/coin/CoinPresolveDual.hpp +85 -0
  190. data/ext/ruby-cbc/install/include/coin/CoinPresolveDupcol.hpp +226 -0
  191. data/ext/ruby-cbc/install/include/coin/CoinPresolveEmpty.hpp +116 -0
  192. data/ext/ruby-cbc/install/include/coin/CoinPresolveFixed.hpp +181 -0
  193. data/ext/ruby-cbc/install/include/coin/CoinPresolveForcing.hpp +61 -0
  194. data/ext/ruby-cbc/install/include/coin/CoinPresolveImpliedFree.hpp +60 -0
  195. data/ext/ruby-cbc/install/include/coin/CoinPresolveIsolated.hpp +51 -0
  196. data/ext/ruby-cbc/install/include/coin/CoinPresolveMatrix.hpp +1842 -0
  197. data/ext/ruby-cbc/install/include/coin/CoinPresolveMonitor.hpp +105 -0
  198. data/ext/ruby-cbc/install/include/coin/CoinPresolvePsdebug.hpp +166 -0
  199. data/ext/ruby-cbc/install/include/coin/CoinPresolveSingleton.hpp +112 -0
  200. data/ext/ruby-cbc/install/include/coin/CoinPresolveSubst.hpp +101 -0
  201. data/ext/ruby-cbc/install/include/coin/CoinPresolveTighten.hpp +55 -0
  202. data/ext/ruby-cbc/install/include/coin/CoinPresolveTripleton.hpp +66 -0
  203. data/ext/ruby-cbc/install/include/coin/CoinPresolveUseless.hpp +63 -0
  204. data/ext/ruby-cbc/install/include/coin/CoinPresolveZeros.hpp +60 -0
  205. data/ext/ruby-cbc/install/include/coin/CoinRational.hpp +44 -0
  206. data/ext/ruby-cbc/install/include/coin/CoinSearchTree.hpp +465 -0
  207. data/ext/ruby-cbc/install/include/coin/CoinShallowPackedVector.hpp +148 -0
  208. data/ext/ruby-cbc/install/include/coin/CoinSignal.hpp +117 -0
  209. data/ext/ruby-cbc/install/include/coin/CoinSimpFactorization.hpp +431 -0
  210. data/ext/ruby-cbc/install/include/coin/CoinSmartPtr.hpp +528 -0
  211. data/ext/ruby-cbc/install/include/coin/CoinSnapshot.hpp +476 -0
  212. data/ext/ruby-cbc/install/include/coin/CoinSort.hpp +678 -0
  213. data/ext/ruby-cbc/install/include/coin/CoinStructuredModel.hpp +247 -0
  214. data/ext/ruby-cbc/install/include/coin/CoinTime.hpp +310 -0
  215. data/ext/ruby-cbc/install/include/coin/CoinTypes.hpp +64 -0
  216. data/ext/ruby-cbc/install/include/coin/CoinUtility.hpp +19 -0
  217. data/ext/ruby-cbc/install/include/coin/CoinUtilsConfig.h +34 -0
  218. data/ext/ruby-cbc/install/include/coin/CoinWarmStart.hpp +58 -0
  219. data/ext/ruby-cbc/install/include/coin/CoinWarmStartBasis.hpp +456 -0
  220. data/ext/ruby-cbc/install/include/coin/CoinWarmStartDual.hpp +166 -0
  221. data/ext/ruby-cbc/install/include/coin/CoinWarmStartPrimalDual.hpp +211 -0
  222. data/ext/ruby-cbc/install/include/coin/CoinWarmStartVector.hpp +488 -0
  223. data/ext/ruby-cbc/install/include/coin/Coin_C_defines.h +115 -0
  224. data/ext/ruby-cbc/install/include/coin/Idiot.hpp +298 -0
  225. data/ext/ruby-cbc/install/include/coin/OsiAuxInfo.hpp +206 -0
  226. data/ext/ruby-cbc/install/include/coin/OsiBranchingObject.hpp +1005 -0
  227. data/ext/ruby-cbc/install/include/coin/OsiCbcSolverInterface.hpp +764 -0
  228. data/ext/ruby-cbc/install/include/coin/OsiChooseVariable.hpp +534 -0
  229. data/ext/ruby-cbc/install/include/coin/OsiClpSolverInterface.hpp +1509 -0
  230. data/ext/ruby-cbc/install/include/coin/OsiColCut.hpp +324 -0
  231. data/ext/ruby-cbc/install/include/coin/OsiCollections.hpp +35 -0
  232. data/ext/ruby-cbc/install/include/coin/OsiConfig.h +19 -0
  233. data/ext/ruby-cbc/install/include/coin/OsiCut.hpp +245 -0
  234. data/ext/ruby-cbc/install/include/coin/OsiCuts.hpp +474 -0
  235. data/ext/ruby-cbc/install/include/coin/OsiPresolve.hpp +252 -0
  236. data/ext/ruby-cbc/install/include/coin/OsiRowCut.hpp +331 -0
  237. data/ext/ruby-cbc/install/include/coin/OsiRowCutDebugger.hpp +187 -0
  238. data/ext/ruby-cbc/install/include/coin/OsiSolverBranch.hpp +152 -0
  239. data/ext/ruby-cbc/install/include/coin/OsiSolverInterface.hpp +2143 -0
  240. data/ext/ruby-cbc/install/include/coin/OsiSolverParameters.hpp +142 -0
  241. data/ext/ruby-cbc/install/include/coin/OsiUnitTests.hpp +374 -0
  242. data/ext/ruby-cbc/install/lib/libCbc.la +35 -0
  243. data/ext/ruby-cbc/install/lib/libCbc.so +0 -0
  244. data/ext/ruby-cbc/install/lib/libCbc.so.3 +0 -0
  245. data/ext/ruby-cbc/install/lib/libCbc.so.3.9.7 +0 -0
  246. data/ext/ruby-cbc/install/lib/libCbcSolver.la +35 -0
  247. data/ext/ruby-cbc/install/lib/libCbcSolver.so +0 -0
  248. data/ext/ruby-cbc/install/lib/libCbcSolver.so.3 +0 -0
  249. data/ext/ruby-cbc/install/lib/libCbcSolver.so.3.9.7 +0 -0
  250. data/ext/ruby-cbc/install/lib/libCgl.la +35 -0
  251. data/ext/ruby-cbc/install/lib/libCgl.so +0 -0
  252. data/ext/ruby-cbc/install/lib/libCgl.so.1 +0 -0
  253. data/ext/ruby-cbc/install/lib/libCgl.so.1.9.7 +0 -0
  254. data/ext/ruby-cbc/install/lib/libClp.la +35 -0
  255. data/ext/ruby-cbc/install/lib/libClp.so +0 -0
  256. data/ext/ruby-cbc/install/lib/libClp.so.1 +0 -0
  257. data/ext/ruby-cbc/install/lib/libClp.so.1.13.9 +0 -0
  258. data/ext/ruby-cbc/install/lib/libClpSolver.la +35 -0
  259. data/ext/ruby-cbc/install/lib/libClpSolver.so +0 -0
  260. data/ext/ruby-cbc/install/lib/libClpSolver.so.1 +0 -0
  261. data/ext/ruby-cbc/install/lib/libClpSolver.so.1.13.9 +0 -0
  262. data/ext/ruby-cbc/install/lib/libCoinUtils.la +35 -0
  263. data/ext/ruby-cbc/install/lib/libCoinUtils.so +0 -0
  264. data/ext/ruby-cbc/install/lib/libCoinUtils.so.3 +0 -0
  265. data/ext/ruby-cbc/install/lib/libCoinUtils.so.3.10.11 +0 -0
  266. data/ext/ruby-cbc/install/lib/libOsi.la +35 -0
  267. data/ext/ruby-cbc/install/lib/libOsi.so +0 -0
  268. data/ext/ruby-cbc/install/lib/libOsi.so.1 +0 -0
  269. data/ext/ruby-cbc/install/lib/libOsi.so.1.12.6 +0 -0
  270. data/ext/ruby-cbc/install/lib/libOsiCbc.la +35 -0
  271. data/ext/ruby-cbc/install/lib/libOsiCbc.so +0 -0
  272. data/ext/ruby-cbc/install/lib/libOsiCbc.so.3 +0 -0
  273. data/ext/ruby-cbc/install/lib/libOsiCbc.so.3.9.7 +0 -0
  274. data/ext/ruby-cbc/install/lib/libOsiClp.la +35 -0
  275. data/ext/ruby-cbc/install/lib/libOsiClp.so +0 -0
  276. data/ext/ruby-cbc/install/lib/libOsiClp.so.1 +0 -0
  277. data/ext/ruby-cbc/install/lib/libOsiClp.so.1.13.9 +0 -0
  278. data/ext/ruby-cbc/install/lib/libOsiCommonTests.la +35 -0
  279. data/ext/ruby-cbc/install/lib/libOsiCommonTests.so +0 -0
  280. data/ext/ruby-cbc/install/lib/libOsiCommonTests.so.1 +0 -0
  281. data/ext/ruby-cbc/install/lib/libOsiCommonTests.so.1.12.6 +0 -0
  282. data/ext/ruby-cbc/install/lib/pkgconfig/cbc.pc +12 -0
  283. data/ext/ruby-cbc/install/lib/pkgconfig/cgl.pc +12 -0
  284. data/ext/ruby-cbc/install/lib/pkgconfig/clp.pc +12 -0
  285. data/ext/ruby-cbc/install/lib/pkgconfig/coindatamiplib3.pc +9 -0
  286. data/ext/ruby-cbc/install/lib/pkgconfig/coindatasample.pc +9 -0
  287. data/ext/ruby-cbc/install/lib/pkgconfig/coinutils.pc +12 -0
  288. data/ext/ruby-cbc/install/lib/pkgconfig/osi-cbc.pc +12 -0
  289. data/ext/ruby-cbc/install/lib/pkgconfig/osi-clp.pc +12 -0
  290. data/ext/ruby-cbc/install/lib/pkgconfig/osi-unittests.pc +12 -0
  291. data/ext/ruby-cbc/install/lib/pkgconfig/osi.pc +12 -0
  292. data/lib/ruby-cbc/ilp/constant.rb +44 -0
  293. data/lib/ruby-cbc/ilp/constraint.rb +32 -0
  294. data/lib/ruby-cbc/ilp/objective.rb +26 -0
  295. data/lib/ruby-cbc/ilp/term.rb +47 -0
  296. data/lib/ruby-cbc/ilp/term_array.rb +80 -0
  297. data/lib/ruby-cbc/ilp/var.rb +62 -0
  298. data/lib/ruby-cbc/model.rb +125 -0
  299. data/lib/ruby-cbc/problem.rb +170 -0
  300. data/lib/ruby-cbc/version.rb +3 -0
  301. data/lib/ruby-cbc.rb +21 -0
  302. data/ruby-cbc.gemspec +36 -0
  303. metadata +431 -0
@@ -0,0 +1,1005 @@
1
+ // Copyright (C) 2006, International Business Machines
2
+ // Corporation and others. All Rights Reserved.
3
+ // This code is licensed under the terms of the Eclipse Public License (EPL).
4
+
5
+ #ifndef OsiBranchingObject_H
6
+ #define OsiBranchingObject_H
7
+
8
+ #include <cassert>
9
+ #include <string>
10
+ #include <vector>
11
+
12
+ #include "CoinError.hpp"
13
+ #include "CoinTypes.hpp"
14
+
15
+ class OsiSolverInterface;
16
+ class OsiSolverBranch;
17
+
18
+ class OsiBranchingObject;
19
+ class OsiBranchingInformation;
20
+
21
+ //#############################################################################
22
+ //This contains the abstract base class for an object and for branching.
23
+ //It also contains a simple integer class
24
+ //#############################################################################
25
+
26
+ /** Abstract base class for `objects'.
27
+
28
+ The branching model used in Osi is based on the idea of an <i>object</i>.
29
+ In the abstract, an object is something that has a feasible region, can be
30
+ evaluated for infeasibility, can be branched on (<i>i.e.</i>, there's some
31
+ constructive action to be taken to move toward feasibility), and allows
32
+ comparison of the effect of branching.
33
+
34
+ This class (OsiObject) is the base class for an object. To round out the
35
+ branching model, the class OsiBranchingObject describes how to perform a
36
+ branch, and the class OsiBranchDecision describes how to compare two
37
+ OsiBranchingObjects.
38
+
39
+ To create a new type of object you need to provide three methods:
40
+ #infeasibility(), #feasibleRegion(), and #createBranch(), described below.
41
+
42
+ This base class is primarily virtual to allow for any form of structure.
43
+ Any form of discontinuity is allowed.
44
+
45
+ As there is an overhead in getting information from solvers and because
46
+ other useful information is available there is also an OsiBranchingInformation
47
+ class which can contain pointers to information.
48
+ If used it must at minimum contain pointers to current value of objective,
49
+ maximum allowed objective and pointers to arrays for bounds and solution
50
+ and direction of optimization. Also integer and primal tolerance.
51
+
52
+ Classes which inherit might have other information such as depth, number of
53
+ solutions, pseudo-shadow prices etc etc.
54
+ May be easier just to throw in here - as I keep doing
55
+ */
56
+ class OsiObject {
57
+
58
+ public:
59
+
60
+ /// Default Constructor
61
+ OsiObject ();
62
+
63
+ /// Copy constructor
64
+ OsiObject ( const OsiObject &);
65
+
66
+ /// Assignment operator
67
+ OsiObject & operator=( const OsiObject& rhs);
68
+
69
+ /// Clone
70
+ virtual OsiObject * clone() const=0;
71
+
72
+ /// Destructor
73
+ virtual ~OsiObject ();
74
+
75
+ /** Infeasibility of the object
76
+
77
+ This is some measure of the infeasibility of the object. 0.0
78
+ indicates that the object is satisfied.
79
+
80
+ The preferred branching direction is returned in whichWay, where for
81
+ normal two-way branching 0 is down, 1 is up
82
+
83
+ This is used to prepare for strong branching but should also think of
84
+ case when no strong branching
85
+
86
+ The object may also compute an estimate of cost of going "up" or "down".
87
+ This will probably be based on pseudo-cost ideas
88
+
89
+ This should also set mutable infeasibility_ and whichWay_
90
+ This is for instant re-use for speed
91
+
92
+ Default for this just calls infeasibility with OsiBranchingInformation
93
+ NOTE - Convention says that an infeasibility of COIN_DBL_MAX means
94
+ object has worked out it can't be satisfied!
95
+ */
96
+ double infeasibility(const OsiSolverInterface * solver,int &whichWay) const ;
97
+ // Faster version when more information available
98
+ virtual double infeasibility(const OsiBranchingInformation * info, int &whichWay) const =0;
99
+ // This does NOT set mutable stuff
100
+ virtual double checkInfeasibility(const OsiBranchingInformation * info) const;
101
+
102
+ /** For the variable(s) referenced by the object,
103
+ look at the current solution and set bounds to match the solution.
104
+ Returns measure of how much it had to move solution to make feasible
105
+ */
106
+ virtual double feasibleRegion(OsiSolverInterface * solver) const ;
107
+ /** For the variable(s) referenced by the object,
108
+ look at the current solution and set bounds to match the solution.
109
+ Returns measure of how much it had to move solution to make feasible
110
+ Faster version
111
+ */
112
+ virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const =0;
113
+
114
+ /** Create a branching object and indicate which way to branch first.
115
+
116
+ The branching object has to know how to create branches (fix
117
+ variables, etc.)
118
+ */
119
+ virtual OsiBranchingObject * createBranch(OsiSolverInterface * /*solver*/,
120
+ const OsiBranchingInformation * /*info*/,
121
+ int /*way*/) const {throw CoinError("Need code","createBranch","OsiBranchingObject"); return NULL; }
122
+
123
+ /** \brief Return true if object can take part in normal heuristics
124
+ */
125
+ virtual bool canDoHeuristics() const
126
+ {return true;}
127
+ /** \brief Return true if object can take part in move to nearest heuristic
128
+ */
129
+ virtual bool canMoveToNearest() const
130
+ {return false;}
131
+ /** Column number if single column object -1 otherwise,
132
+ Used by heuristics
133
+ */
134
+ virtual int columnNumber() const;
135
+ /// Return Priority - note 1 is highest priority
136
+ inline int priority() const
137
+ { return priority_;}
138
+ /// Set priority
139
+ inline void setPriority(int priority)
140
+ { priority_ = priority;}
141
+ /** \brief Return true if branch should only bound variables
142
+ */
143
+ virtual bool boundBranch() const
144
+ {return true;}
145
+ /// Return true if knows how to deal with Pseudo Shadow Prices
146
+ virtual bool canHandleShadowPrices() const
147
+ { return false;}
148
+ /// Return maximum number of ways branch may have
149
+ inline int numberWays() const
150
+ { return numberWays_;}
151
+ /// Set maximum number of ways branch may have
152
+ inline void setNumberWays(int numberWays)
153
+ { numberWays_ = static_cast<short int>(numberWays) ; }
154
+ /** Return preferred way to branch. If two
155
+ then way=0 means down and 1 means up, otherwise
156
+ way points to preferred branch
157
+ */
158
+ inline void setWhichWay(int way)
159
+ { whichWay_ = static_cast<short int>(way) ; }
160
+ /** Return current preferred way to branch. If two
161
+ then way=0 means down and 1 means up, otherwise
162
+ way points to preferred branch
163
+ */
164
+ inline int whichWay() const
165
+ { return whichWay_;}
166
+ /// Get pre-emptive preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
167
+ virtual int preferredWay() const
168
+ { return -1;}
169
+ /// Return infeasibility
170
+ inline double infeasibility() const
171
+ { return infeasibility_;}
172
+ /// Return "up" estimate (default 1.0e-5)
173
+ virtual double upEstimate() const;
174
+ /// Return "down" estimate (default 1.0e-5)
175
+ virtual double downEstimate() const;
176
+ /** Reset variable bounds to their original values.
177
+ Bounds may be tightened, so it may be good to be able to reset them to
178
+ their original values.
179
+ */
180
+ virtual void resetBounds(const OsiSolverInterface * ) {}
181
+ /** Change column numbers after preprocessing
182
+ */
183
+ virtual void resetSequenceEtc(int , const int * ) {}
184
+ /// Updates stuff like pseudocosts before threads
185
+ virtual void updateBefore(const OsiObject * ) {}
186
+ /// Updates stuff like pseudocosts after threads finished
187
+ virtual void updateAfter(const OsiObject * , const OsiObject * ) {}
188
+
189
+ protected:
190
+ /// data
191
+
192
+ /// Computed infeasibility
193
+ mutable double infeasibility_;
194
+ /// Computed preferred way to branch
195
+ mutable short whichWay_;
196
+ /// Maximum number of ways on branch
197
+ short numberWays_;
198
+ /// Priority
199
+ int priority_;
200
+
201
+ };
202
+ /// Define a class to add a bit of complexity to OsiObject
203
+ /// This assumes 2 way branching
204
+
205
+
206
+ class OsiObject2 : public OsiObject {
207
+
208
+ public:
209
+
210
+ /// Default Constructor
211
+ OsiObject2 ();
212
+
213
+ /// Copy constructor
214
+ OsiObject2 ( const OsiObject2 &);
215
+
216
+ /// Assignment operator
217
+ OsiObject2 & operator=( const OsiObject2& rhs);
218
+
219
+ /// Destructor
220
+ virtual ~OsiObject2 ();
221
+
222
+ /// Set preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
223
+ inline void setPreferredWay(int value)
224
+ {preferredWay_=value;}
225
+
226
+ /// Get preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
227
+ virtual int preferredWay() const
228
+ { return preferredWay_;}
229
+ protected:
230
+ /// Preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
231
+ int preferredWay_;
232
+ /// "Infeasibility" on other way
233
+ mutable double otherInfeasibility_;
234
+
235
+ };
236
+
237
+ /** \brief Abstract branching object base class
238
+
239
+ In the abstract, an OsiBranchingObject contains instructions for how to
240
+ branch. We want an abstract class so that we can describe how to branch on
241
+ simple objects (<i>e.g.</i>, integers) and more exotic objects
242
+ (<i>e.g.</i>, cliques or hyperplanes).
243
+
244
+ The #branch() method is the crucial routine: it is expected to be able to
245
+ step through a set of branch arms, executing the actions required to create
246
+ each subproblem in turn. The base class is primarily virtual to allow for
247
+ a wide range of problem modifications.
248
+
249
+ See OsiObject for an overview of the two classes (OsiObject and
250
+ OsiBranchingObject) which make up Osi's branching
251
+ model.
252
+ */
253
+
254
+ class OsiBranchingObject {
255
+
256
+ public:
257
+
258
+ /// Default Constructor
259
+ OsiBranchingObject ();
260
+
261
+ /// Constructor
262
+ OsiBranchingObject (OsiSolverInterface * solver, double value);
263
+
264
+ /// Copy constructor
265
+ OsiBranchingObject ( const OsiBranchingObject &);
266
+
267
+ /// Assignment operator
268
+ OsiBranchingObject & operator=( const OsiBranchingObject& rhs);
269
+
270
+ /// Clone
271
+ virtual OsiBranchingObject * clone() const=0;
272
+
273
+ /// Destructor
274
+ virtual ~OsiBranchingObject ();
275
+
276
+ /// The number of branch arms created for this branching object
277
+ inline int numberBranches() const
278
+ {return numberBranches_;}
279
+
280
+ /// The number of branch arms left for this branching object
281
+ inline int numberBranchesLeft() const
282
+ {return numberBranches_-branchIndex_;}
283
+
284
+ /// Increment the number of branch arms left for this branching object
285
+ inline void incrementNumberBranchesLeft()
286
+ { numberBranches_ ++;}
287
+
288
+ /** Set the number of branch arms left for this branching object
289
+ Just for forcing
290
+ */
291
+ inline void setNumberBranchesLeft(int /*value*/)
292
+ {/*assert (value==1&&!branchIndex_);*/ numberBranches_=1;}
293
+
294
+ /// Decrement the number of branch arms left for this branching object
295
+ inline void decrementNumberBranchesLeft()
296
+ {branchIndex_++;}
297
+
298
+ /** \brief Execute the actions required to branch, as specified by the
299
+ current state of the branching object, and advance the object's
300
+ state.
301
+ Returns change in guessed objective on next branch
302
+ */
303
+ virtual double branch(OsiSolverInterface * solver)=0;
304
+ /** \brief Execute the actions required to branch, as specified by the
305
+ current state of the branching object, and advance the object's
306
+ state.
307
+ Returns change in guessed objective on next branch
308
+ */
309
+ virtual double branch() {return branch(NULL);}
310
+ /** \brief Return true if branch should fix variables
311
+ */
312
+ virtual bool boundBranch() const
313
+ {return true;}
314
+ /** Get the state of the branching object
315
+ This is just the branch index
316
+ */
317
+ inline int branchIndex() const
318
+ {return branchIndex_;}
319
+
320
+ /** Set the state of the branching object.
321
+ */
322
+ inline void setBranchingIndex(int branchIndex)
323
+ { branchIndex_ = static_cast<short int>(branchIndex) ; }
324
+
325
+ /// Current value
326
+ inline double value() const
327
+ {return value_;}
328
+
329
+ /// Return pointer back to object which created
330
+ inline const OsiObject * originalObject() const
331
+ {return originalObject_;}
332
+ /// Set pointer back to object which created
333
+ inline void setOriginalObject(const OsiObject * object)
334
+ {originalObject_=object;}
335
+ /** Double checks in case node can change its mind!
336
+ Returns objective value
337
+ Can change objective etc */
338
+ virtual void checkIsCutoff(double ) {}
339
+ /// For debug
340
+ int columnNumber() const;
341
+ /** \brief Print something about branch - only if log level high
342
+ */
343
+ virtual void print(const OsiSolverInterface * =NULL) const {}
344
+
345
+ protected:
346
+
347
+ /// Current value - has some meaning about branch
348
+ double value_;
349
+
350
+ /// Pointer back to object which created
351
+ const OsiObject * originalObject_;
352
+
353
+ /** Number of branches
354
+ */
355
+ int numberBranches_;
356
+
357
+ /** The state of the branching object. i.e. branch index
358
+ This starts at 0 when created
359
+ */
360
+ short branchIndex_;
361
+
362
+ };
363
+ /* This contains information
364
+ This could also contain pseudo shadow prices
365
+ or information for dealing with computing and trusting pseudo-costs
366
+ */
367
+ class OsiBranchingInformation {
368
+
369
+ public:
370
+
371
+ /// Default Constructor
372
+ OsiBranchingInformation ();
373
+
374
+ /** Useful Constructor
375
+ (normalSolver true if has matrix etc etc)
376
+ copySolution true if constructot should make a copy
377
+ */
378
+ OsiBranchingInformation (const OsiSolverInterface * solver, bool normalSolver,bool copySolution=false);
379
+
380
+ /// Copy constructor
381
+ OsiBranchingInformation ( const OsiBranchingInformation &);
382
+
383
+ /// Assignment operator
384
+ OsiBranchingInformation & operator=( const OsiBranchingInformation& rhs);
385
+
386
+ /// Clone
387
+ virtual OsiBranchingInformation * clone() const;
388
+
389
+ /// Destructor
390
+ virtual ~OsiBranchingInformation ();
391
+
392
+ // Note public
393
+ public:
394
+ /// data
395
+
396
+ /** State of search
397
+ 0 - no solution
398
+ 1 - only heuristic solutions
399
+ 2 - branched to a solution
400
+ 3 - no solution but many nodes
401
+ */
402
+ int stateOfSearch_;
403
+ /// Value of objective function (in minimization sense)
404
+ double objectiveValue_;
405
+ /// Value of objective cutoff (in minimization sense)
406
+ double cutoff_;
407
+ /// Direction 1.0 for minimization, -1.0 for maximization
408
+ double direction_;
409
+ /// Integer tolerance
410
+ double integerTolerance_;
411
+ /// Primal tolerance
412
+ double primalTolerance_;
413
+ /// Maximum time remaining before stopping on time
414
+ double timeRemaining_;
415
+ /// Dual to use if row bound violated (if negative then pseudoShadowPrices off)
416
+ double defaultDual_;
417
+ /// Pointer to solver
418
+ mutable const OsiSolverInterface * solver_;
419
+ /// The number of columns
420
+ int numberColumns_;
421
+ /// Pointer to current lower bounds on columns
422
+ mutable const double * lower_;
423
+ /// Pointer to current solution
424
+ mutable const double * solution_;
425
+ /// Pointer to current upper bounds on columns
426
+ mutable const double * upper_;
427
+ /// Highly optional target (hot start) solution
428
+ const double * hotstartSolution_;
429
+ /// Pointer to duals
430
+ const double * pi_;
431
+ /// Pointer to row activity
432
+ const double * rowActivity_;
433
+ /// Objective
434
+ const double * objective_;
435
+ /// Pointer to current lower bounds on rows
436
+ const double * rowLower_;
437
+ /// Pointer to current upper bounds on rows
438
+ const double * rowUpper_;
439
+ /// Elements in column copy of matrix
440
+ const double * elementByColumn_;
441
+ /// Column starts
442
+ const CoinBigIndex * columnStart_;
443
+ /// Column lengths
444
+ const int * columnLength_;
445
+ /// Row indices
446
+ const int * row_;
447
+ /** Useful region of length CoinMax(numberColumns,2*numberRows)
448
+ This is allocated and deleted before OsiObject::infeasibility
449
+ It is zeroed on entry and should be so on exit
450
+ It only exists if defaultDual_>=0.0
451
+ */
452
+ double * usefulRegion_;
453
+ /// Useful index region to go with usefulRegion_
454
+ int * indexRegion_;
455
+ /// Number of solutions found
456
+ int numberSolutions_;
457
+ /// Number of branching solutions found (i.e. exclude heuristics)
458
+ int numberBranchingSolutions_;
459
+ /// Depth in tree
460
+ int depth_;
461
+ /// TEMP
462
+ bool owningSolution_;
463
+ };
464
+
465
+ /// This just adds two-wayness to a branching object
466
+
467
+ class OsiTwoWayBranchingObject : public OsiBranchingObject {
468
+
469
+ public:
470
+
471
+ /// Default constructor
472
+ OsiTwoWayBranchingObject ();
473
+
474
+ /** Create a standard tw0-way branch object
475
+
476
+ Specifies a simple two-way branch.
477
+ Specify way = -1 to set the object state to perform the down arm first,
478
+ way = 1 for the up arm.
479
+ */
480
+ OsiTwoWayBranchingObject (OsiSolverInterface *solver,const OsiObject * originalObject,
481
+ int way , double value) ;
482
+
483
+ /// Copy constructor
484
+ OsiTwoWayBranchingObject ( const OsiTwoWayBranchingObject &);
485
+
486
+ /// Assignment operator
487
+ OsiTwoWayBranchingObject & operator= (const OsiTwoWayBranchingObject& rhs);
488
+
489
+ /// Destructor
490
+ virtual ~OsiTwoWayBranchingObject ();
491
+
492
+ using OsiBranchingObject::branch ;
493
+ /** \brief Sets the bounds for the variable according to the current arm
494
+ of the branch and advances the object state to the next arm.
495
+ state.
496
+ Returns change in guessed objective on next branch
497
+ */
498
+ virtual double branch(OsiSolverInterface * solver)=0;
499
+
500
+ inline int firstBranch() const { return firstBranch_; }
501
+ /// Way returns -1 on down +1 on up
502
+ inline int way() const
503
+ { return !branchIndex_ ? firstBranch_ : -firstBranch_;}
504
+ protected:
505
+ /// Which way was first branch -1 = down, +1 = up
506
+ int firstBranch_;
507
+ };
508
+ /// Define a single integer class
509
+
510
+
511
+ class OsiSimpleInteger : public OsiObject2 {
512
+
513
+ public:
514
+
515
+ /// Default Constructor
516
+ OsiSimpleInteger ();
517
+
518
+ /// Useful constructor - passed solver index
519
+ OsiSimpleInteger (const OsiSolverInterface * solver, int iColumn);
520
+
521
+ /// Useful constructor - passed solver index and original bounds
522
+ OsiSimpleInteger (int iColumn, double lower, double upper);
523
+
524
+ /// Copy constructor
525
+ OsiSimpleInteger ( const OsiSimpleInteger &);
526
+
527
+ /// Clone
528
+ virtual OsiObject * clone() const;
529
+
530
+ /// Assignment operator
531
+ OsiSimpleInteger & operator=( const OsiSimpleInteger& rhs);
532
+
533
+ /// Destructor
534
+ virtual ~OsiSimpleInteger ();
535
+
536
+ using OsiObject::infeasibility ;
537
+ /// Infeasibility - large is 0.5
538
+ virtual double infeasibility(const OsiBranchingInformation * info, int & whichWay) const;
539
+
540
+ using OsiObject::feasibleRegion ;
541
+ /** Set bounds to fix the variable at the current (integer) value.
542
+
543
+ Given an integer value, set the lower and upper bounds to fix the
544
+ variable. Returns amount it had to move variable.
545
+ */
546
+ virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const;
547
+
548
+ /** Creates a branching object
549
+
550
+ The preferred direction is set by \p way, 0 for down, 1 for up.
551
+ */
552
+ virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const;
553
+
554
+
555
+ /// Set solver column number
556
+ inline void setColumnNumber(int value)
557
+ {columnNumber_=value;}
558
+
559
+ /** Column number if single column object -1 otherwise,
560
+ so returns >= 0
561
+ Used by heuristics
562
+ */
563
+ virtual int columnNumber() const;
564
+
565
+ /// Original bounds
566
+ inline double originalLowerBound() const
567
+ { return originalLower_;}
568
+ inline void setOriginalLowerBound(double value)
569
+ { originalLower_=value;}
570
+ inline double originalUpperBound() const
571
+ { return originalUpper_;}
572
+ inline void setOriginalUpperBound(double value)
573
+ { originalUpper_=value;}
574
+ /** Reset variable bounds to their original values.
575
+ Bounds may be tightened, so it may be good to be able to reset them to
576
+ their original values.
577
+ */
578
+ virtual void resetBounds(const OsiSolverInterface * solver) ;
579
+ /** Change column numbers after preprocessing
580
+ */
581
+ virtual void resetSequenceEtc(int numberColumns, const int * originalColumns);
582
+
583
+ /// Return "up" estimate (default 1.0e-5)
584
+ virtual double upEstimate() const;
585
+ /// Return "down" estimate (default 1.0e-5)
586
+ virtual double downEstimate() const;
587
+ /// Return true if knows how to deal with Pseudo Shadow Prices
588
+ virtual bool canHandleShadowPrices() const
589
+ { return false;}
590
+ protected:
591
+ /// data
592
+ /// Original lower bound
593
+ double originalLower_;
594
+ /// Original upper bound
595
+ double originalUpper_;
596
+ /// Column number in solver
597
+ int columnNumber_;
598
+
599
+ };
600
+ /** Simple branching object for an integer variable
601
+
602
+ This object can specify a two-way branch on an integer variable. For each
603
+ arm of the branch, the upper and lower bounds on the variable can be
604
+ independently specified. 0 -> down, 1-> up.
605
+ */
606
+
607
+ class OsiIntegerBranchingObject : public OsiTwoWayBranchingObject {
608
+
609
+ public:
610
+
611
+ /// Default constructor
612
+ OsiIntegerBranchingObject ();
613
+
614
+ /** Create a standard floor/ceiling branch object
615
+
616
+ Specifies a simple two-way branch. Let \p value = x*. One arm of the
617
+ branch will be lb <= x <= floor(x*), the other ceil(x*) <= x <= ub.
618
+ Specify way = -1 to set the object state to perform the down arm first,
619
+ way = 1 for the up arm.
620
+ */
621
+ OsiIntegerBranchingObject (OsiSolverInterface *solver,const OsiSimpleInteger * originalObject,
622
+ int way , double value) ;
623
+ /** Create a standard floor/ceiling branch object
624
+
625
+ Specifies a simple two-way branch in a more flexible way. One arm of the
626
+ branch will be lb <= x <= downUpperBound, the other upLowerBound <= x <= ub.
627
+ Specify way = -1 to set the object state to perform the down arm first,
628
+ way = 1 for the up arm.
629
+ */
630
+ OsiIntegerBranchingObject (OsiSolverInterface *solver,const OsiSimpleInteger * originalObject,
631
+ int way , double value, double downUpperBound, double upLowerBound) ;
632
+
633
+ /// Copy constructor
634
+ OsiIntegerBranchingObject ( const OsiIntegerBranchingObject &);
635
+
636
+ /// Assignment operator
637
+ OsiIntegerBranchingObject & operator= (const OsiIntegerBranchingObject& rhs);
638
+
639
+ /// Clone
640
+ virtual OsiBranchingObject * clone() const;
641
+
642
+ /// Destructor
643
+ virtual ~OsiIntegerBranchingObject ();
644
+
645
+ using OsiBranchingObject::branch ;
646
+ /** \brief Sets the bounds for the variable according to the current arm
647
+ of the branch and advances the object state to the next arm.
648
+ state.
649
+ Returns change in guessed objective on next branch
650
+ */
651
+ virtual double branch(OsiSolverInterface * solver);
652
+
653
+ using OsiBranchingObject::print ;
654
+ /** \brief Print something about branch - only if log level high
655
+ */
656
+ virtual void print(const OsiSolverInterface * solver=NULL);
657
+
658
+ protected:
659
+ // Probably could get away with just value which is already stored
660
+ /// Lower [0] and upper [1] bounds for the down arm (way_ = -1)
661
+ double down_[2];
662
+ /// Lower [0] and upper [1] bounds for the up arm (way_ = 1)
663
+ double up_[2];
664
+ };
665
+
666
+
667
+ /** Define Special Ordered Sets of type 1 and 2. These do not have to be
668
+ integer - so do not appear in lists of integers.
669
+
670
+ which_ points columns of matrix
671
+ */
672
+
673
+
674
+ class OsiSOS : public OsiObject2 {
675
+
676
+ public:
677
+
678
+ // Default Constructor
679
+ OsiSOS ();
680
+
681
+ /** Useful constructor - which are indices
682
+ and weights are also given. If null then 0,1,2..
683
+ type is SOS type
684
+ */
685
+ OsiSOS (const OsiSolverInterface * solver, int numberMembers,
686
+ const int * which, const double * weights, int type=1);
687
+
688
+ // Copy constructor
689
+ OsiSOS ( const OsiSOS &);
690
+
691
+ /// Clone
692
+ virtual OsiObject * clone() const;
693
+
694
+ // Assignment operator
695
+ OsiSOS & operator=( const OsiSOS& rhs);
696
+
697
+ // Destructor
698
+ virtual ~OsiSOS ();
699
+
700
+ using OsiObject::infeasibility ;
701
+ /// Infeasibility - large is 0.5
702
+ virtual double infeasibility(const OsiBranchingInformation * info,int & whichWay) const;
703
+
704
+ using OsiObject::feasibleRegion ;
705
+ /** Set bounds to fix the variable at the current (integer) value.
706
+
707
+ Given an integer value, set the lower and upper bounds to fix the
708
+ variable. Returns amount it had to move variable.
709
+ */
710
+ virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const;
711
+
712
+ /** Creates a branching object
713
+
714
+ The preferred direction is set by \p way, 0 for down, 1 for up.
715
+ */
716
+ virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const;
717
+ /// Return "up" estimate (default 1.0e-5)
718
+ virtual double upEstimate() const;
719
+ /// Return "down" estimate (default 1.0e-5)
720
+ virtual double downEstimate() const;
721
+
722
+ /// Redoes data when sequence numbers change
723
+ virtual void resetSequenceEtc(int numberColumns, const int * originalColumns);
724
+
725
+ /// Number of members
726
+ inline int numberMembers() const
727
+ {return numberMembers_;}
728
+
729
+ /// Members (indices in range 0 ... numberColumns-1)
730
+ inline const int * members() const
731
+ {return members_;}
732
+
733
+ /// SOS type
734
+ inline int sosType() const
735
+ {return sosType_;}
736
+
737
+ /// SOS type
738
+ inline int setType() const
739
+ {return sosType_;}
740
+
741
+ /** Array of weights */
742
+ inline const double * weights() const
743
+ { return weights_;}
744
+
745
+ /** \brief Return true if object can take part in normal heuristics
746
+ */
747
+ virtual bool canDoHeuristics() const
748
+ {return (sosType_==1&&integerValued_);}
749
+ /// Set whether set is integer valued or not
750
+ inline void setIntegerValued(bool yesNo)
751
+ { integerValued_=yesNo;}
752
+ /// Return true if knows how to deal with Pseudo Shadow Prices
753
+ virtual bool canHandleShadowPrices() const
754
+ { return true;}
755
+ /// Set number of members
756
+ inline void setNumberMembers(int value)
757
+ {numberMembers_=value;}
758
+
759
+ /// Members (indices in range 0 ... numberColumns-1)
760
+ inline int * mutableMembers() const
761
+ {return members_;}
762
+
763
+ /// Set SOS type
764
+ inline void setSosType(int value)
765
+ {sosType_=value;}
766
+
767
+ /** Array of weights */
768
+ inline double * mutableWeights() const
769
+ { return weights_;}
770
+ protected:
771
+ /// data
772
+
773
+ /// Members (indices in range 0 ... numberColumns-1)
774
+ int * members_;
775
+ /// Weights
776
+ double * weights_;
777
+
778
+ /// Number of members
779
+ int numberMembers_;
780
+ /// SOS type
781
+ int sosType_;
782
+ /// Whether integer valued
783
+ bool integerValued_;
784
+ };
785
+
786
+ /** Branching object for Special ordered sets
787
+
788
+ */
789
+ class OsiSOSBranchingObject : public OsiTwoWayBranchingObject {
790
+
791
+ public:
792
+
793
+ // Default Constructor
794
+ OsiSOSBranchingObject ();
795
+
796
+ // Useful constructor
797
+ OsiSOSBranchingObject (OsiSolverInterface * solver, const OsiSOS * originalObject,
798
+ int way,
799
+ double separator);
800
+
801
+ // Copy constructor
802
+ OsiSOSBranchingObject ( const OsiSOSBranchingObject &);
803
+
804
+ // Assignment operator
805
+ OsiSOSBranchingObject & operator=( const OsiSOSBranchingObject& rhs);
806
+
807
+ /// Clone
808
+ virtual OsiBranchingObject * clone() const;
809
+
810
+ // Destructor
811
+ virtual ~OsiSOSBranchingObject ();
812
+
813
+ using OsiBranchingObject::branch ;
814
+ /// Does next branch and updates state
815
+ virtual double branch(OsiSolverInterface * solver);
816
+
817
+ using OsiBranchingObject::print ;
818
+ /** \brief Print something about branch - only if log level high
819
+ */
820
+ virtual void print(const OsiSolverInterface * solver=NULL);
821
+ private:
822
+ /// data
823
+ };
824
+ /** Lotsize class */
825
+
826
+
827
+ class OsiLotsize : public OsiObject2 {
828
+
829
+ public:
830
+
831
+ // Default Constructor
832
+ OsiLotsize ();
833
+
834
+ /* Useful constructor - passed model index.
835
+ Also passed valid values - if range then pairs
836
+ */
837
+ OsiLotsize (const OsiSolverInterface * solver, int iColumn,
838
+ int numberPoints, const double * points, bool range=false);
839
+
840
+ // Copy constructor
841
+ OsiLotsize ( const OsiLotsize &);
842
+
843
+ /// Clone
844
+ virtual OsiObject * clone() const;
845
+
846
+ // Assignment operator
847
+ OsiLotsize & operator=( const OsiLotsize& rhs);
848
+
849
+ // Destructor
850
+ virtual ~OsiLotsize ();
851
+
852
+ using OsiObject::infeasibility ;
853
+ /// Infeasibility - large is 0.5
854
+ virtual double infeasibility(const OsiBranchingInformation * info, int & whichWay) const;
855
+
856
+ using OsiObject::feasibleRegion ;
857
+ /** Set bounds to contain the current solution.
858
+
859
+ More precisely, for the variable associated with this object, take the
860
+ value given in the current solution, force it within the current bounds
861
+ if required, then set the bounds to fix the variable at the integer
862
+ nearest the solution value. Returns amount it had to move variable.
863
+ */
864
+ virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const;
865
+
866
+ /** Creates a branching object
867
+
868
+ The preferred direction is set by \p way, 0 for down, 1 for up.
869
+ */
870
+ virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const;
871
+
872
+
873
+ /// Set solver column number
874
+ inline void setColumnNumber(int value)
875
+ {columnNumber_=value;}
876
+
877
+ /** Column number if single column object -1 otherwise,
878
+ so returns >= 0
879
+ Used by heuristics
880
+ */
881
+ virtual int columnNumber() const;
882
+ /** Reset original upper and lower bound values from the solver.
883
+
884
+ Handy for updating bounds held in this object after bounds held in the
885
+ solver have been tightened.
886
+ */
887
+ virtual void resetBounds(const OsiSolverInterface * solver);
888
+
889
+ /** Finds range of interest so value is feasible in range range_ or infeasible
890
+ between hi[range_] and lo[range_+1]. Returns true if feasible.
891
+ */
892
+ bool findRange(double value, double integerTolerance) const;
893
+
894
+ /** Returns floor and ceiling
895
+ */
896
+ virtual void floorCeiling(double & floorLotsize, double & ceilingLotsize, double value,
897
+ double tolerance) const;
898
+
899
+ /// Original bounds
900
+ inline double originalLowerBound() const
901
+ { return bound_[0];}
902
+ inline double originalUpperBound() const
903
+ { return bound_[rangeType_*numberRanges_-1];}
904
+ /// Type - 1 points, 2 ranges
905
+ inline int rangeType() const
906
+ { return rangeType_;}
907
+ /// Number of points
908
+ inline int numberRanges() const
909
+ { return numberRanges_;}
910
+ /// Ranges
911
+ inline double * bound() const
912
+ { return bound_;}
913
+ /** Change column numbers after preprocessing
914
+ */
915
+ virtual void resetSequenceEtc(int numberColumns, const int * originalColumns);
916
+
917
+ /// Return "up" estimate (default 1.0e-5)
918
+ virtual double upEstimate() const;
919
+ /// Return "down" estimate (default 1.0e-5)
920
+ virtual double downEstimate() const;
921
+ /// Return true if knows how to deal with Pseudo Shadow Prices
922
+ virtual bool canHandleShadowPrices() const
923
+ { return true;}
924
+ /** \brief Return true if object can take part in normal heuristics
925
+ */
926
+ virtual bool canDoHeuristics() const
927
+ {return false;}
928
+
929
+ private:
930
+ /// data
931
+
932
+ /// Column number in model
933
+ int columnNumber_;
934
+ /// Type - 1 points, 2 ranges
935
+ int rangeType_;
936
+ /// Number of points
937
+ int numberRanges_;
938
+ // largest gap
939
+ double largestGap_;
940
+ /// Ranges
941
+ double * bound_;
942
+ /// Current range
943
+ mutable int range_;
944
+ };
945
+
946
+
947
+ /** Lotsize branching object
948
+
949
+ This object can specify a two-way branch on an integer variable. For each
950
+ arm of the branch, the upper and lower bounds on the variable can be
951
+ independently specified.
952
+
953
+ Variable_ holds the index of the integer variable in the integerVariable_
954
+ array of the model.
955
+ */
956
+
957
+ class OsiLotsizeBranchingObject : public OsiTwoWayBranchingObject {
958
+
959
+ public:
960
+
961
+ /// Default constructor
962
+ OsiLotsizeBranchingObject ();
963
+
964
+ /** Create a lotsize floor/ceiling branch object
965
+
966
+ Specifies a simple two-way branch. Let \p value = x*. One arm of the
967
+ branch will be is lb <= x <= valid range below(x*), the other valid range above(x*) <= x <= ub.
968
+ Specify way = -1 to set the object state to perform the down arm first,
969
+ way = 1 for the up arm.
970
+ */
971
+ OsiLotsizeBranchingObject (OsiSolverInterface *solver,const OsiLotsize * originalObject,
972
+ int way , double value) ;
973
+
974
+ /// Copy constructor
975
+ OsiLotsizeBranchingObject ( const OsiLotsizeBranchingObject &);
976
+
977
+ /// Assignment operator
978
+ OsiLotsizeBranchingObject & operator= (const OsiLotsizeBranchingObject& rhs);
979
+
980
+ /// Clone
981
+ virtual OsiBranchingObject * clone() const;
982
+
983
+ /// Destructor
984
+ virtual ~OsiLotsizeBranchingObject ();
985
+
986
+ using OsiBranchingObject::branch ;
987
+ /** \brief Sets the bounds for the variable according to the current arm
988
+ of the branch and advances the object state to the next arm.
989
+ state.
990
+ Returns change in guessed objective on next branch
991
+ */
992
+ virtual double branch(OsiSolverInterface * solver);
993
+
994
+ using OsiBranchingObject::print ;
995
+ /** \brief Print something about branch - only if log level high
996
+ */
997
+ virtual void print(const OsiSolverInterface * solver=NULL);
998
+
999
+ protected:
1000
+ /// Lower [0] and upper [1] bounds for the down arm (way_ = -1)
1001
+ double down_[2];
1002
+ /// Lower [0] and upper [1] bounds for the up arm (way_ = 1)
1003
+ double up_[2];
1004
+ };
1005
+ #endif