ruby-cbc 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
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,1056 @@
1
+ /* $Id: CoinMpsIO.hpp 1642 2013-10-16 00:43:14Z tkr $ */
2
+ // Copyright (C) 2000, International Business Machines
3
+ // Corporation and others. All Rights Reserved.
4
+ // This code is licensed under the terms of the Eclipse Public License (EPL).
5
+
6
+ #ifndef CoinMpsIO_H
7
+ #define CoinMpsIO_H
8
+
9
+ #if defined(_MSC_VER)
10
+ // Turn off compiler warning about long names
11
+ # pragma warning(disable:4786)
12
+ #endif
13
+
14
+ #include <vector>
15
+ #include <string>
16
+
17
+ #include "CoinUtilsConfig.h"
18
+ #include "CoinPackedMatrix.hpp"
19
+ #include "CoinMessageHandler.hpp"
20
+ #include "CoinFileIO.hpp"
21
+ class CoinModel;
22
+
23
+ /// The following lengths are in decreasing order (for 64 bit etc)
24
+ /// Large enough to contain element index
25
+ /// This is already defined as CoinBigIndex
26
+ /// Large enough to contain column index
27
+ typedef int COINColumnIndex;
28
+
29
+ /// Large enough to contain row index (or basis)
30
+ typedef int COINRowIndex;
31
+
32
+ // We are allowing free format - but there is a limit!
33
+ // User can override by using CXXFLAGS += -DCOIN_MAX_FIELD_LENGTH=nnn
34
+ #ifndef COIN_MAX_FIELD_LENGTH
35
+ #define COIN_MAX_FIELD_LENGTH 160
36
+ #endif
37
+ #define MAX_CARD_LENGTH 5*COIN_MAX_FIELD_LENGTH+80
38
+
39
+ enum COINSectionType { COIN_NO_SECTION, COIN_NAME_SECTION, COIN_ROW_SECTION,
40
+ COIN_COLUMN_SECTION,
41
+ COIN_RHS_SECTION, COIN_RANGES_SECTION, COIN_BOUNDS_SECTION,
42
+ COIN_ENDATA_SECTION, COIN_EOF_SECTION, COIN_QUADRATIC_SECTION,
43
+ COIN_CONIC_SECTION,COIN_QUAD_SECTION,COIN_SOS_SECTION,
44
+ COIN_BASIS_SECTION,COIN_UNKNOWN_SECTION
45
+ };
46
+
47
+ enum COINMpsType { COIN_N_ROW, COIN_E_ROW, COIN_L_ROW, COIN_G_ROW,
48
+ COIN_BLANK_COLUMN, COIN_S1_COLUMN, COIN_S2_COLUMN, COIN_S3_COLUMN,
49
+ COIN_INTORG, COIN_INTEND, COIN_SOSEND, COIN_UNSET_BOUND,
50
+ COIN_UP_BOUND, COIN_FX_BOUND, COIN_LO_BOUND, COIN_FR_BOUND,
51
+ COIN_MI_BOUND, COIN_PL_BOUND, COIN_BV_BOUND,
52
+ COIN_UI_BOUND, COIN_LI_BOUND, COIN_BOTH_BOUNDS_SET,
53
+ COIN_SC_BOUND, COIN_S1_BOUND, COIN_S2_BOUND,
54
+ COIN_BS_BASIS, COIN_XL_BASIS, COIN_XU_BASIS,
55
+ COIN_LL_BASIS, COIN_UL_BASIS, COIN_UNKNOWN_MPS_TYPE
56
+ };
57
+ class CoinMpsIO;
58
+ /// Very simple code for reading MPS data
59
+ class CoinMpsCardReader {
60
+
61
+ public:
62
+
63
+ /**@name Constructor and destructor */
64
+ //@{
65
+ /// Constructor expects file to be open
66
+ /// This one takes gzFile if fp null
67
+ CoinMpsCardReader ( CoinFileInput *input, CoinMpsIO * reader );
68
+
69
+ /// Destructor
70
+ ~CoinMpsCardReader ( );
71
+ //@}
72
+
73
+
74
+ /**@name card stuff */
75
+ //@{
76
+ /// Read to next section
77
+ COINSectionType readToNextSection ( );
78
+ /// Gets next field and returns section type e.g. COIN_COLUMN_SECTION
79
+ COINSectionType nextField ( );
80
+ /** Gets next field for .gms file and returns type.
81
+ -1 - EOF
82
+ 0 - what we expected (and processed so pointer moves past)
83
+ 1 - not what we expected
84
+ leading blanks always ignored
85
+ input types
86
+ 0 - anything - stops on non blank card
87
+ 1 - name (in columnname)
88
+ 2 - value
89
+ 3 - value name pair
90
+ 4 - equation type
91
+ 5 - ;
92
+ */
93
+ int nextGmsField ( int expectedType );
94
+ /// Returns current section type
95
+ inline COINSectionType whichSection ( ) const {
96
+ return section_;
97
+ }
98
+ /// Sets current section type
99
+ inline void setWhichSection(COINSectionType section ) {
100
+ section_=section;
101
+ }
102
+ /// Sees if free format.
103
+ inline bool freeFormat() const
104
+ { return freeFormat_;}
105
+ /// Sets whether free format. Mainly for blank RHS etc
106
+ inline void setFreeFormat(bool yesNo)
107
+ { freeFormat_=yesNo;}
108
+ /// Only for first field on card otherwise BLANK_COLUMN
109
+ /// e.g. COIN_E_ROW
110
+ inline COINMpsType mpsType ( ) const {
111
+ return mpsType_;
112
+ }
113
+ /// Reads and cleans card - taking out trailing blanks - return 1 if EOF
114
+ int cleanCard();
115
+ /// Returns row name of current field
116
+ inline const char *rowName ( ) const {
117
+ return rowName_;
118
+ }
119
+ /// Returns column name of current field
120
+ inline const char *columnName ( ) const {
121
+ return columnName_;
122
+ }
123
+ /// Returns value in current field
124
+ inline double value ( ) const {
125
+ return value_;
126
+ }
127
+ /// Returns value as string in current field
128
+ inline const char *valueString ( ) const {
129
+ return valueString_;
130
+ }
131
+ /// Whole card (for printing)
132
+ inline const char *card ( ) const {
133
+ return card_;
134
+ }
135
+ /// Whole card - so we look at it (not const so nextBlankOr will work for gms reader)
136
+ inline char *mutableCard ( ) {
137
+ return card_;
138
+ }
139
+ /// set position (again so gms reader will work)
140
+ inline void setPosition(char * position)
141
+ { position_=position;}
142
+ /// get position (again so gms reader will work)
143
+ inline char * getPosition() const
144
+ { return position_;}
145
+ /// Returns card number
146
+ inline CoinBigIndex cardNumber ( ) const {
147
+ return cardNumber_;
148
+ }
149
+ /// Returns file input
150
+ inline CoinFileInput * fileInput ( ) const {
151
+ return input_;
152
+ }
153
+ /// Sets whether strings allowed
154
+ inline void setStringsAllowed()
155
+ { stringsAllowed_=true;}
156
+ //@}
157
+
158
+ ////////////////// data //////////////////
159
+ protected:
160
+
161
+ /**@name data */
162
+ //@{
163
+ /// Current value
164
+ double value_;
165
+ /// Current card image
166
+ char card_[MAX_CARD_LENGTH];
167
+ /// Current position within card image
168
+ char *position_;
169
+ /// End of card
170
+ char *eol_;
171
+ /// Current COINMpsType
172
+ COINMpsType mpsType_;
173
+ /// Current row name
174
+ char rowName_[COIN_MAX_FIELD_LENGTH];
175
+ /// Current column name
176
+ char columnName_[COIN_MAX_FIELD_LENGTH];
177
+ /// File input
178
+ CoinFileInput *input_;
179
+ /// Which section we think we are in
180
+ COINSectionType section_;
181
+ /// Card number
182
+ CoinBigIndex cardNumber_;
183
+ /// Whether free format. Just for blank RHS etc
184
+ bool freeFormat_;
185
+ /// Whether IEEE - 0 no, 1 INTEL, 2 not INTEL
186
+ int ieeeFormat_;
187
+ /// If all names <= 8 characters then allow embedded blanks
188
+ bool eightChar_;
189
+ /// MpsIO
190
+ CoinMpsIO * reader_;
191
+ /// Message handler
192
+ CoinMessageHandler * handler_;
193
+ /// Messages
194
+ CoinMessages messages_;
195
+ /// Current element as characters (only if strings allowed)
196
+ char valueString_[COIN_MAX_FIELD_LENGTH];
197
+ /// Whether strings allowed
198
+ bool stringsAllowed_;
199
+ //@}
200
+ public:
201
+ /**@name methods */
202
+ //@{
203
+ /// type - 0 normal, 1 INTEL IEEE, 2 other IEEE
204
+ double osi_strtod(char * ptr, char ** output, int type);
205
+ /// remove blanks
206
+ static void strcpyAndCompress ( char *to, const char *from );
207
+ ///
208
+ static char * nextBlankOr ( char *image );
209
+ /// For strings
210
+ double osi_strtod(char * ptr, char ** output);
211
+ //@}
212
+
213
+ };
214
+
215
+ //#############################################################################
216
+ #ifdef USE_SBB
217
+ class SbbObject;
218
+ class SbbModel;
219
+ #endif
220
+ /// Very simple class for containing data on set
221
+ class CoinSet {
222
+
223
+ public:
224
+
225
+ /**@name Constructor and destructor */
226
+ //@{
227
+ /// Default constructor
228
+ CoinSet ( );
229
+ /// Constructor
230
+ CoinSet ( int numberEntries, const int * which);
231
+
232
+ /// Copy constructor
233
+ CoinSet (const CoinSet &);
234
+
235
+ /// Assignment operator
236
+ CoinSet & operator=(const CoinSet& rhs);
237
+
238
+ /// Destructor
239
+ virtual ~CoinSet ( );
240
+ //@}
241
+
242
+
243
+ /**@name gets */
244
+ //@{
245
+ /// Returns number of entries
246
+ inline int numberEntries ( ) const
247
+ { return numberEntries_; }
248
+ /// Returns type of set - 1 =SOS1, 2 =SOS2
249
+ inline int setType ( ) const
250
+ { return setType_; }
251
+ /// Returns list of variables
252
+ inline const int * which ( ) const
253
+ { return which_; }
254
+ /// Returns weights
255
+ inline const double * weights ( ) const
256
+ { return weights_; }
257
+ //@}
258
+
259
+ #ifdef USE_SBB
260
+ /**@name Use in sbb */
261
+ //@{
262
+ /// returns an object of type SbbObject
263
+ virtual SbbObject * sbbObject(SbbModel * model) const
264
+ { return NULL;}
265
+ //@}
266
+ #endif
267
+
268
+ ////////////////// data //////////////////
269
+ protected:
270
+
271
+ /**@name data */
272
+ //@{
273
+ /// Number of entries
274
+ int numberEntries_;
275
+ /// type of set
276
+ int setType_;
277
+ /// Which variables are in set
278
+ int * which_;
279
+ /// Weights
280
+ double * weights_;
281
+ //@}
282
+ };
283
+
284
+ //#############################################################################
285
+ /// Very simple class for containing SOS set
286
+ class CoinSosSet : public CoinSet{
287
+
288
+ public:
289
+
290
+ /**@name Constructor and destructor */
291
+ //@{
292
+ /// Constructor
293
+ CoinSosSet ( int numberEntries, const int * which, const double * weights, int type);
294
+
295
+ /// Destructor
296
+ virtual ~CoinSosSet ( );
297
+ //@}
298
+
299
+
300
+ #ifdef USE_SBB
301
+ /**@name Use in sbb */
302
+ //@{
303
+ /// returns an object of type SbbObject
304
+ virtual SbbObject * sbbObject(SbbModel * model) const ;
305
+ //@}
306
+ #endif
307
+
308
+ ////////////////// data //////////////////
309
+ protected:
310
+
311
+ /**@name data */
312
+ //@{
313
+ //@}
314
+ };
315
+
316
+ //#############################################################################
317
+
318
+ /** MPS IO Interface
319
+
320
+ This class can be used to read in mps files without a solver. After
321
+ reading the file, the CoinMpsIO object contains all relevant data, which
322
+ may be more than a particular OsiSolverInterface allows for. Items may
323
+ be deleted to allow for flexibility of data storage.
324
+
325
+ The implementation makes the CoinMpsIO object look very like a dummy solver,
326
+ as the same conventions are used.
327
+ */
328
+
329
+ class CoinMpsIO {
330
+ friend void CoinMpsIOUnitTest(const std::string & mpsDir);
331
+
332
+ public:
333
+
334
+ /** @name Methods to retrieve problem information
335
+
336
+ These methods return information about the problem held by the CoinMpsIO
337
+ object.
338
+
339
+ Querying an object that has no data associated with it result in zeros for
340
+ the number of rows and columns, and NULL pointers from the methods that
341
+ return vectors. Const pointers returned from any data-query method are
342
+ always valid
343
+ */
344
+ //@{
345
+ /// Get number of columns
346
+ int getNumCols() const;
347
+
348
+ /// Get number of rows
349
+ int getNumRows() const;
350
+
351
+ /// Get number of nonzero elements
352
+ int getNumElements() const;
353
+
354
+ /// Get pointer to array[getNumCols()] of column lower bounds
355
+ const double * getColLower() const;
356
+
357
+ /// Get pointer to array[getNumCols()] of column upper bounds
358
+ const double * getColUpper() const;
359
+
360
+ /** Get pointer to array[getNumRows()] of constraint senses.
361
+ <ul>
362
+ <li>'L': <= constraint
363
+ <li>'E': = constraint
364
+ <li>'G': >= constraint
365
+ <li>'R': ranged constraint
366
+ <li>'N': free constraint
367
+ </ul>
368
+ */
369
+ const char * getRowSense() const;
370
+
371
+ /** Get pointer to array[getNumRows()] of constraint right-hand sides.
372
+
373
+ Given constraints with upper (rowupper) and/or lower (rowlower) bounds,
374
+ the constraint right-hand side (rhs) is set as
375
+ <ul>
376
+ <li> if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
377
+ <li> if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
378
+ <li> if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
379
+ <li> if rowsense()[i] == 'N' then rhs()[i] == 0.0
380
+ </ul>
381
+ */
382
+ const double * getRightHandSide() const;
383
+
384
+ /** Get pointer to array[getNumRows()] of row ranges.
385
+
386
+ Given constraints with upper (rowupper) and/or lower (rowlower) bounds,
387
+ the constraint range (rowrange) is set as
388
+ <ul>
389
+ <li> if rowsense()[i] == 'R' then
390
+ rowrange()[i] == rowupper()[i] - rowlower()[i]
391
+ <li> if rowsense()[i] != 'R' then
392
+ rowrange()[i] is 0.0
393
+ </ul>
394
+ Put another way, only range constraints have a nontrivial value for
395
+ rowrange.
396
+ */
397
+ const double * getRowRange() const;
398
+
399
+ /// Get pointer to array[getNumRows()] of row lower bounds
400
+ const double * getRowLower() const;
401
+
402
+ /// Get pointer to array[getNumRows()] of row upper bounds
403
+ const double * getRowUpper() const;
404
+
405
+ /// Get pointer to array[getNumCols()] of objective function coefficients
406
+ const double * getObjCoefficients() const;
407
+
408
+ /// Get pointer to row-wise copy of the coefficient matrix
409
+ const CoinPackedMatrix * getMatrixByRow() const;
410
+
411
+ /// Get pointer to column-wise copy of the coefficient matrix
412
+ const CoinPackedMatrix * getMatrixByCol() const;
413
+
414
+ /// Return true if column is a continuous variable
415
+ bool isContinuous(int colNumber) const;
416
+
417
+ /** Return true if a column is an integer variable
418
+
419
+ Note: This function returns true if the the column
420
+ is a binary or general integer variable.
421
+ */
422
+ bool isInteger(int columnNumber) const;
423
+
424
+ /** Returns array[getNumCols()] specifying if a variable is integer.
425
+
426
+ At present, simply coded as zero (continuous) and non-zero (integer)
427
+ May be extended at a later date.
428
+ */
429
+ const char * integerColumns() const;
430
+
431
+ /** Returns the row name for the specified index.
432
+
433
+ Returns 0 if the index is out of range.
434
+ */
435
+ const char * rowName(int index) const;
436
+
437
+ /** Returns the column name for the specified index.
438
+
439
+ Returns 0 if the index is out of range.
440
+ */
441
+ const char * columnName(int index) const;
442
+
443
+ /** Returns the index for the specified row name
444
+
445
+ Returns -1 if the name is not found.
446
+ Returns numberRows for the objective row and > numberRows for
447
+ dropped free rows.
448
+ */
449
+ int rowIndex(const char * name) const;
450
+
451
+ /** Returns the index for the specified column name
452
+
453
+ Returns -1 if the name is not found.
454
+ */
455
+ int columnIndex(const char * name) const;
456
+
457
+ /** Returns the (constant) objective offset
458
+
459
+ This is the RHS entry for the objective row
460
+ */
461
+ double objectiveOffset() const;
462
+ /// Set objective offset
463
+ inline void setObjectiveOffset(double value)
464
+ { objectiveOffset_=value;}
465
+
466
+ /// Return the problem name
467
+ const char * getProblemName() const;
468
+
469
+ /// Return the objective name
470
+ const char * getObjectiveName() const;
471
+
472
+ /// Return the RHS vector name
473
+ const char * getRhsName() const;
474
+
475
+ /// Return the range vector name
476
+ const char * getRangeName() const;
477
+
478
+ /// Return the bound vector name
479
+ const char * getBoundName() const;
480
+ /// Number of string elements
481
+ inline int numberStringElements() const
482
+ { return numberStringElements_;}
483
+ /// String element
484
+ inline const char * stringElement(int i) const
485
+ { return stringElements_[i];}
486
+ //@}
487
+
488
+
489
+ /** @name Methods to set problem information
490
+
491
+ Methods to load a problem into the CoinMpsIO object.
492
+ */
493
+ //@{
494
+
495
+ /// Set the problem data
496
+ void setMpsData(const CoinPackedMatrix& m, const double infinity,
497
+ const double* collb, const double* colub,
498
+ const double* obj, const char* integrality,
499
+ const double* rowlb, const double* rowub,
500
+ char const * const * const colnames,
501
+ char const * const * const rownames);
502
+ void setMpsData(const CoinPackedMatrix& m, const double infinity,
503
+ const double* collb, const double* colub,
504
+ const double* obj, const char* integrality,
505
+ const double* rowlb, const double* rowub,
506
+ const std::vector<std::string> & colnames,
507
+ const std::vector<std::string> & rownames);
508
+ void setMpsData(const CoinPackedMatrix& m, const double infinity,
509
+ const double* collb, const double* colub,
510
+ const double* obj, const char* integrality,
511
+ const char* rowsen, const double* rowrhs,
512
+ const double* rowrng,
513
+ char const * const * const colnames,
514
+ char const * const * const rownames);
515
+ void setMpsData(const CoinPackedMatrix& m, const double infinity,
516
+ const double* collb, const double* colub,
517
+ const double* obj, const char* integrality,
518
+ const char* rowsen, const double* rowrhs,
519
+ const double* rowrng,
520
+ const std::vector<std::string> & colnames,
521
+ const std::vector<std::string> & rownames);
522
+
523
+ /** Pass in an array[getNumCols()] specifying if a variable is integer.
524
+
525
+ At present, simply coded as zero (continuous) and non-zero (integer)
526
+ May be extended at a later date.
527
+ */
528
+ void copyInIntegerInformation(const char * integerInformation);
529
+
530
+ /// Set problem name
531
+ void setProblemName(const char *name) ;
532
+
533
+ /// Set objective name
534
+ void setObjectiveName(const char *name) ;
535
+
536
+ //@}
537
+
538
+ /** @name Parameter set/get methods
539
+
540
+ Methods to set and retrieve MPS IO parameters.
541
+ */
542
+
543
+ //@{
544
+ /// Set infinity
545
+ void setInfinity(double value);
546
+
547
+ /// Get infinity
548
+ double getInfinity() const;
549
+
550
+ /// Set default upper bound for integer variables
551
+ void setDefaultBound(int value);
552
+
553
+ /// Get default upper bound for integer variables
554
+ int getDefaultBound() const;
555
+ /// Whether to allow string elements
556
+ inline int allowStringElements() const
557
+ { return allowStringElements_;}
558
+ /// Whether to allow string elements (0 no, 1 yes, 2 yes and try flip)
559
+ inline void setAllowStringElements(int yesNo)
560
+ { allowStringElements_ = yesNo;}
561
+ /** Small element value - elements less than this set to zero on input
562
+ default is 1.0e-14 */
563
+ inline double getSmallElementValue() const
564
+ { return smallElement_;}
565
+ inline void setSmallElementValue(double value)
566
+ { smallElement_=value;}
567
+ //@}
568
+
569
+
570
+ /** @name Methods for problem input and output
571
+
572
+ Methods to read and write MPS format problem files.
573
+
574
+ The read and write methods return the number of errors that occurred during
575
+ the IO operation, or -1 if no file is opened.
576
+
577
+ \note
578
+ If the CoinMpsIO class was compiled with support for libz then
579
+ readMps will automatically try to append .gz to the file name and open it as
580
+ a compressed file if the specified file name cannot be opened.
581
+ (Automatic append of the .bz2 suffix when libbz is used is on the TODO list.)
582
+
583
+ \todo
584
+ Allow for file pointers and positioning
585
+ */
586
+
587
+ //@{
588
+ /// Set the current file name for the CoinMpsIO object
589
+ void setFileName(const char * name);
590
+
591
+ /// Get the current file name for the CoinMpsIO object
592
+ const char * getFileName() const;
593
+
594
+ /** Read a problem in MPS format from the given filename.
595
+
596
+ Use "stdin" or "-" to read from stdin.
597
+ */
598
+ int readMps(const char *filename, const char *extension = "mps");
599
+
600
+ /** Read a problem in MPS format from the given filename.
601
+
602
+ Use "stdin" or "-" to read from stdin.
603
+ But do sets as well
604
+ */
605
+ int readMps(const char *filename, const char *extension ,
606
+ int & numberSets, CoinSet **& sets);
607
+
608
+ /** Read a problem in MPS format from a previously opened file
609
+
610
+ More precisely, read a problem using a CoinMpsCardReader object already
611
+ associated with this CoinMpsIO object.
612
+
613
+ \todo
614
+ Provide an interface that will allow a client to associate a
615
+ CoinMpsCardReader object with a CoinMpsIO object by setting the
616
+ cardReader_ field.
617
+ */
618
+ int readMps();
619
+ /// and
620
+ int readMps(int & numberSets, CoinSet **& sets);
621
+ /** Read a basis in MPS format from the given filename.
622
+ If VALUES on NAME card and solution not NULL fills in solution
623
+ status values as for CoinWarmStartBasis (but one per char)
624
+ -1 file error, 0 normal, 1 has solution values
625
+
626
+ Use "stdin" or "-" to read from stdin.
627
+
628
+ If sizes of names incorrect - read without names
629
+ */
630
+ int readBasis(const char *filename, const char *extension ,
631
+ double * solution, unsigned char *rowStatus, unsigned char *columnStatus,
632
+ const std::vector<std::string> & colnames,int numberColumns,
633
+ const std::vector<std::string> & rownames, int numberRows);
634
+
635
+ /** Read a problem in GAMS format from the given filename.
636
+
637
+ Use "stdin" or "-" to read from stdin.
638
+ if convertObjective then massages objective column
639
+ */
640
+ int readGms(const char *filename, const char *extension = "gms",bool convertObjective=false);
641
+
642
+ /** Read a problem in GAMS format from the given filename.
643
+
644
+ Use "stdin" or "-" to read from stdin.
645
+ But do sets as well
646
+ */
647
+ int readGms(const char *filename, const char *extension ,
648
+ int & numberSets, CoinSet **& sets);
649
+
650
+ /** Read a problem in GAMS format from a previously opened file
651
+
652
+ More precisely, read a problem using a CoinMpsCardReader object already
653
+ associated with this CoinMpsIO object.
654
+
655
+ */
656
+ // Not for now int readGms();
657
+ /// and
658
+ int readGms(int & numberSets, CoinSet **& sets);
659
+ /** Read a problem in GMPL (subset of AMPL) format from the given filenames.
660
+ */
661
+ int readGMPL(const char *modelName, const char * dataName=NULL, bool keepNames=false);
662
+
663
+ /** Write the problem in MPS format to a file with the given filename.
664
+
665
+ \param compression can be set to three values to indicate what kind
666
+ of file should be written
667
+ <ul>
668
+ <li> 0: plain text (default)
669
+ <li> 1: gzip compressed (.gz is appended to \c filename)
670
+ <li> 2: bzip2 compressed (.bz2 is appended to \c filename) (TODO)
671
+ </ul>
672
+ If the library was not compiled with the requested compression then
673
+ writeMps falls back to writing a plain text file.
674
+
675
+ \param formatType specifies the precision to used for values in the
676
+ MPS file
677
+ <ul>
678
+ <li> 0: normal precision (default)
679
+ <li> 1: extra accuracy
680
+ <li> 2: IEEE hex
681
+ </ul>
682
+
683
+ \param numberAcross specifies whether 1 or 2 (default) values should be
684
+ specified on every data line in the MPS file.
685
+
686
+ \param quadratic specifies quadratic objective to be output
687
+ */
688
+ int writeMps(const char *filename, int compression = 0,
689
+ int formatType = 0, int numberAcross = 2,
690
+ CoinPackedMatrix * quadratic = NULL,
691
+ int numberSOS=0,const CoinSet * setInfo=NULL) const;
692
+
693
+ /// Return card reader object so can see what last card was e.g. QUADOBJ
694
+ inline const CoinMpsCardReader * reader() const
695
+ { return cardReader_;}
696
+
697
+ /** Read in a quadratic objective from the given filename.
698
+
699
+ If filename is NULL (or the same as the currently open file) then
700
+ reading continues from the current file.
701
+ If not, the file is closed and the specified file is opened.
702
+
703
+ Code should be added to
704
+ general MPS reader to read this if QSECTION
705
+ Data is assumed to be Q and objective is c + 1/2 xT Q x
706
+ No assumption is made for symmetry, positive definite, etc.
707
+ No check is made for duplicates or non-triangular if checkSymmetry==0.
708
+ If 1 checks lower triangular (so off diagonal should be 2*Q)
709
+ if 2 makes lower triangular and assumes full Q (but adds off diagonals)
710
+
711
+ Arrays should be deleted by delete []
712
+
713
+ Returns number of errors:
714
+ <ul>
715
+ <li> -1: bad file
716
+ <li> -2: no Quadratic section
717
+ <li> -3: an empty section
718
+ <li> +n: then matching errors etc (symmetry forced)
719
+ <li> -4: no matching errors but fails triangular test
720
+ (triangularity forced)
721
+ </ul>
722
+ columnStart is numberColumns+1 long, others numberNonZeros
723
+ */
724
+ int readQuadraticMps(const char * filename,
725
+ int * &columnStart, int * &column, double * &elements,
726
+ int checkSymmetry);
727
+
728
+ /** Read in a list of cones from the given filename.
729
+
730
+ If filename is NULL (or the same as the currently open file) then
731
+ reading continues from the current file.
732
+ If not, the file is closed and the specified file is opened.
733
+
734
+ Code should be added to
735
+ general MPS reader to read this if CSECTION
736
+ No checking is done that in unique cone
737
+
738
+ Arrays should be deleted by delete []
739
+
740
+ Returns number of errors, -1 bad file, -2 no conic section,
741
+ -3 empty section
742
+
743
+ columnStart is numberCones+1 long, other number of columns in matrix
744
+
745
+ coneType is 1 for QUAD, 2 for RQUAD (numberCones long)
746
+ */
747
+ int readConicMps(const char * filename,
748
+ int * &columnStart, int * &column, int * &coneType, int & numberCones);
749
+ /// Set whether to move objective from matrix
750
+ inline void setConvertObjective(bool trueFalse)
751
+ { convertObjective_=trueFalse;}
752
+ /// copies in strings from a CoinModel - returns number
753
+ int copyStringElements(const CoinModel * model);
754
+ //@}
755
+
756
+ /** @name Constructors and destructors */
757
+ //@{
758
+ /// Default Constructor
759
+ CoinMpsIO();
760
+
761
+ /// Copy constructor
762
+ CoinMpsIO (const CoinMpsIO &);
763
+
764
+ /// Assignment operator
765
+ CoinMpsIO & operator=(const CoinMpsIO& rhs);
766
+
767
+ /// Destructor
768
+ ~CoinMpsIO ();
769
+ //@}
770
+
771
+
772
+ /**@name Message handling */
773
+ //@{
774
+ /** Pass in Message handler
775
+
776
+ Supply a custom message handler. It will not be destroyed when the
777
+ CoinMpsIO object is destroyed.
778
+ */
779
+ void passInMessageHandler(CoinMessageHandler * handler);
780
+
781
+ /// Set the language for messages.
782
+ void newLanguage(CoinMessages::Language language);
783
+
784
+ /// Set the language for messages.
785
+ inline void setLanguage(CoinMessages::Language language) {newLanguage(language);}
786
+
787
+ /// Return the message handler
788
+ inline CoinMessageHandler * messageHandler() const {return handler_;}
789
+
790
+ /// Return the messages
791
+ inline CoinMessages messages() {return messages_;}
792
+ /// Return the messages pointer
793
+ inline CoinMessages * messagesPointer() {return & messages_;}
794
+ //@}
795
+
796
+
797
+ /**@name Methods to release storage
798
+
799
+ These methods allow the client to reduce the storage used by the CoinMpsIO
800
+ object be selectively releasing unneeded problem information.
801
+ */
802
+ //@{
803
+ /** Release all information which can be re-calculated.
804
+
805
+ E.g., row sense, copies of rows, hash tables for names.
806
+ */
807
+ void releaseRedundantInformation();
808
+
809
+ /// Release all row information (lower, upper)
810
+ void releaseRowInformation();
811
+
812
+ /// Release all column information (lower, upper, objective)
813
+ void releaseColumnInformation();
814
+
815
+ /// Release integer information
816
+ void releaseIntegerInformation();
817
+
818
+ /// Release row names
819
+ void releaseRowNames();
820
+
821
+ /// Release column names
822
+ void releaseColumnNames();
823
+
824
+ /// Release matrix information
825
+ void releaseMatrixInformation();
826
+ //@}
827
+
828
+ protected:
829
+
830
+ /**@name Miscellaneous helper functions */
831
+ //@{
832
+
833
+ /// Utility method used several times to implement public methods
834
+ void
835
+ setMpsDataWithoutRowAndColNames(
836
+ const CoinPackedMatrix& m, const double infinity,
837
+ const double* collb, const double* colub,
838
+ const double* obj, const char* integrality,
839
+ const double* rowlb, const double* rowub);
840
+ void
841
+ setMpsDataColAndRowNames(
842
+ const std::vector<std::string> & colnames,
843
+ const std::vector<std::string> & rownames);
844
+ void
845
+ setMpsDataColAndRowNames(
846
+ char const * const * const colnames,
847
+ char const * const * const rownames);
848
+
849
+
850
+ /// Does the heavy lifting for destruct and assignment.
851
+ void gutsOfDestructor();
852
+
853
+ /// Does the heavy lifting for copy and assignment.
854
+ void gutsOfCopy(const CoinMpsIO &);
855
+
856
+ /// Clears problem data from the CoinMpsIO object.
857
+ void freeAll();
858
+
859
+
860
+ /** A quick inlined function to convert from lb/ub style constraint
861
+ definition to sense/rhs/range style */
862
+ inline void
863
+ convertBoundToSense(const double lower, const double upper,
864
+ char& sense, double& right, double& range) const;
865
+ /** A quick inlined function to convert from sense/rhs/range stryle
866
+ constraint definition to lb/ub style */
867
+ inline void
868
+ convertSenseToBound(const char sense, const double right,
869
+ const double range,
870
+ double& lower, double& upper) const;
871
+
872
+ /** Deal with a filename
873
+
874
+ As the name says.
875
+ Returns +1 if the file name is new, 0 if it's the same as before
876
+ (i.e., matches fileName_), and -1 if there's an error and the file
877
+ can't be opened.
878
+ Handles automatic append of .gz suffix when compiled with libz.
879
+
880
+ \todo
881
+ Add automatic append of .bz2 suffix when compiled with libbz.
882
+ */
883
+
884
+ int dealWithFileName(const char * filename, const char * extension,
885
+ CoinFileInput * &input);
886
+ /** Add string to list
887
+ iRow==numberRows is objective, nr+1 is lo, nr+2 is up
888
+ iColumn==nc is rhs (can't cope with ranges at present)
889
+ */
890
+ void addString(int iRow,int iColumn, const char * value);
891
+ /// Decode string
892
+ void decodeString(int iString, int & iRow, int & iColumn, const char * & value) const;
893
+ //@}
894
+
895
+
896
+ // for hashing
897
+ typedef struct {
898
+ int index, next;
899
+ } CoinHashLink;
900
+
901
+ /**@name Hash table methods */
902
+ //@{
903
+ /// Creates hash list for names (section = 0 for rows, 1 columns)
904
+ void startHash ( char **names, const int number , int section );
905
+ /// This one does it when names are already in
906
+ void startHash ( int section ) const;
907
+ /// Deletes hash storage
908
+ void stopHash ( int section );
909
+ /// Finds match using hash, -1 not found
910
+ int findHash ( const char *name , int section ) const;
911
+ //@}
912
+
913
+ /**@name Cached problem information */
914
+ //@{
915
+ /// Problem name
916
+ char * problemName_;
917
+
918
+ /// Objective row name
919
+ char * objectiveName_;
920
+
921
+ /// Right-hand side vector name
922
+ char * rhsName_;
923
+
924
+ /// Range vector name
925
+ char * rangeName_;
926
+
927
+ /// Bounds vector name
928
+ char * boundName_;
929
+
930
+ /// Number of rows
931
+ int numberRows_;
932
+
933
+ /// Number of columns
934
+ int numberColumns_;
935
+
936
+ /// Number of coefficients
937
+ CoinBigIndex numberElements_;
938
+
939
+ /// Pointer to dense vector of row sense indicators
940
+ mutable char *rowsense_;
941
+
942
+ /// Pointer to dense vector of row right-hand side values
943
+ mutable double *rhs_;
944
+
945
+ /** Pointer to dense vector of slack variable upper bounds for range
946
+ constraints (undefined for non-range rows)
947
+ */
948
+ mutable double *rowrange_;
949
+
950
+ /// Pointer to row-wise copy of problem matrix coefficients.
951
+ mutable CoinPackedMatrix *matrixByRow_;
952
+
953
+ /// Pointer to column-wise copy of problem matrix coefficients.
954
+ CoinPackedMatrix *matrixByColumn_;
955
+
956
+ /// Pointer to dense vector of row lower bounds
957
+ double * rowlower_;
958
+
959
+ /// Pointer to dense vector of row upper bounds
960
+ double * rowupper_;
961
+
962
+ /// Pointer to dense vector of column lower bounds
963
+ double * collower_;
964
+
965
+ /// Pointer to dense vector of column upper bounds
966
+ double * colupper_;
967
+
968
+ /// Pointer to dense vector of objective coefficients
969
+ double * objective_;
970
+
971
+ /// Constant offset for objective value (i.e., RHS value for OBJ row)
972
+ double objectiveOffset_;
973
+
974
+
975
+ /** Pointer to dense vector specifying if a variable is continuous
976
+ (0) or integer (1).
977
+ */
978
+ char * integerType_;
979
+
980
+ /** Row and column names
981
+ Linked to hash table sections (0 - row names, 1 column names)
982
+ */
983
+ char **names_[2];
984
+ //@}
985
+
986
+ /** @name Hash tables */
987
+ //@{
988
+ /// Current file name
989
+ char * fileName_;
990
+
991
+ /// Number of entries in a hash table section
992
+ int numberHash_[2];
993
+
994
+ /// Hash tables (two sections, 0 - row names, 1 - column names)
995
+ mutable CoinHashLink *hash_[2];
996
+ //@}
997
+
998
+ /** @name CoinMpsIO object parameters */
999
+ //@{
1000
+ /// Upper bound when no bounds for integers
1001
+ int defaultBound_;
1002
+
1003
+ /// Value to use for infinity
1004
+ double infinity_;
1005
+ /// Small element value
1006
+ double smallElement_;
1007
+
1008
+ /// Message handler
1009
+ CoinMessageHandler * handler_;
1010
+ /** Flag to say if the message handler is the default handler.
1011
+
1012
+ If true, the handler will be destroyed when the CoinMpsIO
1013
+ object is destroyed; if false, it will not be destroyed.
1014
+ */
1015
+ bool defaultHandler_;
1016
+ /// Messages
1017
+ CoinMessages messages_;
1018
+ /// Card reader
1019
+ CoinMpsCardReader * cardReader_;
1020
+ /// If .gms file should it be massaged to move objective
1021
+ bool convertObjective_;
1022
+ /// Whether to allow string elements
1023
+ int allowStringElements_;
1024
+ /// Maximum number of string elements
1025
+ int maximumStringElements_;
1026
+ /// Number of string elements
1027
+ int numberStringElements_;
1028
+ /// String elements
1029
+ char ** stringElements_;
1030
+ //@}
1031
+
1032
+ };
1033
+
1034
+ //#############################################################################
1035
+ /** A function that tests the methods in the CoinMpsIO class. The
1036
+ only reason for it not to be a member method is that this way it doesn't
1037
+ have to be compiled into the library. And that's a gain, because the
1038
+ library should be compiled with optimization on, but this method should be
1039
+ compiled with debugging. Also, if this method is compiled with
1040
+ optimization, the compilation takes 10-15 minutes and the machine pages
1041
+ (has 256M core memory!)... */
1042
+ void
1043
+ CoinMpsIOUnitTest(const std::string & mpsDir);
1044
+ // Function to return number in most efficient way
1045
+ // section is 0 for columns, 1 for rhs,ranges and 2 for bounds
1046
+ /* formatType is
1047
+ 0 - normal and 8 character names
1048
+ 1 - extra accuracy
1049
+ 2 - IEEE hex - INTEL
1050
+ 3 - IEEE hex - not INTEL
1051
+ */
1052
+ void
1053
+ CoinConvertDouble(int section, int formatType, double value, char outputValue[24]);
1054
+
1055
+ #endif
1056
+