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,1307 @@
1
+ /* $Id: ClpModel.hpp 2074 2014-12-10 09:43:54Z forrest $ */
2
+ // Copyright (C) 2002, International Business Machines
3
+ // Corporation and others. All Rights Reserved.
4
+ // This code is licensed under the terms of the Eclipse Public License (EPL).
5
+
6
+ #ifndef ClpModel_H
7
+ #define ClpModel_H
8
+
9
+ #include "ClpConfig.h"
10
+
11
+ #include <iostream>
12
+ #include <cassert>
13
+ #include <cmath>
14
+ #include <vector>
15
+ #include <string>
16
+ //#ifndef COIN_USE_CLP
17
+ //#define COIN_USE_CLP
18
+ //#endif
19
+ #include "ClpPackedMatrix.hpp"
20
+ #include "CoinMessageHandler.hpp"
21
+ #include "CoinHelperFunctions.hpp"
22
+ #include "CoinTypes.hpp"
23
+ #include "CoinFinite.hpp"
24
+ #include "ClpParameters.hpp"
25
+ #include "ClpObjective.hpp"
26
+ class ClpEventHandler;
27
+ /** This is the base class for Linear and quadratic Models
28
+ This knows nothing about the algorithm, but it seems to
29
+ have a reasonable amount of information
30
+
31
+ I would welcome suggestions for what should be in this and
32
+ how it relates to OsiSolverInterface. Some methods look
33
+ very similar.
34
+
35
+ */
36
+ class CoinBuild;
37
+ class CoinModel;
38
+ class ClpModel {
39
+
40
+ public:
41
+
42
+ /**@name Constructors and destructor
43
+ Note - copy methods copy ALL data so can chew up memory
44
+ until other copy is freed
45
+ */
46
+ //@{
47
+ /// Default constructor
48
+ ClpModel (bool emptyMessages = false );
49
+
50
+ /** Copy constructor. May scale depending on mode
51
+ -1 leave mode as is
52
+ 0 -off, 1 equilibrium, 2 geometric, 3, auto, 4 auto-but-as-initialSolve-in-bab
53
+ */
54
+ ClpModel(const ClpModel & rhs, int scalingMode = -1);
55
+ /// Assignment operator. This copies the data
56
+ ClpModel & operator=(const ClpModel & rhs);
57
+ /** Subproblem constructor. A subset of whole model is created from the
58
+ row and column lists given. The new order is given by list order and
59
+ duplicates are allowed. Name and integer information can be dropped
60
+ */
61
+ ClpModel (const ClpModel * wholeModel,
62
+ int numberRows, const int * whichRows,
63
+ int numberColumns, const int * whichColumns,
64
+ bool dropNames = true, bool dropIntegers = true);
65
+ /// Destructor
66
+ ~ClpModel ( );
67
+ //@}
68
+
69
+ /**@name Load model - loads some stuff and initializes others */
70
+ //@{
71
+ /** Loads a problem (the constraints on the
72
+ rows are given by lower and upper bounds). If a pointer is 0 then the
73
+ following values are the default:
74
+ <ul>
75
+ <li> <code>colub</code>: all columns have upper bound infinity
76
+ <li> <code>collb</code>: all columns have lower bound 0
77
+ <li> <code>rowub</code>: all rows have upper bound infinity
78
+ <li> <code>rowlb</code>: all rows have lower bound -infinity
79
+ <li> <code>obj</code>: all variables have 0 objective coefficient
80
+ </ul>
81
+ */
82
+ void loadProblem ( const ClpMatrixBase& matrix,
83
+ const double* collb, const double* colub,
84
+ const double* obj,
85
+ const double* rowlb, const double* rowub,
86
+ const double * rowObjective = NULL);
87
+ void loadProblem ( const CoinPackedMatrix& matrix,
88
+ const double* collb, const double* colub,
89
+ const double* obj,
90
+ const double* rowlb, const double* rowub,
91
+ const double * rowObjective = NULL);
92
+
93
+ /** Just like the other loadProblem() method except that the matrix is
94
+ given in a standard column major ordered format (without gaps). */
95
+ void loadProblem ( const int numcols, const int numrows,
96
+ const CoinBigIndex* start, const int* index,
97
+ const double* value,
98
+ const double* collb, const double* colub,
99
+ const double* obj,
100
+ const double* rowlb, const double* rowub,
101
+ const double * rowObjective = NULL);
102
+ /** This loads a model from a coinModel object - returns number of errors.
103
+
104
+ modelObject not const as may be changed as part of process
105
+ If tryPlusMinusOne then will try adding as +-1 matrix
106
+ */
107
+ int loadProblem ( CoinModel & modelObject, bool tryPlusMinusOne = false);
108
+ /// This one is for after presolve to save memory
109
+ void loadProblem ( const int numcols, const int numrows,
110
+ const CoinBigIndex* start, const int* index,
111
+ const double* value, const int * length,
112
+ const double* collb, const double* colub,
113
+ const double* obj,
114
+ const double* rowlb, const double* rowub,
115
+ const double * rowObjective = NULL);
116
+ /** Load up quadratic objective. This is stored as a CoinPackedMatrix */
117
+ void loadQuadraticObjective(const int numberColumns,
118
+ const CoinBigIndex * start,
119
+ const int * column, const double * element);
120
+ void loadQuadraticObjective ( const CoinPackedMatrix& matrix);
121
+ /// Get rid of quadratic objective
122
+ void deleteQuadraticObjective();
123
+ /// This just loads up a row objective
124
+ void setRowObjective(const double * rowObjective);
125
+ /// Read an mps file from the given filename
126
+ int readMps(const char *filename,
127
+ bool keepNames = false,
128
+ bool ignoreErrors = false);
129
+ /// Read GMPL files from the given filenames
130
+ int readGMPL(const char *filename, const char * dataName,
131
+ bool keepNames = false);
132
+ /// Copy in integer informations
133
+ void copyInIntegerInformation(const char * information);
134
+ /// Drop integer informations
135
+ void deleteIntegerInformation();
136
+ /** Set the index-th variable to be a continuous variable */
137
+ void setContinuous(int index);
138
+ /** Set the index-th variable to be an integer variable */
139
+ void setInteger(int index);
140
+ /** Return true if the index-th variable is an integer variable */
141
+ bool isInteger(int index) const;
142
+ /// Resizes rim part of model
143
+ void resize (int newNumberRows, int newNumberColumns);
144
+ /// Deletes rows
145
+ void deleteRows(int number, const int * which);
146
+ /// Add one row
147
+ void addRow(int numberInRow, const int * columns,
148
+ const double * elements, double rowLower = -COIN_DBL_MAX,
149
+ double rowUpper = COIN_DBL_MAX);
150
+ /// Add rows
151
+ void addRows(int number, const double * rowLower,
152
+ const double * rowUpper,
153
+ const CoinBigIndex * rowStarts, const int * columns,
154
+ const double * elements);
155
+ /// Add rows
156
+ void addRows(int number, const double * rowLower,
157
+ const double * rowUpper,
158
+ const CoinBigIndex * rowStarts, const int * rowLengths,
159
+ const int * columns,
160
+ const double * elements);
161
+ #ifndef CLP_NO_VECTOR
162
+ void addRows(int number, const double * rowLower,
163
+ const double * rowUpper,
164
+ const CoinPackedVectorBase * const * rows);
165
+ #endif
166
+ /** Add rows from a build object.
167
+ If tryPlusMinusOne then will try adding as +-1 matrix
168
+ if no matrix exists.
169
+ Returns number of errors e.g. duplicates
170
+ */
171
+ int addRows(const CoinBuild & buildObject, bool tryPlusMinusOne = false,
172
+ bool checkDuplicates = true);
173
+ /** Add rows from a model object. returns
174
+ -1 if object in bad state (i.e. has column information)
175
+ otherwise number of errors.
176
+
177
+ modelObject non const as can be regularized as part of build
178
+ If tryPlusMinusOne then will try adding as +-1 matrix
179
+ if no matrix exists.
180
+ */
181
+ int addRows(CoinModel & modelObject, bool tryPlusMinusOne = false,
182
+ bool checkDuplicates = true);
183
+
184
+ /// Deletes columns
185
+ void deleteColumns(int number, const int * which);
186
+ /// Deletes rows AND columns (keeps old sizes)
187
+ void deleteRowsAndColumns(int numberRows, const int * whichRows,
188
+ int numberColumns, const int * whichColumns);
189
+ /// Add one column
190
+ void addColumn(int numberInColumn,
191
+ const int * rows,
192
+ const double * elements,
193
+ double columnLower = 0.0,
194
+ double columnUpper = COIN_DBL_MAX,
195
+ double objective = 0.0);
196
+ /// Add columns
197
+ void addColumns(int number, const double * columnLower,
198
+ const double * columnUpper,
199
+ const double * objective,
200
+ const CoinBigIndex * columnStarts, const int * rows,
201
+ const double * elements);
202
+ void addColumns(int number, const double * columnLower,
203
+ const double * columnUpper,
204
+ const double * objective,
205
+ const CoinBigIndex * columnStarts, const int * columnLengths,
206
+ const int * rows,
207
+ const double * elements);
208
+ #ifndef CLP_NO_VECTOR
209
+ void addColumns(int number, const double * columnLower,
210
+ const double * columnUpper,
211
+ const double * objective,
212
+ const CoinPackedVectorBase * const * columns);
213
+ #endif
214
+ /** Add columns from a build object
215
+ If tryPlusMinusOne then will try adding as +-1 matrix
216
+ if no matrix exists.
217
+ Returns number of errors e.g. duplicates
218
+ */
219
+ int addColumns(const CoinBuild & buildObject, bool tryPlusMinusOne = false,
220
+ bool checkDuplicates = true);
221
+ /** Add columns from a model object. returns
222
+ -1 if object in bad state (i.e. has row information)
223
+ otherwise number of errors
224
+ modelObject non const as can be regularized as part of build
225
+ If tryPlusMinusOne then will try adding as +-1 matrix
226
+ if no matrix exists.
227
+ */
228
+ int addColumns(CoinModel & modelObject, bool tryPlusMinusOne = false,
229
+ bool checkDuplicates = true);
230
+ /// Modify one element of a matrix
231
+ inline void modifyCoefficient(int row, int column, double newElement,
232
+ bool keepZero = false) {
233
+ matrix_->modifyCoefficient(row, column, newElement, keepZero);
234
+ }
235
+ /** Change row lower bounds */
236
+ void chgRowLower(const double * rowLower);
237
+ /** Change row upper bounds */
238
+ void chgRowUpper(const double * rowUpper);
239
+ /** Change column lower bounds */
240
+ void chgColumnLower(const double * columnLower);
241
+ /** Change column upper bounds */
242
+ void chgColumnUpper(const double * columnUpper);
243
+ /** Change objective coefficients */
244
+ void chgObjCoefficients(const double * objIn);
245
+ /** Borrow model. This is so we don't have to copy large amounts
246
+ of data around. It assumes a derived class wants to overwrite
247
+ an empty model with a real one - while it does an algorithm */
248
+ void borrowModel(ClpModel & otherModel);
249
+ /** Return model - nulls all arrays so can be deleted safely
250
+ also updates any scalars */
251
+ void returnModel(ClpModel & otherModel);
252
+
253
+ /// Create empty ClpPackedMatrix
254
+ void createEmptyMatrix();
255
+ /** Really clean up matrix (if ClpPackedMatrix).
256
+ a) eliminate all duplicate AND small elements in matrix
257
+ b) remove all gaps and set extraGap_ and extraMajor_ to 0.0
258
+ c) reallocate arrays and make max lengths equal to lengths
259
+ d) orders elements
260
+ returns number of elements eliminated or -1 if not ClpPackedMatrix
261
+ */
262
+ int cleanMatrix(double threshold = 1.0e-20);
263
+ /// Copy contents - resizing if necessary - otherwise re-use memory
264
+ void copy(const ClpMatrixBase * from, ClpMatrixBase * & to);
265
+ #ifndef CLP_NO_STD
266
+ /// Drops names - makes lengthnames 0 and names empty
267
+ void dropNames();
268
+ /// Copies in names
269
+ void copyNames(const std::vector<std::string> & rowNames,
270
+ const std::vector<std::string> & columnNames);
271
+ /// Copies in Row names - modifies names first .. last-1
272
+ void copyRowNames(const std::vector<std::string> & rowNames, int first, int last);
273
+ /// Copies in Column names - modifies names first .. last-1
274
+ void copyColumnNames(const std::vector<std::string> & columnNames, int first, int last);
275
+ /// Copies in Row names - modifies names first .. last-1
276
+ void copyRowNames(const char * const * rowNames, int first, int last);
277
+ /// Copies in Column names - modifies names first .. last-1
278
+ void copyColumnNames(const char * const * columnNames, int first, int last);
279
+ /// Set name of row
280
+ void setRowName(int rowIndex, std::string & name) ;
281
+ /// Set name of col
282
+ void setColumnName(int colIndex, std::string & name) ;
283
+ #endif
284
+ /** Find a network subset.
285
+ rotate array should be numberRows. On output
286
+ -1 not in network
287
+ 0 in network as is
288
+ 1 in network with signs swapped
289
+ Returns number of network rows
290
+ */
291
+ int findNetwork(char * rotate, double fractionNeeded = 0.75);
292
+ /** This creates a coinModel object
293
+ */
294
+ CoinModel * createCoinModel() const;
295
+
296
+ /** Write the problem in MPS format to the specified file.
297
+
298
+ Row and column names may be null.
299
+ formatType is
300
+ <ul>
301
+ <li> 0 - normal
302
+ <li> 1 - extra accuracy
303
+ <li> 2 - IEEE hex
304
+ </ul>
305
+
306
+ Returns non-zero on I/O error
307
+ */
308
+ int writeMps(const char *filename,
309
+ int formatType = 0, int numberAcross = 2,
310
+ double objSense = 0.0) const ;
311
+ //@}
312
+ /**@name gets and sets */
313
+ //@{
314
+ /// Number of rows
315
+ inline int numberRows() const {
316
+ return numberRows_;
317
+ }
318
+ inline int getNumRows() const {
319
+ return numberRows_;
320
+ }
321
+ /// Number of columns
322
+ inline int getNumCols() const {
323
+ return numberColumns_;
324
+ }
325
+ inline int numberColumns() const {
326
+ return numberColumns_;
327
+ }
328
+ /// Primal tolerance to use
329
+ inline double primalTolerance() const {
330
+ return dblParam_[ClpPrimalTolerance];
331
+ }
332
+ void setPrimalTolerance( double value) ;
333
+ /// Dual tolerance to use
334
+ inline double dualTolerance() const {
335
+ return dblParam_[ClpDualTolerance];
336
+ }
337
+ void setDualTolerance( double value) ;
338
+ /// Primal objective limit
339
+ inline double primalObjectiveLimit() const {
340
+ return dblParam_[ClpPrimalObjectiveLimit];
341
+ }
342
+ void setPrimalObjectiveLimit(double value);
343
+ /// Dual objective limit
344
+ inline double dualObjectiveLimit() const {
345
+ return dblParam_[ClpDualObjectiveLimit];
346
+ }
347
+ void setDualObjectiveLimit(double value);
348
+ /// Objective offset
349
+ inline double objectiveOffset() const {
350
+ return dblParam_[ClpObjOffset];
351
+ }
352
+ void setObjectiveOffset(double value);
353
+ /// Presolve tolerance to use
354
+ inline double presolveTolerance() const {
355
+ return dblParam_[ClpPresolveTolerance];
356
+ }
357
+ #ifndef CLP_NO_STD
358
+ inline const std::string & problemName() const {
359
+ return strParam_[ClpProbName];
360
+ }
361
+ #endif
362
+ /// Number of iterations
363
+ inline int numberIterations() const {
364
+ return numberIterations_;
365
+ }
366
+ inline int getIterationCount() const {
367
+ return numberIterations_;
368
+ }
369
+ inline void setNumberIterations(int numberIterationsNew) {
370
+ numberIterations_ = numberIterationsNew;
371
+ }
372
+ /** Solve type - 1 simplex, 2 simplex interface, 3 Interior.*/
373
+ inline int solveType() const {
374
+ return solveType_;
375
+ }
376
+ inline void setSolveType(int type) {
377
+ solveType_ = type;
378
+ }
379
+ /// Maximum number of iterations
380
+ inline int maximumIterations() const {
381
+ return intParam_[ClpMaxNumIteration];
382
+ }
383
+ void setMaximumIterations(int value);
384
+ /// Maximum time in seconds (from when set called)
385
+ inline double maximumSeconds() const {
386
+ return dblParam_[ClpMaxSeconds];
387
+ }
388
+ void setMaximumSeconds(double value);
389
+ void setMaximumWallSeconds(double value);
390
+ /// Returns true if hit maximum iterations (or time)
391
+ bool hitMaximumIterations() const;
392
+ /** Status of problem:
393
+ -1 - unknown e.g. before solve or if postSolve says not optimal
394
+ 0 - optimal
395
+ 1 - primal infeasible
396
+ 2 - dual infeasible
397
+ 3 - stopped on iterations or time
398
+ 4 - stopped due to errors
399
+ 5 - stopped by event handler (virtual int ClpEventHandler::event())
400
+ */
401
+ inline int status() const {
402
+ return problemStatus_;
403
+ }
404
+ inline int problemStatus() const {
405
+ return problemStatus_;
406
+ }
407
+ /// Set problem status
408
+ inline void setProblemStatus(int problemStatusNew) {
409
+ problemStatus_ = problemStatusNew;
410
+ }
411
+ /** Secondary status of problem - may get extended
412
+ 0 - none
413
+ 1 - primal infeasible because dual limit reached OR (probably primal
414
+ infeasible but can't prove it - main status was 4)
415
+ 2 - scaled problem optimal - unscaled problem has primal infeasibilities
416
+ 3 - scaled problem optimal - unscaled problem has dual infeasibilities
417
+ 4 - scaled problem optimal - unscaled problem has primal and dual infeasibilities
418
+ 5 - giving up in primal with flagged variables
419
+ 6 - failed due to empty problem check
420
+ 7 - postSolve says not optimal
421
+ 8 - failed due to bad element check
422
+ 9 - status was 3 and stopped on time
423
+ 10 - status was 3 but stopped as primal feasible
424
+ 100 up - translation of enum from ClpEventHandler
425
+ */
426
+ inline int secondaryStatus() const {
427
+ return secondaryStatus_;
428
+ }
429
+ inline void setSecondaryStatus(int newstatus) {
430
+ secondaryStatus_ = newstatus;
431
+ }
432
+ /// Are there a numerical difficulties?
433
+ inline bool isAbandoned() const {
434
+ return problemStatus_ == 4;
435
+ }
436
+ /// Is optimality proven?
437
+ inline bool isProvenOptimal() const {
438
+ return problemStatus_ == 0;
439
+ }
440
+ /// Is primal infeasiblity proven?
441
+ inline bool isProvenPrimalInfeasible() const {
442
+ return problemStatus_ == 1;
443
+ }
444
+ /// Is dual infeasiblity proven?
445
+ inline bool isProvenDualInfeasible() const {
446
+ return problemStatus_ == 2;
447
+ }
448
+ /// Is the given primal objective limit reached?
449
+ bool isPrimalObjectiveLimitReached() const ;
450
+ /// Is the given dual objective limit reached?
451
+ bool isDualObjectiveLimitReached() const ;
452
+ /// Iteration limit reached?
453
+ inline bool isIterationLimitReached() const {
454
+ return problemStatus_ == 3;
455
+ }
456
+ /// Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore
457
+ inline double optimizationDirection() const {
458
+ return optimizationDirection_;
459
+ }
460
+ inline double getObjSense() const {
461
+ return optimizationDirection_;
462
+ }
463
+ void setOptimizationDirection(double value);
464
+ /// Primal row solution
465
+ inline double * primalRowSolution() const {
466
+ return rowActivity_;
467
+ }
468
+ inline const double * getRowActivity() const {
469
+ return rowActivity_;
470
+ }
471
+ /// Primal column solution
472
+ inline double * primalColumnSolution() const {
473
+ return columnActivity_;
474
+ }
475
+ inline const double * getColSolution() const {
476
+ return columnActivity_;
477
+ }
478
+ inline void setColSolution(const double * input) {
479
+ memcpy(columnActivity_, input, numberColumns_ * sizeof(double));
480
+ }
481
+ /// Dual row solution
482
+ inline double * dualRowSolution() const {
483
+ return dual_;
484
+ }
485
+ inline const double * getRowPrice() const {
486
+ return dual_;
487
+ }
488
+ /// Reduced costs
489
+ inline double * dualColumnSolution() const {
490
+ return reducedCost_;
491
+ }
492
+ inline const double * getReducedCost() const {
493
+ return reducedCost_;
494
+ }
495
+ /// Row lower
496
+ inline double* rowLower() const {
497
+ return rowLower_;
498
+ }
499
+ inline const double* getRowLower() const {
500
+ return rowLower_;
501
+ }
502
+ /// Row upper
503
+ inline double* rowUpper() const {
504
+ return rowUpper_;
505
+ }
506
+ inline const double* getRowUpper() const {
507
+ return rowUpper_;
508
+ }
509
+ //-------------------------------------------------------------------------
510
+ /**@name Changing bounds on variables and constraints */
511
+ //@{
512
+ /** Set an objective function coefficient */
513
+ void setObjectiveCoefficient( int elementIndex, double elementValue );
514
+ /** Set an objective function coefficient */
515
+ inline void setObjCoeff( int elementIndex, double elementValue ) {
516
+ setObjectiveCoefficient( elementIndex, elementValue);
517
+ }
518
+
519
+ /** Set a single column lower bound<br>
520
+ Use -DBL_MAX for -infinity. */
521
+ void setColumnLower( int elementIndex, double elementValue );
522
+
523
+ /** Set a single column upper bound<br>
524
+ Use DBL_MAX for infinity. */
525
+ void setColumnUpper( int elementIndex, double elementValue );
526
+
527
+ /** Set a single column lower and upper bound */
528
+ void setColumnBounds( int elementIndex,
529
+ double lower, double upper );
530
+
531
+ /** Set the bounds on a number of columns simultaneously<br>
532
+ The default implementation just invokes setColLower() and
533
+ setColUpper() over and over again.
534
+ @param indexFirst,indexLast pointers to the beginning and after the
535
+ end of the array of the indices of the variables whose
536
+ <em>either</em> bound changes
537
+ @param boundList the new lower/upper bound pairs for the variables
538
+ */
539
+ void setColumnSetBounds(const int* indexFirst,
540
+ const int* indexLast,
541
+ const double* boundList);
542
+
543
+ /** Set a single column lower bound<br>
544
+ Use -DBL_MAX for -infinity. */
545
+ inline void setColLower( int elementIndex, double elementValue ) {
546
+ setColumnLower(elementIndex, elementValue);
547
+ }
548
+ /** Set a single column upper bound<br>
549
+ Use DBL_MAX for infinity. */
550
+ inline void setColUpper( int elementIndex, double elementValue ) {
551
+ setColumnUpper(elementIndex, elementValue);
552
+ }
553
+
554
+ /** Set a single column lower and upper bound */
555
+ inline void setColBounds( int elementIndex,
556
+ double lower, double upper ) {
557
+ setColumnBounds(elementIndex, lower, upper);
558
+ }
559
+
560
+ /** Set the bounds on a number of columns simultaneously<br>
561
+ @param indexFirst,indexLast pointers to the beginning and after the
562
+ end of the array of the indices of the variables whose
563
+ <em>either</em> bound changes
564
+ @param boundList the new lower/upper bound pairs for the variables
565
+ */
566
+ inline void setColSetBounds(const int* indexFirst,
567
+ const int* indexLast,
568
+ const double* boundList) {
569
+ setColumnSetBounds(indexFirst, indexLast, boundList);
570
+ }
571
+
572
+ /** Set a single row lower bound<br>
573
+ Use -DBL_MAX for -infinity. */
574
+ void setRowLower( int elementIndex, double elementValue );
575
+
576
+ /** Set a single row upper bound<br>
577
+ Use DBL_MAX for infinity. */
578
+ void setRowUpper( int elementIndex, double elementValue ) ;
579
+
580
+ /** Set a single row lower and upper bound */
581
+ void setRowBounds( int elementIndex,
582
+ double lower, double upper ) ;
583
+
584
+ /** Set the bounds on a number of rows simultaneously<br>
585
+ @param indexFirst,indexLast pointers to the beginning and after the
586
+ end of the array of the indices of the constraints whose
587
+ <em>either</em> bound changes
588
+ @param boundList the new lower/upper bound pairs for the constraints
589
+ */
590
+ void setRowSetBounds(const int* indexFirst,
591
+ const int* indexLast,
592
+ const double* boundList);
593
+
594
+ //@}
595
+ /// Scaling
596
+ inline const double * rowScale() const {
597
+ return rowScale_;
598
+ }
599
+ inline const double * columnScale() const {
600
+ return columnScale_;
601
+ }
602
+ inline const double * inverseRowScale() const {
603
+ return inverseRowScale_;
604
+ }
605
+ inline const double * inverseColumnScale() const {
606
+ return inverseColumnScale_;
607
+ }
608
+ inline double * mutableRowScale() const {
609
+ return rowScale_;
610
+ }
611
+ inline double * mutableColumnScale() const {
612
+ return columnScale_;
613
+ }
614
+ inline double * mutableInverseRowScale() const {
615
+ return inverseRowScale_;
616
+ }
617
+ inline double * mutableInverseColumnScale() const {
618
+ return inverseColumnScale_;
619
+ }
620
+ inline double * swapRowScale(double * newScale) {
621
+ double * oldScale = rowScale_;
622
+ rowScale_ = newScale;
623
+ return oldScale;
624
+ }
625
+ void setRowScale(double * scale) ;
626
+ void setColumnScale(double * scale);
627
+ /// Scaling of objective
628
+ inline double objectiveScale() const {
629
+ return objectiveScale_;
630
+ }
631
+ inline void setObjectiveScale(double value) {
632
+ objectiveScale_ = value;
633
+ }
634
+ /// Scaling of rhs and bounds
635
+ inline double rhsScale() const {
636
+ return rhsScale_;
637
+ }
638
+ inline void setRhsScale(double value) {
639
+ rhsScale_ = value;
640
+ }
641
+ /// Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3 auto, 4 auto-but-as-initialSolve-in-bab
642
+ void scaling(int mode = 1);
643
+ /** If we constructed a "really" scaled model then this reverses the operation.
644
+ Quantities may not be exactly as they were before due to rounding errors */
645
+ void unscale();
646
+ /// Gets scalingFlag
647
+ inline int scalingFlag() const {
648
+ return scalingFlag_;
649
+ }
650
+ /// Objective
651
+ inline double * objective() const {
652
+ if (objective_) {
653
+ double offset;
654
+ return objective_->gradient(NULL, NULL, offset, false);
655
+ } else {
656
+ return NULL;
657
+ }
658
+ }
659
+ inline double * objective(const double * solution, double & offset, bool refresh = true) const {
660
+ offset = 0.0;
661
+ if (objective_) {
662
+ return objective_->gradient(NULL, solution, offset, refresh);
663
+ } else {
664
+ return NULL;
665
+ }
666
+ }
667
+ inline const double * getObjCoefficients() const {
668
+ if (objective_) {
669
+ double offset;
670
+ return objective_->gradient(NULL, NULL, offset, false);
671
+ } else {
672
+ return NULL;
673
+ }
674
+ }
675
+ /// Row Objective
676
+ inline double * rowObjective() const {
677
+ return rowObjective_;
678
+ }
679
+ inline const double * getRowObjCoefficients() const {
680
+ return rowObjective_;
681
+ }
682
+ /// Column Lower
683
+ inline double * columnLower() const {
684
+ return columnLower_;
685
+ }
686
+ inline const double * getColLower() const {
687
+ return columnLower_;
688
+ }
689
+ /// Column Upper
690
+ inline double * columnUpper() const {
691
+ return columnUpper_;
692
+ }
693
+ inline const double * getColUpper() const {
694
+ return columnUpper_;
695
+ }
696
+ /// Matrix (if not ClpPackedmatrix be careful about memory leak
697
+ inline CoinPackedMatrix * matrix() const {
698
+ if ( matrix_ == NULL ) return NULL;
699
+ else return matrix_->getPackedMatrix();
700
+ }
701
+ /// Number of elements in matrix
702
+ inline int getNumElements() const {
703
+ return matrix_->getNumElements();
704
+ }
705
+ /** Small element value - elements less than this set to zero,
706
+ default is 1.0e-20 */
707
+ inline double getSmallElementValue() const {
708
+ return smallElement_;
709
+ }
710
+ inline void setSmallElementValue(double value) {
711
+ smallElement_ = value;
712
+ }
713
+ /// Row Matrix
714
+ inline ClpMatrixBase * rowCopy() const {
715
+ return rowCopy_;
716
+ }
717
+ /// Set new row matrix
718
+ void setNewRowCopy(ClpMatrixBase * newCopy);
719
+ /// Clp Matrix
720
+ inline ClpMatrixBase * clpMatrix() const {
721
+ return matrix_;
722
+ }
723
+ /// Scaled ClpPackedMatrix
724
+ inline ClpPackedMatrix * clpScaledMatrix() const {
725
+ return scaledMatrix_;
726
+ }
727
+ /// Sets pointer to scaled ClpPackedMatrix
728
+ inline void setClpScaledMatrix(ClpPackedMatrix * scaledMatrix) {
729
+ delete scaledMatrix_;
730
+ scaledMatrix_ = scaledMatrix;
731
+ }
732
+ /// Swaps pointer to scaled ClpPackedMatrix
733
+ inline ClpPackedMatrix * swapScaledMatrix(ClpPackedMatrix * scaledMatrix) {
734
+ ClpPackedMatrix * oldMatrix = scaledMatrix_;
735
+ scaledMatrix_ = scaledMatrix;
736
+ return oldMatrix;
737
+ }
738
+ /** Replace Clp Matrix (current is not deleted unless told to
739
+ and new is used)
740
+ So up to user to delete current. This was used where
741
+ matrices were being rotated. ClpModel takes ownership.
742
+ */
743
+ void replaceMatrix(ClpMatrixBase * matrix, bool deleteCurrent = false);
744
+ /** Replace Clp Matrix (current is not deleted unless told to
745
+ and new is used) So up to user to delete current. This was used where
746
+ matrices were being rotated. This version changes CoinPackedMatrix
747
+ to ClpPackedMatrix. ClpModel takes ownership.
748
+ */
749
+ inline void replaceMatrix(CoinPackedMatrix * newmatrix,
750
+ bool deleteCurrent = false) {
751
+ replaceMatrix(new ClpPackedMatrix(newmatrix), deleteCurrent);
752
+ }
753
+ /// Objective value
754
+ inline double objectiveValue() const {
755
+ return objectiveValue_ * optimizationDirection_ - dblParam_[ClpObjOffset];
756
+ }
757
+ inline void setObjectiveValue(double value) {
758
+ objectiveValue_ = (value + dblParam_[ClpObjOffset]) / optimizationDirection_;
759
+ }
760
+ inline double getObjValue() const {
761
+ return objectiveValue_ * optimizationDirection_ - dblParam_[ClpObjOffset];
762
+ }
763
+ /// Integer information
764
+ inline char * integerInformation() const {
765
+ return integerType_;
766
+ }
767
+ /** Infeasibility/unbounded ray (NULL returned if none/wrong)
768
+ Up to user to use delete [] on these arrays. */
769
+ double * infeasibilityRay(bool fullRay=false) const;
770
+ double * unboundedRay() const;
771
+ /// For advanced users - no need to delete - sign not changed
772
+ inline double * ray() const
773
+ { return ray_;}
774
+ /// just test if infeasibility or unbounded Ray exists
775
+ inline bool rayExists() const {
776
+ return (ray_!=NULL);
777
+ }
778
+ /// just delete ray if exists
779
+ inline void deleteRay() {
780
+ delete [] ray_;
781
+ ray_=NULL;
782
+ }
783
+ /// Access internal ray storage. Users should call infeasibilityRay() or unboundedRay() instead.
784
+ inline const double * internalRay() const {
785
+ return ray_;
786
+ }
787
+ /// See if status (i.e. basis) array exists (partly for OsiClp)
788
+ inline bool statusExists() const {
789
+ return (status_ != NULL);
790
+ }
791
+ /// Return address of status (i.e. basis) array (char[numberRows+numberColumns])
792
+ inline unsigned char * statusArray() const {
793
+ return status_;
794
+ }
795
+ /** Return copy of status (i.e. basis) array (char[numberRows+numberColumns]),
796
+ use delete [] */
797
+ unsigned char * statusCopy() const;
798
+ /// Copy in status (basis) vector
799
+ void copyinStatus(const unsigned char * statusArray);
800
+
801
+ /// User pointer for whatever reason
802
+ inline void setUserPointer (void * pointer) {
803
+ userPointer_ = pointer;
804
+ }
805
+ inline void * getUserPointer () const {
806
+ return userPointer_;
807
+ }
808
+ /// Trusted user pointer
809
+ inline void setTrustedUserPointer (ClpTrustedData * pointer) {
810
+ trustedUserPointer_ = pointer;
811
+ }
812
+ inline ClpTrustedData * getTrustedUserPointer () const {
813
+ return trustedUserPointer_;
814
+ }
815
+ /// What has changed in model (only for masochistic users)
816
+ inline int whatsChanged() const {
817
+ return whatsChanged_;
818
+ }
819
+ inline void setWhatsChanged(int value) {
820
+ whatsChanged_ = value;
821
+ }
822
+ /// Number of threads (not really being used)
823
+ inline int numberThreads() const {
824
+ return numberThreads_;
825
+ }
826
+ inline void setNumberThreads(int value) {
827
+ numberThreads_ = value;
828
+ }
829
+ //@}
830
+ /**@name Message handling */
831
+ //@{
832
+ /// Pass in Message handler (not deleted at end)
833
+ void passInMessageHandler(CoinMessageHandler * handler);
834
+ /// Pass in Message handler (not deleted at end) and return current
835
+ CoinMessageHandler * pushMessageHandler(CoinMessageHandler * handler,
836
+ bool & oldDefault);
837
+ /// back to previous message handler
838
+ void popMessageHandler(CoinMessageHandler * oldHandler, bool oldDefault);
839
+ /// Set language
840
+ void newLanguage(CoinMessages::Language language);
841
+ inline void setLanguage(CoinMessages::Language language) {
842
+ newLanguage(language);
843
+ }
844
+ /// Overrides message handler with a default one
845
+ void setDefaultMessageHandler();
846
+ /// Return handler
847
+ inline CoinMessageHandler * messageHandler() const {
848
+ return handler_;
849
+ }
850
+ /// Return messages
851
+ inline CoinMessages messages() const {
852
+ return messages_;
853
+ }
854
+ /// Return pointer to messages
855
+ inline CoinMessages * messagesPointer() {
856
+ return & messages_;
857
+ }
858
+ /// Return Coin messages
859
+ inline CoinMessages coinMessages() const {
860
+ return coinMessages_;
861
+ }
862
+ /// Return pointer to Coin messages
863
+ inline CoinMessages * coinMessagesPointer() {
864
+ return & coinMessages_;
865
+ }
866
+ /** Amount of print out:
867
+ 0 - none
868
+ 1 - just final
869
+ 2 - just factorizations
870
+ 3 - as 2 plus a bit more
871
+ 4 - verbose
872
+ above that 8,16,32 etc just for selective debug
873
+ */
874
+ inline void setLogLevel(int value) {
875
+ handler_->setLogLevel(value);
876
+ }
877
+ inline int logLevel() const {
878
+ return handler_->logLevel();
879
+ }
880
+ /// Return true if default handler
881
+ inline bool defaultHandler() const {
882
+ return defaultHandler_;
883
+ }
884
+ /// Pass in Event handler (cloned and deleted at end)
885
+ void passInEventHandler(const ClpEventHandler * eventHandler);
886
+ /// Event handler
887
+ inline ClpEventHandler * eventHandler() const {
888
+ return eventHandler_;
889
+ }
890
+ /// Thread specific random number generator
891
+ inline CoinThreadRandom * randomNumberGenerator() {
892
+ return &randomNumberGenerator_;
893
+ }
894
+ /// Thread specific random number generator
895
+ inline CoinThreadRandom & mutableRandomNumberGenerator() {
896
+ return randomNumberGenerator_;
897
+ }
898
+ /// Set seed for thread specific random number generator
899
+ inline void setRandomSeed(int value) {
900
+ randomNumberGenerator_.setSeed(value);
901
+ }
902
+ /// length of names (0 means no names0
903
+ inline int lengthNames() const {
904
+ return lengthNames_;
905
+ }
906
+ #ifndef CLP_NO_STD
907
+ /// length of names (0 means no names0
908
+ inline void setLengthNames(int value) {
909
+ lengthNames_ = value;
910
+ }
911
+ /// Row names
912
+ inline const std::vector<std::string> * rowNames() const {
913
+ return &rowNames_;
914
+ }
915
+ inline const std::string& rowName(int iRow) const {
916
+ return rowNames_[iRow];
917
+ }
918
+ /// Return name or Rnnnnnnn
919
+ std::string getRowName(int iRow) const;
920
+ /// Column names
921
+ inline const std::vector<std::string> * columnNames() const {
922
+ return &columnNames_;
923
+ }
924
+ inline const std::string& columnName(int iColumn) const {
925
+ return columnNames_[iColumn];
926
+ }
927
+ /// Return name or Cnnnnnnn
928
+ std::string getColumnName(int iColumn) const;
929
+ #endif
930
+ /// Objective methods
931
+ inline ClpObjective * objectiveAsObject() const {
932
+ return objective_;
933
+ }
934
+ void setObjective(ClpObjective * objective);
935
+ inline void setObjectivePointer(ClpObjective * newobjective) {
936
+ objective_ = newobjective;
937
+ }
938
+ /** Solve a problem with no elements - return status and
939
+ dual and primal infeasibilites */
940
+ int emptyProblem(int * infeasNumber = NULL, double * infeasSum = NULL, bool printMessage = true);
941
+
942
+ //@}
943
+
944
+ /**@name Matrix times vector methods
945
+ They can be faster if scalar is +- 1
946
+ These are covers so user need not worry about scaling
947
+ Also for simplex I am not using basic/non-basic split */
948
+ //@{
949
+ /** Return <code>y + A * x * scalar</code> in <code>y</code>.
950
+ @pre <code>x</code> must be of size <code>numColumns()</code>
951
+ @pre <code>y</code> must be of size <code>numRows()</code> */
952
+ void times(double scalar,
953
+ const double * x, double * y) const;
954
+ /** Return <code>y + x * scalar * A</code> in <code>y</code>.
955
+ @pre <code>x</code> must be of size <code>numRows()</code>
956
+ @pre <code>y</code> must be of size <code>numColumns()</code> */
957
+ void transposeTimes(double scalar,
958
+ const double * x, double * y) const ;
959
+ //@}
960
+
961
+
962
+ //---------------------------------------------------------------------------
963
+ /**@name Parameter set/get methods
964
+
965
+ The set methods return true if the parameter was set to the given value,
966
+ false otherwise. There can be various reasons for failure: the given
967
+ parameter is not applicable for the solver (e.g., refactorization
968
+ frequency for the volume algorithm), the parameter is not yet implemented
969
+ for the solver or simply the value of the parameter is out of the range
970
+ the solver accepts. If a parameter setting call returns false check the
971
+ details of your solver.
972
+
973
+ The get methods return true if the given parameter is applicable for the
974
+ solver and is implemented. In this case the value of the parameter is
975
+ returned in the second argument. Otherwise they return false.
976
+
977
+ ** once it has been decided where solver sits this may be redone
978
+ */
979
+ //@{
980
+ /// Set an integer parameter
981
+ bool setIntParam(ClpIntParam key, int value) ;
982
+ /// Set an double parameter
983
+ bool setDblParam(ClpDblParam key, double value) ;
984
+ #ifndef CLP_NO_STD
985
+ /// Set an string parameter
986
+ bool setStrParam(ClpStrParam key, const std::string & value);
987
+ #endif
988
+ // Get an integer parameter
989
+ inline bool getIntParam(ClpIntParam key, int& value) const {
990
+ if (key < ClpLastIntParam) {
991
+ value = intParam_[key];
992
+ return true;
993
+ } else {
994
+ return false;
995
+ }
996
+ }
997
+ // Get an double parameter
998
+ inline bool getDblParam(ClpDblParam key, double& value) const {
999
+ if (key < ClpLastDblParam) {
1000
+ value = dblParam_[key];
1001
+ return true;
1002
+ } else {
1003
+ return false;
1004
+ }
1005
+ }
1006
+ #ifndef CLP_NO_STD
1007
+ // Get a string parameter
1008
+ inline bool getStrParam(ClpStrParam key, std::string& value) const {
1009
+ if (key < ClpLastStrParam) {
1010
+ value = strParam_[key];
1011
+ return true;
1012
+ } else {
1013
+ return false;
1014
+ }
1015
+ }
1016
+ #endif
1017
+ /// Create C++ lines to get to current state
1018
+ void generateCpp( FILE * fp);
1019
+ /** For advanced options
1020
+ 1 - Don't keep changing infeasibility weight
1021
+ 2 - Keep nonLinearCost round solves
1022
+ 4 - Force outgoing variables to exact bound (primal)
1023
+ 8 - Safe to use dense initial factorization
1024
+ 16 -Just use basic variables for operation if column generation
1025
+ 32 -Create ray even in BAB
1026
+ 64 -Treat problem as feasible until last minute (i.e. minimize infeasibilities)
1027
+ 128 - Switch off all matrix sanity checks
1028
+ 256 - No row copy
1029
+ 512 - If not in values pass, solution guaranteed, skip as much as possible
1030
+ 1024 - In branch and bound
1031
+ 2048 - Don't bother to re-factorize if < 20 iterations
1032
+ 4096 - Skip some optimality checks
1033
+ 8192 - Do Primal when cleaning up primal
1034
+ 16384 - In fast dual (so we can switch off things)
1035
+ 32768 - called from Osi
1036
+ 65536 - keep arrays around as much as possible (also use maximumR/C)
1037
+ 131072 - transposeTimes is -1.0 and can skip basic and fixed
1038
+ 262144 - extra copy of scaled matrix
1039
+ 524288 - Clp fast dual
1040
+ 1048576 - don't need to finish dual (can return 3)
1041
+ 2097152 - zero costs!
1042
+ 4194304 - don't scale integer variables
1043
+ 8388608 - Idiot when not really sure about it
1044
+ NOTE - many applications can call Clp but there may be some short cuts
1045
+ which are taken which are not guaranteed safe from all applications.
1046
+ Vetted applications will have a bit set and the code may test this
1047
+ At present I expect a few such applications - if too many I will
1048
+ have to re-think. It is up to application owner to change the code
1049
+ if she/he needs these short cuts. I will not debug unless in Coin
1050
+ repository. See COIN_CLP_VETTED comments.
1051
+ 0x01000000 is Cbc (and in branch and bound)
1052
+ 0x02000000 is in a different branch and bound
1053
+ */
1054
+ inline unsigned int specialOptions() const {
1055
+ return specialOptions_;
1056
+ }
1057
+ void setSpecialOptions(unsigned int value);
1058
+ #define COIN_CBC_USING_CLP 0x01000000
1059
+ inline bool inCbcBranchAndBound() const {
1060
+ return (specialOptions_ & COIN_CBC_USING_CLP) != 0;
1061
+ }
1062
+ //@}
1063
+
1064
+ /**@name private or protected methods */
1065
+ //@{
1066
+ protected:
1067
+ /// Does most of deletion (0 = all, 1 = most)
1068
+ void gutsOfDelete(int type);
1069
+ /** Does most of copying
1070
+ If trueCopy 0 then just points to arrays
1071
+ If -1 leaves as much as possible */
1072
+ void gutsOfCopy(const ClpModel & rhs, int trueCopy = 1);
1073
+ /// gets lower and upper bounds on rows
1074
+ void getRowBound(int iRow, double& lower, double& upper) const;
1075
+ /// puts in format I like - 4 array matrix - may make row copy
1076
+ void gutsOfLoadModel ( int numberRows, int numberColumns,
1077
+ const double* collb, const double* colub,
1078
+ const double* obj,
1079
+ const double* rowlb, const double* rowub,
1080
+ const double * rowObjective = NULL);
1081
+ /// Does much of scaling
1082
+ void gutsOfScaling();
1083
+ /// Objective value - always minimize
1084
+ inline double rawObjectiveValue() const {
1085
+ return objectiveValue_;
1086
+ }
1087
+ /// If we are using maximumRows_ and Columns_
1088
+ inline bool permanentArrays() const {
1089
+ return (specialOptions_ & 65536) != 0;
1090
+ }
1091
+ /// Start using maximumRows_ and Columns_
1092
+ void startPermanentArrays();
1093
+ /// Stop using maximumRows_ and Columns_
1094
+ void stopPermanentArrays();
1095
+ /// Create row names as char **
1096
+ const char * const * rowNamesAsChar() const;
1097
+ /// Create column names as char **
1098
+ const char * const * columnNamesAsChar() const;
1099
+ /// Delete char * version of names
1100
+ void deleteNamesAsChar(const char * const * names, int number) const;
1101
+ /// On stopped - sets secondary status
1102
+ void onStopped();
1103
+ //@}
1104
+
1105
+
1106
+ ////////////////// data //////////////////
1107
+ protected:
1108
+
1109
+ /**@name data */
1110
+ //@{
1111
+ /// Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore
1112
+ double optimizationDirection_;
1113
+ /// Array of double parameters
1114
+ double dblParam_[ClpLastDblParam];
1115
+ /// Objective value
1116
+ double objectiveValue_;
1117
+ /// Small element value
1118
+ double smallElement_;
1119
+ /// Scaling of objective
1120
+ double objectiveScale_;
1121
+ /// Scaling of rhs and bounds
1122
+ double rhsScale_;
1123
+ /// Number of rows
1124
+ int numberRows_;
1125
+ /// Number of columns
1126
+ int numberColumns_;
1127
+ /// Row activities
1128
+ double * rowActivity_;
1129
+ /// Column activities
1130
+ double * columnActivity_;
1131
+ /// Duals
1132
+ double * dual_;
1133
+ /// Reduced costs
1134
+ double * reducedCost_;
1135
+ /// Row lower
1136
+ double* rowLower_;
1137
+ /// Row upper
1138
+ double* rowUpper_;
1139
+ /// Objective
1140
+ ClpObjective * objective_;
1141
+ /// Row Objective (? sign) - may be NULL
1142
+ double * rowObjective_;
1143
+ /// Column Lower
1144
+ double * columnLower_;
1145
+ /// Column Upper
1146
+ double * columnUpper_;
1147
+ /// Packed matrix
1148
+ ClpMatrixBase * matrix_;
1149
+ /// Row copy if wanted
1150
+ ClpMatrixBase * rowCopy_;
1151
+ /// Scaled packed matrix
1152
+ ClpPackedMatrix * scaledMatrix_;
1153
+ /// Infeasible/unbounded ray
1154
+ double * ray_;
1155
+ /// Row scale factors for matrix
1156
+ double * rowScale_;
1157
+ /// Column scale factors
1158
+ double * columnScale_;
1159
+ /// Inverse row scale factors for matrix (end of rowScale_)
1160
+ double * inverseRowScale_;
1161
+ /// Inverse column scale factors for matrix (end of columnScale_)
1162
+ double * inverseColumnScale_;
1163
+ /** Scale flag, 0 none, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic,
1164
+ 5 geometric on rows */
1165
+ int scalingFlag_;
1166
+ /** Status (i.e. basis) Region. I know that not all algorithms need a status
1167
+ array, but it made sense for things like crossover and put
1168
+ all permanent stuff in one place. No assumption is made
1169
+ about what is in status array (although it might be good to reserve
1170
+ bottom 3 bits (i.e. 0-7 numeric) for classic status). This
1171
+ is number of columns + number of rows long (in that order).
1172
+ */
1173
+ unsigned char * status_;
1174
+ /// Integer information
1175
+ char * integerType_;
1176
+ /// User pointer for whatever reason
1177
+ void * userPointer_;
1178
+ /// Trusted user pointer e.g. for heuristics
1179
+ ClpTrustedData * trustedUserPointer_;
1180
+ /// Array of integer parameters
1181
+ int intParam_[ClpLastIntParam];
1182
+ /// Number of iterations
1183
+ int numberIterations_;
1184
+ /** Solve type - 1 simplex, 2 simplex interface, 3 Interior.*/
1185
+ int solveType_;
1186
+ /** Whats changed since last solve. This is a work in progress
1187
+ It is designed so careful people can make go faster.
1188
+ It is only used when startFinishOptions used in dual or primal.
1189
+ Bit 1 - number of rows/columns has not changed (so work arrays valid)
1190
+ 2 - matrix has not changed
1191
+ 4 - if matrix has changed only by adding rows
1192
+ 8 - if matrix has changed only by adding columns
1193
+ 16 - row lbs not changed
1194
+ 32 - row ubs not changed
1195
+ 64 - column objective not changed
1196
+ 128 - column lbs not changed
1197
+ 256 - column ubs not changed
1198
+ 512 - basis not changed (up to user to set this to 0)
1199
+ top bits may be used internally
1200
+ shift by 65336 is 3 all same, 1 all except col bounds
1201
+ */
1202
+ #define ROW_COLUMN_COUNTS_SAME 1
1203
+ #define MATRIX_SAME 2
1204
+ #define MATRIX_JUST_ROWS_ADDED 4
1205
+ #define MATRIX_JUST_COLUMNS_ADDED 8
1206
+ #define ROW_LOWER_SAME 16
1207
+ #define ROW_UPPER_SAME 32
1208
+ #define OBJECTIVE_SAME 64
1209
+ #define COLUMN_LOWER_SAME 128
1210
+ #define COLUMN_UPPER_SAME 256
1211
+ #define BASIS_SAME 512
1212
+ #define ALL_SAME 65339
1213
+ #define ALL_SAME_EXCEPT_COLUMN_BOUNDS 65337
1214
+ unsigned int whatsChanged_;
1215
+ /// Status of problem
1216
+ int problemStatus_;
1217
+ /// Secondary status of problem
1218
+ int secondaryStatus_;
1219
+ /// length of names (0 means no names)
1220
+ int lengthNames_;
1221
+ /// Number of threads (not very operational)
1222
+ int numberThreads_;
1223
+ /** For advanced options
1224
+ See get and set for meaning
1225
+ */
1226
+ unsigned int specialOptions_;
1227
+ /// Message handler
1228
+ CoinMessageHandler * handler_;
1229
+ /// Flag to say if default handler (so delete)
1230
+ bool defaultHandler_;
1231
+ /// Thread specific random number generator
1232
+ CoinThreadRandom randomNumberGenerator_;
1233
+ /// Event handler
1234
+ ClpEventHandler * eventHandler_;
1235
+ #ifndef CLP_NO_STD
1236
+ /// Row names
1237
+ std::vector<std::string> rowNames_;
1238
+ /// Column names
1239
+ std::vector<std::string> columnNames_;
1240
+ #endif
1241
+ /// Messages
1242
+ CoinMessages messages_;
1243
+ /// Coin messages
1244
+ CoinMessages coinMessages_;
1245
+ /// Maximum number of columns in model
1246
+ int maximumColumns_;
1247
+ /// Maximum number of rows in model
1248
+ int maximumRows_;
1249
+ /// Maximum number of columns (internal arrays) in model
1250
+ int maximumInternalColumns_;
1251
+ /// Maximum number of rows (internal arrays) in model
1252
+ int maximumInternalRows_;
1253
+ /// Base packed matrix
1254
+ CoinPackedMatrix baseMatrix_;
1255
+ /// Base row copy
1256
+ CoinPackedMatrix baseRowCopy_;
1257
+ /// Saved row scale factors for matrix
1258
+ double * savedRowScale_;
1259
+ /// Saved column scale factors
1260
+ double * savedColumnScale_;
1261
+ #ifndef CLP_NO_STD
1262
+ /// Array of string parameters
1263
+ std::string strParam_[ClpLastStrParam];
1264
+ #endif
1265
+ //@}
1266
+ };
1267
+ /** This is a tiny class where data can be saved round calls.
1268
+ */
1269
+ class ClpDataSave {
1270
+
1271
+ public:
1272
+ /**@name Constructors and destructor
1273
+ */
1274
+ //@{
1275
+ /// Default constructor
1276
+ ClpDataSave ( );
1277
+
1278
+ /// Copy constructor.
1279
+ ClpDataSave(const ClpDataSave &);
1280
+ /// Assignment operator. This copies the data
1281
+ ClpDataSave & operator=(const ClpDataSave & rhs);
1282
+ /// Destructor
1283
+ ~ClpDataSave ( );
1284
+
1285
+ //@}
1286
+
1287
+ ////////////////// data //////////////////
1288
+ public:
1289
+
1290
+ /**@name data - with same names as in other classes*/
1291
+ //@{
1292
+ double dualBound_;
1293
+ double infeasibilityCost_;
1294
+ double pivotTolerance_;
1295
+ double zeroFactorizationTolerance_;
1296
+ double zeroSimplexTolerance_;
1297
+ double acceptablePivot_;
1298
+ double objectiveScale_;
1299
+ int sparseThreshold_;
1300
+ int perturbation_;
1301
+ int forceFactorization_;
1302
+ int scalingFlag_;
1303
+ unsigned int specialOptions_;
1304
+ //@}
1305
+ };
1306
+
1307
+ #endif