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,666 @@
1
+ /* $Id: CoinMessageHandler.hpp 1514 2011-12-10 23:35:23Z lou $ */
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
+ #ifndef CoinMessageHandler_H
7
+ #define CoinMessageHandler_H
8
+
9
+ #include "CoinUtilsConfig.h"
10
+ #include "CoinPragma.hpp"
11
+
12
+ #include <iostream>
13
+ #include <cstdio>
14
+ #include <string>
15
+ #include <vector>
16
+
17
+ /** \file CoinMessageHandler.hpp
18
+ \brief This is a first attempt at a message handler.
19
+
20
+ The COIN Project is in favo(u)r of multi-language support. This implementation
21
+ of a message handler tries to make it as lightweight as possible in the sense
22
+ that only a subset of messages need to be defined --- the rest default to US
23
+ English.
24
+
25
+ The default handler at present just prints to stdout or to a FILE pointer
26
+
27
+ \todo
28
+ This needs to be worked over for correct operation with ISO character codes.
29
+ */
30
+
31
+ /*
32
+ I (jjf) am strongly in favo(u)r of language support for an open
33
+ source project, but I have tried to make it as lightweight as
34
+ possible in the sense that only a subset of messages need to be
35
+ defined - the rest default to US English. There will be different
36
+ sets of messages for each component - so at present there is a
37
+ Clp component and a Coin component.
38
+
39
+ Because messages are only used in a controlled environment and have no
40
+ impact on code and are tested by other tests I have included tests such
41
+ as language and derivation in other unit tests.
42
+ */
43
+ /*
44
+ Where there are derived classes I (jjf) have started message numbers at 1001.
45
+ */
46
+
47
+
48
+ /** \brief Class for one massaged message.
49
+
50
+ A message consists of a text string with formatting codes (#message_),
51
+ an integer identifier (#externalNumber_) which also determines the severity
52
+ level (#severity_) of the message, and a detail (logging) level (#detail_).
53
+
54
+ CoinOneMessage is just a container to hold this information. The
55
+ interpretation is set by CoinMessageHandler, which see.
56
+ */
57
+
58
+ class CoinOneMessage {
59
+
60
+ public:
61
+ /**@name Constructors etc */
62
+ //@{
63
+ /** Default constructor. */
64
+ CoinOneMessage();
65
+ /** Normal constructor */
66
+ CoinOneMessage(int externalNumber, char detail,
67
+ const char * message);
68
+ /** Destructor */
69
+ ~CoinOneMessage();
70
+ /** The copy constructor */
71
+ CoinOneMessage(const CoinOneMessage&);
72
+ /** assignment operator. */
73
+ CoinOneMessage& operator=(const CoinOneMessage&);
74
+ //@}
75
+
76
+ /**@name Useful stuff */
77
+ //@{
78
+ /// Replace message text (<i>e.g.</i>, text in a different language)
79
+ void replaceMessage(const char * message);
80
+ //@}
81
+
82
+ /**@name Get and set methods */
83
+ //@{
84
+ /** Get message ID number */
85
+ inline int externalNumber() const
86
+ {return externalNumber_;}
87
+ /** \brief Set message ID number
88
+
89
+ In the default CoinMessageHandler, this number is printed in the message
90
+ prefix and is used to determine the message severity level.
91
+ */
92
+ inline void setExternalNumber(int number)
93
+ {externalNumber_=number;}
94
+ /// Severity
95
+ inline char severity() const
96
+ {return severity_;}
97
+ /// Set detail level
98
+ inline void setDetail(int level)
99
+ {detail_=static_cast<char> (level);}
100
+ /// Get detail level
101
+ inline int detail() const
102
+ {return detail_;}
103
+ /// Return the message text
104
+ inline char * message() const
105
+ {return message_;}
106
+ //@}
107
+
108
+ /**@name member data */
109
+ //@{
110
+ /// number to print out (also determines severity)
111
+ int externalNumber_;
112
+ /// Will only print if detail matches
113
+ char detail_;
114
+ /// Severity
115
+ char severity_;
116
+ /// Messages (in correct language) (not all 400 may exist)
117
+ mutable char message_[400];
118
+ //@}
119
+ };
120
+
121
+ /** \brief Class to hold and manipulate an array of massaged messages.
122
+
123
+ Note that the message index used to reference a message in the array of
124
+ messages is completely distinct from the external ID number stored with the
125
+ message.
126
+ */
127
+
128
+ class CoinMessages {
129
+
130
+ public:
131
+ /** \brief Supported languages
132
+
133
+ These are the languages that are supported. At present only
134
+ us_en is serious and the rest are for testing.
135
+ */
136
+ enum Language {
137
+ us_en = 0,
138
+ uk_en,
139
+ it
140
+ };
141
+
142
+ /**@name Constructors etc */
143
+ //@{
144
+ /** Constructor with number of messages. */
145
+ CoinMessages(int numberMessages=0);
146
+ /** Destructor */
147
+ ~CoinMessages();
148
+ /** The copy constructor */
149
+ CoinMessages(const CoinMessages&);
150
+ /** assignment operator. */
151
+ CoinMessages& operator=(const CoinMessages&);
152
+ //@}
153
+
154
+ /**@name Useful stuff */
155
+ //@{
156
+ /*! \brief Installs a new message in the specified index position
157
+
158
+ Any existing message is replaced, and a copy of the specified message is
159
+ installed.
160
+ */
161
+ void addMessage(int messageNumber, const CoinOneMessage & message);
162
+ /*! \brief Replaces the text of the specified message
163
+
164
+ Any existing text is deleted and the specified text is copied into the
165
+ specified message.
166
+ */
167
+ void replaceMessage(int messageNumber, const char * message);
168
+ /** Language. Need to think about iso codes */
169
+ inline Language language() const
170
+ {return language_;}
171
+ /** Set language */
172
+ void setLanguage(Language newlanguage)
173
+ {language_ = newlanguage;}
174
+ /// Change detail level for one message
175
+ void setDetailMessage(int newLevel, int messageNumber);
176
+ /** \brief Change detail level for several messages
177
+
178
+ messageNumbers is expected to contain the indices of the messages to be
179
+ changed.
180
+ If numberMessages >= 10000 or messageNumbers is NULL, the detail level
181
+ is changed on all messages.
182
+ */
183
+ void setDetailMessages(int newLevel, int numberMessages,
184
+ int * messageNumbers);
185
+ /** Change detail level for all messages with low <= ID number < high */
186
+ void setDetailMessages(int newLevel, int low, int high);
187
+
188
+ /// Returns class
189
+ inline int getClass() const
190
+ { return class_;}
191
+ /// Moves to compact format
192
+ void toCompact();
193
+ /// Moves from compact format
194
+ void fromCompact();
195
+ //@}
196
+
197
+ /**@name member data */
198
+ //@{
199
+ /// Number of messages
200
+ int numberMessages_;
201
+ /// Language
202
+ Language language_;
203
+ /// Source (null-terminated string, maximum 4 characters).
204
+ char source_[5];
205
+ /// Class - see later on before CoinMessageHandler
206
+ int class_;
207
+ /** Length of fake CoinOneMessage array.
208
+ First you get numberMessages_ pointers which point to stuff
209
+ */
210
+ int lengthMessages_;
211
+ /// Messages
212
+ CoinOneMessage ** message_;
213
+ //@}
214
+ };
215
+
216
+ // for convenience eol
217
+ enum CoinMessageMarker {
218
+ CoinMessageEol = 0,
219
+ CoinMessageNewline = 1
220
+ };
221
+
222
+ /** Base class for message handling
223
+
224
+ The default behavior is described here: messages are printed, and (if the
225
+ severity is sufficiently high) execution will be aborted. Inherit and
226
+ redefine the methods #print and #checkSeverity to augment the behaviour.
227
+
228
+ Messages can be printed with or without a prefix; the prefix will consist
229
+ of a source string, the external ID number, and a letter code,
230
+ <i>e.g.</i>, Clp6024W.
231
+ A prefix makes the messages look less nimble but is very useful
232
+ for "grep" <i>etc</i>.
233
+
234
+ <h3> Usage </h3>
235
+
236
+ The general approach to using the COIN messaging facility is as follows:
237
+ <ul>
238
+ <li> Define your messages. For each message, you must supply an external
239
+ ID number, a log (detail) level, and a format string. Typically, you
240
+ define a convenience structure for this, something that's easy to
241
+ use to create an array of initialised message definitions at compile
242
+ time.
243
+ <li> Create a CoinMessages object, sized to accommodate the number of
244
+ messages you've defined. (Incremental growth will happen if
245
+ necessary as messages are loaded, but it's inefficient.)
246
+ <li> Load the messages into the CoinMessages object. Typically this
247
+ entails creating a CoinOneMessage object for each message and
248
+ passing it as a parameter to CoinMessages::addMessage(). You specify
249
+ the message's internal ID as the other parameter to addMessage.
250
+ <li> Create and use a CoinMessageHandler object to print messages.
251
+ </ul>
252
+ See, for example, CoinMessage.hpp and CoinMessage.cpp for an example of
253
+ the first three steps. `Format codes' below has a simple example of
254
+ printing a message.
255
+
256
+ <h3> External ID numbers and severity </h3>
257
+
258
+ CoinMessageHandler assumes the following relationship between the
259
+ external ID number of a message and the severity of the message:
260
+ \li <3000 are informational ('I')
261
+ \li <6000 warnings ('W')
262
+ \li <9000 non-fatal errors ('E')
263
+ \li >=9000 aborts the program (after printing the message) ('S')
264
+
265
+ <h3> Log (detail) levels </h3>
266
+
267
+ The default behaviour is that a message will print if its detail level
268
+ is less than or equal to the handler's log level. If all you want to
269
+ do is set a single log level for the handler, use #setLogLevel(int).
270
+
271
+ If you want to get fancy, here's how it really works: There's an array,
272
+ #logLevels_, which you can manipulate with #setLogLevel(int,int). Each
273
+ entry logLevels_[i] specifies the log level for messages of class i (see
274
+ CoinMessages::class_). If logLevels_[0] is set to the magic number -1000
275
+ you get the simple behaviour described above, whatever the class of the
276
+ messages. If logLevels_[0] is set to a valid log level (>= 0), then
277
+ logLevels_[i] really is the log level for messages of class i.
278
+
279
+ <h3> Format codes </h3>
280
+
281
+ CoinMessageHandler can print integers (normal, long, and long long),
282
+ doubles, characters, and strings. See the descriptions of the
283
+ various << operators.
284
+
285
+ When processing a standard message with a format string, the formatting
286
+ codes specified in the format string will be passed to the sprintf
287
+ function, along with the argument. When generating a message with no
288
+ format string, each << operator uses a simple format code appropriate for
289
+ its argument. Consult the documentation for the standard printf facility
290
+ for further information on format codes.
291
+
292
+ The special format code `%?' provides a hook to enable or disable
293
+ printing. For each `%?' code, there must be a corresponding call to
294
+ printing(bool). This provides a way to define optional parts in
295
+ messages, delineated by the code `%?' in the format string. Printing can
296
+ be suppressed for these optional parts, but any operands must still be
297
+ supplied. For example, given the message string
298
+ \verbatim
299
+ "A message with%? an optional integer %d and%? a double %g."
300
+ \endverbatim
301
+ installed in CoinMessages \c exampleMsgs with index 5, and
302
+ \c CoinMessageHandler \c hdl, the code
303
+ \code
304
+ hdl.message(5,exampleMsgs) ;
305
+ hdl.printing(true) << 42 ;
306
+ hdl.printing(true) << 53.5 << CoinMessageEol ;
307
+ \endcode
308
+ will print
309
+ \verbatim
310
+ A message with an optional integer 42 and a double 53.5.
311
+ \endverbatim
312
+ while
313
+ \code
314
+ hdl.message(5,exampleMsgs) ;
315
+ hdl.printing(false) << 42 ;
316
+ hdl.printing(true) << 53.5 << CoinMessageEol ;
317
+ \endcode
318
+ will print
319
+ \verbatim
320
+ A message with a double 53.5.
321
+ \endverbatim
322
+
323
+ For additional examples of usage, see CoinMessageHandlerUnitTest in
324
+ CoinMessageHandlerTest.cpp.
325
+ */
326
+
327
+ class CoinMessageHandler {
328
+
329
+ friend bool CoinMessageHandlerUnitTest () ;
330
+
331
+ public:
332
+ /**@name Virtual methods that the derived classes may provide */
333
+ //@{
334
+ /** Print message, return 0 normally.
335
+ */
336
+ virtual int print() ;
337
+ /** Check message severity - if too bad then abort
338
+ */
339
+ virtual void checkSeverity() ;
340
+ //@}
341
+
342
+ /**@name Constructors etc */
343
+ //@{
344
+ /// Constructor
345
+ CoinMessageHandler();
346
+ /// Constructor to put to file pointer (won't be closed)
347
+ CoinMessageHandler(FILE *fp);
348
+ /** Destructor */
349
+ virtual ~CoinMessageHandler();
350
+ /** The copy constructor */
351
+ CoinMessageHandler(const CoinMessageHandler&);
352
+ /** Assignment operator. */
353
+ CoinMessageHandler& operator=(const CoinMessageHandler&);
354
+ /// Clone
355
+ virtual CoinMessageHandler * clone() const;
356
+ //@}
357
+ /**@name Get and set methods */
358
+ //@{
359
+ /// Get detail level of a message.
360
+ inline int detail(int messageNumber, const CoinMessages &normalMessage) const
361
+ { return normalMessage.message_[messageNumber]->detail();}
362
+ /** Get current log (detail) level. */
363
+ inline int logLevel() const
364
+ { return logLevel_;}
365
+ /** \brief Set current log (detail) level.
366
+
367
+ If the log level is equal or greater than the detail level of a message,
368
+ the message will be printed. A rough convention for the amount of output
369
+ expected is
370
+ - 0 - none
371
+ - 1 - minimal
372
+ - 2 - normal low
373
+ - 3 - normal high
374
+ - 4 - verbose
375
+
376
+ Please assign log levels to messages accordingly. Log levels of 8 and
377
+ above (8,16,32, <i>etc</i>.) are intended for selective debugging.
378
+ The logical AND of the log level specified in the message and the current
379
+ log level is used to determine if the message is printed. (In other words,
380
+ you're using individual bits to determine which messages are printed.)
381
+ */
382
+ void setLogLevel(int value);
383
+ /** Get alternative log level. */
384
+ inline int logLevel(int which) const
385
+ { return logLevels_[which];}
386
+ /*! \brief Set alternative log level value.
387
+
388
+ Can be used to store alternative log level information within the handler.
389
+ */
390
+ void setLogLevel(int which, int value);
391
+
392
+ /// Set the number of significant digits for printing floating point numbers
393
+ void setPrecision(unsigned int new_precision);
394
+ /// Current number of significant digits for printing floating point numbers
395
+ inline int precision() { return (g_precision_) ; }
396
+
397
+ /// Switch message prefix on or off.
398
+ void setPrefix(bool yesNo);
399
+ /// Current setting for printing message prefix.
400
+ bool prefix() const;
401
+ /*! \brief Values of double fields already processed.
402
+
403
+ As the parameter for a double field is processed, the value is saved
404
+ and can be retrieved using this function.
405
+ */
406
+ inline double doubleValue(int position) const
407
+ { return doubleValue_[position];}
408
+ /*! \brief Number of double fields already processed.
409
+
410
+ Incremented each time a field of type double is processed.
411
+ */
412
+ inline int numberDoubleFields() const
413
+ {return static_cast<int>(doubleValue_.size());}
414
+ /*! \brief Values of integer fields already processed.
415
+
416
+ As the parameter for a integer field is processed, the value is saved
417
+ and can be retrieved using this function.
418
+ */
419
+ inline int intValue(int position) const
420
+ { return longValue_[position];}
421
+ /*! \brief Number of integer fields already processed.
422
+
423
+ Incremented each time a field of type integer is processed.
424
+ */
425
+ inline int numberIntFields() const
426
+ {return static_cast<int>(longValue_.size());}
427
+ /*! \brief Values of char fields already processed.
428
+
429
+ As the parameter for a char field is processed, the value is saved
430
+ and can be retrieved using this function.
431
+ */
432
+ inline char charValue(int position) const
433
+ { return charValue_[position];}
434
+ /*! \brief Number of char fields already processed.
435
+
436
+ Incremented each time a field of type char is processed.
437
+ */
438
+ inline int numberCharFields() const
439
+ {return static_cast<int>(charValue_.size());}
440
+ /*! \brief Values of string fields already processed.
441
+
442
+ As the parameter for a string field is processed, the value is saved
443
+ and can be retrieved using this function.
444
+ */
445
+ inline std::string stringValue(int position) const
446
+ { return stringValue_[position];}
447
+ /*! \brief Number of string fields already processed.
448
+
449
+ Incremented each time a field of type string is processed.
450
+ */
451
+ inline int numberStringFields() const
452
+ {return static_cast<int>(stringValue_.size());}
453
+
454
+ /// Current message
455
+ inline CoinOneMessage currentMessage() const
456
+ {return currentMessage_;}
457
+ /// Source of current message
458
+ inline std::string currentSource() const
459
+ {return source_;}
460
+ /// Output buffer
461
+ inline const char * messageBuffer() const
462
+ {return messageBuffer_;}
463
+ /// Highest message number (indicates any errors)
464
+ inline int highestNumber() const
465
+ {return highestNumber_;}
466
+ /// Get current file pointer
467
+ inline FILE * filePointer() const
468
+ { return fp_;}
469
+ /// Set new file pointer
470
+ inline void setFilePointer(FILE * fp)
471
+ { fp_ = fp;}
472
+ //@}
473
+
474
+ /**@name Actions to create a message */
475
+ //@{
476
+ /*! \brief Start a message
477
+
478
+ Look up the specified message. A prefix will be generated if enabled.
479
+ The message will be printed if the current log level is equal or greater
480
+ than the log level of the message.
481
+ */
482
+ CoinMessageHandler &message(int messageNumber,
483
+ const CoinMessages &messages) ;
484
+
485
+ /*! \brief Start or continue a message
486
+
487
+ With detail = -1 (default), does nothing except return a reference to the
488
+ handler. (I.e., msghandler.message() << "foo" is precisely equivalent
489
+ to msghandler << "foo".) If \p msgDetail is >= 0, is will be used
490
+ as the detail level to determine whether the message should print
491
+ (assuming class 0).
492
+
493
+ This can be used with any of the << operators. One use is to start
494
+ a message which will be constructed entirely from scratch. Another
495
+ use is continuation of a message after code that interrupts the usual
496
+ sequence of << operators.
497
+ */
498
+ CoinMessageHandler & message(int detail = -1) ;
499
+
500
+ /*! \brief Print a complete message
501
+
502
+ Generate a standard prefix and append \c msg `as is'. This is intended as
503
+ a transition mechanism. The standard prefix is generated (if enabled),
504
+ and \c msg is appended. The message must be ended with a CoinMessageEol
505
+ marker. Attempts to add content with << will have no effect.
506
+
507
+ The default value of \p detail will not change printing status. If
508
+ \p detail is >= 0, it will be used as the detail level to determine
509
+ whether the message should print (assuming class 0).
510
+
511
+ */
512
+ CoinMessageHandler &message(int externalNumber, const char *source,
513
+ const char *msg,
514
+ char severity, int detail = -1) ;
515
+
516
+ /*! \brief Process an integer parameter value.
517
+
518
+ The default format code is `%d'.
519
+ */
520
+ CoinMessageHandler & operator<< (int intvalue);
521
+ #if COIN_BIG_INDEX==1
522
+ /*! \brief Process a long integer parameter value.
523
+
524
+ The default format code is `%ld'.
525
+ */
526
+ CoinMessageHandler & operator<< (long longvalue);
527
+ #endif
528
+ #if COIN_BIG_INDEX==2
529
+ /*! \brief Process a long long integer parameter value.
530
+
531
+ The default format code is `%ld'.
532
+ */
533
+ CoinMessageHandler & operator<< (long long longvalue);
534
+ #endif
535
+ /*! \brief Process a double parameter value.
536
+
537
+ The default format code is `%d'.
538
+ */
539
+ CoinMessageHandler & operator<< (double doublevalue);
540
+ /*! \brief Process a STL string parameter value.
541
+
542
+ The default format code is `%g'.
543
+ */
544
+ CoinMessageHandler & operator<< (const std::string& stringvalue);
545
+ /*! \brief Process a char parameter value.
546
+
547
+ The default format code is `%s'.
548
+ */
549
+ CoinMessageHandler & operator<< (char charvalue);
550
+ /*! \brief Process a C-style string parameter value.
551
+
552
+ The default format code is `%c'.
553
+ */
554
+ CoinMessageHandler & operator<< (const char *stringvalue);
555
+ /*! \brief Process a marker.
556
+
557
+ The default format code is `%s'.
558
+ */
559
+ CoinMessageHandler & operator<< (CoinMessageMarker);
560
+ /** Finish (and print) the message.
561
+
562
+ Equivalent to using the CoinMessageEol marker.
563
+ */
564
+ int finish();
565
+ /*! \brief Enable or disable printing of an optional portion of a message.
566
+
567
+ Optional portions of a message are delimited by `%?' markers, and
568
+ printing processes one %? marker. If \c onOff is true, the subsequent
569
+ portion of the message (to the next %? marker or the end of the format
570
+ string) will be printed. If \c onOff is false, printing is suppressed.
571
+ Parameters must still be supplied, whether printing is suppressed or not.
572
+ See the class documentation for an example.
573
+ */
574
+ CoinMessageHandler & printing(bool onOff);
575
+
576
+ //@}
577
+
578
+ /** Log levels will be by type and will then use type
579
+ given in CoinMessage::class_
580
+
581
+ - 0 - Branch and bound code or similar
582
+ - 1 - Solver
583
+ - 2 - Stuff in Coin directory
584
+ - 3 - Cut generators
585
+ */
586
+ #define COIN_NUM_LOG 4
587
+ /// Maximum length of constructed message (characters)
588
+ #define COIN_MESSAGE_HANDLER_MAX_BUFFER_SIZE 1000
589
+ protected:
590
+ /**@name Protected member data */
591
+ //@{
592
+ /// values in message
593
+ std::vector<double> doubleValue_;
594
+ std::vector<int> longValue_;
595
+ std::vector<char> charValue_;
596
+ std::vector<std::string> stringValue_;
597
+ /// Log level
598
+ int logLevel_;
599
+ /// Log levels
600
+ int logLevels_[COIN_NUM_LOG];
601
+ /// Whether we want prefix (may get more subtle so is int)
602
+ int prefix_;
603
+ /// Current message
604
+ CoinOneMessage currentMessage_;
605
+ /// Internal number for use with enums
606
+ int internalNumber_;
607
+ /// Format string for message (remainder)
608
+ char * format_;
609
+ /// Output buffer
610
+ char messageBuffer_[COIN_MESSAGE_HANDLER_MAX_BUFFER_SIZE];
611
+ /// Position in output buffer
612
+ char * messageOut_;
613
+ /// Current source of message
614
+ std::string source_;
615
+ /** 0 - Normal.
616
+ 1 - Put in values, move along format, but don't print.
617
+ 2 - A complete message was provided; nothing more to do but print
618
+ when CoinMessageEol is processed. Any << operators are treated
619
+ as noops.
620
+ 3 - do nothing except look for CoinMessageEol (i.e., the message
621
+ detail level was not sufficient to cause it to print).
622
+ */
623
+ int printStatus_;
624
+ /// Highest message number (indicates any errors)
625
+ int highestNumber_;
626
+ /// File pointer
627
+ FILE * fp_;
628
+ /// Current format for floating point numbers
629
+ char g_format_[8];
630
+ /// Current number of significant digits for floating point numbers
631
+ int g_precision_ ;
632
+ //@}
633
+
634
+ private:
635
+
636
+ /** The body of the copy constructor and the assignment operator */
637
+ void gutsOfCopy(const CoinMessageHandler &rhs) ;
638
+
639
+ /*! \brief Internal function to locate next format code.
640
+
641
+ Intended for internal use. Side effects modify the format string.
642
+ */
643
+ char *nextPerCent(char *start, const bool initial = false) ;
644
+
645
+ /*! \brief Internal printing function.
646
+
647
+ Makes it easier to split up print into clean, print and check severity
648
+ */
649
+ int internalPrint() ;
650
+
651
+ /// Decide if this message should print.
652
+ void calcPrintStatus(int msglvl, int msgclass) ;
653
+
654
+
655
+ };
656
+
657
+ //#############################################################################
658
+ /** A function that tests the methods in the CoinMessageHandler class. The
659
+ only reason for it not to be a member method is that this way it doesn't
660
+ have to be compiled into the library. And that's a gain, because the
661
+ library should be compiled with optimization on, but this method should be
662
+ compiled with debugging. */
663
+ bool
664
+ CoinMessageHandlerUnitTest();
665
+
666
+ #endif