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,4134 @@
1
+ /* $Id: CbcOrClpParam.cpp 2175 2015-10-06 08:56:43Z 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
+ #include "CoinPragma.hpp"
7
+ #include "CoinTime.hpp"
8
+ #include "CbcOrClpParam.hpp"
9
+
10
+ #include <string>
11
+ #include <iostream>
12
+ #include <cassert>
13
+
14
+ #ifdef COIN_HAS_CBC
15
+ #ifdef COIN_HAS_CLP
16
+ #include "OsiClpSolverInterface.hpp"
17
+ #include "ClpSimplex.hpp"
18
+ #endif
19
+ #include "CbcModel.hpp"
20
+ #endif
21
+ #include "CoinHelperFunctions.hpp"
22
+ #ifdef COIN_HAS_CLP
23
+ #include "ClpSimplex.hpp"
24
+ #include "ClpFactorization.hpp"
25
+ #endif
26
+ #ifdef COIN_HAS_READLINE
27
+ #include <readline/readline.h>
28
+ #include <readline/history.h>
29
+ #endif
30
+ #ifdef COIN_HAS_CBC
31
+ // from CoinSolve
32
+ static char coin_prompt[] = "Coin:";
33
+ #else
34
+ static char coin_prompt[] = "Clp:";
35
+ #endif
36
+ #ifdef CLP_CILK
37
+ #ifndef CBC_THREAD
38
+ #define CBC_THREAD
39
+ #endif
40
+ #endif
41
+ #if defined(COIN_HAS_WSMP) && ! defined(USE_EKKWSSMP)
42
+ #ifndef CBC_THREAD
43
+ #define CBC_THREAD
44
+ #endif
45
+ #endif
46
+ #include "ClpConfig.h"
47
+ #ifdef CLP_HAS_ABC
48
+ #include "AbcCommon.hpp"
49
+ #endif
50
+ static bool doPrinting = true;
51
+ static std::string afterEquals = "";
52
+ static char printArray[200];
53
+ #if COIN_INT_MAX==0
54
+ #undef COIN_INT_MAX
55
+ #define COIN_INT_MAX 2147483647
56
+ #endif
57
+ #if FLUSH_PRINT_BUFFER > 2
58
+ int coinFlushBufferFlag=0;
59
+ #endif
60
+ void setCbcOrClpPrinting(bool yesNo)
61
+ {
62
+ doPrinting = yesNo;
63
+ }
64
+ //#############################################################################
65
+ // Constructors / Destructor / Assignment
66
+ //#############################################################################
67
+
68
+ //-------------------------------------------------------------------
69
+ // Default Constructor
70
+ //-------------------------------------------------------------------
71
+ CbcOrClpParam::CbcOrClpParam ()
72
+ : type_(CBC_PARAM_NOTUSED_INVALID),
73
+ lowerDoubleValue_(0.0),
74
+ upperDoubleValue_(0.0),
75
+ lowerIntValue_(0),
76
+ upperIntValue_(0),
77
+ lengthName_(0),
78
+ lengthMatch_(0),
79
+ definedKeyWords_(),
80
+ name_(),
81
+ shortHelp_(),
82
+ longHelp_(),
83
+ action_(CBC_PARAM_NOTUSED_INVALID),
84
+ currentKeyWord_(-1),
85
+ display_(0),
86
+ intValue_(-1),
87
+ doubleValue_(-1.0),
88
+ stringValue_(""),
89
+ whereUsed_(7),
90
+ fakeKeyWord_(-1),
91
+ fakeValue_(0)
92
+ {
93
+ }
94
+ // Other constructors
95
+ CbcOrClpParam::CbcOrClpParam (std::string name, std::string help,
96
+ double lower, double upper, CbcOrClpParameterType type,
97
+ int display)
98
+ : type_(type),
99
+ lowerIntValue_(0),
100
+ upperIntValue_(0),
101
+ definedKeyWords_(),
102
+ name_(name),
103
+ shortHelp_(help),
104
+ longHelp_(),
105
+ action_(type),
106
+ currentKeyWord_(-1),
107
+ display_(display),
108
+ intValue_(-1),
109
+ doubleValue_(-1.0),
110
+ stringValue_(""),
111
+ whereUsed_(7),
112
+ fakeKeyWord_(-1),
113
+ fakeValue_(0)
114
+ {
115
+ lowerDoubleValue_ = lower;
116
+ upperDoubleValue_ = upper;
117
+ gutsOfConstructor();
118
+ }
119
+ CbcOrClpParam::CbcOrClpParam (std::string name, std::string help,
120
+ int lower, int upper, CbcOrClpParameterType type,
121
+ int display)
122
+ : type_(type),
123
+ lowerDoubleValue_(0.0),
124
+ upperDoubleValue_(0.0),
125
+ definedKeyWords_(),
126
+ name_(name),
127
+ shortHelp_(help),
128
+ longHelp_(),
129
+ action_(type),
130
+ currentKeyWord_(-1),
131
+ display_(display),
132
+ intValue_(-1),
133
+ doubleValue_(-1.0),
134
+ stringValue_(""),
135
+ whereUsed_(7),
136
+ fakeKeyWord_(-1),
137
+ fakeValue_(0)
138
+ {
139
+ gutsOfConstructor();
140
+ lowerIntValue_ = lower;
141
+ upperIntValue_ = upper;
142
+ }
143
+ // Other strings will be added by append
144
+ CbcOrClpParam::CbcOrClpParam (std::string name, std::string help,
145
+ std::string firstValue,
146
+ CbcOrClpParameterType type, int whereUsed,
147
+ int display)
148
+ : type_(type),
149
+ lowerDoubleValue_(0.0),
150
+ upperDoubleValue_(0.0),
151
+ lowerIntValue_(0),
152
+ upperIntValue_(0),
153
+ definedKeyWords_(),
154
+ name_(name),
155
+ shortHelp_(help),
156
+ longHelp_(),
157
+ action_(type),
158
+ currentKeyWord_(0),
159
+ display_(display),
160
+ intValue_(-1),
161
+ doubleValue_(-1.0),
162
+ stringValue_(""),
163
+ whereUsed_(whereUsed),
164
+ fakeKeyWord_(-1),
165
+ fakeValue_(0)
166
+ {
167
+ gutsOfConstructor();
168
+ definedKeyWords_.push_back(firstValue);
169
+ }
170
+ // Action
171
+ CbcOrClpParam::CbcOrClpParam (std::string name, std::string help,
172
+ CbcOrClpParameterType type, int whereUsed,
173
+ int display)
174
+ : type_(type),
175
+ lowerDoubleValue_(0.0),
176
+ upperDoubleValue_(0.0),
177
+ lowerIntValue_(0),
178
+ upperIntValue_(0),
179
+ definedKeyWords_(),
180
+ name_(name),
181
+ shortHelp_(help),
182
+ longHelp_(),
183
+ action_(type),
184
+ currentKeyWord_(-1),
185
+ display_(display),
186
+ intValue_(-1),
187
+ doubleValue_(-1.0),
188
+ stringValue_(""),
189
+ fakeKeyWord_(-1),
190
+ fakeValue_(0)
191
+ {
192
+ whereUsed_ = whereUsed;
193
+ gutsOfConstructor();
194
+ }
195
+
196
+ //-------------------------------------------------------------------
197
+ // Copy constructor
198
+ //-------------------------------------------------------------------
199
+ CbcOrClpParam::CbcOrClpParam (const CbcOrClpParam & rhs)
200
+ {
201
+ type_ = rhs.type_;
202
+ lowerDoubleValue_ = rhs.lowerDoubleValue_;
203
+ upperDoubleValue_ = rhs.upperDoubleValue_;
204
+ lowerIntValue_ = rhs.lowerIntValue_;
205
+ upperIntValue_ = rhs.upperIntValue_;
206
+ lengthName_ = rhs.lengthName_;
207
+ lengthMatch_ = rhs.lengthMatch_;
208
+ definedKeyWords_ = rhs.definedKeyWords_;
209
+ name_ = rhs.name_;
210
+ shortHelp_ = rhs.shortHelp_;
211
+ longHelp_ = rhs.longHelp_;
212
+ action_ = rhs.action_;
213
+ currentKeyWord_ = rhs.currentKeyWord_;
214
+ display_ = rhs.display_;
215
+ intValue_ = rhs.intValue_;
216
+ doubleValue_ = rhs.doubleValue_;
217
+ stringValue_ = rhs.stringValue_;
218
+ whereUsed_ = rhs.whereUsed_;
219
+ fakeKeyWord_ = rhs.fakeKeyWord_;
220
+ fakeValue_ = rhs.fakeValue_;
221
+ }
222
+
223
+ //-------------------------------------------------------------------
224
+ // Destructor
225
+ //-------------------------------------------------------------------
226
+ CbcOrClpParam::~CbcOrClpParam ()
227
+ {
228
+ }
229
+
230
+ //----------------------------------------------------------------
231
+ // Assignment operator
232
+ //-------------------------------------------------------------------
233
+ CbcOrClpParam &
234
+ CbcOrClpParam::operator=(const CbcOrClpParam & rhs)
235
+ {
236
+ if (this != &rhs) {
237
+ type_ = rhs.type_;
238
+ lowerDoubleValue_ = rhs.lowerDoubleValue_;
239
+ upperDoubleValue_ = rhs.upperDoubleValue_;
240
+ lowerIntValue_ = rhs.lowerIntValue_;
241
+ upperIntValue_ = rhs.upperIntValue_;
242
+ lengthName_ = rhs.lengthName_;
243
+ lengthMatch_ = rhs.lengthMatch_;
244
+ definedKeyWords_ = rhs.definedKeyWords_;
245
+ name_ = rhs.name_;
246
+ shortHelp_ = rhs.shortHelp_;
247
+ longHelp_ = rhs.longHelp_;
248
+ action_ = rhs.action_;
249
+ currentKeyWord_ = rhs.currentKeyWord_;
250
+ display_ = rhs.display_;
251
+ intValue_ = rhs.intValue_;
252
+ doubleValue_ = rhs.doubleValue_;
253
+ stringValue_ = rhs.stringValue_;
254
+ whereUsed_ = rhs.whereUsed_;
255
+ fakeKeyWord_ = rhs.fakeKeyWord_;
256
+ fakeValue_ = rhs.fakeValue_;
257
+ }
258
+ return *this;
259
+ }
260
+ void
261
+ CbcOrClpParam::gutsOfConstructor()
262
+ {
263
+ std::string::size_type shriekPos = name_.find('!');
264
+ lengthName_ = static_cast<unsigned int>(name_.length());
265
+ if ( shriekPos == std::string::npos ) {
266
+ //does not contain '!'
267
+ lengthMatch_ = lengthName_;
268
+ } else {
269
+ lengthMatch_ = static_cast<unsigned int>(shriekPos);
270
+ name_ = name_.substr(0, shriekPos) + name_.substr(shriekPos + 1);
271
+ lengthName_--;
272
+ }
273
+ }
274
+ // Sets value of fake keyword to current size of keywords
275
+ void
276
+ CbcOrClpParam::setFakeKeyWord(int fakeValue)
277
+ {
278
+ fakeKeyWord_ = static_cast<int>(definedKeyWords_.size());
279
+ assert (fakeKeyWord_>0);
280
+ fakeValue_ = fakeValue;
281
+ assert (fakeValue_>=0);
282
+ }
283
+ /* Returns current parameter option position
284
+ but if fake keyword returns fakeValue_
285
+ */
286
+ int
287
+ CbcOrClpParam::currentOptionAsInteger ( ) const
288
+ {
289
+ int fakeInteger;
290
+ return currentOptionAsInteger(fakeInteger);
291
+ }
292
+ /* Returns current parameter option position
293
+ but if fake keyword returns fakeValue_ and sets
294
+ fakeInteger to value
295
+ */
296
+ int
297
+ CbcOrClpParam::currentOptionAsInteger ( int & fakeInteger ) const
298
+ {
299
+ fakeInteger=-COIN_INT_MAX;
300
+ if (fakeKeyWord_<0) {
301
+ return currentKeyWord_;
302
+ } else if (currentKeyWord_>=0&&currentKeyWord_<fakeKeyWord_){
303
+ return currentKeyWord_;
304
+ } else {
305
+ // fake
306
+ if (currentKeyWord_<0)
307
+ fakeInteger = currentKeyWord_ + 1000;
308
+ else
309
+ fakeInteger = currentKeyWord_ - 1000;
310
+ return fakeValue_;
311
+ }
312
+ }
313
+ // Returns length of name for printing
314
+ int
315
+ CbcOrClpParam::lengthMatchName ( ) const
316
+ {
317
+ if (lengthName_ == lengthMatch_)
318
+ return lengthName_;
319
+ else
320
+ return lengthName_ + 2;
321
+ }
322
+ // Insert string (only valid for keywords)
323
+ void
324
+ CbcOrClpParam::append(std::string keyWord)
325
+ {
326
+ definedKeyWords_.push_back(keyWord);
327
+ }
328
+
329
+ int
330
+ CbcOrClpParam::matches (std::string input) const
331
+ {
332
+ // look up strings to do more elegantly
333
+ if (input.length() > lengthName_) {
334
+ return 0;
335
+ } else {
336
+ unsigned int i;
337
+ for (i = 0; i < input.length(); i++) {
338
+ if (tolower(name_[i]) != tolower(input[i]))
339
+ break;
340
+ }
341
+ if (i < input.length()) {
342
+ return 0;
343
+ } else if (i >= lengthMatch_) {
344
+ return 1;
345
+ } else {
346
+ // matched but too short
347
+ return 2;
348
+ }
349
+ }
350
+ }
351
+ // Returns name which could match
352
+ std::string
353
+ CbcOrClpParam::matchName ( ) const
354
+ {
355
+ if (lengthMatch_ == lengthName_)
356
+ return name_;
357
+ else
358
+ return name_.substr(0, lengthMatch_) + "(" + name_.substr(lengthMatch_) + ")";
359
+ }
360
+
361
+ // Returns parameter option which matches (-1 if none)
362
+ int
363
+ CbcOrClpParam::parameterOption ( std::string check ) const
364
+ {
365
+ int numberItems = static_cast<int>(definedKeyWords_.size());
366
+ if (!numberItems) {
367
+ return -1;
368
+ } else {
369
+ int whichItem = 0;
370
+ unsigned int it;
371
+ for (it = 0; it < definedKeyWords_.size(); it++) {
372
+ std::string thisOne = definedKeyWords_[it];
373
+ std::string::size_type shriekPos = thisOne.find('!');
374
+ size_t length1 = thisOne.length();
375
+ size_t length2 = length1;
376
+ if ( shriekPos != std::string::npos ) {
377
+ //contains '!'
378
+ length2 = shriekPos;
379
+ thisOne = thisOne.substr(0, shriekPos) +
380
+ thisOne.substr(shriekPos + 1);
381
+ length1 = thisOne.length();
382
+ }
383
+ if (check.length() <= length1 && length2 <= check.length()) {
384
+ unsigned int i;
385
+ for (i = 0; i < check.length(); i++) {
386
+ if (tolower(thisOne[i]) != tolower(check[i]))
387
+ break;
388
+ }
389
+ if (i < check.length()) {
390
+ whichItem++;
391
+ } else if (i >= length2) {
392
+ break;
393
+ }
394
+ } else {
395
+ whichItem++;
396
+ }
397
+ }
398
+ if (whichItem < numberItems) {
399
+ return whichItem;
400
+ } else {
401
+ if (fakeKeyWord_<=0)
402
+ return -1;
403
+ // allow plus or minus
404
+ int n;
405
+ if (check.substr(0,4)=="plus"||check.substr(0,4)=="PLUS") {
406
+ n = 4;
407
+ } else if (check.substr(0,5)=="minus"||check.substr(0,5)=="MINUS") {
408
+ n = 5;
409
+ } else {
410
+ return -1;
411
+ }
412
+ int value = 0;
413
+ std::string field=check.substr(n);
414
+ if (field != "EOL") {
415
+ const char * start = field.c_str();
416
+ char * endPointer = NULL;
417
+ // check valid
418
+ value = static_cast<int>(strtol(start, &endPointer, 10));
419
+ if (*endPointer != '\0') {
420
+ return -1;
421
+ }
422
+ if (n==4)
423
+ return value + 1000;
424
+ else
425
+ return -value - 1000;
426
+ } else {
427
+ return -1;
428
+ }
429
+ }
430
+ }
431
+ }
432
+ // Prints parameter options
433
+ void
434
+ CbcOrClpParam::printOptions ( ) const
435
+ {
436
+ std::cout << "<Possible options for " << name_ << " are:";
437
+ unsigned int it;
438
+ for (it = 0; it < definedKeyWords_.size(); it++) {
439
+ std::string thisOne = definedKeyWords_[it];
440
+ std::string::size_type shriekPos = thisOne.find('!');
441
+ if ( shriekPos != std::string::npos ) {
442
+ //contains '!'
443
+ thisOne = thisOne.substr(0, shriekPos) +
444
+ "(" + thisOne.substr(shriekPos + 1) + ")";
445
+ }
446
+ std::cout << " " << thisOne;
447
+ }
448
+ assert (currentKeyWord_ >= 0 && currentKeyWord_ < static_cast<int>(definedKeyWords_.size()));
449
+ std::string current = definedKeyWords_[currentKeyWord_];
450
+ std::string::size_type shriekPos = current.find('!');
451
+ if ( shriekPos != std::string::npos ) {
452
+ //contains '!'
453
+ current = current.substr(0, shriekPos) +
454
+ "(" + current.substr(shriekPos + 1) + ")";
455
+ }
456
+ std::cout << ";\n\tcurrent " << current << ">" << std::endl;
457
+ }
458
+ // Print action and string
459
+ void
460
+ CbcOrClpParam::printString() const
461
+ {
462
+ if (name_ == "directory")
463
+ std::cout << "Current working directory is " << stringValue_ << std::endl;
464
+ else if (name_.substr(0, 6) == "printM")
465
+ std::cout << "Current value of printMask is " << stringValue_ << std::endl;
466
+ else
467
+ std::cout << "Current default (if $ as parameter) for " << name_
468
+ << " is " << stringValue_ << std::endl;
469
+ }
470
+ void CoinReadPrintit(const char * input)
471
+ {
472
+ int length = static_cast<int>(strlen(input));
473
+ char temp[101];
474
+ int i;
475
+ int n = 0;
476
+ for (i = 0; i < length; i++) {
477
+ if (input[i] == '\n') {
478
+ temp[n] = '\0';
479
+ std::cout << temp << std::endl;
480
+ n = 0;
481
+ } else if (n >= 65 && input[i] == ' ') {
482
+ temp[n] = '\0';
483
+ std::cout << temp << std::endl;
484
+ n = 0;
485
+ } else if (n || input[i] != ' ') {
486
+ temp[n++] = input[i];
487
+ }
488
+ }
489
+ if (n) {
490
+ temp[n] = '\0';
491
+ std::cout << temp << std::endl;
492
+ }
493
+ }
494
+ // Print Long help
495
+ void
496
+ CbcOrClpParam::printLongHelp() const
497
+ {
498
+ if (type_ >= 1 && type_ < 400) {
499
+ CoinReadPrintit(longHelp_.c_str());
500
+ if (type_ < CLP_PARAM_INT_SOLVERLOGLEVEL) {
501
+ printf("<Range of values is %g to %g;\n\tcurrent %g>\n", lowerDoubleValue_, upperDoubleValue_, doubleValue_);
502
+ assert (upperDoubleValue_ > lowerDoubleValue_);
503
+ } else if (type_ < CLP_PARAM_STR_DIRECTION) {
504
+ printf("<Range of values is %d to %d;\n\tcurrent %d>\n", lowerIntValue_, upperIntValue_, intValue_);
505
+ assert (upperIntValue_ > lowerIntValue_);
506
+ } else if (type_ < CLP_PARAM_ACTION_DIRECTORY) {
507
+ printOptions();
508
+ }
509
+ }
510
+ }
511
+ #ifdef COIN_HAS_CBC
512
+ int
513
+ CbcOrClpParam::setDoubleParameter (OsiSolverInterface * model, double value)
514
+ {
515
+ int returnCode;
516
+ setDoubleParameterWithMessage(model, value, returnCode);
517
+ if (doPrinting && strlen(printArray))
518
+ std::cout << printArray << std::endl;
519
+ return returnCode;
520
+ }
521
+ // Sets double parameter and returns printable string and error code
522
+ const char *
523
+ CbcOrClpParam::setDoubleParameterWithMessage ( OsiSolverInterface * model, double value , int & returnCode)
524
+ {
525
+ if (value < lowerDoubleValue_ || value > upperDoubleValue_) {
526
+ sprintf(printArray, "%g was provided for %s - valid range is %g to %g",
527
+ value, name_.c_str(), lowerDoubleValue_, upperDoubleValue_);
528
+ std::cout << value << " was provided for " << name_ <<
529
+ " - valid range is " << lowerDoubleValue_ << " to " <<
530
+ upperDoubleValue_ << std::endl;
531
+ returnCode = 1;
532
+ } else {
533
+ double oldValue = doubleValue_;
534
+ doubleValue_ = value;
535
+ switch (type_) {
536
+ case CLP_PARAM_DBL_DUALTOLERANCE:
537
+ model->getDblParam(OsiDualTolerance, oldValue);
538
+ model->setDblParam(OsiDualTolerance, value);
539
+ break;
540
+ case CLP_PARAM_DBL_PRIMALTOLERANCE:
541
+ model->getDblParam(OsiPrimalTolerance, oldValue);
542
+ model->setDblParam(OsiPrimalTolerance, value);
543
+ break;
544
+ default:
545
+ break;
546
+ }
547
+ sprintf(printArray, "%s was changed from %g to %g",
548
+ name_.c_str(), oldValue, value);
549
+ returnCode = 0;
550
+ }
551
+ return printArray;
552
+ }
553
+ #endif
554
+ #ifdef COIN_HAS_CLP
555
+ int
556
+ CbcOrClpParam::setDoubleParameter (ClpSimplex * model, double value)
557
+ {
558
+ int returnCode;
559
+ setDoubleParameterWithMessage(model, value, returnCode);
560
+ if (doPrinting && strlen(printArray))
561
+ std::cout << printArray << std::endl;
562
+ return returnCode;
563
+ }
564
+ // Sets int parameter and returns printable string and error code
565
+ const char *
566
+ CbcOrClpParam::setDoubleParameterWithMessage ( ClpSimplex * model, double value , int & returnCode)
567
+ {
568
+ double oldValue = doubleValue_;
569
+ if (value < lowerDoubleValue_ || value > upperDoubleValue_) {
570
+ sprintf(printArray, "%g was provided for %s - valid range is %g to %g",
571
+ value, name_.c_str(), lowerDoubleValue_, upperDoubleValue_);
572
+ returnCode = 1;
573
+ } else {
574
+ sprintf(printArray, "%s was changed from %g to %g",
575
+ name_.c_str(), oldValue, value);
576
+ returnCode = 0;
577
+ doubleValue_ = value;
578
+ switch (type_) {
579
+ case CLP_PARAM_DBL_DUALTOLERANCE:
580
+ model->setDualTolerance(value);
581
+ break;
582
+ case CLP_PARAM_DBL_PRIMALTOLERANCE:
583
+ model->setPrimalTolerance(value);
584
+ break;
585
+ case CLP_PARAM_DBL_ZEROTOLERANCE:
586
+ model->setSmallElementValue(value);
587
+ break;
588
+ case CLP_PARAM_DBL_DUALBOUND:
589
+ model->setDualBound(value);
590
+ break;
591
+ case CLP_PARAM_DBL_PRIMALWEIGHT:
592
+ model->setInfeasibilityCost(value);
593
+ break;
594
+ #ifndef COIN_HAS_CBC
595
+ case CLP_PARAM_DBL_TIMELIMIT:
596
+ model->setMaximumSeconds(value);
597
+ break;
598
+ #endif
599
+ case CLP_PARAM_DBL_OBJSCALE:
600
+ model->setObjectiveScale(value);
601
+ break;
602
+ case CLP_PARAM_DBL_RHSSCALE:
603
+ model->setRhsScale(value);
604
+ break;
605
+ case CLP_PARAM_DBL_PRESOLVETOLERANCE:
606
+ model->setDblParam(ClpPresolveTolerance, value);
607
+ break;
608
+ default:
609
+ break;
610
+ }
611
+ }
612
+ return printArray;
613
+ }
614
+ double
615
+ CbcOrClpParam::doubleParameter (ClpSimplex * model) const
616
+ {
617
+ double value;
618
+ switch (type_) {
619
+ #ifndef COIN_HAS_CBC
620
+ case CLP_PARAM_DBL_DUALTOLERANCE:
621
+ value = model->dualTolerance();
622
+ break;
623
+ case CLP_PARAM_DBL_PRIMALTOLERANCE:
624
+ value = model->primalTolerance();
625
+ break;
626
+ #endif
627
+ case CLP_PARAM_DBL_ZEROTOLERANCE:
628
+ value = model->getSmallElementValue();
629
+ break;
630
+ case CLP_PARAM_DBL_DUALBOUND:
631
+ value = model->dualBound();
632
+ break;
633
+ case CLP_PARAM_DBL_PRIMALWEIGHT:
634
+ value = model->infeasibilityCost();
635
+ break;
636
+ #ifndef COIN_HAS_CBC
637
+ case CLP_PARAM_DBL_TIMELIMIT:
638
+ value = model->maximumSeconds();
639
+ break;
640
+ #endif
641
+ case CLP_PARAM_DBL_OBJSCALE:
642
+ value = model->objectiveScale();
643
+ break;
644
+ case CLP_PARAM_DBL_RHSSCALE:
645
+ value = model->rhsScale();
646
+ break;
647
+ default:
648
+ value = doubleValue_;
649
+ break;
650
+ }
651
+ return value;
652
+ }
653
+ int
654
+ CbcOrClpParam::setIntParameter (ClpSimplex * model, int value)
655
+ {
656
+ int returnCode;
657
+ setIntParameterWithMessage(model, value, returnCode);
658
+ if (doPrinting && strlen(printArray))
659
+ std::cout << printArray << std::endl;
660
+ return returnCode;
661
+ }
662
+ // Sets int parameter and returns printable string and error code
663
+ const char *
664
+ CbcOrClpParam::setIntParameterWithMessage ( ClpSimplex * model, int value , int & returnCode)
665
+ {
666
+ int oldValue = intValue_;
667
+ if (value < lowerIntValue_ || value > upperIntValue_) {
668
+ sprintf(printArray, "%d was provided for %s - valid range is %d to %d",
669
+ value, name_.c_str(), lowerIntValue_, upperIntValue_);
670
+ returnCode = 1;
671
+ } else {
672
+ intValue_ = value;
673
+ sprintf(printArray, "%s was changed from %d to %d",
674
+ name_.c_str(), oldValue, value);
675
+ returnCode = 0;
676
+ switch (type_) {
677
+ case CLP_PARAM_INT_SOLVERLOGLEVEL:
678
+ model->setLogLevel(value);
679
+ if (value > 2)
680
+ model->factorization()->messageLevel(8);
681
+ else
682
+ model->factorization()->messageLevel(0);
683
+ break;
684
+ case CLP_PARAM_INT_MAXFACTOR:
685
+ model->factorization()->maximumPivots(value);
686
+ break;
687
+ case CLP_PARAM_INT_PERTVALUE:
688
+ model->setPerturbation(value);
689
+ break;
690
+ case CLP_PARAM_INT_MAXITERATION:
691
+ model->setMaximumIterations(value);
692
+ break;
693
+ case CLP_PARAM_INT_SPECIALOPTIONS:
694
+ model->setSpecialOptions(value);
695
+ break;
696
+ case CLP_PARAM_INT_RANDOMSEED:
697
+ {
698
+ if (value==0) {
699
+ double time = fabs(CoinGetTimeOfDay());
700
+ while (time>=COIN_INT_MAX)
701
+ time *= 0.5;
702
+ value = static_cast<int>(time);
703
+ sprintf(printArray, "using time of day %s was changed from %d to %d",
704
+ name_.c_str(), oldValue, value);
705
+ }
706
+ model->setRandomSeed(value);
707
+ }
708
+ break;
709
+ case CLP_PARAM_INT_MORESPECIALOPTIONS:
710
+ model->setMoreSpecialOptions(value);
711
+ break;
712
+ #ifndef COIN_HAS_CBC
713
+ #ifdef CBC_THREAD
714
+ case CBC_PARAM_INT_THREADS:
715
+ model->setNumberThreads(value);
716
+ break;
717
+ #endif
718
+ #endif
719
+ default:
720
+ break;
721
+ }
722
+ }
723
+ return printArray;
724
+ }
725
+ int
726
+ CbcOrClpParam::intParameter (ClpSimplex * model) const
727
+ {
728
+ int value;
729
+ switch (type_) {
730
+ #ifndef COIN_HAS_CBC
731
+ case CLP_PARAM_INT_SOLVERLOGLEVEL:
732
+ value = model->logLevel();
733
+ break;
734
+ #endif
735
+ case CLP_PARAM_INT_MAXFACTOR:
736
+ value = model->factorization()->maximumPivots();
737
+ break;
738
+ break;
739
+ case CLP_PARAM_INT_PERTVALUE:
740
+ value = model->perturbation();
741
+ break;
742
+ case CLP_PARAM_INT_MAXITERATION:
743
+ value = model->maximumIterations();
744
+ break;
745
+ case CLP_PARAM_INT_SPECIALOPTIONS:
746
+ value = model->specialOptions();
747
+ break;
748
+ case CLP_PARAM_INT_RANDOMSEED:
749
+ value = model->randomNumberGenerator()->getSeed();
750
+ break;
751
+ case CLP_PARAM_INT_MORESPECIALOPTIONS:
752
+ value = model->moreSpecialOptions();
753
+ break;
754
+ #ifndef COIN_HAS_CBC
755
+ #ifdef CBC_THREAD
756
+ case CBC_PARAM_INT_THREADS:
757
+ value = model->numberThreads();
758
+ break;
759
+ #endif
760
+ #endif
761
+ default:
762
+ value = intValue_;
763
+ break;
764
+ }
765
+ return value;
766
+ }
767
+ #endif
768
+ int
769
+ CbcOrClpParam::checkDoubleParameter (double value) const
770
+ {
771
+ if (value < lowerDoubleValue_ || value > upperDoubleValue_) {
772
+ std::cout << value << " was provided for " << name_ <<
773
+ " - valid range is " << lowerDoubleValue_ << " to " <<
774
+ upperDoubleValue_ << std::endl;
775
+ return 1;
776
+ } else {
777
+ return 0;
778
+ }
779
+ }
780
+ #ifdef COIN_HAS_CBC
781
+ double
782
+ CbcOrClpParam::doubleParameter (OsiSolverInterface *
783
+ #ifndef NDEBUG
784
+ model
785
+ #endif
786
+ ) const
787
+ {
788
+ double value = 0.0;
789
+ switch (type_) {
790
+ case CLP_PARAM_DBL_DUALTOLERANCE:
791
+ assert(model->getDblParam(OsiDualTolerance, value));
792
+ break;
793
+ case CLP_PARAM_DBL_PRIMALTOLERANCE:
794
+ assert(model->getDblParam(OsiPrimalTolerance, value));
795
+ break;
796
+ default:
797
+ return doubleValue_;
798
+ break;
799
+ }
800
+ return value;
801
+ }
802
+ int
803
+ CbcOrClpParam::setIntParameter (OsiSolverInterface * model, int value)
804
+ {
805
+ int returnCode;
806
+ setIntParameterWithMessage(model, value, returnCode);
807
+ if (doPrinting && strlen(printArray))
808
+ std::cout << printArray << std::endl;
809
+ return returnCode;
810
+ }
811
+ // Sets int parameter and returns printable string and error code
812
+ const char *
813
+ CbcOrClpParam::setIntParameterWithMessage ( OsiSolverInterface * model, int value , int & returnCode)
814
+ {
815
+ if (value < lowerIntValue_ || value > upperIntValue_) {
816
+ sprintf(printArray, "%d was provided for %s - valid range is %d to %d",
817
+ value, name_.c_str(), lowerIntValue_, upperIntValue_);
818
+ returnCode = 1;
819
+ } else {
820
+ int oldValue = intValue_;
821
+ intValue_ = oldValue;
822
+ switch (type_) {
823
+ case CLP_PARAM_INT_SOLVERLOGLEVEL:
824
+ model->messageHandler()->setLogLevel(value);
825
+ break;
826
+ default:
827
+ break;
828
+ }
829
+ sprintf(printArray, "%s was changed from %d to %d",
830
+ name_.c_str(), oldValue, value);
831
+ returnCode = 0;
832
+ }
833
+ return printArray;
834
+ }
835
+ int
836
+ CbcOrClpParam::intParameter (OsiSolverInterface * model) const
837
+ {
838
+ int value = 0;
839
+ switch (type_) {
840
+ case CLP_PARAM_INT_SOLVERLOGLEVEL:
841
+ value = model->messageHandler()->logLevel();
842
+ break;
843
+ default:
844
+ value = intValue_;
845
+ break;
846
+ }
847
+ return value;
848
+ }
849
+ int
850
+ CbcOrClpParam::setDoubleParameter (CbcModel &model, double value)
851
+ {
852
+ int returnCode=0;
853
+ setDoubleParameterWithMessage(model, value, returnCode);
854
+ if (doPrinting && strlen(printArray))
855
+ std::cout << printArray << std::endl;
856
+ return returnCode;
857
+ }
858
+ // Sets double parameter and returns printable string and error code
859
+ const char *
860
+ CbcOrClpParam::setDoubleParameterWithMessage ( CbcModel & model, double value , int & returnCode)
861
+ {
862
+ if (value < lowerDoubleValue_ || value > upperDoubleValue_) {
863
+ sprintf(printArray, "%g was provided for %s - valid range is %g to %g",
864
+ value, name_.c_str(), lowerDoubleValue_, upperDoubleValue_);
865
+ returnCode = 1;
866
+ } else {
867
+ double oldValue = doubleValue_;
868
+ doubleValue_ = value;
869
+ switch (type_) {
870
+ case CBC_PARAM_DBL_INFEASIBILITYWEIGHT:
871
+ oldValue = model.getDblParam(CbcModel::CbcInfeasibilityWeight);
872
+ model.setDblParam(CbcModel::CbcInfeasibilityWeight, value);
873
+ break;
874
+ case CBC_PARAM_DBL_INTEGERTOLERANCE:
875
+ oldValue = model.getDblParam(CbcModel::CbcIntegerTolerance);
876
+ model.setDblParam(CbcModel::CbcIntegerTolerance, value);
877
+ break;
878
+ case CBC_PARAM_DBL_INCREMENT:
879
+ oldValue = model.getDblParam(CbcModel::CbcCutoffIncrement);
880
+ model.setDblParam(CbcModel::CbcCutoffIncrement, value);
881
+ case CBC_PARAM_DBL_ALLOWABLEGAP:
882
+ oldValue = model.getDblParam(CbcModel::CbcAllowableGap);
883
+ model.setDblParam(CbcModel::CbcAllowableGap, value);
884
+ break;
885
+ case CBC_PARAM_DBL_GAPRATIO:
886
+ oldValue = model.getDblParam(CbcModel::CbcAllowableFractionGap);
887
+ model.setDblParam(CbcModel::CbcAllowableFractionGap, value);
888
+ break;
889
+ case CBC_PARAM_DBL_CUTOFF:
890
+ oldValue = model.getCutoff();
891
+ model.setCutoff(value);
892
+ break;
893
+ case CBC_PARAM_DBL_TIMELIMIT_BAB:
894
+ oldValue = model.getDblParam(CbcModel::CbcMaximumSeconds) ;
895
+ {
896
+ //OsiClpSolverInterface * clpSolver = dynamic_cast< OsiClpSolverInterface*> (model.solver());
897
+ //ClpSimplex * lpSolver = clpSolver->getModelPtr();
898
+ //lpSolver->setMaximumSeconds(value);
899
+ model.setDblParam(CbcModel::CbcMaximumSeconds, value) ;
900
+ }
901
+ break ;
902
+ case CLP_PARAM_DBL_DUALTOLERANCE:
903
+ case CLP_PARAM_DBL_PRIMALTOLERANCE:
904
+ setDoubleParameter(model.solver(), value);
905
+ return 0; // to avoid message
906
+ default:
907
+ break;
908
+ }
909
+ sprintf(printArray, "%s was changed from %g to %g",
910
+ name_.c_str(), oldValue, value);
911
+ returnCode = 0;
912
+ }
913
+ return printArray;
914
+ }
915
+ double
916
+ CbcOrClpParam::doubleParameter (CbcModel &model) const
917
+ {
918
+ double value;
919
+ switch (type_) {
920
+ case CBC_PARAM_DBL_INFEASIBILITYWEIGHT:
921
+ value = model.getDblParam(CbcModel::CbcInfeasibilityWeight);
922
+ break;
923
+ case CBC_PARAM_DBL_INTEGERTOLERANCE:
924
+ value = model.getDblParam(CbcModel::CbcIntegerTolerance);
925
+ break;
926
+ case CBC_PARAM_DBL_INCREMENT:
927
+ value = model.getDblParam(CbcModel::CbcCutoffIncrement);
928
+ break;
929
+ case CBC_PARAM_DBL_ALLOWABLEGAP:
930
+ value = model.getDblParam(CbcModel::CbcAllowableGap);
931
+ break;
932
+ case CBC_PARAM_DBL_GAPRATIO:
933
+ value = model.getDblParam(CbcModel::CbcAllowableFractionGap);
934
+ break;
935
+ case CBC_PARAM_DBL_CUTOFF:
936
+ value = model.getCutoff();
937
+ break;
938
+ case CBC_PARAM_DBL_TIMELIMIT_BAB:
939
+ value = model.getDblParam(CbcModel::CbcMaximumSeconds) ;
940
+ break ;
941
+ case CLP_PARAM_DBL_DUALTOLERANCE:
942
+ case CLP_PARAM_DBL_PRIMALTOLERANCE:
943
+ value = doubleParameter(model.solver());
944
+ break;
945
+ default:
946
+ value = doubleValue_;
947
+ break;
948
+ }
949
+ return value;
950
+ }
951
+ int
952
+ CbcOrClpParam::setIntParameter (CbcModel &model, int value)
953
+ {
954
+ int returnCode;
955
+ setIntParameterWithMessage(model, value, returnCode);
956
+ if (doPrinting && strlen(printArray))
957
+ std::cout << printArray << std::endl;
958
+ return returnCode;
959
+ }
960
+ // Sets int parameter and returns printable string and error code
961
+ const char *
962
+ CbcOrClpParam::setIntParameterWithMessage ( CbcModel & model, int value , int & returnCode)
963
+ {
964
+ if (value < lowerIntValue_ || value > upperIntValue_) {
965
+ sprintf(printArray, "%d was provided for %s - valid range is %d to %d",
966
+ value, name_.c_str(), lowerIntValue_, upperIntValue_);
967
+ returnCode = 1;
968
+ } else {
969
+ printArray[0] = '\0';
970
+ if (value==intValue_)
971
+ return printArray;
972
+ int oldValue = intValue_;
973
+ intValue_ = value;
974
+ switch (type_) {
975
+ case CLP_PARAM_INT_LOGLEVEL:
976
+ oldValue = model.messageHandler()->logLevel();
977
+ model.messageHandler()->setLogLevel(CoinAbs(value));
978
+ break;
979
+ case CLP_PARAM_INT_SOLVERLOGLEVEL:
980
+ oldValue = model.solver()->messageHandler()->logLevel();
981
+ model.solver()->messageHandler()->setLogLevel(value);
982
+ break;
983
+ case CBC_PARAM_INT_MAXNODES:
984
+ oldValue = model.getIntParam(CbcModel::CbcMaxNumNode);
985
+ model.setIntParam(CbcModel::CbcMaxNumNode, value);
986
+ break;
987
+ case CBC_PARAM_INT_MAXSOLS:
988
+ oldValue = model.getIntParam(CbcModel::CbcMaxNumSol);
989
+ model.setIntParam(CbcModel::CbcMaxNumSol, value);
990
+ break;
991
+ case CBC_PARAM_INT_MAXSAVEDSOLS:
992
+ oldValue = model.maximumSavedSolutions();
993
+ model.setMaximumSavedSolutions(value);
994
+ break;
995
+ case CBC_PARAM_INT_STRONGBRANCHING:
996
+ oldValue = model.numberStrong();
997
+ model.setNumberStrong(value);
998
+ break;
999
+ case CBC_PARAM_INT_NUMBERBEFORE:
1000
+ oldValue = model.numberBeforeTrust();
1001
+ model.setNumberBeforeTrust(value);
1002
+ break;
1003
+ case CBC_PARAM_INT_NUMBERANALYZE:
1004
+ oldValue = model.numberAnalyzeIterations();
1005
+ model.setNumberAnalyzeIterations(value);
1006
+ break;
1007
+ case CBC_PARAM_INT_CUTPASSINTREE:
1008
+ oldValue = model.getMaximumCutPasses();
1009
+ model.setMaximumCutPasses(value);
1010
+ break;
1011
+ case CBC_PARAM_INT_CUTPASS:
1012
+ oldValue = model.getMaximumCutPassesAtRoot();
1013
+ model.setMaximumCutPassesAtRoot(value);
1014
+ break;
1015
+ #ifdef COIN_HAS_CBC
1016
+ #ifdef CBC_THREAD
1017
+ case CBC_PARAM_INT_THREADS:
1018
+ oldValue = model.getNumberThreads();
1019
+ model.setNumberThreads(value);
1020
+ break;
1021
+ #endif
1022
+ case CBC_PARAM_INT_RANDOMSEED:
1023
+ oldValue = model.getRandomSeed();
1024
+ model.setRandomSeed(value);
1025
+ break;
1026
+ #endif
1027
+ default:
1028
+ break;
1029
+ }
1030
+ sprintf(printArray, "%s was changed from %d to %d",
1031
+ name_.c_str(), oldValue, value);
1032
+ returnCode = 0;
1033
+ }
1034
+ return printArray;
1035
+ }
1036
+ int
1037
+ CbcOrClpParam::intParameter (CbcModel &model) const
1038
+ {
1039
+ int value;
1040
+ switch (type_) {
1041
+ case CLP_PARAM_INT_LOGLEVEL:
1042
+ value = model.messageHandler()->logLevel();
1043
+ break;
1044
+ case CLP_PARAM_INT_SOLVERLOGLEVEL:
1045
+ value = model.solver()->messageHandler()->logLevel();
1046
+ break;
1047
+ case CBC_PARAM_INT_MAXNODES:
1048
+ value = model.getIntParam(CbcModel::CbcMaxNumNode);
1049
+ break;
1050
+ case CBC_PARAM_INT_MAXSOLS:
1051
+ value = model.getIntParam(CbcModel::CbcMaxNumSol);
1052
+ break;
1053
+ case CBC_PARAM_INT_MAXSAVEDSOLS:
1054
+ value = model.maximumSavedSolutions();
1055
+ break;
1056
+ case CBC_PARAM_INT_STRONGBRANCHING:
1057
+ value = model.numberStrong();
1058
+ break;
1059
+ case CBC_PARAM_INT_NUMBERBEFORE:
1060
+ value = model.numberBeforeTrust();
1061
+ break;
1062
+ case CBC_PARAM_INT_NUMBERANALYZE:
1063
+ value = model.numberAnalyzeIterations();
1064
+ break;
1065
+ case CBC_PARAM_INT_CUTPASSINTREE:
1066
+ value = model.getMaximumCutPasses();
1067
+ break;
1068
+ case CBC_PARAM_INT_CUTPASS:
1069
+ value = model.getMaximumCutPassesAtRoot();
1070
+ break;
1071
+ #ifdef COIN_HAS_CBC
1072
+ #ifdef CBC_THREAD
1073
+ case CBC_PARAM_INT_THREADS:
1074
+ value = model.getNumberThreads();
1075
+ #endif
1076
+ case CBC_PARAM_INT_RANDOMSEED:
1077
+ value = model.getRandomSeed();
1078
+ break;
1079
+ #endif
1080
+ default:
1081
+ value = intValue_;
1082
+ break;
1083
+ }
1084
+ return value;
1085
+ }
1086
+ #endif
1087
+ // Sets current parameter option using string
1088
+ void
1089
+ CbcOrClpParam::setCurrentOption ( const std::string value )
1090
+ {
1091
+ int action = parameterOption(value);
1092
+ if (action >= 0)
1093
+ currentKeyWord_ = action;
1094
+ #if FLUSH_PRINT_BUFFER > 2
1095
+ if (name_=="bufferedMode")
1096
+ coinFlushBufferFlag=action;
1097
+ #endif
1098
+ }
1099
+ // Sets current parameter option
1100
+ void
1101
+ CbcOrClpParam::setCurrentOption ( int value , bool printIt)
1102
+ {
1103
+ if (printIt && value != currentKeyWord_)
1104
+ std::cout << "Option for " << name_ << " changed from "
1105
+ << definedKeyWords_[currentKeyWord_] << " to "
1106
+ << definedKeyWords_[value] << std::endl;
1107
+
1108
+ #if FLUSH_PRINT_BUFFER > 2
1109
+ if (name_=="bufferedMode")
1110
+ coinFlushBufferFlag=value;
1111
+ #endif
1112
+ currentKeyWord_ = value;
1113
+ }
1114
+ // Sets current parameter option and returns printable string
1115
+ const char *
1116
+ CbcOrClpParam::setCurrentOptionWithMessage ( int value )
1117
+ {
1118
+ if (value != currentKeyWord_) {
1119
+ char current[100];
1120
+ char newString[100];
1121
+ if (currentKeyWord_>=0&&(fakeKeyWord_<=0||currentKeyWord_<fakeKeyWord_))
1122
+ strcpy(current,definedKeyWords_[currentKeyWord_].c_str());
1123
+ else if (currentKeyWord_<0)
1124
+ sprintf(current,"minus%d",-currentKeyWord_-1000);
1125
+ else
1126
+ sprintf(current,"plus%d",currentKeyWord_-1000);
1127
+ if (value>=0&&(fakeKeyWord_<=0||value<fakeKeyWord_) )
1128
+ strcpy(newString,definedKeyWords_[value].c_str());
1129
+ else if (value<0)
1130
+ sprintf(newString,"minus%d",-value-1000);
1131
+ else
1132
+ sprintf(newString,"plus%d",value-1000);
1133
+ sprintf(printArray, "Option for %s changed from %s to %s",
1134
+ name_.c_str(), current, newString);
1135
+ #if FLUSH_PRINT_BUFFER > 2
1136
+ if (name_=="bufferedMode")
1137
+ coinFlushBufferFlag=value;
1138
+ #endif
1139
+ currentKeyWord_ = value;
1140
+ } else {
1141
+ printArray[0] = '\0';
1142
+ }
1143
+ return printArray;
1144
+ }
1145
+ // Sets current parameter option using string with message
1146
+ const char *
1147
+ CbcOrClpParam::setCurrentOptionWithMessage ( const std::string value )
1148
+ {
1149
+ int action = parameterOption(value);
1150
+ char current[100];
1151
+ printArray[0] = '\0';
1152
+ if (action >= 0) {
1153
+ #if FLUSH_PRINT_BUFFER > 2
1154
+ if (name_=="bufferedMode")
1155
+ coinFlushBufferFlag=action;
1156
+ #endif
1157
+ if (action == currentKeyWord_)
1158
+ return NULL;
1159
+ if (currentKeyWord_>=0&&(fakeKeyWord_<=0||currentKeyWord_<fakeKeyWord_))
1160
+ strcpy(current,definedKeyWords_[currentKeyWord_].c_str());
1161
+ else if (currentKeyWord_<0)
1162
+ sprintf(current,"minus%d",-currentKeyWord_-1000);
1163
+ else
1164
+ sprintf(current,"plus%d",currentKeyWord_-1000);
1165
+ sprintf(printArray, "Option for %s changed from %s to %s",
1166
+ name_.c_str(), current, value.c_str());
1167
+ currentKeyWord_ = action;
1168
+ } else {
1169
+ sprintf(printArray, "Option for %s given illegal value %s",
1170
+ name_.c_str(), value.c_str());
1171
+ }
1172
+ return printArray;
1173
+ }
1174
+ void
1175
+ CbcOrClpParam::setIntValue ( int value )
1176
+ {
1177
+ if (value < lowerIntValue_ || value > upperIntValue_) {
1178
+ std::cout << value << " was provided for " << name_ <<
1179
+ " - valid range is " << lowerIntValue_ << " to " <<
1180
+ upperIntValue_ << std::endl;
1181
+ } else {
1182
+ intValue_ = value;
1183
+ }
1184
+ }
1185
+ const char *
1186
+ CbcOrClpParam::setIntValueWithMessage ( int value )
1187
+ {
1188
+ printArray[0] = '\0';
1189
+ if (value < lowerIntValue_ || value > upperIntValue_) {
1190
+ sprintf(printArray, "%d was provided for %s - valid range is %d to %d",
1191
+ value,name_.c_str(),lowerIntValue_,upperIntValue_);
1192
+ } else {
1193
+ if (value==intValue_)
1194
+ return NULL;
1195
+ sprintf(printArray, "%s was changed from %d to %d",
1196
+ name_.c_str(), intValue_, value);
1197
+ intValue_ = value;
1198
+ }
1199
+ return printArray;
1200
+ }
1201
+ void
1202
+ CbcOrClpParam::setDoubleValue ( double value )
1203
+ {
1204
+ if (value < lowerDoubleValue_ || value > upperDoubleValue_) {
1205
+ std::cout << value << " was provided for " << name_ <<
1206
+ " - valid range is " << lowerDoubleValue_ << " to " <<
1207
+ upperDoubleValue_ << std::endl;
1208
+ } else {
1209
+ doubleValue_ = value;
1210
+ }
1211
+ }
1212
+ const char *
1213
+ CbcOrClpParam::setDoubleValueWithMessage ( double value )
1214
+ {
1215
+ printArray[0] = '\0';
1216
+ if (value < lowerDoubleValue_ || value > upperDoubleValue_) {
1217
+ sprintf(printArray, "%g was provided for %s - valid range is %g to %g",
1218
+ value,name_.c_str(),lowerDoubleValue_,upperDoubleValue_);
1219
+ } else {
1220
+ if (value==doubleValue_)
1221
+ return NULL;
1222
+ sprintf(printArray, "%s was changed from %g to %g",
1223
+ name_.c_str(), doubleValue_, value);
1224
+ doubleValue_ = value;
1225
+ }
1226
+ return printArray;
1227
+ }
1228
+ void
1229
+ CbcOrClpParam::setStringValue ( std::string value )
1230
+ {
1231
+ stringValue_ = value;
1232
+ }
1233
+ static char line[1000];
1234
+ static char * where = NULL;
1235
+ extern int CbcOrClpRead_mode;
1236
+ int CbcOrClpEnvironmentIndex = -1;
1237
+ static size_t fillEnv()
1238
+ {
1239
+ #if defined(_MSC_VER) || defined(__MSVCRT__)
1240
+ return 0;
1241
+ #else
1242
+ // Don't think it will work on Windows
1243
+ char * environ = getenv("CBC_CLP_ENVIRONMENT");
1244
+ size_t length = 0;
1245
+ if (environ) {
1246
+ length = strlen(environ);
1247
+ if (CbcOrClpEnvironmentIndex < static_cast<int>(length)) {
1248
+ // find next non blank
1249
+ char * whereEnv = environ + CbcOrClpEnvironmentIndex;
1250
+ // munch white space
1251
+ while (*whereEnv == ' ' || *whereEnv == '\t' || *whereEnv < ' ')
1252
+ whereEnv++;
1253
+ // copy
1254
+ char * put = line;
1255
+ while ( *whereEnv != '\0' ) {
1256
+ if ( *whereEnv == ' ' || *whereEnv == '\t' || *whereEnv < ' ' ) {
1257
+ break;
1258
+ }
1259
+ *put = *whereEnv;
1260
+ put++;
1261
+ assert (put - line < 1000);
1262
+ whereEnv++;
1263
+ }
1264
+ CbcOrClpEnvironmentIndex = static_cast<int>(whereEnv - environ);
1265
+ *put = '\0';
1266
+ length = strlen(line);
1267
+ } else {
1268
+ length = 0;
1269
+ }
1270
+ }
1271
+ if (!length)
1272
+ CbcOrClpEnvironmentIndex = -1;
1273
+ return length;
1274
+ #endif
1275
+ }
1276
+ extern FILE * CbcOrClpReadCommand;
1277
+ // Simple read stuff
1278
+ std::string
1279
+ CoinReadNextField()
1280
+ {
1281
+ std::string field;
1282
+ if (!where) {
1283
+ // need new line
1284
+ #ifdef COIN_HAS_READLINE
1285
+ if (CbcOrClpReadCommand == stdin) {
1286
+ // Get a line from the user.
1287
+ where = readline (coin_prompt);
1288
+
1289
+ // If the line has any text in it, save it on the history.
1290
+ if (where) {
1291
+ if ( *where)
1292
+ add_history (where);
1293
+ strcpy(line, where);
1294
+ free(where);
1295
+ }
1296
+ } else {
1297
+ where = fgets(line, 1000, CbcOrClpReadCommand);
1298
+ }
1299
+ #else
1300
+ if (CbcOrClpReadCommand == stdin) {
1301
+ fputs(coin_prompt,stdout);
1302
+ fflush(stdout);
1303
+ }
1304
+ where = fgets(line, 1000, CbcOrClpReadCommand);
1305
+ #endif
1306
+ if (!where)
1307
+ return field; // EOF
1308
+ where = line;
1309
+ // clean image
1310
+ char * lastNonBlank = line - 1;
1311
+ while ( *where != '\0' ) {
1312
+ if ( *where != '\t' && *where < ' ' ) {
1313
+ break;
1314
+ } else if ( *where != '\t' && *where != ' ') {
1315
+ lastNonBlank = where;
1316
+ }
1317
+ where++;
1318
+ }
1319
+ where = line;
1320
+ *(lastNonBlank + 1) = '\0';
1321
+ }
1322
+ // munch white space
1323
+ while (*where == ' ' || *where == '\t')
1324
+ where++;
1325
+ char * saveWhere = where;
1326
+ while (*where != ' ' && *where != '\t' && *where != '\0')
1327
+ where++;
1328
+ if (where != saveWhere) {
1329
+ char save = *where;
1330
+ *where = '\0';
1331
+ //convert to string
1332
+ field = saveWhere;
1333
+ *where = save;
1334
+ } else {
1335
+ where = NULL;
1336
+ field = "EOL";
1337
+ }
1338
+ return field;
1339
+ }
1340
+
1341
+ std::string
1342
+ CoinReadGetCommand(int argc, const char *argv[])
1343
+ {
1344
+ std::string field = "EOL";
1345
+ // say no =
1346
+ afterEquals = "";
1347
+ while (field == "EOL") {
1348
+ if (CbcOrClpRead_mode > 0) {
1349
+ if ((CbcOrClpRead_mode < argc && argv[CbcOrClpRead_mode]) ||
1350
+ CbcOrClpEnvironmentIndex >= 0) {
1351
+ if (CbcOrClpEnvironmentIndex < 0) {
1352
+ field = argv[CbcOrClpRead_mode++];
1353
+ } else {
1354
+ if (fillEnv()) {
1355
+ field = line;
1356
+ } else {
1357
+ // not there
1358
+ continue;
1359
+ }
1360
+ }
1361
+ if (field == "-") {
1362
+ std::cout << "Switching to line mode" << std::endl;
1363
+ CbcOrClpRead_mode = -1;
1364
+ field = CoinReadNextField();
1365
+ } else if (field[0] != '-') {
1366
+ if (CbcOrClpRead_mode != 2) {
1367
+ // now allow std::cout<<"skipping non-command "<<field<<std::endl;
1368
+ // field="EOL"; // skip
1369
+ } else if (CbcOrClpEnvironmentIndex < 0) {
1370
+ // special dispensation - taken as -import name
1371
+ CbcOrClpRead_mode--;
1372
+ field = "import";
1373
+ }
1374
+ } else {
1375
+ if (field != "--") {
1376
+ // take off -
1377
+ field = field.substr(1);
1378
+ } else {
1379
+ // special dispensation - taken as -import --
1380
+ CbcOrClpRead_mode--;
1381
+ field = "import";
1382
+ }
1383
+ }
1384
+ } else {
1385
+ field = "";
1386
+ }
1387
+ } else {
1388
+ field = CoinReadNextField();
1389
+ }
1390
+ }
1391
+ // if = then modify and save
1392
+ std::string::size_type found = field.find('=');
1393
+ if (found != std::string::npos) {
1394
+ afterEquals = field.substr(found + 1);
1395
+ field = field.substr(0, found);
1396
+ }
1397
+ //std::cout<<field<<std::endl;
1398
+ return field;
1399
+ }
1400
+ std::string
1401
+ CoinReadGetString(int argc, const char *argv[])
1402
+ {
1403
+ std::string field = "EOL";
1404
+ if (afterEquals == "") {
1405
+ if (CbcOrClpRead_mode > 0) {
1406
+ if (CbcOrClpRead_mode < argc || CbcOrClpEnvironmentIndex >= 0) {
1407
+ if (CbcOrClpEnvironmentIndex < 0) {
1408
+ if (argv[CbcOrClpRead_mode][0] != '-') {
1409
+ field = argv[CbcOrClpRead_mode++];
1410
+ } else if (!strcmp(argv[CbcOrClpRead_mode], "--")) {
1411
+ field = argv[CbcOrClpRead_mode++];
1412
+ // -- means import from stdin
1413
+ field = "-";
1414
+ }
1415
+ } else {
1416
+ fillEnv();
1417
+ field = line;
1418
+ }
1419
+ }
1420
+ } else {
1421
+ field = CoinReadNextField();
1422
+ }
1423
+ } else {
1424
+ field = afterEquals;
1425
+ afterEquals = "";
1426
+ }
1427
+ //std::cout<<field<<std::endl;
1428
+ return field;
1429
+ }
1430
+ // valid 0 - okay, 1 bad, 2 not there
1431
+ int
1432
+ CoinReadGetIntField(int argc, const char *argv[], int * valid)
1433
+ {
1434
+ std::string field = "EOL";
1435
+ if (afterEquals == "") {
1436
+ if (CbcOrClpRead_mode > 0) {
1437
+ if (CbcOrClpRead_mode < argc || CbcOrClpEnvironmentIndex >= 0) {
1438
+ if (CbcOrClpEnvironmentIndex < 0) {
1439
+ // may be negative value so do not check for -
1440
+ field = argv[CbcOrClpRead_mode++];
1441
+ } else {
1442
+ fillEnv();
1443
+ field = line;
1444
+ }
1445
+ }
1446
+ } else {
1447
+ field = CoinReadNextField();
1448
+ }
1449
+ } else {
1450
+ field = afterEquals;
1451
+ afterEquals = "";
1452
+ }
1453
+ long int value = 0;
1454
+ //std::cout<<field<<std::endl;
1455
+ if (field != "EOL") {
1456
+ const char * start = field.c_str();
1457
+ char * endPointer = NULL;
1458
+ // check valid
1459
+ value = strtol(start, &endPointer, 10);
1460
+ if (*endPointer == '\0') {
1461
+ *valid = 0;
1462
+ } else {
1463
+ *valid = 1;
1464
+ std::cout << "String of " << field;
1465
+ }
1466
+ } else {
1467
+ *valid = 2;
1468
+ }
1469
+ return static_cast<int>(value);
1470
+ }
1471
+ double
1472
+ CoinReadGetDoubleField(int argc, const char *argv[], int * valid)
1473
+ {
1474
+ std::string field = "EOL";
1475
+ if (afterEquals == "") {
1476
+ if (CbcOrClpRead_mode > 0) {
1477
+ if (CbcOrClpRead_mode < argc || CbcOrClpEnvironmentIndex >= 0) {
1478
+ if (CbcOrClpEnvironmentIndex < 0) {
1479
+ // may be negative value so do not check for -
1480
+ field = argv[CbcOrClpRead_mode++];
1481
+ } else {
1482
+ fillEnv();
1483
+ field = line;
1484
+ }
1485
+ }
1486
+ } else {
1487
+ field = CoinReadNextField();
1488
+ }
1489
+ } else {
1490
+ field = afterEquals;
1491
+ afterEquals = "";
1492
+ }
1493
+ double value = 0.0;
1494
+ //std::cout<<field<<std::endl;
1495
+ if (field != "EOL") {
1496
+ const char * start = field.c_str();
1497
+ char * endPointer = NULL;
1498
+ // check valid
1499
+ value = strtod(start, &endPointer);
1500
+ if (*endPointer == '\0') {
1501
+ *valid = 0;
1502
+ } else {
1503
+ *valid = 1;
1504
+ std::cout << "String of " << field;
1505
+ }
1506
+ } else {
1507
+ *valid = 2;
1508
+ }
1509
+ return value;
1510
+ }
1511
+ /*
1512
+ Subroutine to establish the cbc parameter array. See the description of
1513
+ class CbcOrClpParam for details. Pulled from C..Main() for clarity.
1514
+ */
1515
+ void
1516
+ establishParams (int &numberParameters, CbcOrClpParam *const parameters)
1517
+ {
1518
+ numberParameters = 0;
1519
+ parameters[numberParameters++] =
1520
+ CbcOrClpParam("?", "For help", CBC_PARAM_GENERALQUERY, 7, 0);
1521
+ parameters[numberParameters++] =
1522
+ CbcOrClpParam("???", "For help", CBC_PARAM_FULLGENERALQUERY, 7, 0);
1523
+ parameters[numberParameters++] =
1524
+ CbcOrClpParam("-", "From stdin",
1525
+ CLP_PARAM_ACTION_STDIN, 3, 0);
1526
+ #ifdef ABC_INHERIT
1527
+ parameters[numberParameters++] =
1528
+ CbcOrClpParam("abc", "Whether to visit Aboca",
1529
+ "off", CLP_PARAM_STR_ABCWANTED, 7, 0);
1530
+ parameters[numberParameters-1].append("one");
1531
+ parameters[numberParameters-1].append("two");
1532
+ parameters[numberParameters-1].append("three");
1533
+ parameters[numberParameters-1].append("four");
1534
+ parameters[numberParameters-1].append("five");
1535
+ parameters[numberParameters-1].append("six");
1536
+ parameters[numberParameters-1].append("seven");
1537
+ parameters[numberParameters-1].append("eight");
1538
+ parameters[numberParameters-1].append("on");
1539
+ parameters[numberParameters-1].append("decide");
1540
+ parameters[numberParameters-1].setFakeKeyWord(10);
1541
+ parameters[numberParameters-1].setLonghelp
1542
+ (
1543
+ "Decide whether to use A Basic Optimization Code (Accelerated?) \
1544
+ and whether to try going parallel!"
1545
+ );
1546
+ #endif
1547
+ parameters[numberParameters++] =
1548
+ CbcOrClpParam("allC!ommands", "Whether to print less used commands",
1549
+ "no", CLP_PARAM_STR_ALLCOMMANDS);
1550
+ parameters[numberParameters-1].append("more");
1551
+ parameters[numberParameters-1].append("all");
1552
+ parameters[numberParameters-1].setLonghelp
1553
+ (
1554
+ "For the sake of your sanity, only the more useful and simple commands \
1555
+ are printed out on ?."
1556
+ );
1557
+ #ifdef COIN_HAS_CBC
1558
+ parameters[numberParameters++] =
1559
+ CbcOrClpParam("allow!ableGap", "Stop when gap between best possible and \
1560
+ best less than this",
1561
+ 0.0, 1.0e20, CBC_PARAM_DBL_ALLOWABLEGAP);
1562
+ parameters[numberParameters-1].setDoubleValue(0.0);
1563
+ parameters[numberParameters-1].setLonghelp
1564
+ (
1565
+ "If the gap between best solution and best possible solution is less than this \
1566
+ then the search will be terminated. Also see ratioGap."
1567
+ );
1568
+ #endif
1569
+ #ifdef COIN_HAS_CLP
1570
+ parameters[numberParameters++] =
1571
+ CbcOrClpParam("allS!lack", "Set basis back to all slack and reset solution",
1572
+ CLP_PARAM_ACTION_ALLSLACK, 3);
1573
+ parameters[numberParameters-1].setLonghelp
1574
+ (
1575
+ "Mainly useful for tuning purposes. Normally the first dual or primal will be using an all slack \
1576
+ basis anyway."
1577
+ );
1578
+ #endif
1579
+ #ifdef COIN_HAS_CBC
1580
+ parameters[numberParameters++] =
1581
+ CbcOrClpParam("artif!icialCost", "Costs >= this treated as artificials in feasibility pump",
1582
+ 0.0, COIN_DBL_MAX, CBC_PARAM_DBL_ARTIFICIALCOST, 1);
1583
+ parameters[numberParameters-1].setDoubleValue(0.0);
1584
+ parameters[numberParameters-1].setLonghelp
1585
+ (
1586
+ "0.0 off - otherwise variables with costs >= this are treated as artificials and fixed to lower bound in feasibility pump"
1587
+ );
1588
+ #endif
1589
+ #ifdef COIN_HAS_CLP
1590
+ parameters[numberParameters++] =
1591
+ CbcOrClpParam("auto!Scale", "Whether to scale objective, rhs and bounds of problem if they look odd",
1592
+ "off", CLP_PARAM_STR_AUTOSCALE, 7, 0);
1593
+ parameters[numberParameters-1].append("on");
1594
+ parameters[numberParameters-1].setLonghelp
1595
+ (
1596
+ "If you think you may get odd objective values or large equality rows etc then\
1597
+ it may be worth setting this true. It is still experimental and you may prefer\
1598
+ to use objective!Scale and rhs!Scale."
1599
+ );
1600
+ parameters[numberParameters++] =
1601
+ CbcOrClpParam("barr!ier", "Solve using primal dual predictor corrector algorithm",
1602
+ CLP_PARAM_ACTION_BARRIER);
1603
+ parameters[numberParameters-1].setLonghelp
1604
+ (
1605
+ "This command solves the current model using the primal dual predictor \
1606
+ corrector algorithm. You may want to link in an alternative \
1607
+ ordering and factorization. It will also solve models \
1608
+ with quadratic objectives."
1609
+
1610
+ );
1611
+ parameters[numberParameters++] =
1612
+ CbcOrClpParam("basisI!n", "Import basis from bas file",
1613
+ CLP_PARAM_ACTION_BASISIN, 3);
1614
+ parameters[numberParameters-1].setLonghelp
1615
+ (
1616
+ "This will read an MPS format basis file from the given file name. It will use the default\
1617
+ directory given by 'directory'. A name of '$' will use the previous value for the name. This\
1618
+ is initialized to '', i.e. it must be set. If you have libz then it can read compressed\
1619
+ files 'xxxxxxxx.gz' or xxxxxxxx.bz2."
1620
+ );
1621
+ parameters[numberParameters++] =
1622
+ CbcOrClpParam("basisO!ut", "Export basis as bas file",
1623
+ CLP_PARAM_ACTION_BASISOUT);
1624
+ parameters[numberParameters-1].setLonghelp
1625
+ (
1626
+ "This will write an MPS format basis file to the given file name. It will use the default\
1627
+ directory given by 'directory'. A name of '$' will use the previous value for the name. This\
1628
+ is initialized to 'default.bas'."
1629
+ );
1630
+ parameters[numberParameters++] =
1631
+ CbcOrClpParam("biasLU", "Whether factorization biased towards U",
1632
+ "UU", CLP_PARAM_STR_BIASLU, 2, 0);
1633
+ parameters[numberParameters-1].append("UX");
1634
+ parameters[numberParameters-1].append("LX");
1635
+ parameters[numberParameters-1].append("LL");
1636
+ parameters[numberParameters-1].setCurrentOption("LX");
1637
+ #endif
1638
+ #ifdef COIN_HAS_CBC
1639
+ parameters[numberParameters++] =
1640
+ CbcOrClpParam("branch!AndCut", "Do Branch and Cut",
1641
+ CBC_PARAM_ACTION_BAB);
1642
+ parameters[numberParameters-1].setLonghelp
1643
+ (
1644
+ "This does branch and cut. There are many parameters which can affect the performance. \
1645
+ First just try with default settings and look carefully at the log file. Did cuts help? Did they take too long? \
1646
+ Look at output to see which cuts were effective and then do some tuning. You will see that the \
1647
+ options for cuts are off, on, root and ifmove, forceon. Off is \
1648
+ obvious, on means that this cut generator will be tried in the branch and cut tree (you can fine tune using \
1649
+ 'depth'). Root means just at the root node while 'ifmove' means that cuts will be used in the tree if they \
1650
+ look as if they are doing some good and moving the objective value. Forceon is same as on but forces code to use \
1651
+ cut generator at every node. For probing forceonbut just does fixing probing in tree - not strengthening etc. \
1652
+ If pre-processing reduced the size of the \
1653
+ problem or strengthened many coefficients then it is probably wise to leave it on. Switch off heuristics \
1654
+ which did not provide solutions. The other major area to look at is the search. Hopefully good solutions \
1655
+ were obtained fairly early in the search so the important point is to select the best variable to branch on. \
1656
+ See whether strong branching did a good job - or did it just take a lot of iterations. Adjust the strongBranching \
1657
+ and trustPseudoCosts parameters. If cuts did a good job, then you may wish to \
1658
+ have more rounds of cuts - see passC!uts and passT!ree."
1659
+ );
1660
+ #endif
1661
+ parameters[numberParameters++] =
1662
+ CbcOrClpParam("bscale", "Whether to scale in barrier (and ordering speed)",
1663
+ "off", CLP_PARAM_STR_BARRIERSCALE, 7, 0);
1664
+ parameters[numberParameters-1].append("on");
1665
+ parameters[numberParameters-1].append("off1");
1666
+ parameters[numberParameters-1].append("on1");
1667
+ parameters[numberParameters-1].append("off2");
1668
+ parameters[numberParameters-1].append("on2");
1669
+ #if FLUSH_PRINT_BUFFER > 2
1670
+ parameters[numberParameters++] =
1671
+ CbcOrClpParam("buff!eredMode", "Whether to flush print buffer",
1672
+ "on", CLP_PARAM_STR_BUFFER_MODE);
1673
+ parameters[numberParameters-1].append("off");
1674
+ parameters[numberParameters-1].setLonghelp
1675
+ (
1676
+ "Default is on, off switches on unbuffered output"
1677
+ );
1678
+ parameters[numberParameters-1].setIntValue(0);
1679
+ #endif
1680
+ parameters[numberParameters++] =
1681
+ CbcOrClpParam("chol!esky", "Which cholesky algorithm",
1682
+ "native", CLP_PARAM_STR_CHOLESKY, 7);
1683
+ parameters[numberParameters-1].append("dense");
1684
+ //#ifdef FOREIGN_BARRIER
1685
+ #ifdef COIN_HAS_WSMP
1686
+ parameters[numberParameters-1].append("fudge!Long");
1687
+ parameters[numberParameters-1].append("wssmp");
1688
+ #else
1689
+ parameters[numberParameters-1].append("fudge!Long_dummy");
1690
+ parameters[numberParameters-1].append("wssmp_dummy");
1691
+ #endif
1692
+ #if defined(COIN_HAS_AMD) || defined(COIN_HAS_CHOLMOD) || defined(COIN_HAS_GLPK)
1693
+ parameters[numberParameters-1].append("Uni!versityOfFlorida");
1694
+ #else
1695
+ parameters[numberParameters-1].append("Uni!versityOfFlorida_dummy");
1696
+ #endif
1697
+ #ifdef TAUCS_BARRIER
1698
+ parameters[numberParameters-1].append("Taucs");
1699
+ #else
1700
+ parameters[numberParameters-1].append("Taucs_dummy");
1701
+ #endif
1702
+ #ifdef COIN_HAS_MUMPS
1703
+ parameters[numberParameters-1].append("Mumps");
1704
+ #else
1705
+ parameters[numberParameters-1].append("Mumps_dummy");
1706
+ #endif
1707
+ parameters[numberParameters-1].setLonghelp
1708
+ (
1709
+ "For a barrier code to be effective it needs a good Cholesky ordering and factorization. \
1710
+ The native ordering and factorization is not state of the art, although acceptable. \
1711
+ You may want to link in one from another source. See Makefile.locations for some \
1712
+ possibilities."
1713
+ );
1714
+ //#endif
1715
+ #ifdef COIN_HAS_CBC
1716
+ parameters[numberParameters++] =
1717
+ CbcOrClpParam("clique!Cuts", "Whether to use Clique cuts",
1718
+ "off", CBC_PARAM_STR_CLIQUECUTS);
1719
+ parameters[numberParameters-1].append("on");
1720
+ parameters[numberParameters-1].append("root");
1721
+ parameters[numberParameters-1].append("ifmove");
1722
+ parameters[numberParameters-1].append("forceOn");
1723
+ parameters[numberParameters-1].append("onglobal");
1724
+ parameters[numberParameters-1].setLonghelp
1725
+ (
1726
+ "This switches on clique cuts (either at root or in entire tree) \
1727
+ See branchAndCut for information on options."
1728
+ );
1729
+ parameters[numberParameters++] =
1730
+ CbcOrClpParam("combine!Solutions", "Whether to use combine solution heuristic",
1731
+ "off", CBC_PARAM_STR_COMBINE);
1732
+ parameters[numberParameters-1].append("on");
1733
+ parameters[numberParameters-1].append("both");
1734
+ parameters[numberParameters-1].append("before");
1735
+ parameters[numberParameters-1].append("onquick");
1736
+ parameters[numberParameters-1].append("bothquick");
1737
+ parameters[numberParameters-1].append("beforequick");
1738
+ parameters[numberParameters-1].setLonghelp
1739
+ (
1740
+ "This switches on a heuristic which does branch and cut on the problem given by just \
1741
+ using variables which have appeared in one or more solutions. \
1742
+ It obviously only tries after two or more solutions. \
1743
+ See Rounding for meaning of on,both,before"
1744
+ );
1745
+ parameters[numberParameters++] =
1746
+ CbcOrClpParam("combine2!Solutions", "Whether to use crossover solution heuristic",
1747
+ "off", CBC_PARAM_STR_CROSSOVER2);
1748
+ parameters[numberParameters-1].append("on");
1749
+ parameters[numberParameters-1].append("both");
1750
+ parameters[numberParameters-1].append("before");
1751
+ parameters[numberParameters-1].setLonghelp
1752
+ (
1753
+ "This switches on a heuristic which does branch and cut on the problem given by \
1754
+ fixing variables which have same value in two or more solutions. \
1755
+ It obviously only tries after two or more solutions. \
1756
+ See Rounding for meaning of on,both,before"
1757
+ );
1758
+ parameters[numberParameters++] =
1759
+ CbcOrClpParam("constraint!fromCutoff", "Whether to use cutoff as constraint",
1760
+ "off", CBC_PARAM_STR_CUTOFF_CONSTRAINT);
1761
+ parameters[numberParameters-1].append("on");
1762
+ parameters[numberParameters-1].append("variable");
1763
+ parameters[numberParameters-1].append("forcevariable");
1764
+ parameters[numberParameters-1].append("conflict");
1765
+ parameters[numberParameters-1].setLonghelp
1766
+ (
1767
+ "This adds the objective as a constraint with best solution as RHS"
1768
+ );
1769
+ parameters[numberParameters++] =
1770
+ CbcOrClpParam("cost!Strategy", "How to use costs as priorities",
1771
+ "off", CBC_PARAM_STR_COSTSTRATEGY);
1772
+ parameters[numberParameters-1].append("pri!orities");
1773
+ parameters[numberParameters-1].append("column!Order?");
1774
+ parameters[numberParameters-1].append("01f!irst?");
1775
+ parameters[numberParameters-1].append("01l!ast?");
1776
+ parameters[numberParameters-1].append("length!?");
1777
+ parameters[numberParameters-1].append("singletons");
1778
+ parameters[numberParameters-1].append("nonzero");
1779
+ parameters[numberParameters-1].append("general!Force?");
1780
+ parameters[numberParameters-1].setLonghelp
1781
+ (
1782
+ "This orders the variables in order of their absolute costs - with largest cost ones being branched on \
1783
+ first. This primitive strategy can be surprsingly effective. The column order\
1784
+ option is obviously not on costs but easy to code here."
1785
+ );
1786
+ parameters[numberParameters++] =
1787
+ CbcOrClpParam("cplex!Use", "Whether to use Cplex!",
1788
+ "off", CBC_PARAM_STR_CPX);
1789
+ parameters[numberParameters-1].append("on");
1790
+ parameters[numberParameters-1].setLonghelp
1791
+ (
1792
+ " If the user has Cplex, but wants to use some of Cbc's heuristics \
1793
+ then you can! If this is on, then Cbc will get to the root node and then \
1794
+ hand over to Cplex. If heuristics find a solution this can be significantly \
1795
+ quicker. You will probably want to switch off Cbc's cuts as Cplex thinks \
1796
+ they are genuine constraints. It is also probable that you want to switch \
1797
+ off preprocessing, although for difficult problems it is worth trying \
1798
+ both."
1799
+ );
1800
+ #endif
1801
+ parameters[numberParameters++] =
1802
+ CbcOrClpParam("cpp!Generate", "Generates C++ code",
1803
+ -1, 50000, CLP_PARAM_INT_CPP, 1);
1804
+ parameters[numberParameters-1].setLonghelp
1805
+ (
1806
+ "Once you like what the stand-alone solver does then this allows \
1807
+ you to generate user_driver.cpp which approximates the code. \
1808
+ 0 gives simplest driver, 1 generates saves and restores, 2 \
1809
+ generates saves and restores even for variables at default value. \
1810
+ 4 bit in cbc generates size dependent code rather than computed values. \
1811
+ This is now deprecated as you can call stand-alone solver - see \
1812
+ Cbc/examples/driver4.cpp."
1813
+ );
1814
+ #ifdef COIN_HAS_CLP
1815
+ parameters[numberParameters++] =
1816
+ CbcOrClpParam("crash", "Whether to create basis for problem",
1817
+ "off", CLP_PARAM_STR_CRASH);
1818
+ parameters[numberParameters-1].append("on");
1819
+ parameters[numberParameters-1].append("so!low_halim");
1820
+ parameters[numberParameters-1].append("lots");
1821
+ #ifdef CLP_INHERIT_MODE
1822
+ parameters[numberParameters-1].append("dual");
1823
+ parameters[numberParameters-1].append("dw");
1824
+ parameters[numberParameters-1].append("idiot");
1825
+ #else
1826
+ parameters[numberParameters-1].append("idiot1");
1827
+ parameters[numberParameters-1].append("idiot2");
1828
+ parameters[numberParameters-1].append("idiot3");
1829
+ parameters[numberParameters-1].append("idiot4");
1830
+ parameters[numberParameters-1].append("idiot5");
1831
+ parameters[numberParameters-1].append("idiot6");
1832
+ parameters[numberParameters-1].append("idiot7");
1833
+ #endif
1834
+ parameters[numberParameters-1].setLonghelp
1835
+ (
1836
+ "If crash is set on and there is an all slack basis then Clp will flip or put structural\
1837
+ variables into basis with the aim of getting dual feasible. On the whole dual seems to be\
1838
+ better without it and there are alternative types of 'crash' for primal e.g. 'idiot' or 'sprint'. \
1839
+ I have also added a variant due to Solow and Halim which is as on but just flip.");
1840
+ parameters[numberParameters++] =
1841
+ CbcOrClpParam("cross!over", "Whether to get a basic solution after barrier",
1842
+ "on", CLP_PARAM_STR_CROSSOVER);
1843
+ parameters[numberParameters-1].append("off");
1844
+ parameters[numberParameters-1].append("maybe");
1845
+ parameters[numberParameters-1].append("presolve");
1846
+ parameters[numberParameters-1].setLonghelp
1847
+ (
1848
+ "Interior point algorithms do not obtain a basic solution (and \
1849
+ the feasibility criterion is a bit suspect (JJF)). This option will crossover \
1850
+ to a basic solution suitable for ranging or branch and cut. With the current state \
1851
+ of quadratic it may be a good idea to switch off crossover for quadratic (and maybe \
1852
+ presolve as well) - the option maybe does this."
1853
+ );
1854
+ #endif
1855
+ #ifdef COIN_HAS_CBC
1856
+ parameters[numberParameters++] =
1857
+ CbcOrClpParam("csv!Statistics", "Create one line of statistics",
1858
+ CLP_PARAM_ACTION_CSVSTATISTICS, 2, 1);
1859
+ parameters[numberParameters-1].setLonghelp
1860
+ (
1861
+ "This appends statistics to given file name. It will use the default\
1862
+ directory given by 'directory'. A name of '$' will use the previous value for the name. This\
1863
+ is initialized to '', i.e. it must be set. Adds header if file empty or does not exist."
1864
+ );
1865
+ parameters[numberParameters++] =
1866
+ CbcOrClpParam("cutD!epth", "Depth in tree at which to do cuts",
1867
+ -1, 999999, CBC_PARAM_INT_CUTDEPTH);
1868
+ parameters[numberParameters-1].setLonghelp
1869
+ (
1870
+ "Cut generators may be - off, on only at root, on if they look possible \
1871
+ and on. If they are done every node then that is that, but it may be worth doing them \
1872
+ every so often. The original method was every so many nodes but it is more logical \
1873
+ to do it whenever depth in tree is a multiple of K. This option does that and defaults \
1874
+ to -1 (off -> code decides)."
1875
+ );
1876
+ parameters[numberParameters-1].setIntValue(-1);
1877
+ parameters[numberParameters++] =
1878
+ CbcOrClpParam("cutL!ength", "Length of a cut",
1879
+ -1, COIN_INT_MAX, CBC_PARAM_INT_CUTLENGTH);
1880
+ parameters[numberParameters-1].setLonghelp
1881
+ (
1882
+ "At present this only applies to Gomory cuts. -1 (default) leaves as is. \
1883
+ Any value >0 says that all cuts <= this length can be generated both at \
1884
+ root node and in tree. 0 says to use some dynamic lengths. If value >=10,000,000 \
1885
+ then the length in tree is value%10000000 - so 10000100 means unlimited length \
1886
+ at root and 100 in tree."
1887
+ );
1888
+ parameters[numberParameters-1].setIntValue(-1);
1889
+ parameters[numberParameters++] =
1890
+ CbcOrClpParam("cuto!ff", "All solutions must be better than this",
1891
+ -1.0e60, 1.0e60, CBC_PARAM_DBL_CUTOFF);
1892
+ parameters[numberParameters-1].setDoubleValue(1.0e50);
1893
+ parameters[numberParameters-1].setLonghelp
1894
+ (
1895
+ "All solutions must be better than this value (in a minimization sense). \
1896
+ This is also set by code whenever it obtains a solution and is set to value of \
1897
+ objective for solution minus cutoff increment."
1898
+ );
1899
+ parameters[numberParameters++] =
1900
+ CbcOrClpParam("cuts!OnOff", "Switches all cuts on or off",
1901
+ "off", CBC_PARAM_STR_CUTSSTRATEGY);
1902
+ parameters[numberParameters-1].append("on");
1903
+ parameters[numberParameters-1].append("root");
1904
+ parameters[numberParameters-1].append("ifmove");
1905
+ parameters[numberParameters-1].append("forceOn");
1906
+ parameters[numberParameters-1].setLonghelp
1907
+ (
1908
+ "This can be used to switch on or off all cuts (apart from Reduce and Split). Then you can do \
1909
+ individual ones off or on \
1910
+ See branchAndCut for information on options."
1911
+ );
1912
+ parameters[numberParameters++] =
1913
+ CbcOrClpParam("debug!In", "read valid solution from file",
1914
+ CLP_PARAM_ACTION_DEBUG, 7, 1);
1915
+ parameters[numberParameters-1].setLonghelp
1916
+ (
1917
+ "This will read a solution file from the given file name. It will use the default\
1918
+ directory given by 'directory'. A name of '$' will use the previous value for the name. This\
1919
+ is initialized to '', i.e. it must be set.\n\n\
1920
+ If set to create it will create a file called debug.file after search.\n\n\
1921
+ The idea is that if you suspect a bad cut generator \
1922
+ you can do a good run with debug set to 'create' and then switch on the cuts you suspect and \
1923
+ re-run with debug set to 'debug.file' The create case has same effect as saveSolution."
1924
+ );
1925
+ #endif
1926
+ #ifdef COIN_HAS_CLP
1927
+ parameters[numberParameters++] =
1928
+ CbcOrClpParam("decomp!ose", "Whether to try decomposition",
1929
+ -COIN_INT_MAX, COIN_INT_MAX, CLP_PARAM_INT_DECOMPOSE_BLOCKS, 1);
1930
+ parameters[numberParameters-1].setLonghelp
1931
+ (
1932
+ "0 - off, 1 choose blocks >1 use as blocks \
1933
+ Dantzig Wolfe if primal, Benders if dual \
1934
+ - uses sprint pass for number of passes"
1935
+ );
1936
+ parameters[numberParameters-1].setIntValue(0);
1937
+ #if CLP_MULTIPLE_FACTORIZATIONS >0
1938
+ parameters[numberParameters++] =
1939
+ CbcOrClpParam("dense!Threshold", "Whether to use dense factorization",
1940
+ -1, 10000, CBC_PARAM_INT_DENSE, 1);
1941
+ parameters[numberParameters-1].setLonghelp
1942
+ (
1943
+ "If processed problem <= this use dense factorization"
1944
+ );
1945
+ parameters[numberParameters-1].setIntValue(-1);
1946
+ #endif
1947
+ #endif
1948
+ #ifdef COIN_HAS_CBC
1949
+ parameters[numberParameters++] =
1950
+ CbcOrClpParam("depth!MiniBab", "Depth at which to try mini BAB",
1951
+ -COIN_INT_MAX, COIN_INT_MAX, CBC_PARAM_INT_DEPTHMINIBAB);
1952
+ parameters[numberParameters-1].setIntValue(-1);
1953
+ parameters[numberParameters-1].setLonghelp
1954
+ (
1955
+ "Rather a complicated parameter but can be useful. -1 means off for large problems but on as if -12 for problems where rows+columns<500, -2 \
1956
+ means use Cplex if it is linked in. Otherwise if negative then go into depth first complete search fast branch and bound when depth>= -value-2 (so -3 will use this at depth>=1). This mode is only switched on after 500 nodes. If you really want to switch it off for small problems then set this to -999. If >=0 the value doesn't matter very much. The code will do approximately 100 nodes of fast branch and bound every now and then at depth>=5. The actual logic is too twisted to describe here."
1957
+ );
1958
+ parameters[numberParameters++] =
1959
+ CbcOrClpParam("dextra3", "Extra double parameter 3",
1960
+ -COIN_DBL_MAX, COIN_DBL_MAX, CBC_PARAM_DBL_DEXTRA3, 0);
1961
+ parameters[numberParameters-1].setDoubleValue(0.0);
1962
+ parameters[numberParameters++] =
1963
+ CbcOrClpParam("dextra4", "Extra double parameter 4",
1964
+ -COIN_DBL_MAX, COIN_DBL_MAX, CBC_PARAM_DBL_DEXTRA4, 0);
1965
+ parameters[numberParameters-1].setDoubleValue(0.0);
1966
+ parameters[numberParameters++] =
1967
+ CbcOrClpParam("dextra5", "Extra double parameter 5",
1968
+ -COIN_DBL_MAX, COIN_DBL_MAX, CBC_PARAM_DBL_DEXTRA5, 0);
1969
+ parameters[numberParameters-1].setDoubleValue(0.0);
1970
+ parameters[numberParameters++] =
1971
+ CbcOrClpParam("Dins", "Whether to try Distance Induced Neighborhood Search",
1972
+ "off", CBC_PARAM_STR_DINS);
1973
+ parameters[numberParameters-1].append("on");
1974
+ parameters[numberParameters-1].append("both");
1975
+ parameters[numberParameters-1].append("before");
1976
+ parameters[numberParameters-1].append("often");
1977
+ parameters[numberParameters-1].setLonghelp
1978
+ (
1979
+ "This switches on Distance induced neighborhood Search. \
1980
+ See Rounding for meaning of on,both,before"
1981
+ );
1982
+ #endif
1983
+ parameters[numberParameters++] =
1984
+ CbcOrClpParam("direction", "Minimize or Maximize",
1985
+ "min!imize", CLP_PARAM_STR_DIRECTION);
1986
+ parameters[numberParameters-1].append("max!imize");
1987
+ parameters[numberParameters-1].append("zero");
1988
+ parameters[numberParameters-1].setLonghelp
1989
+ (
1990
+ "The default is minimize - use 'direction maximize' for maximization.\n\
1991
+ You can also use the parameters 'maximize' or 'minimize'."
1992
+ );
1993
+ parameters[numberParameters++] =
1994
+ CbcOrClpParam("directory", "Set Default directory for import etc.",
1995
+ CLP_PARAM_ACTION_DIRECTORY);
1996
+ parameters[numberParameters-1].setLonghelp
1997
+ (
1998
+ "This sets the directory which import, export, saveModel, restoreModel etc will use.\
1999
+ It is initialized to './'"
2000
+ );
2001
+ parameters[numberParameters++] =
2002
+ CbcOrClpParam("dirSample", "Set directory where the COIN-OR sample problems are.",
2003
+ CLP_PARAM_ACTION_DIRSAMPLE, 7, 1);
2004
+ parameters[numberParameters-1].setLonghelp
2005
+ (
2006
+ "This sets the directory where the COIN-OR sample problems reside. It is\
2007
+ used only when -unitTest is passed to clp. clp will pick up the test problems\
2008
+ from this directory.\
2009
+ It is initialized to '../../Data/Sample'"
2010
+ );
2011
+ parameters[numberParameters++] =
2012
+ CbcOrClpParam("dirNetlib", "Set directory where the netlib problems are.",
2013
+ CLP_PARAM_ACTION_DIRNETLIB, 7, 1);
2014
+ parameters[numberParameters-1].setLonghelp
2015
+ (
2016
+ "This sets the directory where the netlib problems reside. One can get\
2017
+ the netlib problems from COIN-OR or from the main netlib site. This\
2018
+ parameter is used only when -netlib is passed to clp. clp will pick up the\
2019
+ netlib problems from this directory. If clp is built without zlib support\
2020
+ then the problems must be uncompressed.\
2021
+ It is initialized to '../../Data/Netlib'"
2022
+ );
2023
+ parameters[numberParameters++] =
2024
+ CbcOrClpParam("dirMiplib", "Set directory where the miplib 2003 problems are.",
2025
+ CBC_PARAM_ACTION_DIRMIPLIB, 7, 1);
2026
+ parameters[numberParameters-1].setLonghelp
2027
+ (
2028
+ "This sets the directory where the miplib 2003 problems reside. One can\
2029
+ get the miplib problems from COIN-OR or from the main miplib site. This\
2030
+ parameter is used only when -miplib is passed to cbc. cbc will pick up the\
2031
+ miplib problems from this directory. If cbc is built without zlib support\
2032
+ then the problems must be uncompressed.\
2033
+ It is initialized to '../../Data/miplib3'"
2034
+ );
2035
+ #ifdef COIN_HAS_CBC
2036
+ parameters[numberParameters++] =
2037
+ CbcOrClpParam("diveO!pt", "Diving options",
2038
+ -1, 200000, CBC_PARAM_INT_DIVEOPT, 1);
2039
+ parameters[numberParameters-1].setLonghelp
2040
+ (
2041
+ "If >2 && <20 then modify diving options - \
2042
+ \n\t3 only at root and if no solution, \
2043
+ \n\t4 only at root and if this heuristic has not got solution, \
2044
+ \n\t5 decay only if no solution, \
2045
+ \n\t6 if depth <3 or decay, \
2046
+ \n\t7 run up to 2 times if solution found 4 otherwise, \
2047
+ \n\t>10 All only at root (DivingC normal as value-10), \
2048
+ \n\t>20 All with value-20)."
2049
+ );
2050
+ parameters[numberParameters-1].setIntValue(-1);
2051
+ parameters[numberParameters++] =
2052
+ CbcOrClpParam("diveS!olves", "Diving solve option",
2053
+ -1, 200000, CBC_PARAM_INT_DIVEOPTSOLVES, 1);
2054
+ parameters[numberParameters-1].setLonghelp
2055
+ (
2056
+ "If >0 then do up to this many solves. Last digit is ignored \
2057
+ and used for extra options - \
2058
+ \n\t1-3 allow fixing of satisfied integers (but not at bound) \
2059
+ \n\t1 switch off above for that dive if goes infeasible \
2060
+ \n\t2 switch off above permanently if goes infeasible"
2061
+ );
2062
+ parameters[numberParameters-1].setIntValue(100);
2063
+ parameters[numberParameters++] =
2064
+ CbcOrClpParam("DivingS!ome", "Whether to try Diving heuristics",
2065
+ "off", CBC_PARAM_STR_DIVINGS);
2066
+ parameters[numberParameters-1].append("on");
2067
+ parameters[numberParameters-1].append("both");
2068
+ parameters[numberParameters-1].append("before");
2069
+ parameters[numberParameters-1].setLonghelp
2070
+ (
2071
+ "This switches on a random diving heuristic at various times. \
2072
+ C - Coefficient, F - Fractional, G - Guided, L - LineSearch, P - PseudoCost, V - VectorLength. \
2073
+ You may prefer to use individual on/off \
2074
+ See Rounding for meaning of on,both,before"
2075
+ );
2076
+ parameters[numberParameters++] =
2077
+ CbcOrClpParam("DivingC!oefficient", "Whether to try DiveCoefficient",
2078
+ "off", CBC_PARAM_STR_DIVINGC);
2079
+ parameters[numberParameters-1].append("on");
2080
+ parameters[numberParameters-1].append("both");
2081
+ parameters[numberParameters-1].append("before");
2082
+ parameters[numberParameters++] =
2083
+ CbcOrClpParam("DivingF!ractional", "Whether to try DiveFractional",
2084
+ "off", CBC_PARAM_STR_DIVINGF);
2085
+ parameters[numberParameters-1].append("on");
2086
+ parameters[numberParameters-1].append("both");
2087
+ parameters[numberParameters-1].append("before");
2088
+ parameters[numberParameters++] =
2089
+ CbcOrClpParam("DivingG!uided", "Whether to try DiveGuided",
2090
+ "off", CBC_PARAM_STR_DIVINGG);
2091
+ parameters[numberParameters-1].append("on");
2092
+ parameters[numberParameters-1].append("both");
2093
+ parameters[numberParameters-1].append("before");
2094
+ parameters[numberParameters++] =
2095
+ CbcOrClpParam("DivingL!ineSearch", "Whether to try DiveLineSearch",
2096
+ "off", CBC_PARAM_STR_DIVINGL);
2097
+ parameters[numberParameters-1].append("on");
2098
+ parameters[numberParameters-1].append("both");
2099
+ parameters[numberParameters-1].append("before");
2100
+ parameters[numberParameters++] =
2101
+ CbcOrClpParam("DivingP!seudoCost", "Whether to try DivePseudoCost",
2102
+ "off", CBC_PARAM_STR_DIVINGP);
2103
+ parameters[numberParameters-1].append("on");
2104
+ parameters[numberParameters-1].append("both");
2105
+ parameters[numberParameters-1].append("before");
2106
+ parameters[numberParameters++] =
2107
+ CbcOrClpParam("DivingV!ectorLength", "Whether to try DiveVectorLength",
2108
+ "off", CBC_PARAM_STR_DIVINGV);
2109
+ parameters[numberParameters-1].append("on");
2110
+ parameters[numberParameters-1].append("both");
2111
+ parameters[numberParameters-1].append("before");
2112
+ parameters[numberParameters++] =
2113
+ CbcOrClpParam("doH!euristic", "Do heuristics before any preprocessing",
2114
+ CBC_PARAM_ACTION_DOHEURISTIC, 3);
2115
+ parameters[numberParameters-1].setLonghelp
2116
+ (
2117
+ "Normally heuristics are done in branch and bound. It may be useful to do them outside. \
2118
+ Only those heuristics with 'both' or 'before' set will run. \
2119
+ Doing this may also set cutoff, which can help with preprocessing."
2120
+ );
2121
+ #endif
2122
+ #ifdef COIN_HAS_CLP
2123
+ parameters[numberParameters++] =
2124
+ CbcOrClpParam("dualB!ound", "Initially algorithm acts as if no \
2125
+ gap between bounds exceeds this value",
2126
+ 1.0e-20, 1.0e12, CLP_PARAM_DBL_DUALBOUND);
2127
+ parameters[numberParameters-1].setLonghelp
2128
+ (
2129
+ "The dual algorithm in Clp is a single phase algorithm as opposed to a two phase\
2130
+ algorithm where you first get feasible then optimal. If a problem has both upper and\
2131
+ lower bounds then it is trivial to get dual feasible by setting non basic variables\
2132
+ to correct bound. If the gap between the upper and lower bounds of a variable is more\
2133
+ than the value of dualBound Clp introduces fake bounds so that it can make the problem\
2134
+ dual feasible. This has the same effect as a composite objective function in the\
2135
+ primal algorithm. Too high a value may mean more iterations, while too low a bound means\
2136
+ the code may go all the way and then have to increase the bounds. OSL had a heuristic to\
2137
+ adjust bounds, maybe we need that here."
2138
+ );
2139
+ parameters[numberParameters++] =
2140
+ CbcOrClpParam("dualize", "Solves dual reformulation",
2141
+ 0, 4, CLP_PARAM_INT_DUALIZE, 1);
2142
+ parameters[numberParameters-1].setLonghelp
2143
+ (
2144
+ "Don't even think about it."
2145
+ );
2146
+ parameters[numberParameters++] =
2147
+ CbcOrClpParam("dualP!ivot", "Dual pivot choice algorithm",
2148
+ "auto!matic", CLP_PARAM_STR_DUALPIVOT, 7, 1);
2149
+ parameters[numberParameters-1].append("dant!zig");
2150
+ parameters[numberParameters-1].append("partial");
2151
+ parameters[numberParameters-1].append("steep!est");
2152
+ parameters[numberParameters-1].setLonghelp
2153
+ (
2154
+ "Clp can use any pivot selection algorithm which the user codes as long as it\
2155
+ implements the features in the abstract pivot base class. The Dantzig method is implemented\
2156
+ to show a simple method but its use is deprecated. Steepest is the method of choice and there\
2157
+ are two variants which keep all weights updated but only scan a subset each iteration.\
2158
+ Partial switches this on while automatic decides at each iteration based on information\
2159
+ about the factorization."
2160
+ );
2161
+ parameters[numberParameters++] =
2162
+ CbcOrClpParam("dualS!implex", "Do dual simplex algorithm",
2163
+ CLP_PARAM_ACTION_DUALSIMPLEX);
2164
+ parameters[numberParameters-1].setLonghelp
2165
+ (
2166
+ "This command solves the continuous relaxation of the current model using the dual steepest edge algorithm.\
2167
+ The time and iterations may be affected by settings such as presolve, scaling, crash\
2168
+ and also by dual pivot method, fake bound on variables and dual and primal tolerances."
2169
+ );
2170
+ #endif
2171
+ parameters[numberParameters++] =
2172
+ CbcOrClpParam("dualT!olerance", "For an optimal solution \
2173
+ no dual infeasibility may exceed this value",
2174
+ 1.0e-20, 1.0e12, CLP_PARAM_DBL_DUALTOLERANCE);
2175
+ parameters[numberParameters-1].setLonghelp
2176
+ (
2177
+ "Normally the default tolerance is fine, but you may want to increase it a\
2178
+ bit if a dual run seems to be having a hard time. One method which can be faster is \
2179
+ to use a large tolerance e.g. 1.0e-4 and dual and then clean up problem using primal and the \
2180
+ correct tolerance (remembering to switch off presolve for this final short clean up phase)."
2181
+ );
2182
+ #ifdef COIN_HAS_CBC
2183
+ parameters[numberParameters++] =
2184
+ CbcOrClpParam("dw!Heuristic", "Whether to try DW heuristic",
2185
+ "off", CBC_PARAM_STR_DW);
2186
+ parameters[numberParameters-1].append("on");
2187
+ parameters[numberParameters-1].append("both");
2188
+ parameters[numberParameters-1].append("before");
2189
+ parameters[numberParameters-1].setLonghelp
2190
+ (
2191
+ "See Rounding for meaning of on,both,before"
2192
+ );
2193
+ #endif
2194
+ #ifdef COIN_HAS_CLP
2195
+ parameters[numberParameters++] =
2196
+ CbcOrClpParam("either!Simplex", "Do dual or primal simplex algorithm",
2197
+ CLP_PARAM_ACTION_EITHERSIMPLEX);
2198
+ parameters[numberParameters-1].setLonghelp
2199
+ (
2200
+ "This command solves the continuous relaxation of the current model using the dual or primal algorithm,\
2201
+ based on a dubious analysis of model."
2202
+ );
2203
+ #endif
2204
+ parameters[numberParameters++] =
2205
+ CbcOrClpParam("end", "Stops clp execution",
2206
+ CLP_PARAM_ACTION_EXIT);
2207
+ parameters[numberParameters-1].setLonghelp
2208
+ (
2209
+ "This stops execution ; end, exit, quit and stop are synonyms"
2210
+ );
2211
+ parameters[numberParameters++] =
2212
+ CbcOrClpParam("environ!ment", "Read commands from environment",
2213
+ CLP_PARAM_ACTION_ENVIRONMENT, 7, 0);
2214
+ parameters[numberParameters-1].setLonghelp
2215
+ (
2216
+ "This starts reading from environment variable CBC_CLP_ENVIRONMENT."
2217
+ );
2218
+ parameters[numberParameters++] =
2219
+ CbcOrClpParam("error!sAllowed", "Whether to allow import errors",
2220
+ "off", CLP_PARAM_STR_ERRORSALLOWED, 3);
2221
+ parameters[numberParameters-1].append("on");
2222
+ parameters[numberParameters-1].setLonghelp
2223
+ (
2224
+ "The default is not to use any model which had errors when reading the mps file.\
2225
+ Setting this to 'on' will allow all errors from which the code can recover\
2226
+ simply by ignoring the error. There are some errors from which the code can not recover \
2227
+ e.g. no ENDATA. This has to be set before import i.e. -errorsAllowed on -import xxxxxx.mps."
2228
+ );
2229
+ parameters[numberParameters++] =
2230
+ CbcOrClpParam("exit", "Stops clp execution",
2231
+ CLP_PARAM_ACTION_EXIT);
2232
+ parameters[numberParameters-1].setLonghelp
2233
+ (
2234
+ "This stops the execution of Clp, end, exit, quit and stop are synonyms"
2235
+ );
2236
+ #ifdef COIN_HAS_CBC
2237
+ parameters[numberParameters++] =
2238
+ CbcOrClpParam("exper!iment", "Whether to use testing features",
2239
+ -1, 200, CBC_PARAM_INT_EXPERIMENT, 0);
2240
+ parameters[numberParameters-1].setLonghelp
2241
+ (
2242
+ "Defines how adventurous you want to be in using new ideas. \
2243
+ 0 then no new ideas, 1 fairly sensible, 2 a bit dubious, 3 you are on your own!"
2244
+ );
2245
+ parameters[numberParameters-1].setIntValue(0);
2246
+ parameters[numberParameters++] =
2247
+ CbcOrClpParam("expensive!Strong", "Whether to do even more strong branching",
2248
+ 0, COIN_INT_MAX, CBC_PARAM_INT_STRONG_STRATEGY, 0);
2249
+ parameters[numberParameters-1].setLonghelp
2250
+ (
2251
+ "Strategy for extra strong branching \n\
2252
+ \n\t0 - normal\n\
2253
+ \n\twhen to do all fractional\n\
2254
+ \n\t1 - root node\n\
2255
+ \n\t2 - depth less than modifier\n\
2256
+ \n\t4 - if objective == best possible\n\
2257
+ \n\t6 - as 2+4\n\
2258
+ \n\twhen to do all including satisfied\n\
2259
+ \n\t10 - root node etc.\n\
2260
+ \n\tIf >=100 then do when depth <= strategy/100 (otherwise 5)"
2261
+ );
2262
+ parameters[numberParameters-1].setIntValue(0);
2263
+ #endif
2264
+ parameters[numberParameters++] =
2265
+ CbcOrClpParam("export", "Export model as mps file",
2266
+ CLP_PARAM_ACTION_EXPORT);
2267
+ parameters[numberParameters-1].setLonghelp
2268
+ (
2269
+ "This will write an MPS format file to the given file name. It will use the default\
2270
+ directory given by 'directory'. A name of '$' will use the previous value for the name. This\
2271
+ is initialized to 'default.mps'. \
2272
+ It can be useful to get rid of the original names and go over to using Rnnnnnnn and Cnnnnnnn. This can be done by setting 'keepnames' off before importing mps file."
2273
+ );
2274
+ #ifdef COIN_HAS_CBC
2275
+ parameters[numberParameters++] =
2276
+ CbcOrClpParam("extra1", "Extra integer parameter 1",
2277
+ -COIN_INT_MAX, COIN_INT_MAX, CBC_PARAM_INT_EXTRA1, 0);
2278
+ parameters[numberParameters-1].setIntValue(-1);
2279
+ parameters[numberParameters++] =
2280
+ CbcOrClpParam("extra2", "Extra integer parameter 2",
2281
+ -100, COIN_INT_MAX, CBC_PARAM_INT_EXTRA2, 0);
2282
+ parameters[numberParameters-1].setIntValue(-1);
2283
+ parameters[numberParameters++] =
2284
+ CbcOrClpParam("extra3", "Extra integer parameter 3",
2285
+ -1, COIN_INT_MAX, CBC_PARAM_INT_EXTRA3, 0);
2286
+ parameters[numberParameters-1].setIntValue(-1);
2287
+ parameters[numberParameters++] =
2288
+ CbcOrClpParam("extra4", "Extra integer parameter 4",
2289
+ -1, COIN_INT_MAX, CBC_PARAM_INT_EXTRA4, 0);
2290
+ parameters[numberParameters-1].setIntValue(-1);
2291
+ parameters[numberParameters-1].setLonghelp
2292
+ (
2293
+ "This switches on yet more special options!! \
2294
+ The bottom digit is a strategy when to used shadow price stuff e.g. 3 \
2295
+ means use until a solution is found. The next two digits say what sort \
2296
+ of dual information to use. After that it goes back to powers of 2 so -\n\
2297
+ \n\t1000 - switches on experimental hotstart\n\
2298
+ \n\t2,4,6000 - switches on experimental methods of stopping cuts\n\
2299
+ \n\t8000 - increase minimum drop gradually\n\
2300
+ \n\t16000 - switches on alternate gomory criterion"
2301
+ );
2302
+ parameters[numberParameters++] =
2303
+ CbcOrClpParam("extraV!ariables", "Allow creation of extra integer variables",
2304
+ -COIN_INT_MAX, COIN_INT_MAX, CBC_PARAM_INT_EXTRA_VARIABLES, 0);
2305
+ parameters[numberParameters-1].setIntValue(0);
2306
+ parameters[numberParameters-1].setLonghelp
2307
+ (
2308
+ "This switches on creation of extra integer variables \
2309
+ to gather all variables with same cost."
2310
+ );
2311
+ #endif
2312
+ #ifdef COIN_HAS_CLP
2313
+ parameters[numberParameters++] =
2314
+ CbcOrClpParam("fact!orization", "Which factorization to use",
2315
+ "normal", CLP_PARAM_STR_FACTORIZATION);
2316
+ parameters[numberParameters-1].append("dense");
2317
+ parameters[numberParameters-1].append("simple");
2318
+ parameters[numberParameters-1].append("osl");
2319
+ parameters[numberParameters-1].setLonghelp
2320
+ (
2321
+ #ifndef ABC_INHERIT
2322
+ "The default is to use the normal CoinFactorization, but \
2323
+ other choices are a dense one, osl's or one designed for small problems."
2324
+ #else
2325
+ "Normally the default is to use the normal CoinFactorization, but \
2326
+ other choices are a dense one, osl's or one designed for small problems. \
2327
+ However if at Aboca then the default is CoinAbcFactorization and other choices are \
2328
+ a dense one, one designed for small problems or if enabled a long factorization."
2329
+ #endif
2330
+ );
2331
+ parameters[numberParameters++] =
2332
+ CbcOrClpParam("fakeB!ound", "All bounds <= this value - DEBUG",
2333
+ 1.0, 1.0e15, CLP_PARAM_ACTION_FAKEBOUND, 0);
2334
+ #ifdef COIN_HAS_CBC
2335
+ parameters[numberParameters++] =
2336
+ CbcOrClpParam("feas!ibilityPump", "Whether to try Feasibility Pump",
2337
+ "off", CBC_PARAM_STR_FPUMP);
2338
+ parameters[numberParameters-1].append("on");
2339
+ parameters[numberParameters-1].append("both");
2340
+ parameters[numberParameters-1].append("before");
2341
+ parameters[numberParameters-1].setLonghelp
2342
+ (
2343
+ "This switches on feasibility pump heuristic at root. This is due to Fischetti, Lodi and Glover \
2344
+ and uses a sequence of Lps to try and get an integer feasible solution. \
2345
+ Some fine tuning is available by passFeasibilityPump and also pumpTune. \
2346
+ See Rounding for meaning of on,both,before"
2347
+ );
2348
+ parameters[numberParameters++] =
2349
+ CbcOrClpParam("fix!OnDj", "Try heuristic based on fixing variables with \
2350
+ reduced costs greater than this",
2351
+ -1.0e20, 1.0e20, CBC_PARAM_DBL_DJFIX, 1);
2352
+ parameters[numberParameters-1].setLonghelp
2353
+ (
2354
+ "If this is set integer variables with reduced costs greater than this will be fixed \
2355
+ before branch and bound - use with extreme caution!"
2356
+ );
2357
+ parameters[numberParameters++] =
2358
+ CbcOrClpParam("flow!CoverCuts", "Whether to use Flow Cover cuts",
2359
+ "off", CBC_PARAM_STR_FLOWCUTS);
2360
+ parameters[numberParameters-1].append("on");
2361
+ parameters[numberParameters-1].append("root");
2362
+ parameters[numberParameters-1].append("ifmove");
2363
+ parameters[numberParameters-1].append("forceOn");
2364
+ parameters[numberParameters-1].append("onglobal");
2365
+ parameters[numberParameters-1].setFakeKeyWord(3);
2366
+ parameters[numberParameters-1].setLonghelp
2367
+ (
2368
+ "This switches on flow cover cuts (either at root or in entire tree) \
2369
+ See branchAndCut for information on options. \
2370
+ Can also enter testing values by plusnn (==ifmove)"
2371
+ );
2372
+ parameters[numberParameters++] =
2373
+ CbcOrClpParam("force!Solution", "Whether to use given solution as crash for BAB",
2374
+ -1, 20000000, CLP_PARAM_INT_USESOLUTION);
2375
+ parameters[numberParameters-1].setIntValue(-1);
2376
+ parameters[numberParameters-1].setLonghelp
2377
+ (
2378
+ "-1 off. If 1 then tries to branch to solution given by AMPL or priorities file. \
2379
+ If 0 then just tries to set as best solution \
2380
+ If >1 then also does that many nodes on fixed problem."
2381
+ );
2382
+ parameters[numberParameters++] =
2383
+ CbcOrClpParam("fraction!forBAB", "Fraction in feasibility pump",
2384
+ 1.0e-5, 1.1, CBC_PARAM_DBL_SMALLBAB, 1);
2385
+ parameters[numberParameters-1].setDoubleValue(0.5);
2386
+ parameters[numberParameters-1].setLonghelp
2387
+ (
2388
+ "After a pass in feasibility pump, variables which have not moved \
2389
+ about are fixed and if the preprocessed model is small enough a few nodes \
2390
+ of branch and bound are done on reduced problem. Small problem has to be less than this fraction of original."
2391
+ );
2392
+ #endif
2393
+ parameters[numberParameters++] =
2394
+ CbcOrClpParam("gamma!(Delta)", "Whether to regularize barrier",
2395
+ "off", CLP_PARAM_STR_GAMMA, 7, 1);
2396
+ parameters[numberParameters-1].append("on");
2397
+ parameters[numberParameters-1].append("gamma");
2398
+ parameters[numberParameters-1].append("delta");
2399
+ parameters[numberParameters-1].append("onstrong");
2400
+ parameters[numberParameters-1].append("gammastrong");
2401
+ parameters[numberParameters-1].append("deltastrong");
2402
+ #endif
2403
+ #ifdef COIN_HAS_CBC
2404
+ parameters[numberParameters++] =
2405
+ CbcOrClpParam("GMI!Cuts", "Whether to use alternative Gomory cuts",
2406
+ "off", CBC_PARAM_STR_GMICUTS);
2407
+ parameters[numberParameters-1].append("on");
2408
+ parameters[numberParameters-1].append("root");
2409
+ parameters[numberParameters-1].append("ifmove");
2410
+ parameters[numberParameters-1].append("forceOn");
2411
+ parameters[numberParameters-1].append("endonly");
2412
+ parameters[numberParameters-1].append("long");
2413
+ parameters[numberParameters-1].append("longroot");
2414
+ parameters[numberParameters-1].append("longifmove");
2415
+ parameters[numberParameters-1].append("forceLongOn");
2416
+ parameters[numberParameters-1].append("longendonly");
2417
+ parameters[numberParameters-1].setLonghelp
2418
+ (
2419
+ "This switches on an alternative Gomory cut generator (either at root or in entire tree) \
2420
+ This version is by Giacomo Nannicini and may be more robust \
2421
+ See branchAndCut for information on options."
2422
+ );
2423
+ parameters[numberParameters++] =
2424
+ CbcOrClpParam("gomory!Cuts", "Whether to use Gomory cuts",
2425
+ "off", CBC_PARAM_STR_GOMORYCUTS);
2426
+ parameters[numberParameters-1].append("on");
2427
+ parameters[numberParameters-1].append("root");
2428
+ parameters[numberParameters-1].append("ifmove");
2429
+ parameters[numberParameters-1].append("forceOn");
2430
+ parameters[numberParameters-1].append("onglobal");
2431
+ parameters[numberParameters-1].append("forceandglobal");
2432
+ parameters[numberParameters-1].append("forceLongOn");
2433
+ parameters[numberParameters-1].append("long");
2434
+ parameters[numberParameters-1].setLonghelp
2435
+ (
2436
+ "The original cuts - beware of imitations! Having gone out of favor, they are now more \
2437
+ fashionable as LP solvers are more robust and they interact well with other cuts. They will almost always \
2438
+ give cuts (although in this executable they are limited as to number of variables in cut). \
2439
+ However the cuts may be dense so it is worth experimenting (Long allows any length). \
2440
+ See branchAndCut for information on options."
2441
+ );
2442
+ parameters[numberParameters++] =
2443
+ CbcOrClpParam("greedy!Heuristic", "Whether to use a greedy heuristic",
2444
+ "off", CBC_PARAM_STR_GREEDY);
2445
+ parameters[numberParameters-1].append("on");
2446
+ parameters[numberParameters-1].append("both");
2447
+ parameters[numberParameters-1].append("before");
2448
+ //parameters[numberParameters-1].append("root");
2449
+ parameters[numberParameters-1].setLonghelp
2450
+ (
2451
+ "Switches on a greedy heuristic which will try and obtain a solution. It may just fix a \
2452
+ percentage of variables and then try a small branch and cut run. \
2453
+ See Rounding for meaning of on,both,before"
2454
+ );
2455
+ #endif
2456
+ parameters[numberParameters++] =
2457
+ CbcOrClpParam("gsolu!tion", "Puts glpk solution to file",
2458
+ CLP_PARAM_ACTION_GMPL_SOLUTION);
2459
+ parameters[numberParameters-1].setLonghelp
2460
+ (
2461
+ "Will write a glpk solution file to the given file name. It will use the default\
2462
+ directory given by 'directory'. A name of '$' will use the previous value for the name. This\
2463
+ is initialized to 'stdout' (this defaults to ordinary solution if stdout). \
2464
+ If problem created from gmpl model - will do any reports."
2465
+ );
2466
+ #ifdef COIN_HAS_CBC
2467
+ parameters[numberParameters++] =
2468
+ CbcOrClpParam("heur!isticsOnOff", "Switches most heuristics on or off",
2469
+ "off", CBC_PARAM_STR_HEURISTICSTRATEGY);
2470
+ parameters[numberParameters-1].append("on");
2471
+ parameters[numberParameters-1].setLonghelp
2472
+ (
2473
+ "This can be used to switch on or off all heuristics. Then you can do \
2474
+ individual ones off or on. CbcTreeLocal is not included as it dramatically \
2475
+ alters search."
2476
+ );
2477
+ #endif
2478
+ parameters[numberParameters++] =
2479
+ CbcOrClpParam("help", "Print out version, non-standard options and some help",
2480
+ CLP_PARAM_ACTION_HELP, 3);
2481
+ parameters[numberParameters-1].setLonghelp
2482
+ (
2483
+ "This prints out some help to get user started. If you have printed this then \
2484
+ you should be past that stage:-)"
2485
+ );
2486
+ #ifdef COIN_HAS_CBC
2487
+ parameters[numberParameters++] =
2488
+ CbcOrClpParam("hOp!tions", "Heuristic options",
2489
+ -9999999, 9999999, CBC_PARAM_INT_HOPTIONS, 1);
2490
+ parameters[numberParameters-1].setLonghelp
2491
+ (
2492
+ "1 says stop heuristic immediately allowable gap reached. \
2493
+ Others are for feasibility pump - \
2494
+ 2 says do exact number of passes given, \
2495
+ 4 only applies if initial cutoff given and says relax after 50 passes, \
2496
+ while 8 will adapt cutoff rhs after first solution if it looks as if code is stalling."
2497
+ );
2498
+ parameters[numberParameters-1].setIntValue(0);
2499
+ parameters[numberParameters++] =
2500
+ CbcOrClpParam("hot!StartMaxIts", "Maximum iterations on hot start",
2501
+ 0, COIN_INT_MAX, CBC_PARAM_INT_MAXHOTITS);
2502
+ #endif
2503
+ #ifdef COIN_HAS_CLP
2504
+ parameters[numberParameters++] =
2505
+ CbcOrClpParam("idiot!Crash", "Whether to try idiot crash",
2506
+ -1, 99999999, CLP_PARAM_INT_IDIOT);
2507
+ parameters[numberParameters-1].setLonghelp
2508
+ (
2509
+ "This is a type of 'crash' which works well on some homogeneous problems.\
2510
+ It works best on problems with unit elements and rhs but will do something to any model. It should only be\
2511
+ used before primal. It can be set to -1 when the code decides for itself whether to use it,\
2512
+ 0 to switch off or n > 0 to do n passes."
2513
+ );
2514
+ #endif
2515
+ parameters[numberParameters++] =
2516
+ CbcOrClpParam("import", "Import model from mps file",
2517
+ CLP_PARAM_ACTION_IMPORT, 3);
2518
+ parameters[numberParameters-1].setLonghelp
2519
+ (
2520
+ "This will read an MPS format file from the given file name. It will use the default\
2521
+ directory given by 'directory'. A name of '$' will use the previous value for the name. This\
2522
+ is initialized to '', i.e. it must be set. If you have libgz then it can read compressed\
2523
+ files 'xxxxxxxx.gz' or 'xxxxxxxx.bz2'. \
2524
+ If 'keepnames' is off, then names are dropped -> Rnnnnnnn and Cnnnnnnn."
2525
+ );
2526
+ #ifdef COIN_HAS_CBC
2527
+ parameters[numberParameters++] =
2528
+ CbcOrClpParam("inc!rement", "A valid solution must be at least this \
2529
+ much better than last integer solution",
2530
+ -1.0e20, 1.0e20, CBC_PARAM_DBL_INCREMENT);
2531
+ parameters[numberParameters-1].setLonghelp
2532
+ (
2533
+ "Whenever a solution is found the bound on solutions is set to solution (in a minimization\
2534
+ sense) plus this. If it is not set then the code will try and work one out e.g. if \
2535
+ all objective coefficients are multiples of 0.01 and only integer variables have entries in \
2536
+ objective then this can be set to 0.01. Be careful if you set this negative!"
2537
+ );
2538
+ parameters[numberParameters++] =
2539
+ CbcOrClpParam("inf!easibilityWeight", "Each integer infeasibility is expected \
2540
+ to cost this much",
2541
+ 0.0, 1.0e20, CBC_PARAM_DBL_INFEASIBILITYWEIGHT, 1);
2542
+ parameters[numberParameters-1].setLonghelp
2543
+ (
2544
+ "A primitive way of deciding which node to explore next. Satisfying each integer infeasibility is \
2545
+ expected to cost this much."
2546
+ );
2547
+ parameters[numberParameters++] =
2548
+ CbcOrClpParam("initialS!olve", "Solve to continuous",
2549
+ CLP_PARAM_ACTION_SOLVECONTINUOUS);
2550
+ parameters[numberParameters-1].setLonghelp
2551
+ (
2552
+ "This just solves the problem to continuous - without adding any cuts"
2553
+ );
2554
+ parameters[numberParameters++] =
2555
+ CbcOrClpParam("integerT!olerance", "For an optimal solution \
2556
+ no integer variable may be this away from an integer value",
2557
+ 1.0e-20, 0.5, CBC_PARAM_DBL_INTEGERTOLERANCE);
2558
+ parameters[numberParameters-1].setLonghelp
2559
+ (
2560
+ "Beware of setting this smaller than the primal tolerance."
2561
+ );
2562
+ #endif
2563
+ #ifdef COIN_HAS_CLP
2564
+ parameters[numberParameters++] =
2565
+ CbcOrClpParam("keepN!ames", "Whether to keep names from import",
2566
+ "on", CLP_PARAM_STR_KEEPNAMES);
2567
+ parameters[numberParameters-1].append("off");
2568
+ parameters[numberParameters-1].setLonghelp
2569
+ (
2570
+ "It saves space to get rid of names so if you need to you can set this to off. \
2571
+ This needs to be set before the import of model - so -keepnames off -import xxxxx.mps."
2572
+ );
2573
+ parameters[numberParameters++] =
2574
+ CbcOrClpParam("KKT", "Whether to use KKT factorization",
2575
+ "off", CLP_PARAM_STR_KKT, 7, 1);
2576
+ parameters[numberParameters-1].append("on");
2577
+ #endif
2578
+ #ifdef COIN_HAS_CBC
2579
+ parameters[numberParameters++] =
2580
+ CbcOrClpParam("knapsack!Cuts", "Whether to use Knapsack cuts",
2581
+ "off", CBC_PARAM_STR_KNAPSACKCUTS);
2582
+ parameters[numberParameters-1].append("on");
2583
+ parameters[numberParameters-1].append("root");
2584
+ parameters[numberParameters-1].append("ifmove");
2585
+ parameters[numberParameters-1].append("forceOn");
2586
+ parameters[numberParameters-1].append("onglobal");
2587
+ parameters[numberParameters-1].append("forceandglobal");
2588
+ parameters[numberParameters-1].setLonghelp
2589
+ (
2590
+ "This switches on knapsack cuts (either at root or in entire tree) \
2591
+ See branchAndCut for information on options."
2592
+ );
2593
+ parameters[numberParameters++] =
2594
+ CbcOrClpParam("lagomory!Cuts", "Whether to use Lagrangean Gomory cuts",
2595
+ "off", CBC_PARAM_STR_LAGOMORYCUTS);
2596
+ parameters[numberParameters-1].append("endonlyroot");
2597
+ parameters[numberParameters-1].append("endcleanroot");
2598
+ parameters[numberParameters-1].append("root");
2599
+ parameters[numberParameters-1].append("endonly");
2600
+ parameters[numberParameters-1].append("endclean");
2601
+ parameters[numberParameters-1].append("endboth");
2602
+ parameters[numberParameters-1].append("onlyaswell");
2603
+ parameters[numberParameters-1].append("cleanaswell");
2604
+ parameters[numberParameters-1].append("bothaswell");
2605
+ parameters[numberParameters-1].append("onlyinstead");
2606
+ parameters[numberParameters-1].append("cleaninstead");
2607
+ parameters[numberParameters-1].append("bothinstead");
2608
+ parameters[numberParameters-1].append("onlyaswellroot");
2609
+ parameters[numberParameters-1].append("cleanaswellroot");
2610
+ parameters[numberParameters-1].append("bothaswellroot");
2611
+ parameters[numberParameters-1].setLonghelp
2612
+ (
2613
+ "This is a gross simplification of 'A Relax-and-Cut Framework for Gomory's Mixed-Integer Cuts' \
2614
+ by Matteo Fischetti & Domenico Salvagnin. This simplification \
2615
+ just uses original constraints while modifying objective using other cuts. \
2616
+ So you don't use messy constraints generated by Gomory etc. \
2617
+ A variant is to allow non messy cuts e.g. clique cuts. \
2618
+ So 'only' does this while clean also allows integral valued cuts. \
2619
+ 'End' is recommended which waits until other cuts have finished and then \
2620
+ does a few passes. \
2621
+ The length options for gomory cuts are used."
2622
+ );
2623
+ parameters[numberParameters++] =
2624
+ CbcOrClpParam("latwomir!Cuts", "Whether to use Lagrangean TwoMir cuts",
2625
+ "off", CBC_PARAM_STR_LATWOMIRCUTS);
2626
+ parameters[numberParameters-1].append("endonlyroot");
2627
+ parameters[numberParameters-1].append("endcleanroot");
2628
+ parameters[numberParameters-1].append("endbothroot");
2629
+ parameters[numberParameters-1].append("endonly");
2630
+ parameters[numberParameters-1].append("endclean");
2631
+ parameters[numberParameters-1].append("endboth");
2632
+ parameters[numberParameters-1].append("onlyaswell");
2633
+ parameters[numberParameters-1].append("cleanaswell");
2634
+ parameters[numberParameters-1].append("bothaswell");
2635
+ parameters[numberParameters-1].append("onlyinstead");
2636
+ parameters[numberParameters-1].append("cleaninstead");
2637
+ parameters[numberParameters-1].append("bothinstead");
2638
+ parameters[numberParameters-1].setLonghelp
2639
+ (
2640
+ "This is a lagrangean relaxation for TwoMir cuts. See \
2641
+ lagomoryCuts for description of options."
2642
+ );
2643
+ parameters[numberParameters++] =
2644
+ CbcOrClpParam("lift!AndProjectCuts", "Whether to use Lift and Project cuts",
2645
+ "off", CBC_PARAM_STR_LANDPCUTS);
2646
+ parameters[numberParameters-1].append("on");
2647
+ parameters[numberParameters-1].append("root");
2648
+ parameters[numberParameters-1].append("ifmove");
2649
+ parameters[numberParameters-1].append("forceOn");
2650
+ parameters[numberParameters-1].setLonghelp
2651
+ (
2652
+ "Lift and project cuts. \
2653
+ May be slow \
2654
+ See branchAndCut for information on options."
2655
+ );
2656
+ parameters[numberParameters++] =
2657
+ CbcOrClpParam("local!TreeSearch", "Whether to use local treesearch",
2658
+ "off", CBC_PARAM_STR_LOCALTREE);
2659
+ parameters[numberParameters-1].append("on");
2660
+ parameters[numberParameters-1].setLonghelp
2661
+ (
2662
+ "This switches on a local search algorithm when a solution is found. This is from \
2663
+ Fischetti and Lodi and is not really a heuristic although it can be used as one. \
2664
+ When used from Coin solve it has limited functionality. It is not switched on when \
2665
+ heuristics are switched on."
2666
+ );
2667
+ #endif
2668
+ #ifndef COIN_HAS_CBC
2669
+ parameters[numberParameters++] =
2670
+ CbcOrClpParam("log!Level", "Level of detail in Solver output",
2671
+ -1, 999999, CLP_PARAM_INT_SOLVERLOGLEVEL);
2672
+ #else
2673
+ parameters[numberParameters++] =
2674
+ CbcOrClpParam("log!Level", "Level of detail in Coin branch and Cut output",
2675
+ -63, 63, CLP_PARAM_INT_LOGLEVEL);
2676
+ parameters[numberParameters-1].setIntValue(1);
2677
+ #endif
2678
+ parameters[numberParameters-1].setLonghelp
2679
+ (
2680
+ "If 0 then there should be no output in normal circumstances. 1 is probably the best\
2681
+ value for most uses, while 2 and 3 give more information."
2682
+ );
2683
+ parameters[numberParameters++] =
2684
+ CbcOrClpParam("max!imize", "Set optimization direction to maximize",
2685
+ CLP_PARAM_ACTION_MAXIMIZE, 7);
2686
+ parameters[numberParameters-1].setLonghelp
2687
+ (
2688
+ "The default is minimize - use 'maximize' for maximization.\n\
2689
+ You can also use the parameters 'direction maximize'."
2690
+ );
2691
+ #ifdef COIN_HAS_CLP
2692
+ parameters[numberParameters++] =
2693
+ CbcOrClpParam("maxF!actor", "Maximum number of iterations between \
2694
+ refactorizations",
2695
+ 1, 999999, CLP_PARAM_INT_MAXFACTOR);
2696
+ parameters[numberParameters-1].setLonghelp
2697
+ (
2698
+ "If this is at its initial value of 200 then in this executable clp will guess at a\
2699
+ value to use. Otherwise the user can set a value. The code may decide to re-factorize\
2700
+ earlier for accuracy."
2701
+ );
2702
+ parameters[numberParameters++] =
2703
+ CbcOrClpParam("maxIt!erations", "Maximum number of iterations before \
2704
+ stopping",
2705
+ 0, 2147483647, CLP_PARAM_INT_MAXITERATION);
2706
+ parameters[numberParameters-1].setLonghelp
2707
+ (
2708
+ "This can be used for testing purposes. The corresponding library call\n\
2709
+ \tsetMaximumIterations(value)\n can be useful. If the code stops on\
2710
+ seconds or by an interrupt this will be treated as stopping on maximum iterations. This is ignored in branchAndCut - use maxN!odes."
2711
+ );
2712
+ #endif
2713
+ #ifdef COIN_HAS_CBC
2714
+ parameters[numberParameters++] =
2715
+ CbcOrClpParam("maxN!odes", "Maximum number of nodes to do",
2716
+ -1, 2147483647, CBC_PARAM_INT_MAXNODES);
2717
+ parameters[numberParameters-1].setLonghelp
2718
+ (
2719
+ "This is a repeatable way to limit search. Normally using time is easier \
2720
+ but then the results may not be repeatable."
2721
+ );
2722
+ parameters[numberParameters++] =
2723
+ CbcOrClpParam("maxSaved!Solutions", "Maximum number of solutions to save",
2724
+ 0, 2147483647, CBC_PARAM_INT_MAXSAVEDSOLS);
2725
+ parameters[numberParameters-1].setLonghelp
2726
+ (
2727
+ "Number of solutions to save."
2728
+ );
2729
+ parameters[numberParameters++] =
2730
+ CbcOrClpParam("maxSo!lutions", "Maximum number of solutions to get",
2731
+ 1, 2147483647, CBC_PARAM_INT_MAXSOLS);
2732
+ parameters[numberParameters-1].setLonghelp
2733
+ (
2734
+ "You may want to stop after (say) two solutions or an hour. \
2735
+ This is checked every node in tree, so it is possible to get more solutions from heuristics."
2736
+ );
2737
+ #endif
2738
+ parameters[numberParameters++] =
2739
+ CbcOrClpParam("min!imize", "Set optimization direction to minimize",
2740
+ CLP_PARAM_ACTION_MINIMIZE, 7);
2741
+ parameters[numberParameters-1].setLonghelp
2742
+ (
2743
+ "The default is minimize - use 'maximize' for maximization.\n\
2744
+ This should only be necessary if you have previously set maximization \
2745
+ You can also use the parameters 'direction minimize'."
2746
+ );
2747
+ #ifdef COIN_HAS_CBC
2748
+ parameters[numberParameters++] =
2749
+ CbcOrClpParam("mipO!ptions", "Dubious options for mip",
2750
+ 0, COIN_INT_MAX, CBC_PARAM_INT_MIPOPTIONS, 0);
2751
+ parameters[numberParameters++] =
2752
+ CbcOrClpParam("more!MipOptions", "More dubious options for mip",
2753
+ -1, COIN_INT_MAX, CBC_PARAM_INT_MOREMIPOPTIONS, 0);
2754
+ parameters[numberParameters++] =
2755
+ CbcOrClpParam("more2!MipOptions", "More more dubious options for mip",
2756
+ -1, COIN_INT_MAX, CBC_PARAM_INT_MOREMOREMIPOPTIONS, 0);
2757
+ parameters[numberParameters-1].setIntValue(0);
2758
+ parameters[numberParameters++] =
2759
+ CbcOrClpParam("mixed!IntegerRoundingCuts", "Whether to use Mixed Integer Rounding cuts",
2760
+ "off", CBC_PARAM_STR_MIXEDCUTS);
2761
+ parameters[numberParameters-1].append("on");
2762
+ parameters[numberParameters-1].append("root");
2763
+ parameters[numberParameters-1].append("ifmove");
2764
+ parameters[numberParameters-1].append("forceOn");
2765
+ parameters[numberParameters-1].append("onglobal");
2766
+ parameters[numberParameters-1].setLonghelp
2767
+ (
2768
+ "This switches on mixed integer rounding cuts (either at root or in entire tree) \
2769
+ See branchAndCut for information on options."
2770
+ );
2771
+ #endif
2772
+ parameters[numberParameters++] =
2773
+ CbcOrClpParam("mess!ages", "Controls if Clpnnnn is printed",
2774
+ "off", CLP_PARAM_STR_MESSAGES);
2775
+ parameters[numberParameters-1].append("on");
2776
+ parameters[numberParameters-1].setLonghelp
2777
+ ("The default behavior is to put out messages such as:\n\
2778
+ Clp0005 2261 Objective 109.024 Primal infeas 944413 (758)\n\
2779
+ but this program turns this off to make it look more friendly. It can be useful\
2780
+ to turn them back on if you want to be able to 'grep' for particular messages or if\
2781
+ you intend to override the behavior of a particular message. This only affects Clp not Cbc."
2782
+ );
2783
+ parameters[numberParameters++] =
2784
+ CbcOrClpParam("miplib", "Do some of miplib test set",
2785
+ CBC_PARAM_ACTION_MIPLIB, 3, 1);
2786
+ #ifdef COIN_HAS_CBC
2787
+ parameters[numberParameters++] =
2788
+ CbcOrClpParam("mips!tart", "reads an initial feasible solution from file",
2789
+ CBC_PARAM_ACTION_MIPSTART);
2790
+ parameters[numberParameters-1].setLonghelp
2791
+ ("\
2792
+ The MIPStart allows one to enter an initial integer feasible solution \
2793
+ to CBC. Values of the main decision variables which are active (have \
2794
+ non-zero values) in this solution are specified in a text file. The \
2795
+ text file format used is the same of the solutions saved by CBC, but \
2796
+ not all fields are required to be filled. First line may contain the \
2797
+ solution status and will be ignored, remaining lines contain column \
2798
+ indexes, names and values as in this example:\n\
2799
+ \n\
2800
+ Stopped on iterations - objective value 57597.00000000\n\
2801
+ 0 x(1,1,2,2) 1 \n\
2802
+ 1 x(3,1,3,2) 1 \n\
2803
+ 5 v(5,1) 2 \n\
2804
+ 33 x(8,1,5,2) 1 \n\
2805
+ ...\n\
2806
+ \n\
2807
+ Column indexes are also ignored since pre-processing can change them. \
2808
+ There is no need to include values for continuous or integer auxiliary \
2809
+ variables, since they can be computed based on main decision variables. \
2810
+ Starting CBC with an integer feasible solution can dramatically improve \
2811
+ its performance: several MIP heuristics (e.g. RINS) rely on having at \
2812
+ least one feasible solution available and can start immediately if the \
2813
+ user provides one. Feasibility Pump (FP) is a heuristic which tries to \
2814
+ overcome the problem of taking too long to find feasible solution (or \
2815
+ not finding at all), but it not always succeeds. If you provide one \
2816
+ starting solution you will probably save some time by disabling FP. \
2817
+ \n\n\
2818
+ Knowledge specific to your problem can be considered to write an \
2819
+ external module to quickly produce an initial feasible solution - some \
2820
+ alternatives are the implementation of simple greedy heuristics or the \
2821
+ solution (by CBC for example) of a simpler model created just to find \
2822
+ a feasible solution. \
2823
+ \n\n\
2824
+ Question and suggestions regarding MIPStart can be directed to\n\
2825
+ haroldo.santos@gmail.com.\
2826
+ ");
2827
+ #endif
2828
+ parameters[numberParameters++] =
2829
+ CbcOrClpParam("moreS!pecialOptions", "Yet more dubious options for Simplex - see ClpSimplex.hpp",
2830
+ 0, COIN_INT_MAX, CLP_PARAM_INT_MORESPECIALOPTIONS, 0);
2831
+ #ifdef COIN_HAS_CBC
2832
+ parameters[numberParameters++] =
2833
+ CbcOrClpParam("moreT!une", "Yet more dubious ideas for feasibility pump",
2834
+ 0, 100000000, CBC_PARAM_INT_FPUMPTUNE2, 0);
2835
+ parameters[numberParameters-1].setLonghelp
2836
+ (
2837
+ "Yet more ideas for Feasibility Pump \n\
2838
+ \t/100000 == 1 use box constraints and original obj in cleanup\n\
2839
+ \t/1000 == 1 Pump will run twice if no solution found\n\
2840
+ \t/1000 == 2 Pump will only run after root cuts if no solution found\n\
2841
+ \t/1000 >10 as above but even if solution found\n\
2842
+ \t/100 == 1,3.. exact 1.0 for objective values\n\
2843
+ \t/100 == 2,3.. allow more iterations per pass\n\
2844
+ \t n fix if value of variable same for last n iterations."
2845
+ );
2846
+ parameters[numberParameters-1].setIntValue(0);
2847
+ parameters[numberParameters++] =
2848
+ CbcOrClpParam("multiple!RootPasses", "Do multiple root passes to collect cuts and solutions",
2849
+ 0, 100000000, CBC_PARAM_INT_MULTIPLEROOTS, 0);
2850
+ parameters[numberParameters-1].setIntValue(0);
2851
+ parameters[numberParameters-1].setLonghelp
2852
+ (
2853
+ "Do (in parallel if threads enabled) the root phase this number of times \
2854
+ and collect all solutions and cuts generated. The actual format is aabbcc \
2855
+ where aa is number of extra passes, if bb is non zero \
2856
+ then it is number of threads to use (otherwise uses threads setting) and \
2857
+ cc is number of times to do root phase. Yet another one from the Italian idea factory \
2858
+ (This time - Andrea Lodi , Matteo Fischetti , Michele Monaci , Domenico Salvagnin , \
2859
+ and Andrea Tramontani). \
2860
+ The solvers do not interact with each other. However if extra passes are specified \
2861
+ then cuts are collected and used in later passes - so there is interaction there."
2862
+ );
2863
+ parameters[numberParameters++] =
2864
+ CbcOrClpParam("naive!Heuristics", "Whether to try some stupid heuristic",
2865
+ "off", CBC_PARAM_STR_NAIVE, 7, 1);
2866
+ parameters[numberParameters-1].append("on");
2867
+ parameters[numberParameters-1].append("both");
2868
+ parameters[numberParameters-1].append("before");
2869
+ parameters[numberParameters-1].setLonghelp
2870
+ (
2871
+ "Really silly stuff e.g. fix all integers with costs to zero!. \
2872
+ Doh option does heuristic before preprocessing" );
2873
+ #endif
2874
+ #ifdef COIN_HAS_CLP
2875
+ parameters[numberParameters++] =
2876
+ CbcOrClpParam("netlib", "Solve entire netlib test set",
2877
+ CLP_PARAM_ACTION_NETLIB_EITHER, 3, 1);
2878
+ parameters[numberParameters-1].setLonghelp
2879
+ (
2880
+ "This exercises the unit test for clp and then solves the netlib test set using dual or primal.\
2881
+ The user can set options before e.g. clp -presolve off -netlib"
2882
+ );
2883
+ parameters[numberParameters++] =
2884
+ CbcOrClpParam("netlibB!arrier", "Solve entire netlib test set with barrier",
2885
+ CLP_PARAM_ACTION_NETLIB_BARRIER, 3, 1);
2886
+ parameters[numberParameters-1].setLonghelp
2887
+ (
2888
+ "This exercises the unit test for clp and then solves the netlib test set using barrier.\
2889
+ The user can set options before e.g. clp -kkt on -netlib"
2890
+ );
2891
+ parameters[numberParameters++] =
2892
+ CbcOrClpParam("netlibD!ual", "Solve entire netlib test set (dual)",
2893
+ CLP_PARAM_ACTION_NETLIB_DUAL, 3, 1);
2894
+ parameters[numberParameters-1].setLonghelp
2895
+ (
2896
+ "This exercises the unit test for clp and then solves the netlib test set using dual.\
2897
+ The user can set options before e.g. clp -presolve off -netlib"
2898
+ );
2899
+ parameters[numberParameters++] =
2900
+ CbcOrClpParam("netlibP!rimal", "Solve entire netlib test set (primal)",
2901
+ CLP_PARAM_ACTION_NETLIB_PRIMAL, 3, 1);
2902
+ parameters[numberParameters-1].setLonghelp
2903
+ (
2904
+ "This exercises the unit test for clp and then solves the netlib test set using primal.\
2905
+ The user can set options before e.g. clp -presolve off -netlibp"
2906
+ );
2907
+ parameters[numberParameters++] =
2908
+ CbcOrClpParam("netlibT!une", "Solve entire netlib test set with 'best' algorithm",
2909
+ CLP_PARAM_ACTION_NETLIB_TUNE, 3, 1);
2910
+ parameters[numberParameters-1].setLonghelp
2911
+ (
2912
+ "This exercises the unit test for clp and then solves the netlib test set using whatever \
2913
+ works best. I know this is cheating but it also stresses the code better by doing a \
2914
+ mixture of stuff. The best algorithm was chosen on a Linux ThinkPad using native cholesky \
2915
+ with University of Florida ordering."
2916
+ );
2917
+ parameters[numberParameters++] =
2918
+ CbcOrClpParam("network", "Tries to make network matrix",
2919
+ CLP_PARAM_ACTION_NETWORK, 7, 0);
2920
+ parameters[numberParameters-1].setLonghelp
2921
+ (
2922
+ "Clp will go faster if the matrix can be converted to a network. The matrix\
2923
+ operations may be a bit faster with more efficient storage, but the main advantage\
2924
+ comes from using a network factorization. It will probably not be as fast as a \
2925
+ specialized network code."
2926
+ );
2927
+ #ifdef COIN_HAS_CBC
2928
+ parameters[numberParameters++] =
2929
+ CbcOrClpParam("nextB!estSolution", "Prints next best saved solution to file",
2930
+ CLP_PARAM_ACTION_NEXTBESTSOLUTION);
2931
+ parameters[numberParameters-1].setLonghelp
2932
+ (
2933
+ "To write best solution, just use solution. This prints next best (if exists) \
2934
+ and then deletes it. \
2935
+ This will write a primitive solution file to the given file name. It will use the default\
2936
+ directory given by 'directory'. A name of '$' will use the previous value for the name. This\
2937
+ is initialized to 'stdout'. The amount of output can be varied using printi!ngOptions or printMask."
2938
+ );
2939
+ parameters[numberParameters++] =
2940
+ CbcOrClpParam("node!Strategy", "What strategy to use to select nodes",
2941
+ "hybrid", CBC_PARAM_STR_NODESTRATEGY);
2942
+ parameters[numberParameters-1].append("fewest");
2943
+ parameters[numberParameters-1].append("depth");
2944
+ parameters[numberParameters-1].append("upfewest");
2945
+ parameters[numberParameters-1].append("downfewest");
2946
+ parameters[numberParameters-1].append("updepth");
2947
+ parameters[numberParameters-1].append("downdepth");
2948
+ parameters[numberParameters-1].setLonghelp
2949
+ (
2950
+ "Normally before a solution the code will choose node with fewest infeasibilities. \
2951
+ You can choose depth as the criterion. You can also say if up or down branch must \
2952
+ be done first (the up down choice will carry on after solution). \
2953
+ Default has now been changed to hybrid which is breadth first on small depth nodes then fewest."
2954
+ );
2955
+ parameters[numberParameters++] =
2956
+ CbcOrClpParam("numberA!nalyze", "Number of analysis iterations",
2957
+ -COIN_INT_MAX, COIN_INT_MAX, CBC_PARAM_INT_NUMBERANALYZE, 0);
2958
+ parameters[numberParameters-1].setLonghelp
2959
+ (
2960
+ "This says how many iterations to spend at root node analyzing problem. \
2961
+ This is a first try and will hopefully become more sophisticated."
2962
+ );
2963
+ #endif
2964
+ parameters[numberParameters++] =
2965
+ CbcOrClpParam("objective!Scale", "Scale factor to apply to objective",
2966
+ -1.0e20, 1.0e20, CLP_PARAM_DBL_OBJSCALE, 1);
2967
+ parameters[numberParameters-1].setLonghelp
2968
+ (
2969
+ "If the objective function has some very large values, you may wish to scale them\
2970
+ internally by this amount. It can also be set by autoscale. It is applied after scaling. You are unlikely to need this."
2971
+ );
2972
+ parameters[numberParameters-1].setDoubleValue(1.0);
2973
+ #endif
2974
+ #ifdef COIN_HAS_CBC
2975
+ #ifdef COIN_HAS_NTY
2976
+ parameters[numberParameters++] =
2977
+ CbcOrClpParam("Orbit!alBranching", "Whether to try orbital branching",
2978
+ "off", CBC_PARAM_STR_ORBITAL);
2979
+ parameters[numberParameters-1].append("on");
2980
+ parameters[numberParameters-1].append("strong");
2981
+ parameters[numberParameters-1].append("force");
2982
+ parameters[numberParameters-1].setLonghelp
2983
+ (
2984
+ "This switches on Orbital branching. \
2985
+ On just adds orbital, strong tries extra fixing in strong branching");
2986
+ #endif
2987
+ parameters[numberParameters++] =
2988
+ CbcOrClpParam("outDup!licates", "takes duplicate rows etc out of integer model",
2989
+ CLP_PARAM_ACTION_OUTDUPROWS, 7, 0);
2990
+ #endif
2991
+ parameters[numberParameters++] =
2992
+ CbcOrClpParam("output!Format", "Which output format to use",
2993
+ 1, 6, CLP_PARAM_INT_OUTPUTFORMAT);
2994
+ parameters[numberParameters-1].setLonghelp
2995
+ (
2996
+ "Normally export will be done using normal representation for numbers and two values\
2997
+ per line. You may want to do just one per line (for grep or suchlike) and you may wish\
2998
+ to save with absolute accuracy using a coded version of the IEEE value. A value of 2 is normal.\
2999
+ otherwise odd values gives one value per line, even two. Values 1,2 give normal format, 3,4\
3000
+ gives greater precision, while 5,6 give IEEE values. When used for exporting a basis 1 does not save \
3001
+ values, 2 saves values, 3 with greater accuracy and 4 in IEEE."
3002
+ );
3003
+ #ifdef COIN_HAS_CLP
3004
+ parameters[numberParameters++] =
3005
+ CbcOrClpParam("para!metrics", "Import data from file and do parametrics",
3006
+ CLP_PARAM_ACTION_PARAMETRICS, 3);
3007
+ parameters[numberParameters-1].setLonghelp
3008
+ (
3009
+ "This will read a file with parametric data from the given file name \
3010
+ and then do parametrics. It will use the default\
3011
+ directory given by 'directory'. A name of '$' will use the previous value for the name. This\
3012
+ is initialized to '', i.e. it must be set. This can not read from compressed files. \
3013
+ File is in modified csv format - a line ROWS will be followed by rows data \
3014
+ while a line COLUMNS will be followed by column data. The last line \
3015
+ should be ENDATA. The ROWS line must exist and is in the format \
3016
+ ROWS, inital theta, final theta, interval theta, n where n is 0 to get \
3017
+ CLPI0062 message at interval or at each change of theta \
3018
+ and 1 to get CLPI0063 message at each iteration. If interval theta is 0.0 \
3019
+ or >= final theta then no interval reporting. n may be missed out when it is \
3020
+ taken as 0. If there is Row data then \
3021
+ there is a headings line with allowed headings - name, number, \
3022
+ lower(rhs change), upper(rhs change), rhs(change). Either the lower and upper \
3023
+ fields should be given or the rhs field. \
3024
+ The optional COLUMNS line is followed by a headings line with allowed \
3025
+ headings - name, number, objective(change), lower(change), upper(change). \
3026
+ Exactly one of name and number must be given for either section and \
3027
+ missing ones have value 0.0."
3028
+ );
3029
+ #endif
3030
+ #ifdef COIN_HAS_CBC
3031
+ parameters[numberParameters++] =
3032
+ CbcOrClpParam("passC!uts", "Number of cut passes at root node",
3033
+ -9999999, 9999999, CBC_PARAM_INT_CUTPASS);
3034
+ parameters[numberParameters-1].setLonghelp
3035
+ (
3036
+ "The default is 100 passes if less than 500 columns, 100 passes (but \
3037
+ stop if drop small if less than 5000 columns, 20 otherwise"
3038
+ );
3039
+ parameters[numberParameters++] =
3040
+ CbcOrClpParam("passF!easibilityPump", "How many passes in feasibility pump",
3041
+ 0, 10000, CBC_PARAM_INT_FPUMPITS);
3042
+ parameters[numberParameters-1].setLonghelp
3043
+ (
3044
+ "This fine tunes Feasibility Pump by doing more or fewer passes."
3045
+ );
3046
+ parameters[numberParameters-1].setIntValue(20);
3047
+ #endif
3048
+ #ifdef COIN_HAS_CLP
3049
+ parameters[numberParameters++] =
3050
+ CbcOrClpParam("passP!resolve", "How many passes in presolve",
3051
+ -200, 100, CLP_PARAM_INT_PRESOLVEPASS, 1);
3052
+ parameters[numberParameters-1].setLonghelp
3053
+ (
3054
+ "Normally Presolve does 10 passes but you may want to do less to make it\
3055
+ more lightweight or do more if improvements are still being made. As Presolve will return\
3056
+ if nothing is being taken out, you should not normally need to use this fine tuning."
3057
+ );
3058
+ #endif
3059
+ #ifdef COIN_HAS_CBC
3060
+ parameters[numberParameters++] =
3061
+ CbcOrClpParam("passT!reeCuts", "Number of cut passes in tree",
3062
+ -9999999, 9999999, CBC_PARAM_INT_CUTPASSINTREE);
3063
+ parameters[numberParameters-1].setLonghelp
3064
+ (
3065
+ "The default is one pass"
3066
+ );
3067
+ #endif
3068
+ #ifdef COIN_HAS_CLP
3069
+ parameters[numberParameters++] =
3070
+ CbcOrClpParam("pertV!alue", "Method of perturbation",
3071
+ -5000, 102, CLP_PARAM_INT_PERTVALUE, 1);
3072
+ parameters[numberParameters++] =
3073
+ CbcOrClpParam("perturb!ation", "Whether to perturb problem",
3074
+ "on", CLP_PARAM_STR_PERTURBATION);
3075
+ parameters[numberParameters-1].append("off");
3076
+ parameters[numberParameters-1].setLonghelp
3077
+ (
3078
+ "Perturbation helps to stop cycling, but Clp uses other measures for this.\
3079
+ However large problems and especially ones with unit elements and unit rhs or costs\
3080
+ benefit from perturbation. Normally Clp tries to be intelligent, but you can switch this off.\
3081
+ The Clp library has this off by default. This program has it on by default."
3082
+ );
3083
+ parameters[numberParameters++] =
3084
+ CbcOrClpParam("PFI", "Whether to use Product Form of Inverse in simplex",
3085
+ "off", CLP_PARAM_STR_PFI, 7, 0);
3086
+ parameters[numberParameters-1].append("on");
3087
+ parameters[numberParameters-1].setLonghelp
3088
+ (
3089
+ "By default clp uses Forrest-Tomlin L-U update. If you are masochistic you can switch it off."
3090
+ );
3091
+ #endif
3092
+ #ifdef COIN_HAS_CBC
3093
+ parameters[numberParameters++] =
3094
+ CbcOrClpParam("pivotAndC!omplement", "Whether to try Pivot and Complement heuristic",
3095
+ "off", CBC_PARAM_STR_PIVOTANDCOMPLEMENT);
3096
+ parameters[numberParameters-1].append("on");
3097
+ parameters[numberParameters-1].append("both");
3098
+ parameters[numberParameters-1].append("before");
3099
+ parameters[numberParameters-1].setLonghelp
3100
+ (
3101
+ "stuff needed. \
3102
+ Doh option does heuristic before preprocessing" );
3103
+ parameters[numberParameters++] =
3104
+ CbcOrClpParam("pivotAndF!ix", "Whether to try Pivot and Fix heuristic",
3105
+ "off", CBC_PARAM_STR_PIVOTANDFIX);
3106
+ parameters[numberParameters-1].append("on");
3107
+ parameters[numberParameters-1].append("both");
3108
+ parameters[numberParameters-1].append("before");
3109
+ parameters[numberParameters-1].setLonghelp
3110
+ (
3111
+ "stuff needed. \
3112
+ Doh option does heuristic before preprocessing" );
3113
+ #endif
3114
+ #ifdef COIN_HAS_CLP
3115
+ parameters[numberParameters++] =
3116
+ CbcOrClpParam("plus!Minus", "Tries to make +- 1 matrix",
3117
+ CLP_PARAM_ACTION_PLUSMINUS, 7, 0);
3118
+ parameters[numberParameters-1].setLonghelp
3119
+ (
3120
+ "Clp will go slightly faster if the matrix can be converted so that the elements are\
3121
+ not stored and are known to be unit. The main advantage is memory use. Clp may automatically\
3122
+ see if it can convert the problem so you should not need to use this."
3123
+ );
3124
+ parameters[numberParameters++] =
3125
+ CbcOrClpParam("pO!ptions", "Dubious print options",
3126
+ 0, COIN_INT_MAX, CLP_PARAM_INT_PRINTOPTIONS, 1);
3127
+ parameters[numberParameters-1].setIntValue(0);
3128
+ parameters[numberParameters-1].setLonghelp
3129
+ (
3130
+ "If this is > 0 then presolve will give more information and branch and cut will give statistics"
3131
+ );
3132
+ parameters[numberParameters++] =
3133
+ CbcOrClpParam("preO!pt", "Presolve options",
3134
+ 0, COIN_INT_MAX, CLP_PARAM_INT_PRESOLVEOPTIONS, 0);
3135
+ #endif
3136
+ parameters[numberParameters++] =
3137
+ CbcOrClpParam("presolve", "Whether to presolve problem",
3138
+ "on", CLP_PARAM_STR_PRESOLVE);
3139
+ parameters[numberParameters-1].append("off");
3140
+ parameters[numberParameters-1].append("more");
3141
+ parameters[numberParameters-1].append("file");
3142
+ parameters[numberParameters-1].setLonghelp
3143
+ (
3144
+ "Presolve analyzes the model to find such things as redundant equations, equations\
3145
+ which fix some variables, equations which can be transformed into bounds etc etc. For the\
3146
+ initial solve of any problem this is worth doing unless you know that it will have no effect. \
3147
+ on will normally do 5 passes while using 'more' will do 10. If the problem is very large you may need \
3148
+ to write the original to file using 'file'."
3149
+ );
3150
+ #ifdef COIN_HAS_CBC
3151
+ parameters[numberParameters++] =
3152
+ CbcOrClpParam("preprocess", "Whether to use integer preprocessing",
3153
+ "off", CBC_PARAM_STR_PREPROCESS);
3154
+ parameters[numberParameters-1].append("on");
3155
+ parameters[numberParameters-1].append("save");
3156
+ parameters[numberParameters-1].append("equal");
3157
+ parameters[numberParameters-1].append("sos");
3158
+ parameters[numberParameters-1].append("trysos");
3159
+ parameters[numberParameters-1].append("equalall");
3160
+ parameters[numberParameters-1].append("strategy");
3161
+ parameters[numberParameters-1].append("aggregate");
3162
+ parameters[numberParameters-1].append("forcesos");
3163
+ parameters[numberParameters-1].setLonghelp
3164
+ (
3165
+ "This tries to reduce size of model in a similar way to presolve and \
3166
+ it also tries to strengthen the model - this can be very useful and is worth trying. \
3167
+ Save option saves on file presolved.mps. equal will turn <= cliques into \
3168
+ ==. sos will create sos sets if all 0-1 in sets (well one extra is allowed) \
3169
+ and no overlaps. trysos is same but allows any number extra. equalall will turn all \
3170
+ valid inequalities into equalities with integer slacks. strategy is as \
3171
+ on but uses CbcStrategy."
3172
+ );
3173
+ #endif
3174
+ #ifdef COIN_HAS_CLP
3175
+ parameters[numberParameters++] =
3176
+ CbcOrClpParam("preT!olerance", "Tolerance to use in presolve",
3177
+ 1.0e-20, 1.0e12, CLP_PARAM_DBL_PRESOLVETOLERANCE);
3178
+ parameters[numberParameters-1].setLonghelp
3179
+ (
3180
+ "The default is 1.0e-8 - you may wish to try 1.0e-7 if presolve says the problem is \
3181
+ infeasible and you have awkward numbers and you are sure the problem is really feasible."
3182
+ );
3183
+ parameters[numberParameters++] =
3184
+ CbcOrClpParam("primalP!ivot", "Primal pivot choice algorithm",
3185
+ "auto!matic", CLP_PARAM_STR_PRIMALPIVOT, 7, 1);
3186
+ parameters[numberParameters-1].append("exa!ct");
3187
+ parameters[numberParameters-1].append("dant!zig");
3188
+ parameters[numberParameters-1].append("part!ial");
3189
+ parameters[numberParameters-1].append("steep!est");
3190
+ parameters[numberParameters-1].append("change");
3191
+ parameters[numberParameters-1].append("sprint");
3192
+ parameters[numberParameters-1].setLonghelp
3193
+ (
3194
+ "Clp can use any pivot selection algorithm which the user codes as long as it\
3195
+ implements the features in the abstract pivot base class. The Dantzig method is implemented\
3196
+ to show a simple method but its use is deprecated. Exact devex is the method of choice and there\
3197
+ are two variants which keep all weights updated but only scan a subset each iteration.\
3198
+ Partial switches this on while change initially does dantzig until the factorization\
3199
+ becomes denser. This is still a work in progress."
3200
+ );
3201
+ parameters[numberParameters++] =
3202
+ CbcOrClpParam("primalS!implex", "Do primal simplex algorithm",
3203
+ CLP_PARAM_ACTION_PRIMALSIMPLEX);
3204
+ parameters[numberParameters-1].setLonghelp
3205
+ (
3206
+ "This command solves the continuous relaxation of the current model using the primal algorithm.\
3207
+ The default is to use exact devex.\
3208
+ The time and iterations may be affected by settings such as presolve, scaling, crash\
3209
+ and also by column selection method, infeasibility weight and dual and primal tolerances."
3210
+ );
3211
+ #endif
3212
+ parameters[numberParameters++] =
3213
+ CbcOrClpParam("primalT!olerance", "For an optimal solution \
3214
+ no primal infeasibility may exceed this value",
3215
+ 1.0e-20, 1.0e12, CLP_PARAM_DBL_PRIMALTOLERANCE);
3216
+ parameters[numberParameters-1].setLonghelp
3217
+ (
3218
+ "Normally the default tolerance is fine, but you may want to increase it a\
3219
+ bit if a primal run seems to be having a hard time"
3220
+ );
3221
+ #ifdef COIN_HAS_CLP
3222
+ parameters[numberParameters++] =
3223
+ CbcOrClpParam("primalW!eight", "Initially algorithm acts as if it \
3224
+ costs this much to be infeasible",
3225
+ 1.0e-20, 1.0e20, CLP_PARAM_DBL_PRIMALWEIGHT);
3226
+ parameters[numberParameters-1].setLonghelp
3227
+ (
3228
+ "The primal algorithm in Clp is a single phase algorithm as opposed to a two phase\
3229
+ algorithm where you first get feasible then optimal. So Clp is minimizing this weight times\
3230
+ the sum of primal infeasibilities plus the true objective function (in minimization sense).\
3231
+ Too high a value may mean more iterations, while too low a bound means\
3232
+ the code may go all the way and then have to increase the weight in order to get feasible.\
3233
+ OSL had a heuristic to\
3234
+ adjust bounds, maybe we need that here."
3235
+ );
3236
+ #endif
3237
+ parameters[numberParameters++] =
3238
+ CbcOrClpParam("printi!ngOptions", "Print options",
3239
+ "normal", CLP_PARAM_STR_INTPRINT, 3);
3240
+ parameters[numberParameters-1].append("integer");
3241
+ parameters[numberParameters-1].append("special");
3242
+ parameters[numberParameters-1].append("rows");
3243
+ parameters[numberParameters-1].append("all");
3244
+ parameters[numberParameters-1].append("csv");
3245
+ parameters[numberParameters-1].append("bound!ranging");
3246
+ parameters[numberParameters-1].append("rhs!ranging");
3247
+ parameters[numberParameters-1].append("objective!ranging");
3248
+ parameters[numberParameters-1].append("stats");
3249
+ parameters[numberParameters-1].append("boundsint");
3250
+ parameters[numberParameters-1].append("boundsall");
3251
+ parameters[numberParameters-1].setLonghelp
3252
+ (
3253
+ "This changes the amount and format of printing a solution:\nnormal - nonzero column variables \n\
3254
+ integer - nonzero integer column variables\n\
3255
+ special - in format suitable for OsiRowCutDebugger\n\
3256
+ rows - nonzero column variables and row activities\n\
3257
+ all - all column variables and row activities.\n\
3258
+ \nFor non-integer problems 'integer' and 'special' act like 'normal'. \
3259
+ Also see printMask for controlling output."
3260
+ );
3261
+ parameters[numberParameters++] =
3262
+ CbcOrClpParam("printM!ask", "Control printing of solution on a mask",
3263
+ CLP_PARAM_ACTION_PRINTMASK, 3);
3264
+ parameters[numberParameters-1].setLonghelp
3265
+ (
3266
+ "If set then only those names which match mask are printed in a solution. \
3267
+ '?' matches any character and '*' matches any set of characters. \
3268
+ The default is '' i.e. unset so all variables are printed. \
3269
+ This is only active if model has names."
3270
+ );
3271
+ #ifdef COIN_HAS_CBC
3272
+ parameters[numberParameters++] =
3273
+ CbcOrClpParam("prio!rityIn", "Import priorities etc from file",
3274
+ CBC_PARAM_ACTION_PRIORITYIN, 3);
3275
+ parameters[numberParameters-1].setLonghelp
3276
+ (
3277
+ "This will read a file with priorities from the given file name. It will use the default\
3278
+ directory given by 'directory'. A name of '$' will use the previous value for the name. This\
3279
+ is initialized to '', i.e. it must be set. This can not read from compressed files. \
3280
+ File is in csv format with allowed headings - name, number, priority, direction, up, down, solution. Exactly one of\
3281
+ name and number must be given."
3282
+ );
3283
+ parameters[numberParameters++] =
3284
+ CbcOrClpParam("probing!Cuts", "Whether to use Probing cuts",
3285
+ "off", CBC_PARAM_STR_PROBINGCUTS);
3286
+ parameters[numberParameters-1].append("on");
3287
+ parameters[numberParameters-1].append("root");
3288
+ parameters[numberParameters-1].append("ifmove");
3289
+ parameters[numberParameters-1].append("forceOn");
3290
+ parameters[numberParameters-1].append("onglobal");
3291
+ parameters[numberParameters-1].append("forceonglobal");
3292
+ parameters[numberParameters-1].append("forceOnBut");
3293
+ parameters[numberParameters-1].append("forceOnStrong");
3294
+ parameters[numberParameters-1].append("forceOnButStrong");
3295
+ parameters[numberParameters-1].append("strongRoot");
3296
+ parameters[numberParameters-1].setLonghelp
3297
+ (
3298
+ "This switches on probing cuts (either at root or in entire tree) \
3299
+ See branchAndCut for information on options. \
3300
+ but strong options do more probing"
3301
+ );
3302
+ parameters[numberParameters++] =
3303
+ CbcOrClpParam("proximity!Search", "Whether to do proximity search heuristic",
3304
+ "off", CBC_PARAM_STR_PROXIMITY);
3305
+ parameters[numberParameters-1].append("on");
3306
+ parameters[numberParameters-1].append("both");
3307
+ parameters[numberParameters-1].append("before");
3308
+ parameters[numberParameters-1].append("10");
3309
+ parameters[numberParameters-1].append("100");
3310
+ parameters[numberParameters-1].append("300");
3311
+ // but allow numbers after this (returning 1)
3312
+ parameters[numberParameters-1].setFakeKeyWord(1);
3313
+ parameters[numberParameters-1].setLonghelp
3314
+ (
3315
+ "This switches on a heuristic which looks for a solution close \
3316
+ to incumbent solution (Fischetti and Monaci). \
3317
+ See Rounding for meaning of on,both,before. \
3318
+ Can also set different maxNode settings by plusnnnn (and are 'on'(on==30))."
3319
+ );
3320
+ parameters[numberParameters++] =
3321
+ CbcOrClpParam("pumpC!utoff", "Fake cutoff for use in feasibility pump",
3322
+ -COIN_DBL_MAX, COIN_DBL_MAX, CBC_PARAM_DBL_FAKECUTOFF);
3323
+ parameters[numberParameters-1].setDoubleValue(0.0);
3324
+ parameters[numberParameters-1].setLonghelp
3325
+ (
3326
+ "0.0 off - otherwise add a constraint forcing objective below this value\
3327
+ in feasibility pump"
3328
+ );
3329
+ parameters[numberParameters++] =
3330
+ CbcOrClpParam("pumpI!ncrement", "Fake increment for use in feasibility pump",
3331
+ -COIN_DBL_MAX, COIN_DBL_MAX, CBC_PARAM_DBL_FAKEINCREMENT, 1);
3332
+ parameters[numberParameters-1].setDoubleValue(0.0);
3333
+ parameters[numberParameters-1].setLonghelp
3334
+ (
3335
+ "0.0 off - otherwise use as absolute increment to cutoff \
3336
+ when solution found in feasibility pump"
3337
+ );
3338
+ parameters[numberParameters++] =
3339
+ CbcOrClpParam("pumpT!une", "Dubious ideas for feasibility pump",
3340
+ 0, 100000000, CBC_PARAM_INT_FPUMPTUNE);
3341
+ parameters[numberParameters-1].setLonghelp
3342
+ (
3343
+ "This fine tunes Feasibility Pump \n\
3344
+ \t>=10000000 use as objective weight switch\n\
3345
+ \t>=1000000 use as accumulate switch\n\
3346
+ \t>=1000 use index+1 as number of large loops\n\
3347
+ \t==100 use objvalue +0.05*fabs(objvalue) as cutoff OR fakeCutoff if set\n\
3348
+ \t%100 == 10,20 affects how each solve is done\n\
3349
+ \t1 == fix ints at bounds, 2 fix all integral ints, 3 and continuous at bounds. \
3350
+ If accumulate is on then after a major pass, variables which have not moved \
3351
+ are fixed and a small branch and bound is tried."
3352
+ );
3353
+ parameters[numberParameters-1].setIntValue(0);
3354
+ #endif
3355
+ parameters[numberParameters++] =
3356
+ CbcOrClpParam("quit", "Stops clp execution",
3357
+ CLP_PARAM_ACTION_EXIT);
3358
+ parameters[numberParameters-1].setLonghelp
3359
+ (
3360
+ "This stops the execution of Clp, end, exit, quit and stop are synonyms"
3361
+ );
3362
+ #ifdef COIN_HAS_CBC
3363
+ parameters[numberParameters++] =
3364
+ CbcOrClpParam("randomC!bcSeed", "Random seed for Cbc",
3365
+ -1, COIN_INT_MAX, CBC_PARAM_INT_RANDOMSEED);
3366
+ parameters[numberParameters-1].setLonghelp
3367
+ (
3368
+ "This sets a random seed for Cbc \
3369
+ - 0 says use time of day, -1 is as now."
3370
+ );
3371
+ parameters[numberParameters-1].setIntValue(-1);
3372
+ parameters[numberParameters++] =
3373
+ CbcOrClpParam("randomi!zedRounding", "Whether to try randomized rounding heuristic",
3374
+ "off", CBC_PARAM_STR_RANDROUND);
3375
+ parameters[numberParameters-1].append("on");
3376
+ parameters[numberParameters-1].append("both");
3377
+ parameters[numberParameters-1].append("before");
3378
+ parameters[numberParameters-1].setLonghelp
3379
+ (
3380
+ "stuff needed. \
3381
+ Doh option does heuristic before preprocessing" );
3382
+ #endif
3383
+ #ifdef COIN_HAS_CLP
3384
+ parameters[numberParameters++] =
3385
+ CbcOrClpParam("randomS!eed", "Random seed for Clp",
3386
+ 0, COIN_INT_MAX, CLP_PARAM_INT_RANDOMSEED);
3387
+ parameters[numberParameters-1].setLonghelp
3388
+ (
3389
+ "This sets a random seed for Clp \
3390
+ - 0 says use time of day."
3391
+ );
3392
+ parameters[numberParameters-1].setIntValue(1234567);
3393
+ #endif
3394
+ #ifdef COIN_HAS_CBC
3395
+ parameters[numberParameters++] =
3396
+ CbcOrClpParam("ratio!Gap", "Stop when gap between best possible and \
3397
+ best less than this fraction of larger of two",
3398
+ 0.0, 1.0e20, CBC_PARAM_DBL_GAPRATIO);
3399
+ parameters[numberParameters-1].setDoubleValue(0.0);
3400
+ parameters[numberParameters-1].setLonghelp
3401
+ (
3402
+ "If the gap between best solution and best possible solution is less than this fraction \
3403
+ of the objective value at the root node then the search will terminate. See 'allowableGap' for a \
3404
+ way of using absolute value rather than fraction."
3405
+ );
3406
+ #endif
3407
+ parameters[numberParameters++] =
3408
+ CbcOrClpParam("restoreS!olution", "reads solution from file",
3409
+ CLP_PARAM_ACTION_RESTORESOL);
3410
+ parameters[numberParameters-1].setLonghelp
3411
+ (
3412
+ "This will read a binary solution file from the given file name. It will use the default\
3413
+ directory given by 'directory'. A name of '$' will use the previous value for the name. This\
3414
+ is initialized to 'solution.file'. This reads in a file from saveSolution"
3415
+ );
3416
+ #ifdef COIN_HAS_CBC
3417
+ parameters[numberParameters++] =
3418
+ CbcOrClpParam("readSt!ored", "Import stored cuts from file",
3419
+ CLP_PARAM_ACTION_STOREDFILE, 3, 0);
3420
+ #endif
3421
+ #ifdef COIN_HAS_CLP
3422
+ parameters[numberParameters++] =
3423
+ CbcOrClpParam("reallyO!bjectiveScale", "Scale factor to apply to objective in place",
3424
+ -1.0e20, 1.0e20, CLP_PARAM_DBL_OBJSCALE2, 0);
3425
+ parameters[numberParameters-1].setLonghelp
3426
+ (
3427
+ "You can set this to -1.0 to test maximization or other to stress code"
3428
+ );
3429
+ parameters[numberParameters-1].setDoubleValue(1.0);
3430
+ parameters[numberParameters++] =
3431
+ CbcOrClpParam("reallyS!cale", "Scales model in place",
3432
+ CLP_PARAM_ACTION_REALLY_SCALE, 7, 0);
3433
+ #endif
3434
+ #ifdef COIN_HAS_CBC
3435
+ parameters[numberParameters++] =
3436
+ CbcOrClpParam("reduce!AndSplitCuts", "Whether to use Reduce-and-Split cuts",
3437
+ "off", CBC_PARAM_STR_REDSPLITCUTS);
3438
+ parameters[numberParameters-1].append("on");
3439
+ parameters[numberParameters-1].append("root");
3440
+ parameters[numberParameters-1].append("ifmove");
3441
+ parameters[numberParameters-1].append("forceOn");
3442
+ parameters[numberParameters-1].setLonghelp
3443
+ (
3444
+ "This switches on reduce and split cuts (either at root or in entire tree). \
3445
+ May be slow \
3446
+ See branchAndCut for information on options."
3447
+ );
3448
+ parameters[numberParameters++] =
3449
+ CbcOrClpParam("reduce2!AndSplitCuts", "Whether to use Reduce-and-Split cuts - style 2",
3450
+ "off", CBC_PARAM_STR_REDSPLIT2CUTS);
3451
+ parameters[numberParameters-1].append("on");
3452
+ parameters[numberParameters-1].append("root");
3453
+ parameters[numberParameters-1].append("longOn");
3454
+ parameters[numberParameters-1].append("longRoot");
3455
+ parameters[numberParameters-1].setLonghelp
3456
+ (
3457
+ "This switches on reduce and split cuts (either at root or in entire tree) \
3458
+ This version is by Giacomo Nannicini based on Francois Margot's version \
3459
+ Standard setting only uses rows in tableau <=256, long uses all \
3460
+ May be slow \
3461
+ See branchAndCut for information on options."
3462
+ );
3463
+ parameters[numberParameters++] =
3464
+ CbcOrClpParam("reduce2!AndSplitCuts", "Whether to use Reduce-and-Split cuts - style 2",
3465
+ "off", CBC_PARAM_STR_REDSPLIT2CUTS);
3466
+ parameters[numberParameters-1].append("on");
3467
+ parameters[numberParameters-1].append("root");
3468
+ parameters[numberParameters-1].append("longOn");
3469
+ parameters[numberParameters-1].append("longRoot");
3470
+ parameters[numberParameters-1].setLonghelp
3471
+ (
3472
+ "This switches on reduce and split cuts (either at root or in entire tree) \
3473
+ This version is by Giacomo Nannicini based on Francois Margot's version \
3474
+ Standard setting only uses rows in tableau <=256, long uses all \
3475
+ See branchAndCut for information on options."
3476
+ );
3477
+ parameters[numberParameters++] =
3478
+ CbcOrClpParam("residual!CapacityCuts", "Whether to use Residual Capacity cuts",
3479
+ "off", CBC_PARAM_STR_RESIDCUTS);
3480
+ parameters[numberParameters-1].append("on");
3481
+ parameters[numberParameters-1].append("root");
3482
+ parameters[numberParameters-1].append("ifmove");
3483
+ parameters[numberParameters-1].append("forceOn");
3484
+ parameters[numberParameters-1].setLonghelp
3485
+ (
3486
+ "Residual capacity cuts. \
3487
+ See branchAndCut for information on options."
3488
+ );
3489
+ #endif
3490
+ #ifdef COIN_HAS_CLP
3491
+ parameters[numberParameters++] =
3492
+ CbcOrClpParam("restore!Model", "Restore model from binary file",
3493
+ CLP_PARAM_ACTION_RESTORE, 7, 1);
3494
+ parameters[numberParameters-1].setLonghelp
3495
+ (
3496
+ "This reads data save by saveModel from the given file. It will use the default\
3497
+ directory given by 'directory'. A name of '$' will use the previous value for the name. This\
3498
+ is initialized to 'default.prob'."
3499
+ );
3500
+ parameters[numberParameters++] =
3501
+ CbcOrClpParam("reverse", "Reverses sign of objective",
3502
+ CLP_PARAM_ACTION_REVERSE, 7, 0);
3503
+ parameters[numberParameters-1].setLonghelp
3504
+ (
3505
+ "Useful for testing if maximization works correctly"
3506
+ );
3507
+ parameters[numberParameters++] =
3508
+ CbcOrClpParam("rhs!Scale", "Scale factor to apply to rhs and bounds",
3509
+ -1.0e20, 1.0e20, CLP_PARAM_DBL_RHSSCALE, 0);
3510
+ parameters[numberParameters-1].setLonghelp
3511
+ (
3512
+ "If the rhs or bounds have some very large meaningful values, you may wish to scale them\
3513
+ internally by this amount. It can also be set by autoscale. This should not be needed."
3514
+ );
3515
+ parameters[numberParameters-1].setDoubleValue(1.0);
3516
+ #endif
3517
+ #ifdef COIN_HAS_CBC
3518
+ parameters[numberParameters++] =
3519
+ CbcOrClpParam("Rens", "Whether to try Relaxation Enforced Neighborhood Search",
3520
+ "off", CBC_PARAM_STR_RENS);
3521
+ parameters[numberParameters-1].append("on");
3522
+ parameters[numberParameters-1].append("both");
3523
+ parameters[numberParameters-1].append("before");
3524
+ parameters[numberParameters-1].append("200");
3525
+ parameters[numberParameters-1].append("1000");
3526
+ parameters[numberParameters-1].append("10000");
3527
+ parameters[numberParameters-1].append("dj");
3528
+ parameters[numberParameters-1].append("djbefore");
3529
+ parameters[numberParameters-1].append("usesolution");
3530
+ parameters[numberParameters-1].setLonghelp
3531
+ (
3532
+ "This switches on Relaxation enforced neighborhood Search. \
3533
+ on just does 50 nodes \
3534
+ 200 or 1000 does that many nodes. \
3535
+ Doh option does heuristic before preprocessing" );
3536
+ parameters[numberParameters++] =
3537
+ CbcOrClpParam("Rins", "Whether to try Relaxed Induced Neighborhood Search",
3538
+ "off", CBC_PARAM_STR_RINS);
3539
+ parameters[numberParameters-1].append("on");
3540
+ parameters[numberParameters-1].append("both");
3541
+ parameters[numberParameters-1].append("before");
3542
+ parameters[numberParameters-1].append("often");
3543
+ parameters[numberParameters-1].setLonghelp
3544
+ (
3545
+ "This switches on Relaxed induced neighborhood Search. \
3546
+ Doh option does heuristic before preprocessing" );
3547
+ parameters[numberParameters++] =
3548
+ CbcOrClpParam("round!ingHeuristic", "Whether to use Rounding heuristic",
3549
+ "off", CBC_PARAM_STR_ROUNDING);
3550
+ parameters[numberParameters-1].append("on");
3551
+ parameters[numberParameters-1].append("both");
3552
+ parameters[numberParameters-1].append("before");
3553
+ parameters[numberParameters-1].setLonghelp
3554
+ (
3555
+ "This switches on a simple (but effective) rounding heuristic at each node of tree. \
3556
+ On means do in solve i.e. after preprocessing, \
3557
+ Before means do if doHeuristics used, off otherwise, \
3558
+ and both means do if doHeuristics and in solve."
3559
+ );
3560
+
3561
+ #endif
3562
+ parameters[numberParameters++] =
3563
+ CbcOrClpParam("saveM!odel", "Save model to binary file",
3564
+ CLP_PARAM_ACTION_SAVE, 7, 1);
3565
+ parameters[numberParameters-1].setLonghelp
3566
+ (
3567
+ "This will save the problem to the given file name for future use\
3568
+ by restoreModel. It will use the default\
3569
+ directory given by 'directory'. A name of '$' will use the previous value for the name. This\
3570
+ is initialized to 'default.prob'."
3571
+ );
3572
+ parameters[numberParameters++] =
3573
+ CbcOrClpParam("saveS!olution", "saves solution to file",
3574
+ CLP_PARAM_ACTION_SAVESOL);
3575
+ parameters[numberParameters-1].setLonghelp
3576
+ (
3577
+ "This will write a binary solution file to the given file name. It will use the default\
3578
+ directory given by 'directory'. A name of '$' will use the previous value for the name. This\
3579
+ is initialized to 'solution.file'. To read the file use fread(int) twice to pick up number of rows \
3580
+ and columns, then fread(double) to pick up objective value, then pick up row activities, row duals, column \
3581
+ activities and reduced costs - see bottom of CbcOrClpParam.cpp for code that reads or writes file. \
3582
+ If name contains '_fix_read_' then does not write but reads and will fix all variables"
3583
+ );
3584
+ parameters[numberParameters++] =
3585
+ CbcOrClpParam("scal!ing", "Whether to scale problem",
3586
+ "off", CLP_PARAM_STR_SCALING);
3587
+ parameters[numberParameters-1].append("equi!librium");
3588
+ parameters[numberParameters-1].append("geo!metric");
3589
+ parameters[numberParameters-1].append("auto!matic");
3590
+ parameters[numberParameters-1].append("dynamic");
3591
+ parameters[numberParameters-1].append("rows!only");
3592
+ parameters[numberParameters-1].setLonghelp
3593
+ (
3594
+ "Scaling can help in solving problems which might otherwise fail because of lack of\
3595
+ accuracy. It can also reduce the number of iterations. It is not applied if the range\
3596
+ of elements is small. When unscaled it is possible that there may be small primal and/or\
3597
+ infeasibilities."
3598
+ );
3599
+ parameters[numberParameters-1].setCurrentOption(3); // say auto
3600
+ #ifndef COIN_HAS_CBC
3601
+ parameters[numberParameters++] =
3602
+ CbcOrClpParam("sec!onds", "Maximum seconds",
3603
+ -1.0, 1.0e12, CLP_PARAM_DBL_TIMELIMIT);
3604
+ parameters[numberParameters-1].setLonghelp
3605
+ (
3606
+ "After this many seconds clp will act as if maximum iterations had been reached \
3607
+ (if value >=0)."
3608
+ );
3609
+ #else
3610
+ parameters[numberParameters++] =
3611
+ CbcOrClpParam("sec!onds", "maximum seconds",
3612
+ -1.0, 1.0e12, CBC_PARAM_DBL_TIMELIMIT_BAB);
3613
+ parameters[numberParameters-1].setLonghelp
3614
+ (
3615
+ "After this many seconds coin solver will act as if maximum nodes had been reached."
3616
+ );
3617
+ #endif
3618
+ parameters[numberParameters++] =
3619
+ CbcOrClpParam("sleep", "for debug",
3620
+ CLP_PARAM_ACTION_DUMMY, 7, 0);
3621
+ parameters[numberParameters-1].setLonghelp
3622
+ (
3623
+ "If passed to solver fom ampl, then ampl will wait so that you can copy .nl file for debug."
3624
+ );
3625
+ #ifdef COIN_HAS_CBC
3626
+ parameters[numberParameters++] =
3627
+ CbcOrClpParam("slow!cutpasses", "Maximum number of tries for slower cuts",
3628
+ -1, COIN_INT_MAX, CBC_PARAM_INT_MAX_SLOW_CUTS);
3629
+ parameters[numberParameters-1].setLonghelp
3630
+ (
3631
+ "Some cut generators are fairly slow - this limits the number of times they are tried."
3632
+ );
3633
+ parameters[numberParameters-1].setIntValue(10);
3634
+ #endif
3635
+ #ifdef COIN_HAS_CLP
3636
+ parameters[numberParameters++] =
3637
+ CbcOrClpParam("slp!Value", "Number of slp passes before primal",
3638
+ -50000, 50000, CLP_PARAM_INT_SLPVALUE, 1);
3639
+ parameters[numberParameters-1].setLonghelp
3640
+ (
3641
+ "If you are solving a quadratic problem using primal then it may be helpful to do some \
3642
+ sequential Lps to get a good approximate solution."
3643
+ );
3644
+ #if CLP_MULTIPLE_FACTORIZATIONS > 0
3645
+ parameters[numberParameters++] =
3646
+ CbcOrClpParam("small!Factorization", "Whether to use small factorization",
3647
+ -1, 10000, CBC_PARAM_INT_SMALLFACT, 1);
3648
+ parameters[numberParameters-1].setLonghelp
3649
+ (
3650
+ "If processed problem <= this use small factorization"
3651
+ );
3652
+ parameters[numberParameters-1].setIntValue(-1);
3653
+ #endif
3654
+ #endif
3655
+ parameters[numberParameters++] =
3656
+ CbcOrClpParam("solu!tion", "Prints solution to file",
3657
+ CLP_PARAM_ACTION_SOLUTION);
3658
+ parameters[numberParameters-1].setLonghelp
3659
+ (
3660
+ "This will write a primitive solution file to the given file name. It will use the default\
3661
+ directory given by 'directory'. A name of '$' will use the previous value for the name. This\
3662
+ is initialized to 'stdout'. The amount of output can be varied using printi!ngOptions or printMask."
3663
+ );
3664
+ #ifdef COIN_HAS_CLP
3665
+ #ifdef COIN_HAS_CBC
3666
+ parameters[numberParameters++] =
3667
+ CbcOrClpParam("solv!e", "Solve problem",
3668
+ CBC_PARAM_ACTION_BAB);
3669
+ parameters[numberParameters-1].setLonghelp
3670
+ (
3671
+ "If there are no integer variables then this just solves LP. If there are integer variables \
3672
+ this does branch and cut."
3673
+ );
3674
+ parameters[numberParameters++] =
3675
+ CbcOrClpParam("sos!Options", "Whether to use SOS from AMPL",
3676
+ "off", CBC_PARAM_STR_SOS);
3677
+ parameters[numberParameters-1].append("on");
3678
+ parameters[numberParameters-1].setCurrentOption("on");
3679
+ parameters[numberParameters-1].setLonghelp
3680
+ (
3681
+ "Normally if AMPL says there are SOS variables they should be used, but sometime sthey should\
3682
+ be turned off - this does so."
3683
+ );
3684
+ parameters[numberParameters++] =
3685
+ CbcOrClpParam("slog!Level", "Level of detail in (LP) Solver output",
3686
+ -1, 63, CLP_PARAM_INT_SOLVERLOGLEVEL);
3687
+ parameters[numberParameters-1].setLonghelp
3688
+ (
3689
+ "If 0 then there should be no output in normal circumstances. 1 is probably the best\
3690
+ value for most uses, while 2 and 3 give more information. This parameter is only used inside MIP - for Clp use 'log'"
3691
+ );
3692
+ #else
3693
+ // allow solve as synonym for possible dual
3694
+ parameters[numberParameters++] =
3695
+ CbcOrClpParam("solv!e", "Solve problem using dual simplex (probably)",
3696
+ CLP_PARAM_ACTION_EITHERSIMPLEX);
3697
+ parameters[numberParameters-1].setLonghelp
3698
+ (
3699
+ "Just so can use solve for clp as well as in cbc"
3700
+ );
3701
+ #endif
3702
+ #endif
3703
+ #ifdef COIN_HAS_CLP
3704
+ parameters[numberParameters++] =
3705
+ CbcOrClpParam("spars!eFactor", "Whether factorization treated as sparse",
3706
+ "on", CLP_PARAM_STR_SPARSEFACTOR, 7, 0);
3707
+ parameters[numberParameters-1].append("off");
3708
+ parameters[numberParameters++] =
3709
+ CbcOrClpParam("special!Options", "Dubious options for Simplex - see ClpSimplex.hpp",
3710
+ 0, COIN_INT_MAX, CLP_PARAM_INT_SPECIALOPTIONS, 0);
3711
+ parameters[numberParameters++] =
3712
+ CbcOrClpParam("sprint!Crash", "Whether to try sprint crash",
3713
+ -1, 5000000, CLP_PARAM_INT_SPRINT);
3714
+ parameters[numberParameters-1].setLonghelp
3715
+ (
3716
+ "For long and thin problems this program may solve a series of small problems\
3717
+ created by taking a subset of the columns. I introduced the idea as 'Sprint' after\
3718
+ an LP code of that name of the 60's which tried the same tactic (not totally successfully).\
3719
+ Cplex calls it 'sifting'. -1 is automatic choice, 0 is off, n is number of passes"
3720
+ );
3721
+ parameters[numberParameters++] =
3722
+ CbcOrClpParam("stat!istics", "Print some statistics",
3723
+ CLP_PARAM_ACTION_STATISTICS);
3724
+ parameters[numberParameters-1].setLonghelp
3725
+ (
3726
+ "This command prints some statistics for the current model.\
3727
+ If log level >1 then more is printed.\
3728
+ These are for presolved model if presolve on (and unscaled)."
3729
+ );
3730
+ #endif
3731
+ parameters[numberParameters++] =
3732
+ CbcOrClpParam("stop", "Stops clp execution",
3733
+ CLP_PARAM_ACTION_EXIT);
3734
+ parameters[numberParameters-1].setLonghelp
3735
+ (
3736
+ "This stops the execution of Clp, end, exit, quit and stop are synonyms"
3737
+ );
3738
+ #ifdef COIN_HAS_CBC
3739
+ parameters[numberParameters++] =
3740
+ CbcOrClpParam("strat!egy", "Switches on groups of features",
3741
+ 0, 2, CBC_PARAM_INT_STRATEGY);
3742
+ parameters[numberParameters-1].setLonghelp
3743
+ (
3744
+ "This turns on newer features. \
3745
+ Use 0 for easy problems, 1 is default, 2 is aggressive. \
3746
+ 1 uses Gomory cuts using tolerance of 0.01 at root, \
3747
+ does a possible restart after 100 nodes if can fix many \
3748
+ and activates a diving and RINS heuristic and makes feasibility pump \
3749
+ more aggressive. \
3750
+ This does not apply to unit tests (where 'experiment' may have similar effects)."
3751
+ );
3752
+ parameters[numberParameters-1].setIntValue(1);
3753
+ #ifdef CBC_KEEP_DEPRECATED
3754
+ parameters[numberParameters++] =
3755
+ CbcOrClpParam("strengthen", "Create strengthened problem",
3756
+ CBC_PARAM_ACTION_STRENGTHEN, 3);
3757
+ parameters[numberParameters-1].setLonghelp
3758
+ (
3759
+ "This creates a new problem by applying the root node cuts. All tight constraints \
3760
+ will be in resulting problem"
3761
+ );
3762
+ #endif
3763
+ parameters[numberParameters++] =
3764
+ CbcOrClpParam("strong!Branching", "Number of variables to look at in strong branching",
3765
+ 0, COIN_INT_MAX, CBC_PARAM_INT_STRONGBRANCHING);
3766
+ parameters[numberParameters-1].setLonghelp
3767
+ (
3768
+ "In order to decide which variable to branch on, the code will choose up to this number \
3769
+ of unsatisfied variables to do mini up and down branches on. Then the most effective one is chosen. \
3770
+ If a variable is branched on many times then the previous average up and down costs may be used - \
3771
+ see number before trust."
3772
+ );
3773
+ #endif
3774
+ #ifdef COIN_HAS_CLP
3775
+ parameters[numberParameters++] =
3776
+ CbcOrClpParam("subs!titution", "How long a column to substitute for in presolve",
3777
+ 0, 10000, CLP_PARAM_INT_SUBSTITUTION, 0);
3778
+ parameters[numberParameters-1].setLonghelp
3779
+ (
3780
+ "Normally Presolve gets rid of 'free' variables when there are no more than 3 \
3781
+ variables in column. If you increase this the number of rows may decrease but number of \
3782
+ elements may increase."
3783
+ );
3784
+ #endif
3785
+ #ifdef COIN_HAS_CBC
3786
+ parameters[numberParameters++] =
3787
+ CbcOrClpParam("testO!si", "Test OsiObject stuff",
3788
+ -1, COIN_INT_MAX, CBC_PARAM_INT_TESTOSI, 0);
3789
+ #endif
3790
+ #ifdef CBC_THREAD
3791
+ parameters[numberParameters++] =
3792
+ CbcOrClpParam("thread!s", "Number of threads to try and use",
3793
+ -100, 100000, CBC_PARAM_INT_THREADS, 1);
3794
+ parameters[numberParameters-1].setLonghelp
3795
+ (
3796
+ "To use multiple threads, set threads to number wanted. It may be better \
3797
+ to use one or two more than number of cpus available. If 100+n then n threads and \
3798
+ search is repeatable (maybe be somewhat slower), \
3799
+ if 200+n use threads for root cuts, 400+n threads used in sub-trees."
3800
+ );
3801
+ #endif
3802
+ #ifdef COIN_HAS_CBC
3803
+ parameters[numberParameters++] =
3804
+ CbcOrClpParam("tighten!Factor", "Tighten bounds using this times largest \
3805
+ activity at continuous solution",
3806
+ 1.0e-3, 1.0e20, CBC_PARAM_DBL_TIGHTENFACTOR, 0);
3807
+ parameters[numberParameters-1].setLonghelp
3808
+ (
3809
+ "This sleazy trick can help on some problems."
3810
+ );
3811
+ #endif
3812
+ #ifdef COIN_HAS_CLP
3813
+ parameters[numberParameters++] =
3814
+ CbcOrClpParam("tightLP", "Poor person's preSolve for now",
3815
+ CLP_PARAM_ACTION_TIGHTEN, 7, 0);
3816
+ #endif
3817
+ parameters[numberParameters++] =
3818
+ CbcOrClpParam("timeM!ode", "Whether to use CPU or elapsed time",
3819
+ "cpu", CLP_PARAM_STR_TIME_MODE);
3820
+ parameters[numberParameters-1].append("elapsed");
3821
+ parameters[numberParameters-1].setLonghelp
3822
+ (
3823
+ "cpu uses CPU time for stopping, while elapsed uses elapsed time. \
3824
+ (On Windows, elapsed time is always used)."
3825
+ );
3826
+ #ifdef COIN_HAS_CBC
3827
+ parameters[numberParameters++] =
3828
+ CbcOrClpParam("trust!PseudoCosts", "Number of branches before we trust pseudocosts",
3829
+ -3, 2000000000, CBC_PARAM_INT_NUMBERBEFORE);
3830
+ parameters[numberParameters-1].setLonghelp
3831
+ (
3832
+ "Using strong branching computes pseudo-costs. After this many times for a variable we just \
3833
+ trust the pseudo costs and do not do any more strong branching."
3834
+ );
3835
+ #endif
3836
+ #ifdef COIN_HAS_CBC
3837
+ parameters[numberParameters++] =
3838
+ CbcOrClpParam("tune!PreProcess", "Dubious tuning parameters",
3839
+ 0, 2000000000, CLP_PARAM_INT_PROCESSTUNE, 1);
3840
+ parameters[numberParameters-1].setLonghelp
3841
+ (
3842
+ "Format aabbcccc - \n If aa then this is number of major passes (i.e. with presolve) \n \
3843
+ If bb and bb>0 then this is number of minor passes (if unset or 0 then 10) \n \
3844
+ cccc is bit set \n 0 - 1 Heavy probing \n 1 - 2 Make variables integer if possible (if obj value)\n \
3845
+ 2 - 4 As above but even if zero objective value\n \
3846
+ 7 - 128 Try and create cliques\n 8 - 256 If all +1 try hard for dominated rows\n \
3847
+ 10 - 1024 Use a larger feasibility tolerance in presolve\n \
3848
+ 11 - 2048 Try probing before creating cliques"
3849
+ );
3850
+ parameters[numberParameters++] =
3851
+ CbcOrClpParam("two!MirCuts", "Whether to use Two phase Mixed Integer Rounding cuts",
3852
+ "off", CBC_PARAM_STR_TWOMIRCUTS);
3853
+ parameters[numberParameters-1].append("on");
3854
+ parameters[numberParameters-1].append("root");
3855
+ parameters[numberParameters-1].append("ifmove");
3856
+ parameters[numberParameters-1].append("forceOn");
3857
+ parameters[numberParameters-1].append("onglobal");
3858
+ parameters[numberParameters-1].append("forceandglobal");
3859
+ parameters[numberParameters-1].append("forceLongOn");
3860
+ parameters[numberParameters-1].setLonghelp
3861
+ (
3862
+ "This switches on two phase mixed integer rounding cuts (either at root or in entire tree) \
3863
+ See branchAndCut for information on options."
3864
+ );
3865
+ #endif
3866
+ parameters[numberParameters++] =
3867
+ CbcOrClpParam("unitTest", "Do unit test",
3868
+ CLP_PARAM_ACTION_UNITTEST, 3, 1);
3869
+ parameters[numberParameters-1].setLonghelp
3870
+ (
3871
+ "This exercises the unit test for clp"
3872
+ );
3873
+ parameters[numberParameters++] =
3874
+ CbcOrClpParam("userClp", "Hand coded Clp stuff",
3875
+ CLP_PARAM_ACTION_USERCLP, 0, 0);
3876
+ parameters[numberParameters-1].setLonghelp
3877
+ (
3878
+ "There are times e.g. when using AMPL interface when you may wish to do something unusual. \
3879
+ Look for USERCLP in main driver and modify sample code."
3880
+ );
3881
+ #ifdef COIN_HAS_CBC
3882
+ parameters[numberParameters++] =
3883
+ CbcOrClpParam("userCbc", "Hand coded Cbc stuff",
3884
+ CBC_PARAM_ACTION_USERCBC, 0, 0);
3885
+ parameters[numberParameters-1].setLonghelp
3886
+ (
3887
+ "There are times e.g. when using AMPL interface when you may wish to do something unusual. \
3888
+ Look for USERCBC in main driver and modify sample code. \
3889
+ It is possible you can get same effect by using example driver4.cpp."
3890
+ );
3891
+ parameters[numberParameters++] =
3892
+ CbcOrClpParam("Vnd!VariableNeighborhoodSearch", "Whether to try Variable Neighborhood Search",
3893
+ "off", CBC_PARAM_STR_VND);
3894
+ parameters[numberParameters-1].append("on");
3895
+ parameters[numberParameters-1].append("both");
3896
+ parameters[numberParameters-1].append("before");
3897
+ parameters[numberParameters-1].append("intree");
3898
+ parameters[numberParameters-1].setLonghelp
3899
+ (
3900
+ "This switches on variable neighborhood Search. \
3901
+ Doh option does heuristic before preprocessing" );
3902
+ #endif
3903
+ parameters[numberParameters++] =
3904
+ CbcOrClpParam("vector", "Whether to use vector? Form of matrix in simplex",
3905
+ "off", CLP_PARAM_STR_VECTOR, 7, 0);
3906
+ parameters[numberParameters-1].append("on");
3907
+ parameters[numberParameters-1].setLonghelp
3908
+ (
3909
+ "If this is on ClpPackedMatrix uses extra column copy in odd format."
3910
+ );
3911
+ parameters[numberParameters++] =
3912
+ CbcOrClpParam("verbose", "Switches on longer help on single ?",
3913
+ 0, 31, CLP_PARAM_INT_VERBOSE, 0);
3914
+ parameters[numberParameters-1].setLonghelp
3915
+ (
3916
+ "Set to 1 to get short help with ? list, 2 to get long help, 3 for both. (add 4 to just get ampl ones)."
3917
+ );
3918
+ parameters[numberParameters-1].setIntValue(0);
3919
+ #ifdef COIN_HAS_CBC
3920
+ parameters[numberParameters++] =
3921
+ CbcOrClpParam("vub!heuristic", "Type of vub heuristic",
3922
+ -2, 20, CBC_PARAM_INT_VUBTRY, 0);
3923
+ parameters[numberParameters-1].setLonghelp
3924
+ (
3925
+ "If set will try and fix some integer variables"
3926
+ );
3927
+ parameters[numberParameters-1].setIntValue(-1);
3928
+ parameters[numberParameters++] =
3929
+ CbcOrClpParam("zero!HalfCuts", "Whether to use zero half cuts",
3930
+ "off", CBC_PARAM_STR_ZEROHALFCUTS);
3931
+ parameters[numberParameters-1].append("on");
3932
+ parameters[numberParameters-1].append("root");
3933
+ parameters[numberParameters-1].append("ifmove");
3934
+ parameters[numberParameters-1].append("forceOn");
3935
+ parameters[numberParameters-1].append("onglobal");
3936
+ parameters[numberParameters-1].setLonghelp
3937
+ (
3938
+ "This switches on zero-half cuts (either at root or in entire tree) \
3939
+ See branchAndCut for information on options. This implementation was written by \
3940
+ Alberto Caprara."
3941
+ );
3942
+ #endif
3943
+ parameters[numberParameters++] =
3944
+ CbcOrClpParam("zeroT!olerance", "Kill all coefficients \
3945
+ whose absolute value is less than this value",
3946
+ 1.0e-100, 1.0e-5, CLP_PARAM_DBL_ZEROTOLERANCE);
3947
+ parameters[numberParameters-1].setLonghelp
3948
+ (
3949
+ "This applies to reading mps files (and also lp files \
3950
+ if KILL_ZERO_READLP defined)"
3951
+ );
3952
+ parameters[numberParameters-1].setDoubleValue(1.0e-20);
3953
+ assert(numberParameters < CBCMAXPARAMETERS);
3954
+ }
3955
+ // Given a parameter type - returns its number in list
3956
+ int whichParam (CbcOrClpParameterType name,
3957
+ int numberParameters, CbcOrClpParam *const parameters)
3958
+ {
3959
+ int i;
3960
+ for (i = 0; i < numberParameters; i++) {
3961
+ if (parameters[i].type() == name)
3962
+ break;
3963
+ }
3964
+ assert (i < numberParameters);
3965
+ return i;
3966
+ }
3967
+ #ifdef COIN_HAS_CLP
3968
+ /* Restore a solution from file.
3969
+ mode 0 normal, 1 swap rows and columns and primal and dual
3970
+ if 2 set then also change signs
3971
+ */
3972
+ void restoreSolution(ClpSimplex * lpSolver, std::string fileName, int mode)
3973
+ {
3974
+ FILE * fp = fopen(fileName.c_str(), "rb");
3975
+ if (fp) {
3976
+ int numberRows = lpSolver->numberRows();
3977
+ int numberColumns = lpSolver->numberColumns();
3978
+ int numberRowsFile;
3979
+ int numberColumnsFile;
3980
+ double objectiveValue;
3981
+ size_t nRead;
3982
+ nRead = fread(&numberRowsFile, sizeof(int), 1, fp);
3983
+ if (nRead != 1)
3984
+ throw("Error in fread");
3985
+ nRead = fread(&numberColumnsFile, sizeof(int), 1, fp);
3986
+ if (nRead != 1)
3987
+ throw("Error in fread");
3988
+ nRead = fread(&objectiveValue, sizeof(double), 1, fp);
3989
+ if (nRead != 1)
3990
+ throw("Error in fread");
3991
+ double * dualRowSolution = lpSolver->dualRowSolution();
3992
+ double * primalRowSolution = lpSolver->primalRowSolution();
3993
+ double * dualColumnSolution = lpSolver->dualColumnSolution();
3994
+ double * primalColumnSolution = lpSolver->primalColumnSolution();
3995
+ if (mode) {
3996
+ // swap
3997
+ int k = numberRows;
3998
+ numberRows = numberColumns;
3999
+ numberColumns = k;
4000
+ double * temp;
4001
+ temp = dualRowSolution;
4002
+ dualRowSolution = primalColumnSolution;
4003
+ primalColumnSolution = temp;
4004
+ temp = dualColumnSolution;
4005
+ dualColumnSolution = primalRowSolution;
4006
+ primalRowSolution = temp;
4007
+ }
4008
+ if (numberRows > numberRowsFile || numberColumns > numberColumnsFile) {
4009
+ std::cout << "Mismatch on rows and/or columns - giving up" << std::endl;
4010
+ } else {
4011
+ lpSolver->setObjectiveValue(objectiveValue);
4012
+ if (numberRows == numberRowsFile && numberColumns == numberColumnsFile) {
4013
+ nRead = fread(primalRowSolution, sizeof(double), numberRows, fp);
4014
+ if (nRead != static_cast<size_t>(numberRows))
4015
+ throw("Error in fread");
4016
+ nRead = fread(dualRowSolution, sizeof(double), numberRows, fp);
4017
+ if (nRead != static_cast<size_t>(numberRows))
4018
+ throw("Error in fread");
4019
+ nRead = fread(primalColumnSolution, sizeof(double), numberColumns, fp);
4020
+ if (nRead != static_cast<size_t>(numberColumns))
4021
+ throw("Error in fread");
4022
+ nRead = fread(dualColumnSolution, sizeof(double), numberColumns, fp);
4023
+ if (nRead != static_cast<size_t>(numberColumns))
4024
+ throw("Error in fread");
4025
+ } else {
4026
+ std::cout << "Mismatch on rows and/or columns - truncating" << std::endl;
4027
+ double * temp = new double [CoinMax(numberRowsFile, numberColumnsFile)];
4028
+ nRead = fread(temp, sizeof(double), numberRowsFile, fp);
4029
+ if (nRead != static_cast<size_t>(numberRowsFile))
4030
+ throw("Error in fread");
4031
+ CoinMemcpyN(temp, numberRows, primalRowSolution);
4032
+ nRead = fread(temp, sizeof(double), numberRowsFile, fp);
4033
+ if (nRead != static_cast<size_t>(numberRowsFile))
4034
+ throw("Error in fread");
4035
+ CoinMemcpyN(temp, numberRows, dualRowSolution);
4036
+ nRead = fread(temp, sizeof(double), numberColumnsFile, fp);
4037
+ if (nRead != static_cast<size_t>(numberColumnsFile))
4038
+ throw("Error in fread");
4039
+ CoinMemcpyN(temp, numberColumns, primalColumnSolution);
4040
+ nRead = fread(temp, sizeof(double), numberColumnsFile, fp);
4041
+ if (nRead != static_cast<size_t>(numberColumnsFile))
4042
+ throw("Error in fread");
4043
+ CoinMemcpyN(temp, numberColumns, dualColumnSolution);
4044
+ delete [] temp;
4045
+ }
4046
+ if (mode == 3) {
4047
+ int i;
4048
+ for (i = 0; i < numberRows; i++) {
4049
+ primalRowSolution[i] = -primalRowSolution[i];
4050
+ dualRowSolution[i] = -dualRowSolution[i];
4051
+ }
4052
+ for (i = 0; i < numberColumns; i++) {
4053
+ primalColumnSolution[i] = -primalColumnSolution[i];
4054
+ dualColumnSolution[i] = -dualColumnSolution[i];
4055
+ }
4056
+ }
4057
+ }
4058
+ fclose(fp);
4059
+ } else {
4060
+ std::cout << "Unable to open file " << fileName << std::endl;
4061
+ }
4062
+ }
4063
+ // Dump a solution to file
4064
+ void saveSolution(const ClpSimplex * lpSolver, std::string fileName)
4065
+ {
4066
+ if (strstr(fileName.c_str(), "_fix_read_")) {
4067
+ FILE * fp = fopen(fileName.c_str(), "rb");
4068
+ if (fp) {
4069
+ ClpSimplex * solver = const_cast<ClpSimplex *>(lpSolver);
4070
+ restoreSolution(solver, fileName, 0);
4071
+ // fix all
4072
+ int logLevel = solver->logLevel();
4073
+ int iColumn;
4074
+ int numberColumns = solver->numberColumns();
4075
+ double * primalColumnSolution =
4076
+ solver->primalColumnSolution();
4077
+ double * columnLower = solver->columnLower();
4078
+ double * columnUpper = solver->columnUpper();
4079
+ for (iColumn = 0; iColumn < numberColumns; iColumn++) {
4080
+ double value = primalColumnSolution[iColumn];
4081
+ if (value > columnUpper[iColumn]) {
4082
+ if (value > columnUpper[iColumn] + 1.0e-6 && logLevel > 1)
4083
+ printf("%d value of %g - bounds %g %g\n",
4084
+ iColumn, value, columnLower[iColumn], columnUpper[iColumn]);
4085
+ value = columnUpper[iColumn];
4086
+ } else if (value < columnLower[iColumn]) {
4087
+ if (value < columnLower[iColumn] - 1.0e-6 && logLevel > 1)
4088
+ printf("%d value of %g - bounds %g %g\n",
4089
+ iColumn, value, columnLower[iColumn], columnUpper[iColumn]);
4090
+ value = columnLower[iColumn];
4091
+ }
4092
+ columnLower[iColumn] = value;
4093
+ columnUpper[iColumn] = value;
4094
+ }
4095
+ return;
4096
+ }
4097
+ }
4098
+ FILE * fp = fopen(fileName.c_str(), "wb");
4099
+ if (fp) {
4100
+ int numberRows = lpSolver->numberRows();
4101
+ int numberColumns = lpSolver->numberColumns();
4102
+ double objectiveValue = lpSolver->objectiveValue();
4103
+ size_t nWrite;
4104
+ nWrite = fwrite(&numberRows, sizeof(int), 1, fp);
4105
+ if (nWrite != 1)
4106
+ throw("Error in fwrite");
4107
+ nWrite = fwrite(&numberColumns, sizeof(int), 1, fp);
4108
+ if (nWrite != 1)
4109
+ throw("Error in fwrite");
4110
+ nWrite = fwrite(&objectiveValue, sizeof(double), 1, fp);
4111
+ if (nWrite != 1)
4112
+ throw("Error in fwrite");
4113
+ double * dualRowSolution = lpSolver->dualRowSolution();
4114
+ double * primalRowSolution = lpSolver->primalRowSolution();
4115
+ nWrite = fwrite(primalRowSolution, sizeof(double), numberRows, fp);
4116
+ if (nWrite != static_cast<size_t>(numberRows))
4117
+ throw("Error in fwrite");
4118
+ nWrite = fwrite(dualRowSolution, sizeof(double), numberRows, fp);
4119
+ if (nWrite != static_cast<size_t>(numberRows))
4120
+ throw("Error in fwrite");
4121
+ double * dualColumnSolution = lpSolver->dualColumnSolution();
4122
+ double * primalColumnSolution = lpSolver->primalColumnSolution();
4123
+ nWrite = fwrite(primalColumnSolution, sizeof(double), numberColumns, fp);
4124
+ if (nWrite != static_cast<size_t>(numberColumns))
4125
+ throw("Error in fwrite");
4126
+ nWrite = fwrite(dualColumnSolution, sizeof(double), numberColumns, fp);
4127
+ if (nWrite != static_cast<size_t>(numberColumns))
4128
+ throw("Error in fwrite");
4129
+ fclose(fp);
4130
+ } else {
4131
+ std::cout << "Unable to open file " << fileName << std::endl;
4132
+ }
4133
+ }
4134
+ #endif