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,300 @@
1
+ /* $Id: ClpSimplexDual.hpp 1761 2011-07-06 16:06:24Z forrest $ */
2
+ // Copyright (C) 2002, International Business Machines
3
+ // Corporation and others. All Rights Reserved.
4
+ // This code is licensed under the terms of the Eclipse Public License (EPL).
5
+ /*
6
+ Authors
7
+
8
+ John Forrest
9
+
10
+ */
11
+ #ifndef ClpSimplexDual_H
12
+ #define ClpSimplexDual_H
13
+
14
+ #include "ClpSimplex.hpp"
15
+
16
+ /** This solves LPs using the dual simplex method
17
+
18
+ It inherits from ClpSimplex. It has no data of its own and
19
+ is never created - only cast from a ClpSimplex object at algorithm time.
20
+
21
+ */
22
+
23
+ class ClpSimplexDual : public ClpSimplex {
24
+
25
+ public:
26
+
27
+ /**@name Description of algorithm */
28
+ //@{
29
+ /** Dual algorithm
30
+
31
+ Method
32
+
33
+ It tries to be a single phase approach with a weight of 1.0 being
34
+ given to getting optimal and a weight of updatedDualBound_ being
35
+ given to getting dual feasible. In this version I have used the
36
+ idea that this weight can be thought of as a fake bound. If the
37
+ distance between the lower and upper bounds on a variable is less
38
+ than the feasibility weight then we are always better off flipping
39
+ to other bound to make dual feasible. If the distance is greater
40
+ then we make up a fake bound updatedDualBound_ away from one bound.
41
+ If we end up optimal or primal infeasible, we check to see if
42
+ bounds okay. If so we have finished, if not we increase updatedDualBound_
43
+ and continue (after checking if unbounded). I am undecided about
44
+ free variables - there is coding but I am not sure about it. At
45
+ present I put them in basis anyway.
46
+
47
+ The code is designed to take advantage of sparsity so arrays are
48
+ seldom zeroed out from scratch or gone over in their entirety.
49
+ The only exception is a full scan to find outgoing variable for
50
+ Dantzig row choice. For steepest edge we keep an updated list
51
+ of infeasibilities (actually squares).
52
+ On easy problems we don't need full scan - just
53
+ pick first reasonable.
54
+
55
+ One problem is how to tackle degeneracy and accuracy. At present
56
+ I am using the modification of costs which I put in OSL and some
57
+ of what I think is the dual analog of Gill et al.
58
+ I am still not sure of the exact details.
59
+
60
+ The flow of dual is three while loops as follows:
61
+
62
+ while (not finished) {
63
+
64
+ while (not clean solution) {
65
+
66
+ Factorize and/or clean up solution by flipping variables so
67
+ dual feasible. If looks finished check fake dual bounds.
68
+ Repeat until status is iterating (-1) or finished (0,1,2)
69
+
70
+ }
71
+
72
+ while (status==-1) {
73
+
74
+ Iterate until no pivot in or out or time to re-factorize.
75
+
76
+ Flow is:
77
+
78
+ choose pivot row (outgoing variable). if none then
79
+ we are primal feasible so looks as if done but we need to
80
+ break and check bounds etc.
81
+
82
+ Get pivot row in tableau
83
+
84
+ Choose incoming column. If we don't find one then we look
85
+ primal infeasible so break and check bounds etc. (Also the
86
+ pivot tolerance is larger after any iterations so that may be
87
+ reason)
88
+
89
+ If we do find incoming column, we may have to adjust costs to
90
+ keep going forwards (anti-degeneracy). Check pivot will be stable
91
+ and if unstable throw away iteration and break to re-factorize.
92
+ If minor error re-factorize after iteration.
93
+
94
+ Update everything (this may involve flipping variables to stay
95
+ dual feasible.
96
+
97
+ }
98
+
99
+ }
100
+
101
+ TODO's (or maybe not)
102
+
103
+ At present we never check we are going forwards. I overdid that in
104
+ OSL so will try and make a last resort.
105
+
106
+ Needs partial scan pivot out option.
107
+
108
+ May need other anti-degeneracy measures, especially if we try and use
109
+ loose tolerances as a way to solve in fewer iterations.
110
+
111
+ I like idea of dynamic scaling. This gives opportunity to decouple
112
+ different implications of scaling for accuracy, iteration count and
113
+ feasibility tolerance.
114
+
115
+ for use of exotic parameter startFinishoptions see Clpsimplex.hpp
116
+ */
117
+
118
+ int dual(int ifValuesPass, int startFinishOptions = 0);
119
+ /** For strong branching. On input lower and upper are new bounds
120
+ while on output they are change in objective function values
121
+ (>1.0e50 infeasible).
122
+ Return code is 0 if nothing interesting, -1 if infeasible both
123
+ ways and +1 if infeasible one way (check values to see which one(s))
124
+ Solutions are filled in as well - even down, odd up - also
125
+ status and number of iterations
126
+ */
127
+ int strongBranching(int numberVariables, const int * variables,
128
+ double * newLower, double * newUpper,
129
+ double ** outputSolution,
130
+ int * outputStatus, int * outputIterations,
131
+ bool stopOnFirstInfeasible = true,
132
+ bool alwaysFinish = false,
133
+ int startFinishOptions = 0);
134
+ /// This does first part of StrongBranching
135
+ ClpFactorization * setupForStrongBranching(char * arrays, int numberRows,
136
+ int numberColumns, bool solveLp = false);
137
+ /// This cleans up after strong branching
138
+ void cleanupAfterStrongBranching(ClpFactorization * factorization);
139
+ //@}
140
+
141
+ /**@name Functions used in dual */
142
+ //@{
143
+ /** This has the flow between re-factorizations
144
+ Broken out for clarity and will be used by strong branching
145
+
146
+ Reasons to come out:
147
+ -1 iterations etc
148
+ -2 inaccuracy
149
+ -3 slight inaccuracy (and done iterations)
150
+ +0 looks optimal (might be unbounded - but we will investigate)
151
+ +1 looks infeasible
152
+ +3 max iterations
153
+
154
+ If givenPi not NULL then in values pass
155
+ */
156
+ int whileIterating(double * & givenPi, int ifValuesPass);
157
+ /** The duals are updated by the given arrays.
158
+ Returns number of infeasibilities.
159
+ After rowArray and columnArray will just have those which
160
+ have been flipped.
161
+ Variables may be flipped between bounds to stay dual feasible.
162
+ The output vector has movement of primal
163
+ solution (row length array) */
164
+ int updateDualsInDual(CoinIndexedVector * rowArray,
165
+ CoinIndexedVector * columnArray,
166
+ CoinIndexedVector * outputArray,
167
+ double theta,
168
+ double & objectiveChange,
169
+ bool fullRecompute);
170
+ /** The duals are updated by the given arrays.
171
+ This is in values pass - so no changes to primal is made
172
+ */
173
+ void updateDualsInValuesPass(CoinIndexedVector * rowArray,
174
+ CoinIndexedVector * columnArray,
175
+ double theta);
176
+ /** While updateDualsInDual sees what effect is of flip
177
+ this does actual flipping.
178
+ */
179
+ void flipBounds(CoinIndexedVector * rowArray,
180
+ CoinIndexedVector * columnArray);
181
+ /**
182
+ Row array has row part of pivot row
183
+ Column array has column part.
184
+ This chooses pivot column.
185
+ Spare arrays are used to save pivots which will go infeasible
186
+ We will check for basic so spare array will never overflow.
187
+ If necessary will modify costs
188
+ For speed, we may need to go to a bucket approach when many
189
+ variables are being flipped.
190
+ Returns best possible pivot value
191
+ */
192
+ double dualColumn(CoinIndexedVector * rowArray,
193
+ CoinIndexedVector * columnArray,
194
+ CoinIndexedVector * spareArray,
195
+ CoinIndexedVector * spareArray2,
196
+ double accpetablePivot,
197
+ CoinBigIndex * dubiousWeights);
198
+ /// Does first bit of dualColumn
199
+ int dualColumn0(const CoinIndexedVector * rowArray,
200
+ const CoinIndexedVector * columnArray,
201
+ CoinIndexedVector * spareArray,
202
+ double acceptablePivot,
203
+ double & upperReturn, double &bestReturn, double & badFree);
204
+ /**
205
+ Row array has row part of pivot row
206
+ Column array has column part.
207
+ This sees what is best thing to do in dual values pass
208
+ if sequenceIn==sequenceOut can change dual on chosen row and leave variable in basis
209
+ */
210
+ void checkPossibleValuesMove(CoinIndexedVector * rowArray,
211
+ CoinIndexedVector * columnArray,
212
+ double acceptablePivot);
213
+ /**
214
+ Row array has row part of pivot row
215
+ Column array has column part.
216
+ This sees what is best thing to do in branch and bound cleanup
217
+ If sequenceIn_ < 0 then can't do anything
218
+ */
219
+ void checkPossibleCleanup(CoinIndexedVector * rowArray,
220
+ CoinIndexedVector * columnArray,
221
+ double acceptablePivot);
222
+ /**
223
+ This sees if we can move duals in dual values pass.
224
+ This is done before any pivoting
225
+ */
226
+ void doEasyOnesInValuesPass(double * givenReducedCosts);
227
+ /**
228
+ Chooses dual pivot row
229
+ Would be faster with separate region to scan
230
+ and will have this (with square of infeasibility) when steepest
231
+ For easy problems we can just choose one of the first rows we look at
232
+
233
+ If alreadyChosen >=0 then in values pass and that row has been
234
+ selected
235
+ */
236
+ void dualRow(int alreadyChosen);
237
+ /** Checks if any fake bounds active - if so returns number and modifies
238
+ updatedDualBound_ and everything.
239
+ Free variables will be left as free
240
+ Returns number of bounds changed if >=0
241
+ Returns -1 if not initialize and no effect
242
+ Fills in changeVector which can be used to see if unbounded
243
+ and cost of change vector
244
+ If 2 sets to original (just changed)
245
+ */
246
+ int changeBounds(int initialize, CoinIndexedVector * outputArray,
247
+ double & changeCost);
248
+ /** As changeBounds but just changes new bounds for a single variable.
249
+ Returns true if change */
250
+ bool changeBound( int iSequence);
251
+ /// Restores bound to original bound
252
+ void originalBound(int iSequence);
253
+ /** Checks if tentative optimal actually means unbounded in dual
254
+ Returns -3 if not, 2 if is unbounded */
255
+ int checkUnbounded(CoinIndexedVector * ray, CoinIndexedVector * spare,
256
+ double changeCost);
257
+ /** Refactorizes if necessary
258
+ Checks if finished. Updates status.
259
+ lastCleaned refers to iteration at which some objective/feasibility
260
+ cleaning too place.
261
+
262
+ type - 0 initial so set up save arrays etc
263
+ - 1 normal -if good update save
264
+ - 2 restoring from saved
265
+ */
266
+ void statusOfProblemInDual(int & lastCleaned, int type,
267
+ double * givenDjs, ClpDataSave & saveData,
268
+ int ifValuesPass);
269
+ /** Perturbs problem (method depends on perturbation())
270
+ returns nonzero if should go to dual */
271
+ int perturb();
272
+ /** Fast iterations. Misses out a lot of initialization.
273
+ Normally stops on maximum iterations, first re-factorization
274
+ or tentative optimum. If looks interesting then continues as
275
+ normal. Returns 0 if finished properly, 1 otherwise.
276
+ */
277
+ int fastDual(bool alwaysFinish = false);
278
+ /** Checks number of variables at fake bounds. This is used by fastDual
279
+ so can exit gracefully before end */
280
+ int numberAtFakeBound();
281
+
282
+ /** Pivot in a variable and choose an outgoing one. Assumes dual
283
+ feasible - will not go through a reduced cost. Returns step length in theta
284
+ Return codes as before but -1 means no acceptable pivot
285
+ */
286
+ int pivotResultPart1();
287
+ /** Get next free , -1 if none */
288
+ int nextSuperBasic();
289
+ /** Startup part of dual (may be extended to other algorithms)
290
+ returns 0 if good, 1 if bad */
291
+ int startupSolve(int ifValuesPass, double * saveDuals, int startFinishOptions);
292
+ void finishSolve(int startFinishOptions);
293
+ void gutsOfDual(int ifValuesPass, double * & saveDuals, int initialStatus,
294
+ ClpDataSave & saveData);
295
+ //int dual2(int ifValuesPass,int startFinishOptions=0);
296
+ void resetFakeBounds(int type);
297
+
298
+ //@}
299
+ };
300
+ #endif
@@ -0,0 +1,117 @@
1
+ /* $Id: ClpSimplexNonlinear.hpp 2025 2014-03-19 12:49:55Z forrest $ */
2
+ // Copyright (C) 2004, 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
+ Authors
7
+
8
+ John Forrest
9
+
10
+ */
11
+ #ifndef ClpSimplexNonlinear_H
12
+ #define ClpSimplexNonlinear_H
13
+
14
+ class ClpNonlinearInfo;
15
+ class ClpQuadraticObjective;
16
+ class ClpConstraint;
17
+
18
+ #include "ClpSimplexPrimal.hpp"
19
+
20
+ /** This solves non-linear LPs using the primal simplex method
21
+
22
+ It inherits from ClpSimplexPrimal. It has no data of its own and
23
+ is never created - only cast from a ClpSimplexPrimal object at algorithm time.
24
+ If needed create new class and pass around
25
+
26
+ */
27
+
28
+ class ClpSimplexNonlinear : public ClpSimplexPrimal {
29
+
30
+ public:
31
+
32
+ /**@name Description of algorithm */
33
+ //@{
34
+ /** Primal algorithms for reduced gradient
35
+ At present we have two algorithms:
36
+
37
+ */
38
+ /// A reduced gradient method.
39
+ int primal();
40
+ /** Primal algorithm for quadratic
41
+ Using a semi-trust region approach as for pooling problem
42
+ This is in because I have it lying around
43
+ */
44
+ int primalSLP(int numberPasses, double deltaTolerance,
45
+ int otherOptions=0);
46
+ /// May use a cut approach for solving any LP
47
+ int primalDualCuts(char * rowsIn, int startUp, int algorithm);
48
+ /** Primal algorithm for nonlinear constraints
49
+ Using a semi-trust region approach as for pooling problem
50
+ This is in because I have it lying around
51
+
52
+ */
53
+ int primalSLP(int numberConstraints, ClpConstraint ** constraints,
54
+ int numberPasses, double deltaTolerance);
55
+
56
+ /** Creates direction vector. note longArray is long enough
57
+ for rows and columns. If numberNonBasic 0 then is updated
58
+ otherwise mode is ignored and those are used.
59
+ Norms are only for those > 1.0e3*dualTolerance
60
+ If mode is nonzero then just largest dj */
61
+ void directionVector (CoinIndexedVector * longArray,
62
+ CoinIndexedVector * spare1, CoinIndexedVector * spare2,
63
+ int mode,
64
+ double & normFlagged, double & normUnflagged,
65
+ int & numberNonBasic);
66
+ /// Main part.
67
+ int whileIterating (int & pivotMode);
68
+ /**
69
+ longArray has direction
70
+ pivotMode -
71
+ 0 - use all dual infeasible variables
72
+ 1 - largest dj
73
+ while >= 10 trying startup phase
74
+ Returns 0 - can do normal iteration (basis change)
75
+ 1 - no basis change
76
+ 2 - if wants singleton
77
+ 3 - if time to re-factorize
78
+ If sequenceIn_ >=0 then that will be incoming variable
79
+ */
80
+ int pivotColumn(CoinIndexedVector * longArray,
81
+ CoinIndexedVector * rowArray,
82
+ CoinIndexedVector * columnArray,
83
+ CoinIndexedVector * spare,
84
+ int & pivotMode,
85
+ double & solutionError,
86
+ double * array1);
87
+ /** Refactorizes if necessary
88
+ Checks if finished. Updates status.
89
+ lastCleaned refers to iteration at which some objective/feasibility
90
+ cleaning too place.
91
+
92
+ type - 0 initial so set up save arrays etc
93
+ - 1 normal -if good update save
94
+ - 2 restoring from saved
95
+ */
96
+ void statusOfProblemInPrimal(int & lastCleaned, int type,
97
+ ClpSimplexProgress * progress,
98
+ bool doFactorization,
99
+ double & bestObjectiveWhenFlagged);
100
+ /** Do last half of an iteration.
101
+ Return codes
102
+ Reasons to come out normal mode
103
+ -1 normal
104
+ -2 factorize now - good iteration
105
+ -3 slight inaccuracy - refactorize - iteration done
106
+ -4 inaccuracy - refactorize - no iteration
107
+ -5 something flagged - go round again
108
+ +2 looks unbounded
109
+ +3 max iterations (iteration done)
110
+
111
+ */
112
+ int pivotNonlinearResult();
113
+ //@}
114
+
115
+ };
116
+ #endif
117
+
@@ -0,0 +1,277 @@
1
+ /* $Id: ClpSimplexOther.hpp 2070 2014-11-18 11:12:54Z forrest $ */
2
+ // Copyright (C) 2004, 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
+ Authors
7
+
8
+ John Forrest
9
+
10
+ */
11
+ #ifndef ClpSimplexOther_H
12
+ #define ClpSimplexOther_H
13
+
14
+ #include "ClpSimplex.hpp"
15
+
16
+ /** This is for Simplex stuff which is neither dual nor primal
17
+
18
+ It inherits from ClpSimplex. It has no data of its own and
19
+ is never created - only cast from a ClpSimplex object at algorithm time.
20
+
21
+ */
22
+
23
+ class ClpSimplexOther : public ClpSimplex {
24
+
25
+ public:
26
+
27
+ /**@name Methods */
28
+ //@{
29
+ /** Dual ranging.
30
+ This computes increase/decrease in cost for each given variable and corresponding
31
+ sequence numbers which would change basis. Sequence numbers are 0..numberColumns
32
+ and numberColumns.. for artificials/slacks.
33
+ For non-basic variables the information is trivial to compute and the change in cost is just minus the
34
+ reduced cost and the sequence number will be that of the non-basic variables.
35
+ For basic variables a ratio test is between the reduced costs for non-basic variables
36
+ and the row of the tableau corresponding to the basic variable.
37
+ The increase/decrease value is always >= 0.0
38
+
39
+ Up to user to provide correct length arrays where each array is of length numberCheck.
40
+ which contains list of variables for which information is desired. All other
41
+ arrays will be filled in by function. If fifth entry in which is variable 7 then fifth entry in output arrays
42
+ will be information for variable 7.
43
+
44
+ If valueIncrease/Decrease not NULL (both must be NULL or both non NULL) then these are filled with
45
+ the value of variable if such a change in cost were made (the existing bounds are ignored)
46
+
47
+ When here - guaranteed optimal
48
+ */
49
+ void dualRanging(int numberCheck, const int * which,
50
+ double * costIncrease, int * sequenceIncrease,
51
+ double * costDecrease, int * sequenceDecrease,
52
+ double * valueIncrease = NULL, double * valueDecrease = NULL);
53
+ /** Primal ranging.
54
+ This computes increase/decrease in value for each given variable and corresponding
55
+ sequence numbers which would change basis. Sequence numbers are 0..numberColumns
56
+ and numberColumns.. for artificials/slacks.
57
+ This should only be used for non-basic variabls as otherwise information is pretty useless
58
+ For basic variables the sequence number will be that of the basic variables.
59
+
60
+ Up to user to provide correct length arrays where each array is of length numberCheck.
61
+ which contains list of variables for which information is desired. All other
62
+ arrays will be filled in by function. If fifth entry in which is variable 7 then fifth entry in output arrays
63
+ will be information for variable 7.
64
+
65
+ When here - guaranteed optimal
66
+ */
67
+ void primalRanging(int numberCheck, const int * which,
68
+ double * valueIncrease, int * sequenceIncrease,
69
+ double * valueDecrease, int * sequenceDecrease);
70
+ /** Parametrics
71
+ This is an initial slow version.
72
+ The code uses current bounds + theta * change (if change array not NULL)
73
+ and similarly for objective.
74
+ It starts at startingTheta and returns ending theta in endingTheta.
75
+ If reportIncrement 0.0 it will report on any movement
76
+ If reportIncrement >0.0 it will report at startingTheta+k*reportIncrement.
77
+ If it can not reach input endingTheta return code will be 1 for infeasible,
78
+ 2 for unbounded, if error on ranges -1, otherwise 0.
79
+ Normal report is just theta and objective but
80
+ if event handler exists it may do more
81
+ On exit endingTheta is maximum reached (can be used for next startingTheta)
82
+ */
83
+ int parametrics(double startingTheta, double & endingTheta, double reportIncrement,
84
+ const double * changeLowerBound, const double * changeUpperBound,
85
+ const double * changeLowerRhs, const double * changeUpperRhs,
86
+ const double * changeObjective);
87
+ /** Version of parametrics which reads from file
88
+ See CbcClpParam.cpp for details of format
89
+ Returns -2 if unable to open file */
90
+ int parametrics(const char * dataFile);
91
+ /** Parametrics
92
+ This is an initial slow version.
93
+ The code uses current bounds + theta * change (if change array not NULL)
94
+ It starts at startingTheta and returns ending theta in endingTheta.
95
+ If it can not reach input endingTheta return code will be 1 for infeasible,
96
+ 2 for unbounded, if error on ranges -1, otherwise 0.
97
+ Event handler may do more
98
+ On exit endingTheta is maximum reached (can be used for next startingTheta)
99
+ */
100
+ int parametrics(double startingTheta, double & endingTheta,
101
+ const double * changeLowerBound, const double * changeUpperBound,
102
+ const double * changeLowerRhs, const double * changeUpperRhs);
103
+ int parametricsObj(double startingTheta, double & endingTheta,
104
+ const double * changeObjective);
105
+ /// Finds best possible pivot
106
+ double bestPivot(bool justColumns=false);
107
+ typedef struct {
108
+ double startingTheta;
109
+ double endingTheta;
110
+ double maxTheta;
111
+ double acceptableMaxTheta; // if this far then within tolerances
112
+ double * lowerChange; // full array of lower bound changes
113
+ int * lowerList; // list of lower bound changes
114
+ double * upperChange; // full array of upper bound changes
115
+ int * upperList; // list of upper bound changes
116
+ char * markDone; // mark which ones looked at
117
+ int * backwardBasic; // from sequence to pivot row
118
+ int * lowerActive;
119
+ double * lowerGap;
120
+ double * lowerCoefficient;
121
+ int * upperActive;
122
+ double * upperGap;
123
+ double * upperCoefficient;
124
+ int unscaledChangesOffset;
125
+ bool firstIteration; // so can update rhs for accuracy
126
+ } parametricsData;
127
+
128
+ private:
129
+ /** Parametrics - inner loop
130
+ This first attempt is when reportIncrement non zero and may
131
+ not report endingTheta correctly
132
+ If it can not reach input endingTheta return code will be 1 for infeasible,
133
+ 2 for unbounded, otherwise 0.
134
+ Normal report is just theta and objective but
135
+ if event handler exists it may do more
136
+ */
137
+ int parametricsLoop(parametricsData & paramData, double reportIncrement,
138
+ const double * changeLower, const double * changeUpper,
139
+ const double * changeObjective, ClpDataSave & data,
140
+ bool canTryQuick);
141
+ int parametricsLoop(parametricsData & paramData,
142
+ ClpDataSave & data,bool canSkipFactorization=false);
143
+ int parametricsObjLoop(parametricsData & paramData,
144
+ ClpDataSave & data,bool canSkipFactorization=false);
145
+ /** Refactorizes if necessary
146
+ Checks if finished. Updates status.
147
+
148
+ type - 0 initial so set up save arrays etc
149
+ - 1 normal -if good update save
150
+ - 2 restoring from saved
151
+ */
152
+ void statusOfProblemInParametrics(int type, ClpDataSave & saveData);
153
+ void statusOfProblemInParametricsObj(int type, ClpDataSave & saveData);
154
+ /** This has the flow between re-factorizations
155
+
156
+ Reasons to come out:
157
+ -1 iterations etc
158
+ -2 inaccuracy
159
+ -3 slight inaccuracy (and done iterations)
160
+ +0 looks optimal (might be unbounded - but we will investigate)
161
+ +1 looks infeasible
162
+ +3 max iterations
163
+ */
164
+ int whileIterating(parametricsData & paramData, double reportIncrement,
165
+ const double * changeObjective);
166
+ /** Computes next theta and says if objective or bounds (0= bounds, 1 objective, -1 none).
167
+ theta is in theta_.
168
+ type 1 bounds, 2 objective, 3 both.
169
+ */
170
+ int nextTheta(int type, double maxTheta, parametricsData & paramData,
171
+ const double * changeObjective);
172
+ int whileIteratingObj(parametricsData & paramData);
173
+ int nextThetaObj(double maxTheta, parametricsData & paramData);
174
+ /// Restores bound to original bound
175
+ void originalBound(int iSequence, double theta, const double * changeLower,
176
+ const double * changeUpper);
177
+ /// Compute new rowLower_ etc (return negative if infeasible - otherwise largest change)
178
+ double computeRhsEtc(parametricsData & paramData);
179
+ /// Redo lower_ from rowLower_ etc
180
+ void redoInternalArrays();
181
+ /**
182
+ Row array has row part of pivot row
183
+ Column array has column part.
184
+ This is used in dual ranging
185
+ */
186
+ void checkDualRatios(CoinIndexedVector * rowArray,
187
+ CoinIndexedVector * columnArray,
188
+ double & costIncrease, int & sequenceIncrease, double & alphaIncrease,
189
+ double & costDecrease, int & sequenceDecrease, double & alphaDecrease);
190
+ /**
191
+ Row array has pivot column
192
+ This is used in primal ranging
193
+ */
194
+ void checkPrimalRatios(CoinIndexedVector * rowArray,
195
+ int direction);
196
+ /// Returns new value of whichOther when whichIn enters basis
197
+ double primalRanging1(int whichIn, int whichOther);
198
+
199
+ public:
200
+ /** Write the basis in MPS format to the specified file.
201
+ If writeValues true writes values of structurals
202
+ (and adds VALUES to end of NAME card)
203
+
204
+ Row and column names may be null.
205
+ formatType is
206
+ <ul>
207
+ <li> 0 - normal
208
+ <li> 1 - extra accuracy
209
+ <li> 2 - IEEE hex (later)
210
+ </ul>
211
+
212
+ Returns non-zero on I/O error
213
+ */
214
+ int writeBasis(const char *filename,
215
+ bool writeValues = false,
216
+ int formatType = 0) const;
217
+ /// Read a basis from the given filename
218
+ int readBasis(const char *filename);
219
+ /** Creates dual of a problem if looks plausible
220
+ (defaults will always create model)
221
+ fractionRowRanges is fraction of rows allowed to have ranges
222
+ fractionColumnRanges is fraction of columns allowed to have ranges
223
+ */
224
+ ClpSimplex * dualOfModel(double fractionRowRanges = 1.0, double fractionColumnRanges = 1.0) const;
225
+ /** Restores solution from dualized problem
226
+ non-zero return code indicates minor problems
227
+ */
228
+ int restoreFromDual(const ClpSimplex * dualProblem,
229
+ bool checkAccuracy=false);
230
+ /** Sets solution in dualized problem
231
+ non-zero return code indicates minor problems
232
+ */
233
+ int setInDual(ClpSimplex * dualProblem);
234
+ /** Does very cursory presolve.
235
+ rhs is numberRows, whichRows is 3*numberRows and whichColumns is 2*numberColumns.
236
+ */
237
+ ClpSimplex * crunch(double * rhs, int * whichRows, int * whichColumns,
238
+ int & nBound, bool moreBounds = false, bool tightenBounds = false);
239
+ /** After very cursory presolve.
240
+ rhs is numberRows, whichRows is 3*numberRows and whichColumns is 2*numberColumns.
241
+ */
242
+ void afterCrunch(const ClpSimplex & small,
243
+ const int * whichRows, const int * whichColumns,
244
+ int nBound);
245
+ /** Returns gub version of model or NULL
246
+ whichRows has to be numberRows
247
+ whichColumns has to be numberRows+numberColumns */
248
+ ClpSimplex * gubVersion(int * whichRows, int * whichColumns,
249
+ int neededGub,
250
+ int factorizationFrequency=50);
251
+ /// Sets basis from original
252
+ void setGubBasis(ClpSimplex &original,const int * whichRows,
253
+ const int * whichColumns);
254
+ /// Restores basis to original
255
+ void getGubBasis(ClpSimplex &original,const int * whichRows,
256
+ const int * whichColumns) const;
257
+ /// Quick try at cleaning up duals if postsolve gets wrong
258
+ void cleanupAfterPostsolve();
259
+ /** Tightens integer bounds - returns number tightened or -1 if infeasible
260
+ */
261
+ int tightenIntegerBounds(double * rhsSpace);
262
+ /** Expands out all possible combinations for a knapsack
263
+ If buildObj NULL then just computes space needed - returns number elements
264
+ On entry numberOutput is maximum allowed, on exit it is number needed or
265
+ -1 (as will be number elements) if maximum exceeded. numberOutput will have at
266
+ least space to return values which reconstruct input.
267
+ Rows returned will be original rows but no entries will be returned for
268
+ any rows all of whose entries are in knapsack. So up to user to allow for this.
269
+ If reConstruct >=0 then returns number of entrie which make up item "reConstruct"
270
+ in expanded knapsack. Values in buildRow and buildElement;
271
+ */
272
+ int expandKnapsack(int knapsackRow, int & numberOutput,
273
+ double * buildObj, CoinBigIndex * buildStart,
274
+ int * buildRow, double * buildElement, int reConstruct = -1) const;
275
+ //@}
276
+ };
277
+ #endif