lpsolver 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1165) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/README.md +104 -26
  4. data/ext/lpsolver/Makefile +269 -0
  5. data/ext/lpsolver/ext.c +353 -0
  6. data/ext/lpsolver/ext.o +0 -0
  7. data/ext/lpsolver/extconf.rb +79 -0
  8. data/ext/lpsolver/native.so +0 -0
  9. data/ext/lpsolver-highs/AUTHORS +7 -0
  10. data/ext/lpsolver-highs/BUILD.bazel +243 -0
  11. data/ext/lpsolver-highs/CITATION.cff +29 -0
  12. data/ext/lpsolver-highs/CMakeCache.txt +406 -0
  13. data/ext/lpsolver-highs/CMakeFiles/3.31.4/CMakeCCompiler.cmake +81 -0
  14. data/ext/lpsolver-highs/CMakeFiles/3.31.4/CMakeCXXCompiler.cmake +101 -0
  15. data/ext/lpsolver-highs/CMakeFiles/3.31.4/CMakeDetermineCompilerABI_C.bin +0 -0
  16. data/ext/lpsolver-highs/CMakeFiles/3.31.4/CMakeDetermineCompilerABI_CXX.bin +0 -0
  17. data/ext/lpsolver-highs/CMakeFiles/3.31.4/CMakeSystem.cmake +15 -0
  18. data/ext/lpsolver-highs/CMakeFiles/3.31.4/CompilerIdC/CMakeCCompilerId.c +904 -0
  19. data/ext/lpsolver-highs/CMakeFiles/3.31.4/CompilerIdC/a.out +0 -0
  20. data/ext/lpsolver-highs/CMakeFiles/3.31.4/CompilerIdCXX/CMakeCXXCompilerId.cpp +919 -0
  21. data/ext/lpsolver-highs/CMakeFiles/3.31.4/CompilerIdCXX/a.out +0 -0
  22. data/ext/lpsolver-highs/CMakeFiles/CMakeConfigureLog.yaml +576 -0
  23. data/ext/lpsolver-highs/CMakeFiles/cmake.check_cache +1 -0
  24. data/ext/lpsolver-highs/CMakeLists.txt +983 -0
  25. data/ext/lpsolver-highs/CODE_OF_CONDUCT.md +128 -0
  26. data/ext/lpsolver-highs/CONTRIBUTING.md +31 -0
  27. data/ext/lpsolver-highs/FEATURES.md +61 -0
  28. data/ext/lpsolver-highs/LICENSE.txt +21 -0
  29. data/ext/lpsolver-highs/MODULE.bazel +38 -0
  30. data/ext/lpsolver-highs/README.md +281 -0
  31. data/ext/lpsolver-highs/THIRD_PARTY_NOTICES.md +78 -0
  32. data/ext/lpsolver-highs/Version.txt +4 -0
  33. data/ext/lpsolver-highs/WORKSPACE +33 -0
  34. data/ext/lpsolver-highs/app/CMakeLists.txt +110 -0
  35. data/ext/lpsolver-highs/app/HighsRuntimeOptions.h +292 -0
  36. data/ext/lpsolver-highs/app/RunHighs.cpp +147 -0
  37. data/ext/lpsolver-highs/app/highs_webdemo_shell.html +73 -0
  38. data/ext/lpsolver-highs/build/bin/highs +0 -0
  39. data/ext/lpsolver-highs/build/include/highs/HConfig.h +22 -0
  40. data/ext/lpsolver-highs/build/include/highs/Highs.h +1812 -0
  41. data/ext/lpsolver-highs/build/include/highs/interfaces/highs_c_api.h +2651 -0
  42. data/ext/lpsolver-highs/build/include/highs/io/Filereader.h +45 -0
  43. data/ext/lpsolver-highs/build/include/highs/io/FilereaderLp.h +49 -0
  44. data/ext/lpsolver-highs/build/include/highs/io/FilereaderMps.h +27 -0
  45. data/ext/lpsolver-highs/build/include/highs/io/HMPSIO.h +78 -0
  46. data/ext/lpsolver-highs/build/include/highs/io/HMpsFF.h +245 -0
  47. data/ext/lpsolver-highs/build/include/highs/io/HighsIO.h +118 -0
  48. data/ext/lpsolver-highs/build/include/highs/io/LoadOptions.h +24 -0
  49. data/ext/lpsolver-highs/build/include/highs/io/filereaderlp/builder.hpp +25 -0
  50. data/ext/lpsolver-highs/build/include/highs/io/filereaderlp/def.hpp +19 -0
  51. data/ext/lpsolver-highs/build/include/highs/io/filereaderlp/model.hpp +68 -0
  52. data/ext/lpsolver-highs/build/include/highs/io/filereaderlp/reader.hpp +10 -0
  53. data/ext/lpsolver-highs/build/include/highs/ipm/IpxSolution.h +32 -0
  54. data/ext/lpsolver-highs/build/include/highs/ipm/IpxWrapper.h +106 -0
  55. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu.h +161 -0
  56. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_factorize.h +247 -0
  57. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_get_factors.h +108 -0
  58. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_initialize.h +119 -0
  59. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_factorize.h +34 -0
  60. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_free.h +19 -0
  61. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_get_factors.h +34 -0
  62. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_initialize.h +46 -0
  63. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_solve_dense.h +29 -0
  64. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_solve_for_update.h +42 -0
  65. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_solve_sparse.h +32 -0
  66. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_update.h +31 -0
  67. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_object.h +30 -0
  68. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_solve_dense.h +75 -0
  69. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_solve_for_update.h +169 -0
  70. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_solve_sparse.h +112 -0
  71. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_update.h +125 -0
  72. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/lu_def.h +39 -0
  73. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/lu_file.h +21 -0
  74. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/lu_internal.h +220 -0
  75. data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/lu_list.h +173 -0
  76. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/basiclu_kernel.h +20 -0
  77. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/basiclu_wrapper.h +47 -0
  78. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/basis.h +350 -0
  79. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/conjugate_residuals.h +74 -0
  80. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/control.h +167 -0
  81. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/crossover.h +157 -0
  82. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/diagonal_precond.h +45 -0
  83. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/forrest_tomlin.h +102 -0
  84. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/guess_basis.h +21 -0
  85. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/indexed_vector.h +113 -0
  86. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/info.h +27 -0
  87. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/ipm.h +94 -0
  88. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/ipx_c.h +47 -0
  89. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/ipx_config.h +9 -0
  90. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/ipx_info.h +111 -0
  91. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/ipx_internal.h +89 -0
  92. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/ipx_parameters.h +76 -0
  93. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/ipx_status.h +57 -0
  94. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/iterate.h +331 -0
  95. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/kkt_solver.h +70 -0
  96. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/kkt_solver_basis.h +66 -0
  97. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/kkt_solver_diag.h +48 -0
  98. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/linear_operator.h +26 -0
  99. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/lp_solver.h +204 -0
  100. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/lu_factorization.h +79 -0
  101. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/lu_update.h +129 -0
  102. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/maxvolume.h +54 -0
  103. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/model.h +413 -0
  104. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/multistream.h +52 -0
  105. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/normal_matrix.h +44 -0
  106. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/power_method.h +44 -0
  107. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/sparse_matrix.h +195 -0
  108. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/sparse_utils.h +58 -0
  109. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/splitted_normal_matrix.h +63 -0
  110. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/starting_basis.h +39 -0
  111. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/symbolic_invert.h +29 -0
  112. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/timer.h +25 -0
  113. data/ext/lpsolver-highs/build/include/highs/ipm/ipx/utils.h +37 -0
  114. data/ext/lpsolver-highs/build/include/highs/lp_data/HConst.h +430 -0
  115. data/ext/lpsolver-highs/build/include/highs/lp_data/HStruct.h +213 -0
  116. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsAnalysis.h +23 -0
  117. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsCallback.h +104 -0
  118. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsCallbackStruct.h +70 -0
  119. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsDebug.h +34 -0
  120. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsIis.h +139 -0
  121. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsInfo.h +421 -0
  122. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsInfoDebug.h +27 -0
  123. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsLp.h +97 -0
  124. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsLpSolverObject.h +47 -0
  125. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsLpUtils.h +330 -0
  126. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsModelUtils.h +129 -0
  127. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsOptions.h +1715 -0
  128. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsRanging.h +43 -0
  129. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsSolution.h +179 -0
  130. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsSolutionDebug.h +87 -0
  131. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsSolve.h +29 -0
  132. data/ext/lpsolver-highs/build/include/highs/lp_data/HighsStatus.h +29 -0
  133. data/ext/lpsolver-highs/build/include/highs/mip/HighsCliqueTable.h +329 -0
  134. data/ext/lpsolver-highs/build/include/highs/mip/HighsConflictPool.h +109 -0
  135. data/ext/lpsolver-highs/build/include/highs/mip/HighsCutGeneration.h +108 -0
  136. data/ext/lpsolver-highs/build/include/highs/mip/HighsCutPool.h +168 -0
  137. data/ext/lpsolver-highs/build/include/highs/mip/HighsDebugSol.h +133 -0
  138. data/ext/lpsolver-highs/build/include/highs/mip/HighsDomain.h +657 -0
  139. data/ext/lpsolver-highs/build/include/highs/mip/HighsDomainChange.h +48 -0
  140. data/ext/lpsolver-highs/build/include/highs/mip/HighsDynamicRowMatrix.h +104 -0
  141. data/ext/lpsolver-highs/build/include/highs/mip/HighsGFkSolve.h +439 -0
  142. data/ext/lpsolver-highs/build/include/highs/mip/HighsImplications.h +194 -0
  143. data/ext/lpsolver-highs/build/include/highs/mip/HighsLpAggregator.h +50 -0
  144. data/ext/lpsolver-highs/build/include/highs/mip/HighsLpRelaxation.h +361 -0
  145. data/ext/lpsolver-highs/build/include/highs/mip/HighsMipAnalysis.h +71 -0
  146. data/ext/lpsolver-highs/build/include/highs/mip/HighsMipSolver.h +159 -0
  147. data/ext/lpsolver-highs/build/include/highs/mip/HighsMipSolverData.h +313 -0
  148. data/ext/lpsolver-highs/build/include/highs/mip/HighsModkSeparator.h +60 -0
  149. data/ext/lpsolver-highs/build/include/highs/mip/HighsNodeQueue.h +312 -0
  150. data/ext/lpsolver-highs/build/include/highs/mip/HighsObjectiveFunction.h +71 -0
  151. data/ext/lpsolver-highs/build/include/highs/mip/HighsPathSeparator.h +39 -0
  152. data/ext/lpsolver-highs/build/include/highs/mip/HighsPrimalHeuristics.h +75 -0
  153. data/ext/lpsolver-highs/build/include/highs/mip/HighsPseudocost.h +366 -0
  154. data/ext/lpsolver-highs/build/include/highs/mip/HighsRedcostFixing.h +42 -0
  155. data/ext/lpsolver-highs/build/include/highs/mip/HighsSearch.h +241 -0
  156. data/ext/lpsolver-highs/build/include/highs/mip/HighsSeparation.h +41 -0
  157. data/ext/lpsolver-highs/build/include/highs/mip/HighsSeparator.h +60 -0
  158. data/ext/lpsolver-highs/build/include/highs/mip/HighsTableauSeparator.h +34 -0
  159. data/ext/lpsolver-highs/build/include/highs/mip/HighsTransformedLp.h +63 -0
  160. data/ext/lpsolver-highs/build/include/highs/mip/MipTimer.h +544 -0
  161. data/ext/lpsolver-highs/build/include/highs/mip/feasibilityjump.hh +800 -0
  162. data/ext/lpsolver-highs/build/include/highs/model/HighsHessian.h +54 -0
  163. data/ext/lpsolver-highs/build/include/highs/model/HighsHessianUtils.h +47 -0
  164. data/ext/lpsolver-highs/build/include/highs/model/HighsModel.h +42 -0
  165. data/ext/lpsolver-highs/build/include/highs/parallel/HighsBinarySemaphore.h +108 -0
  166. data/ext/lpsolver-highs/build/include/highs/parallel/HighsCacheAlign.h +82 -0
  167. data/ext/lpsolver-highs/build/include/highs/parallel/HighsCombinable.h +116 -0
  168. data/ext/lpsolver-highs/build/include/highs/parallel/HighsMutex.h +124 -0
  169. data/ext/lpsolver-highs/build/include/highs/parallel/HighsParallel.h +128 -0
  170. data/ext/lpsolver-highs/build/include/highs/parallel/HighsRaceTimer.h +38 -0
  171. data/ext/lpsolver-highs/build/include/highs/parallel/HighsSchedulerConstants.h +19 -0
  172. data/ext/lpsolver-highs/build/include/highs/parallel/HighsSpinMutex.h +48 -0
  173. data/ext/lpsolver-highs/build/include/highs/parallel/HighsSplitDeque.h +606 -0
  174. data/ext/lpsolver-highs/build/include/highs/parallel/HighsTask.h +170 -0
  175. data/ext/lpsolver-highs/build/include/highs/parallel/HighsTaskExecutor.h +217 -0
  176. data/ext/lpsolver-highs/build/include/highs/pdlp/CupdlpWrapper.h +108 -0
  177. data/ext/lpsolver-highs/build/include/highs/pdlp/HiPdlpTimer.h +155 -0
  178. data/ext/lpsolver-highs/build/include/highs/pdlp/HiPdlpWrapper.h +26 -0
  179. data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_cs.h +40 -0
  180. data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_defs.h +447 -0
  181. data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_linalg.h +189 -0
  182. data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_proj.h +19 -0
  183. data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_restart.h +31 -0
  184. data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_scaling.h +26 -0
  185. data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_solver.h +105 -0
  186. data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_step.h +37 -0
  187. data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_utils.c +1850 -0
  188. data/ext/lpsolver-highs/build/include/highs/pdlp/hipdlp/defs.hpp +222 -0
  189. data/ext/lpsolver-highs/build/include/highs/pdlp/hipdlp/linalg.hpp +61 -0
  190. data/ext/lpsolver-highs/build/include/highs/pdlp/hipdlp/logger.hpp +80 -0
  191. data/ext/lpsolver-highs/build/include/highs/pdlp/hipdlp/pdhg.hpp +358 -0
  192. data/ext/lpsolver-highs/build/include/highs/pdlp/hipdlp/restart.hpp +96 -0
  193. data/ext/lpsolver-highs/build/include/highs/pdlp/hipdlp/scaling.hpp +74 -0
  194. data/ext/lpsolver-highs/build/include/highs/pdlp/hipdlp/solver_results.hpp +65 -0
  195. data/ext/lpsolver-highs/build/include/highs/pdqsort/pdqsort.h +532 -0
  196. data/ext/lpsolver-highs/build/include/highs/presolve/HPresolve.h +505 -0
  197. data/ext/lpsolver-highs/build/include/highs/presolve/HPresolveAnalysis.h +52 -0
  198. data/ext/lpsolver-highs/build/include/highs/presolve/HighsPostsolveStack.h +943 -0
  199. data/ext/lpsolver-highs/build/include/highs/presolve/HighsSymmetry.h +284 -0
  200. data/ext/lpsolver-highs/build/include/highs/presolve/ICrash.h +124 -0
  201. data/ext/lpsolver-highs/build/include/highs/presolve/ICrashUtil.h +62 -0
  202. data/ext/lpsolver-highs/build/include/highs/presolve/ICrashX.h +23 -0
  203. data/ext/lpsolver-highs/build/include/highs/presolve/PresolveComponent.h +90 -0
  204. data/ext/lpsolver-highs/build/include/highs/qpsolver/a_asm.hpp +77 -0
  205. data/ext/lpsolver-highs/build/include/highs/qpsolver/a_quass.hpp +22 -0
  206. data/ext/lpsolver-highs/build/include/highs/qpsolver/basis.hpp +159 -0
  207. data/ext/lpsolver-highs/build/include/highs/qpsolver/crashsolution.hpp +20 -0
  208. data/ext/lpsolver-highs/build/include/highs/qpsolver/dantzigpricing.hpp +80 -0
  209. data/ext/lpsolver-highs/build/include/highs/qpsolver/devexpricing.hpp +108 -0
  210. data/ext/lpsolver-highs/build/include/highs/qpsolver/eventhandler.hpp +30 -0
  211. data/ext/lpsolver-highs/build/include/highs/qpsolver/factor.hpp +408 -0
  212. data/ext/lpsolver-highs/build/include/highs/qpsolver/feasibility_bounded.hpp +114 -0
  213. data/ext/lpsolver-highs/build/include/highs/qpsolver/feasibility_highs.hpp +301 -0
  214. data/ext/lpsolver-highs/build/include/highs/qpsolver/gradient.hpp +46 -0
  215. data/ext/lpsolver-highs/build/include/highs/qpsolver/instance.hpp +70 -0
  216. data/ext/lpsolver-highs/build/include/highs/qpsolver/matrix.hpp +342 -0
  217. data/ext/lpsolver-highs/build/include/highs/qpsolver/perturbation.hpp +15 -0
  218. data/ext/lpsolver-highs/build/include/highs/qpsolver/pricing.hpp +22 -0
  219. data/ext/lpsolver-highs/build/include/highs/qpsolver/qpconst.hpp +34 -0
  220. data/ext/lpsolver-highs/build/include/highs/qpsolver/qpvector.hpp +242 -0
  221. data/ext/lpsolver-highs/build/include/highs/qpsolver/quass.hpp +27 -0
  222. data/ext/lpsolver-highs/build/include/highs/qpsolver/ratiotest.hpp +26 -0
  223. data/ext/lpsolver-highs/build/include/highs/qpsolver/runtime.hpp +45 -0
  224. data/ext/lpsolver-highs/build/include/highs/qpsolver/scaling.hpp +15 -0
  225. data/ext/lpsolver-highs/build/include/highs/qpsolver/settings.hpp +84 -0
  226. data/ext/lpsolver-highs/build/include/highs/qpsolver/snippets.hpp +36 -0
  227. data/ext/lpsolver-highs/build/include/highs/qpsolver/statistics.hpp +30 -0
  228. data/ext/lpsolver-highs/build/include/highs/qpsolver/steepestedgepricing.hpp +173 -0
  229. data/ext/lpsolver-highs/build/include/highs/simplex/HApp.h +550 -0
  230. data/ext/lpsolver-highs/build/include/highs/simplex/HEkk.h +419 -0
  231. data/ext/lpsolver-highs/build/include/highs/simplex/HEkkDual.h +513 -0
  232. data/ext/lpsolver-highs/build/include/highs/simplex/HEkkDualRHS.h +134 -0
  233. data/ext/lpsolver-highs/build/include/highs/simplex/HEkkDualRow.h +201 -0
  234. data/ext/lpsolver-highs/build/include/highs/simplex/HEkkPrimal.h +191 -0
  235. data/ext/lpsolver-highs/build/include/highs/simplex/HSimplex.h +42 -0
  236. data/ext/lpsolver-highs/build/include/highs/simplex/HSimplexDebug.h +48 -0
  237. data/ext/lpsolver-highs/build/include/highs/simplex/HSimplexNla.h +158 -0
  238. data/ext/lpsolver-highs/build/include/highs/simplex/HSimplexReport.h +21 -0
  239. data/ext/lpsolver-highs/build/include/highs/simplex/HighsSimplexAnalysis.h +500 -0
  240. data/ext/lpsolver-highs/build/include/highs/simplex/SimplexConst.h +273 -0
  241. data/ext/lpsolver-highs/build/include/highs/simplex/SimplexStruct.h +263 -0
  242. data/ext/lpsolver-highs/build/include/highs/simplex/SimplexTimer.h +414 -0
  243. data/ext/lpsolver-highs/build/include/highs/test_kkt/DevKkt.h +143 -0
  244. data/ext/lpsolver-highs/build/include/highs/test_kkt/KktCh2.h +79 -0
  245. data/ext/lpsolver-highs/build/include/highs/util/FactorTimer.h +199 -0
  246. data/ext/lpsolver-highs/build/include/highs/util/HFactor.h +587 -0
  247. data/ext/lpsolver-highs/build/include/highs/util/HFactorConst.h +81 -0
  248. data/ext/lpsolver-highs/build/include/highs/util/HFactorDebug.h +55 -0
  249. data/ext/lpsolver-highs/build/include/highs/util/HSet.h +89 -0
  250. data/ext/lpsolver-highs/build/include/highs/util/HVector.h +22 -0
  251. data/ext/lpsolver-highs/build/include/highs/util/HVectorBase.h +102 -0
  252. data/ext/lpsolver-highs/build/include/highs/util/HighsCDouble.h +323 -0
  253. data/ext/lpsolver-highs/build/include/highs/util/HighsComponent.h +53 -0
  254. data/ext/lpsolver-highs/build/include/highs/util/HighsDataStack.h +83 -0
  255. data/ext/lpsolver-highs/build/include/highs/util/HighsDisjointSets.h +107 -0
  256. data/ext/lpsolver-highs/build/include/highs/util/HighsHash.h +1274 -0
  257. data/ext/lpsolver-highs/build/include/highs/util/HighsHashTree.h +1461 -0
  258. data/ext/lpsolver-highs/build/include/highs/util/HighsInt.h +36 -0
  259. data/ext/lpsolver-highs/build/include/highs/util/HighsIntegers.h +212 -0
  260. data/ext/lpsolver-highs/build/include/highs/util/HighsLinearSumBounds.h +203 -0
  261. data/ext/lpsolver-highs/build/include/highs/util/HighsMatrixPic.h +37 -0
  262. data/ext/lpsolver-highs/build/include/highs/util/HighsMatrixSlice.h +561 -0
  263. data/ext/lpsolver-highs/build/include/highs/util/HighsMatrixUtils.h +57 -0
  264. data/ext/lpsolver-highs/build/include/highs/util/HighsMemoryAllocation.h +63 -0
  265. data/ext/lpsolver-highs/build/include/highs/util/HighsRandom.h +242 -0
  266. data/ext/lpsolver-highs/build/include/highs/util/HighsRbTree.h +452 -0
  267. data/ext/lpsolver-highs/build/include/highs/util/HighsSort.h +131 -0
  268. data/ext/lpsolver-highs/build/include/highs/util/HighsSparseMatrix.h +151 -0
  269. data/ext/lpsolver-highs/build/include/highs/util/HighsSparseVectorSum.h +95 -0
  270. data/ext/lpsolver-highs/build/include/highs/util/HighsSplay.h +135 -0
  271. data/ext/lpsolver-highs/build/include/highs/util/HighsTimer.h +385 -0
  272. data/ext/lpsolver-highs/build/include/highs/util/HighsUtils.h +272 -0
  273. data/ext/lpsolver-highs/build/include/highs/util/stringutil.h +46 -0
  274. data/ext/lpsolver-highs/build/include/highs/zstr/strict_fstream.hpp +237 -0
  275. data/ext/lpsolver-highs/build/include/highs/zstr/zstr.hpp +473 -0
  276. data/ext/lpsolver-highs/build/include/highs_export.h +43 -0
  277. data/ext/lpsolver-highs/build/lib/cmake/highs/highs-config-version.cmake +65 -0
  278. data/ext/lpsolver-highs/build/lib/cmake/highs/highs-config.cmake +36 -0
  279. data/ext/lpsolver-highs/build/lib/cmake/highs/highs-targets-release.cmake +19 -0
  280. data/ext/lpsolver-highs/build/lib/cmake/highs/highs-targets.cmake +111 -0
  281. data/ext/lpsolver-highs/build/lib/libhighs.a +0 -0
  282. data/ext/lpsolver-highs/build/lib/pkgconfig/highs.pc +12 -0
  283. data/ext/lpsolver-highs/build/share/doc/HIGHS/AUTHORS +7 -0
  284. data/ext/lpsolver-highs/build/share/doc/HIGHS/CITATION.cff +29 -0
  285. data/ext/lpsolver-highs/build/share/doc/HIGHS/CODE_OF_CONDUCT.md +128 -0
  286. data/ext/lpsolver-highs/build/share/doc/HIGHS/CONTRIBUTING.md +31 -0
  287. data/ext/lpsolver-highs/build/share/doc/HIGHS/FEATURES.md +61 -0
  288. data/ext/lpsolver-highs/build/share/doc/HIGHS/LICENSE.txt +21 -0
  289. data/ext/lpsolver-highs/build/share/doc/HIGHS/README.md +281 -0
  290. data/ext/lpsolver-highs/build_webdemo.sh +46 -0
  291. data/ext/lpsolver-highs/check/Avgas.cpp +245 -0
  292. data/ext/lpsolver-highs/check/Avgas.h +44 -0
  293. data/ext/lpsolver-highs/check/CMakeLists.txt +573 -0
  294. data/ext/lpsolver-highs/check/HCheckConfig.h.bazel.in +6 -0
  295. data/ext/lpsolver-highs/check/HCheckConfig.h.in +12 -0
  296. data/ext/lpsolver-highs/check/HCheckConfig.h.meson.in +6 -0
  297. data/ext/lpsolver-highs/check/SpecialLps.h +405 -0
  298. data/ext/lpsolver-highs/check/TestAlienBasis.cpp +720 -0
  299. data/ext/lpsolver-highs/check/TestBasis.cpp +359 -0
  300. data/ext/lpsolver-highs/check/TestBasisSolves.cpp +669 -0
  301. data/ext/lpsolver-highs/check/TestCAPI.c +2513 -0
  302. data/ext/lpsolver-highs/check/TestCallbacks.cpp +608 -0
  303. data/ext/lpsolver-highs/check/TestCheckSolution.cpp +740 -0
  304. data/ext/lpsolver-highs/check/TestCrossover.cpp +111 -0
  305. data/ext/lpsolver-highs/check/TestDualize.cpp +172 -0
  306. data/ext/lpsolver-highs/check/TestEkk.cpp +100 -0
  307. data/ext/lpsolver-highs/check/TestFactor.cpp +389 -0
  308. data/ext/lpsolver-highs/check/TestFilereader.cpp +568 -0
  309. data/ext/lpsolver-highs/check/TestFortranAPI.f90 +65 -0
  310. data/ext/lpsolver-highs/check/TestHSet.cpp +80 -0
  311. data/ext/lpsolver-highs/check/TestHighsCDouble.cpp +109 -0
  312. data/ext/lpsolver-highs/check/TestHighsGFkSolve.cpp +102 -0
  313. data/ext/lpsolver-highs/check/TestHighsHash.cpp +126 -0
  314. data/ext/lpsolver-highs/check/TestHighsHessian.cpp +329 -0
  315. data/ext/lpsolver-highs/check/TestHighsIntegers.cpp +42 -0
  316. data/ext/lpsolver-highs/check/TestHighsModel.cpp +134 -0
  317. data/ext/lpsolver-highs/check/TestHighsParallel.cpp +277 -0
  318. data/ext/lpsolver-highs/check/TestHighsRbTree.cpp +109 -0
  319. data/ext/lpsolver-highs/check/TestHighsSparseMatrix.cpp +126 -0
  320. data/ext/lpsolver-highs/check/TestHighsVersion.cpp +61 -0
  321. data/ext/lpsolver-highs/check/TestHipo.cpp +122 -0
  322. data/ext/lpsolver-highs/check/TestICrash.cpp +46 -0
  323. data/ext/lpsolver-highs/check/TestIO.cpp +163 -0
  324. data/ext/lpsolver-highs/check/TestIis.cpp +1063 -0
  325. data/ext/lpsolver-highs/check/TestInfo.cpp +116 -0
  326. data/ext/lpsolver-highs/check/TestIpm.cpp +226 -0
  327. data/ext/lpsolver-highs/check/TestIpx.cpp +96 -0
  328. data/ext/lpsolver-highs/check/TestLPFileFormat.cpp +22 -0
  329. data/ext/lpsolver-highs/check/TestLogging.cpp +69 -0
  330. data/ext/lpsolver-highs/check/TestLpModification.cpp +2497 -0
  331. data/ext/lpsolver-highs/check/TestLpOrientation.cpp +121 -0
  332. data/ext/lpsolver-highs/check/TestLpSolvers.cpp +555 -0
  333. data/ext/lpsolver-highs/check/TestLpValidation.cpp +689 -0
  334. data/ext/lpsolver-highs/check/TestMain.cpp +6 -0
  335. data/ext/lpsolver-highs/check/TestMipSolver.cpp +1406 -0
  336. data/ext/lpsolver-highs/check/TestModelProperties.cpp +143 -0
  337. data/ext/lpsolver-highs/check/TestMultiObjective.cpp +198 -0
  338. data/ext/lpsolver-highs/check/TestNames.cpp +187 -0
  339. data/ext/lpsolver-highs/check/TestOptions.cpp +544 -0
  340. data/ext/lpsolver-highs/check/TestPdlp.cpp +327 -0
  341. data/ext/lpsolver-highs/check/TestPdlpHi.cpp +40 -0
  342. data/ext/lpsolver-highs/check/TestPresolve.cpp +912 -0
  343. data/ext/lpsolver-highs/check/TestQpSolver.cpp +1345 -0
  344. data/ext/lpsolver-highs/check/TestRanging.cpp +558 -0
  345. data/ext/lpsolver-highs/check/TestRays.cpp +1010 -0
  346. data/ext/lpsolver-highs/check/TestSemiVariables.cpp +329 -0
  347. data/ext/lpsolver-highs/check/TestSetup.cpp +12 -0
  348. data/ext/lpsolver-highs/check/TestSort.cpp +247 -0
  349. data/ext/lpsolver-highs/check/TestSpecialLps.cpp +775 -0
  350. data/ext/lpsolver-highs/check/TestThrow.cpp +83 -0
  351. data/ext/lpsolver-highs/check/TestTspSolver.cpp +19 -0
  352. data/ext/lpsolver-highs/check/TestUserScale.cpp +444 -0
  353. data/ext/lpsolver-highs/check/cublas_example.cpp +76 -0
  354. data/ext/lpsolver-highs/check/cublas_gpu_start.cpp +88 -0
  355. data/ext/lpsolver-highs/check/hipo_test_option_files/hipo_options_0 +1 -0
  356. data/ext/lpsolver-highs/check/instances/1448.lp +1 -0
  357. data/ext/lpsolver-highs/check/instances/1449a.lp +1 -0
  358. data/ext/lpsolver-highs/check/instances/1449b.lp +1 -0
  359. data/ext/lpsolver-highs/check/instances/1451.lp +8 -0
  360. data/ext/lpsolver-highs/check/instances/2122.lp +1822 -0
  361. data/ext/lpsolver-highs/check/instances/2171.mps +717 -0
  362. data/ext/lpsolver-highs/check/instances/25fv47.mps +6919 -0
  363. data/ext/lpsolver-highs/check/instances/2821-duplicate.mps +31 -0
  364. data/ext/lpsolver-highs/check/instances/2821-qmatrix.mps +31 -0
  365. data/ext/lpsolver-highs/check/instances/2821-quadobj.mps +29 -0
  366. data/ext/lpsolver-highs/check/instances/2821-summation.mps +30 -0
  367. data/ext/lpsolver-highs/check/instances/2821.mps +29 -0
  368. data/ext/lpsolver-highs/check/instances/2894.mps +89 -0
  369. data/ext/lpsolver-highs/check/instances/80bau3b.mps +23732 -0
  370. data/ext/lpsolver-highs/check/instances/WithInf.set +3 -0
  371. data/ext/lpsolver-highs/check/instances/adlittle.mps +335 -0
  372. data/ext/lpsolver-highs/check/instances/afiro.mps +83 -0
  373. data/ext/lpsolver-highs/check/instances/avgas.mps +51 -0
  374. data/ext/lpsolver-highs/check/instances/bell5.mps +384 -0
  375. data/ext/lpsolver-highs/check/instances/bgetam.mps +2112 -0
  376. data/ext/lpsolver-highs/check/instances/blending.mps +13 -0
  377. data/ext/lpsolver-highs/check/instances/box1.mps +1085 -0
  378. data/ext/lpsolver-highs/check/instances/chip.mps +13 -0
  379. data/ext/lpsolver-highs/check/instances/comment.mps +23 -0
  380. data/ext/lpsolver-highs/check/instances/cplex1.mps +9674 -0
  381. data/ext/lpsolver-highs/check/instances/dD2e.mps +10 -0
  382. data/ext/lpsolver-highs/check/instances/dcmulti.mps +2310 -0
  383. data/ext/lpsolver-highs/check/instances/e226.mps +1733 -0
  384. data/ext/lpsolver-highs/check/instances/egout-ac.mps +473 -0
  385. data/ext/lpsolver-highs/check/instances/egout.mps +403 -0
  386. data/ext/lpsolver-highs/check/instances/etamacro.mps +2084 -0
  387. data/ext/lpsolver-highs/check/instances/ex72a.mps +849 -0
  388. data/ext/lpsolver-highs/check/instances/fixed-binary.lp +11 -0
  389. data/ext/lpsolver-highs/check/instances/flugpl.mps +111 -0
  390. data/ext/lpsolver-highs/check/instances/flugpl_illegal_integer.sol +24 -0
  391. data/ext/lpsolver-highs/check/instances/flugpl_integer.sol +25 -0
  392. data/ext/lpsolver-highs/check/instances/forest6.mps +261 -0
  393. data/ext/lpsolver-highs/check/instances/galenet.mps +34 -0
  394. data/ext/lpsolver-highs/check/instances/gams10am.mps +478 -0
  395. data/ext/lpsolver-highs/check/instances/garbage.ems +3 -0
  396. data/ext/lpsolver-highs/check/instances/garbage.lp +3 -0
  397. data/ext/lpsolver-highs/check/instances/garbage.mps +3 -0
  398. data/ext/lpsolver-highs/check/instances/gas11.mps +2924 -0
  399. data/ext/lpsolver-highs/check/instances/gesa2.mps +5459 -0
  400. data/ext/lpsolver-highs/check/instances/greenbea.mps +19215 -0
  401. data/ext/lpsolver-highs/check/instances/gt2.mps +534 -0
  402. data/ext/lpsolver-highs/check/instances/infeasible-mip0.mps +140 -0
  403. data/ext/lpsolver-highs/check/instances/infeasible-mip1.mps +371 -0
  404. data/ext/lpsolver-highs/check/instances/israel.mps +1490 -0
  405. data/ext/lpsolver-highs/check/instances/issue-2095.mps +836 -0
  406. data/ext/lpsolver-highs/check/instances/issue-2173.mps +3331 -0
  407. data/ext/lpsolver-highs/check/instances/issue-2204.mps +143 -0
  408. data/ext/lpsolver-highs/check/instances/issue-2290.mps +158 -0
  409. data/ext/lpsolver-highs/check/instances/issue-2388.lp +76 -0
  410. data/ext/lpsolver-highs/check/instances/issue-2402.mps +435 -0
  411. data/ext/lpsolver-highs/check/instances/issue-2446.mps +9154 -0
  412. data/ext/lpsolver-highs/check/instances/issue-2585.lp +16 -0
  413. data/ext/lpsolver-highs/check/instances/issue-2874-3.mps +97 -0
  414. data/ext/lpsolver-highs/check/instances/klein1.mps +422 -0
  415. data/ext/lpsolver-highs/check/instances/lseu.mps +371 -0
  416. data/ext/lpsolver-highs/check/instances/model.xyz +1 -0
  417. data/ext/lpsolver-highs/check/instances/nan0.mps +13 -0
  418. data/ext/lpsolver-highs/check/instances/nan1.mps +13 -0
  419. data/ext/lpsolver-highs/check/instances/nan2.mps +13 -0
  420. data/ext/lpsolver-highs/check/instances/no-newline-eof.lp +5 -0
  421. data/ext/lpsolver-highs/check/instances/p01.mps +909 -0
  422. data/ext/lpsolver-highs/check/instances/p0548.mps +1992 -0
  423. data/ext/lpsolver-highs/check/instances/primal1.mps +3909 -0
  424. data/ext/lpsolver-highs/check/instances/qap04.mps +606 -0
  425. data/ext/lpsolver-highs/check/instances/qcqp.lp +8 -0
  426. data/ext/lpsolver-highs/check/instances/qjh.lp +9 -0
  427. data/ext/lpsolver-highs/check/instances/qjh.mps +18 -0
  428. data/ext/lpsolver-highs/check/instances/qjh_qmatrix.mps +19 -0
  429. data/ext/lpsolver-highs/check/instances/qjh_quadobj.mps +18 -0
  430. data/ext/lpsolver-highs/check/instances/qjh_quadobj_qmatrix.mps +25 -0
  431. data/ext/lpsolver-highs/check/instances/qjh_uncon.lp +10 -0
  432. data/ext/lpsolver-highs/check/instances/qjh_uncon.mps +17 -0
  433. data/ext/lpsolver-highs/check/instances/qpinfeasible.lp +8 -0
  434. data/ext/lpsolver-highs/check/instances/qptestnw.lp +7 -0
  435. data/ext/lpsolver-highs/check/instances/qpunbounded.lp +5 -0
  436. data/ext/lpsolver-highs/check/instances/refinery.mps +1882 -0
  437. data/ext/lpsolver-highs/check/instances/rgn.mps +559 -0
  438. data/ext/lpsolver-highs/check/instances/scrs8.mps +2717 -0
  439. data/ext/lpsolver-highs/check/instances/sctest.mps +66 -0
  440. data/ext/lpsolver-highs/check/instances/semi-continuous.lp +13 -0
  441. data/ext/lpsolver-highs/check/instances/semi-continuous.mps +24 -0
  442. data/ext/lpsolver-highs/check/instances/semi-integer.lp +15 -0
  443. data/ext/lpsolver-highs/check/instances/semi-integer.mps +22 -0
  444. data/ext/lpsolver-highs/check/instances/shell.mps +4039 -0
  445. data/ext/lpsolver-highs/check/instances/silly-names.mps +14 -0
  446. data/ext/lpsolver-highs/check/instances/small_mip.mps +87 -0
  447. data/ext/lpsolver-highs/check/instances/smalllp.mps +21 -0
  448. data/ext/lpsolver-highs/check/instances/sp150x300d.mps +1983 -0
  449. data/ext/lpsolver-highs/check/instances/stair.mps +2499 -0
  450. data/ext/lpsolver-highs/check/instances/standata.mps +2317 -0
  451. data/ext/lpsolver-highs/check/instances/standgub.mps +2428 -0
  452. data/ext/lpsolver-highs/check/instances/standmps.mps +2695 -0
  453. data/ext/lpsolver-highs/check/instances/test.mps +53 -0
  454. data/ext/lpsolver-highs/check/instances/vol1.mps +1895 -0
  455. data/ext/lpsolver-highs/check/instances/warnings.mps +68 -0
  456. data/ext/lpsolver-highs/check/instances/woodinfe.mps +216 -0
  457. data/ext/lpsolver-highs/check/matrix_multiplication.hpp +49 -0
  458. data/ext/lpsolver-highs/check/meson.build +92 -0
  459. data/ext/lpsolver-highs/check/pythontest.py +11 -0
  460. data/ext/lpsolver-highs/check/sample_options_file +8 -0
  461. data/ext/lpsolver-highs/cmake/CheckAtomic.cmake +74 -0
  462. data/ext/lpsolver-highs/cmake/FindCUDAConf.cmake +44 -0
  463. data/ext/lpsolver-highs/cmake/FindHipoDeps.cmake +351 -0
  464. data/ext/lpsolver-highs/cmake/README.md +243 -0
  465. data/ext/lpsolver-highs/cmake/cpp-highs.cmake +243 -0
  466. data/ext/lpsolver-highs/cmake/dotnet.cmake +94 -0
  467. data/ext/lpsolver-highs/cmake/highs-config.cmake.in +22 -0
  468. data/ext/lpsolver-highs/cmake/python-highs.cmake +74 -0
  469. data/ext/lpsolver-highs/cmake/set-version.cmake +26 -0
  470. data/ext/lpsolver-highs/cmake/sources-python.cmake +461 -0
  471. data/ext/lpsolver-highs/cmake/sources.cmake +618 -0
  472. data/ext/lpsolver-highs/docs/HiGHS_CopyrightHeader.pl +78 -0
  473. data/ext/lpsolver-highs/docs/HiGHS_CopyrightHeaderUpdateAll +32 -0
  474. data/ext/lpsolver-highs/docs/Project.toml +7 -0
  475. data/ext/lpsolver-highs/docs/README.md +27 -0
  476. data/ext/lpsolver-highs/docs/c_api_gen/HConfig.h +1 -0
  477. data/ext/lpsolver-highs/docs/c_api_gen/build.jl +48 -0
  478. data/ext/lpsolver-highs/docs/make.jl +115 -0
  479. data/ext/lpsolver-highs/docs/src/assets/logo.png +0 -0
  480. data/ext/lpsolver-highs/docs/src/callbacks.md +171 -0
  481. data/ext/lpsolver-highs/docs/src/executable.md +88 -0
  482. data/ext/lpsolver-highs/docs/src/guide/advanced.md +66 -0
  483. data/ext/lpsolver-highs/docs/src/guide/basic.md +116 -0
  484. data/ext/lpsolver-highs/docs/src/guide/further.md +193 -0
  485. data/ext/lpsolver-highs/docs/src/guide/gpu.md +58 -0
  486. data/ext/lpsolver-highs/docs/src/guide/index.md +18 -0
  487. data/ext/lpsolver-highs/docs/src/guide/kkt.md +219 -0
  488. data/ext/lpsolver-highs/docs/src/guide/numerics.md +55 -0
  489. data/ext/lpsolver-highs/docs/src/index.md +86 -0
  490. data/ext/lpsolver-highs/docs/src/installation.md +130 -0
  491. data/ext/lpsolver-highs/docs/src/interfaces/c_api.md +6 -0
  492. data/ext/lpsolver-highs/docs/src/interfaces/cpp/examples.md +1 -0
  493. data/ext/lpsolver-highs/docs/src/interfaces/cpp/index.md +29 -0
  494. data/ext/lpsolver-highs/docs/src/interfaces/cpp/library.md +107 -0
  495. data/ext/lpsolver-highs/docs/src/interfaces/csharp.md +55 -0
  496. data/ext/lpsolver-highs/docs/src/interfaces/fortran.md +11 -0
  497. data/ext/lpsolver-highs/docs/src/interfaces/julia/index.md +130 -0
  498. data/ext/lpsolver-highs/docs/src/interfaces/other.md +41 -0
  499. data/ext/lpsolver-highs/docs/src/interfaces/python/example-py.md +275 -0
  500. data/ext/lpsolver-highs/docs/src/interfaces/python/index.md +91 -0
  501. data/ext/lpsolver-highs/docs/src/interfaces/python/model-py.md +90 -0
  502. data/ext/lpsolver-highs/docs/src/options/definitions.md +529 -0
  503. data/ext/lpsolver-highs/docs/src/options/intro.md +46 -0
  504. data/ext/lpsolver-highs/docs/src/parallel.md +88 -0
  505. data/ext/lpsolver-highs/docs/src/solvers.md +168 -0
  506. data/ext/lpsolver-highs/docs/src/structures/classes/HighsHessian.md +9 -0
  507. data/ext/lpsolver-highs/docs/src/structures/classes/HighsIis.md +16 -0
  508. data/ext/lpsolver-highs/docs/src/structures/classes/HighsLp.md +19 -0
  509. data/ext/lpsolver-highs/docs/src/structures/classes/HighsModel.md +6 -0
  510. data/ext/lpsolver-highs/docs/src/structures/classes/HighsSparseMatrix.md +10 -0
  511. data/ext/lpsolver-highs/docs/src/structures/classes/index.md +11 -0
  512. data/ext/lpsolver-highs/docs/src/structures/enums.md +114 -0
  513. data/ext/lpsolver-highs/docs/src/structures/index.md +12 -0
  514. data/ext/lpsolver-highs/docs/src/structures/structs/HighsBasis.md +8 -0
  515. data/ext/lpsolver-highs/docs/src/structures/structs/HighsInfo.md +148 -0
  516. data/ext/lpsolver-highs/docs/src/structures/structs/HighsLinearObjective.md +11 -0
  517. data/ext/lpsolver-highs/docs/src/structures/structs/HighsSolution.md +10 -0
  518. data/ext/lpsolver-highs/docs/src/structures/structs/index.md +10 -0
  519. data/ext/lpsolver-highs/docs/src/terminology.md +163 -0
  520. data/ext/lpsolver-highs/examples/CMakeLists.txt +26 -0
  521. data/ext/lpsolver-highs/examples/Docs.py +104 -0
  522. data/ext/lpsolver-highs/examples/branch-and-price.py +465 -0
  523. data/ext/lpsolver-highs/examples/call_highs_from_c.c +685 -0
  524. data/ext/lpsolver-highs/examples/call_highs_from_c_minimal.c +659 -0
  525. data/ext/lpsolver-highs/examples/call_highs_from_cpp.cpp +178 -0
  526. data/ext/lpsolver-highs/examples/call_highs_from_csharp.cs +83 -0
  527. data/ext/lpsolver-highs/examples/call_highs_from_fortran.f90 +579 -0
  528. data/ext/lpsolver-highs/examples/call_highs_from_python.py +448 -0
  529. data/ext/lpsolver-highs/examples/call_highs_from_python_highspy.py +71 -0
  530. data/ext/lpsolver-highs/examples/call_highs_from_python_mps.py +59 -0
  531. data/ext/lpsolver-highs/examples/callback_gap.py +71 -0
  532. data/ext/lpsolver-highs/examples/chip.py +43 -0
  533. data/ext/lpsolver-highs/examples/chip0.py +29 -0
  534. data/ext/lpsolver-highs/examples/distillation.py +77 -0
  535. data/ext/lpsolver-highs/examples/knapsack.py +43 -0
  536. data/ext/lpsolver-highs/examples/minimal.py +11 -0
  537. data/ext/lpsolver-highs/examples/multi_objective.py +139 -0
  538. data/ext/lpsolver-highs/examples/multiple_objective.py +120 -0
  539. data/ext/lpsolver-highs/examples/network_flow.py +37 -0
  540. data/ext/lpsolver-highs/examples/nqueens.py +29 -0
  541. data/ext/lpsolver-highs/examples/plot_highs_log.py +134 -0
  542. data/ext/lpsolver-highs/extern/CLI11.hpp +11546 -0
  543. data/ext/lpsolver-highs/extern/LICENCE_1_0.txt +23 -0
  544. data/ext/lpsolver-highs/extern/amd/License.txt +35 -0
  545. data/ext/lpsolver-highs/extern/amd/SuiteSparse_config.c +54 -0
  546. data/ext/lpsolver-highs/extern/amd/SuiteSparse_config.h +56 -0
  547. data/ext/lpsolver-highs/extern/amd/amd.h +357 -0
  548. data/ext/lpsolver-highs/extern/amd/amd_1.c +172 -0
  549. data/ext/lpsolver-highs/extern/amd/amd_2.c +1761 -0
  550. data/ext/lpsolver-highs/extern/amd/amd_aat.c +179 -0
  551. data/ext/lpsolver-highs/extern/amd/amd_control.c +65 -0
  552. data/ext/lpsolver-highs/extern/amd/amd_defaults.c +37 -0
  553. data/ext/lpsolver-highs/extern/amd/amd_info.c +120 -0
  554. data/ext/lpsolver-highs/extern/amd/amd_internal.h +137 -0
  555. data/ext/lpsolver-highs/extern/amd/amd_order.c +195 -0
  556. data/ext/lpsolver-highs/extern/amd/amd_post_tree.c +105 -0
  557. data/ext/lpsolver-highs/extern/amd/amd_postorder.c +140 -0
  558. data/ext/lpsolver-highs/extern/amd/amd_preprocess.c +107 -0
  559. data/ext/lpsolver-highs/extern/amd/amd_valid.c +93 -0
  560. data/ext/lpsolver-highs/extern/amd/changes.txt +8 -0
  561. data/ext/lpsolver-highs/extern/catch.hpp +18861 -0
  562. data/ext/lpsolver-highs/extern/metis/Changes.txt +31 -0
  563. data/ext/lpsolver-highs/extern/metis/GKlib/GKlib.h +62 -0
  564. data/ext/lpsolver-highs/extern/metis/GKlib/error.c +21 -0
  565. data/ext/lpsolver-highs/extern/metis/GKlib/gk_arch.h +64 -0
  566. data/ext/lpsolver-highs/extern/metis/GKlib/gk_defs.h +19 -0
  567. data/ext/lpsolver-highs/extern/metis/GKlib/gk_macros.h +50 -0
  568. data/ext/lpsolver-highs/extern/metis/GKlib/gk_mkblas.h +51 -0
  569. data/ext/lpsolver-highs/extern/metis/GKlib/gk_mkmemory.h +80 -0
  570. data/ext/lpsolver-highs/extern/metis/GKlib/gk_mkpqueue.h +329 -0
  571. data/ext/lpsolver-highs/extern/metis/GKlib/gk_mkrandom.h +89 -0
  572. data/ext/lpsolver-highs/extern/metis/GKlib/gk_mksort.h +271 -0
  573. data/ext/lpsolver-highs/extern/metis/GKlib/gk_ms_inttypes.h +41 -0
  574. data/ext/lpsolver-highs/extern/metis/GKlib/gk_ms_stat.h +22 -0
  575. data/ext/lpsolver-highs/extern/metis/GKlib/gk_ms_stdint.h +41 -0
  576. data/ext/lpsolver-highs/extern/metis/GKlib/gk_proto.h +50 -0
  577. data/ext/lpsolver-highs/extern/metis/GKlib/gk_struct.h +66 -0
  578. data/ext/lpsolver-highs/extern/metis/GKlib/gk_types.h +15 -0
  579. data/ext/lpsolver-highs/extern/metis/GKlib/mcore.c +176 -0
  580. data/ext/lpsolver-highs/extern/metis/GKlib/memory.c +23 -0
  581. data/ext/lpsolver-highs/extern/metis/GKlib/random.c +37 -0
  582. data/ext/lpsolver-highs/extern/metis/LICENSE.txt +18 -0
  583. data/ext/lpsolver-highs/extern/metis/libmetis/auxapi.c +27 -0
  584. data/ext/lpsolver-highs/extern/metis/libmetis/balance.c +491 -0
  585. data/ext/lpsolver-highs/extern/metis/libmetis/bucketsort.c +44 -0
  586. data/ext/lpsolver-highs/extern/metis/libmetis/coarsen.c +895 -0
  587. data/ext/lpsolver-highs/extern/metis/libmetis/compress.c +231 -0
  588. data/ext/lpsolver-highs/extern/metis/libmetis/contig.c +83 -0
  589. data/ext/lpsolver-highs/extern/metis/libmetis/defs.h +39 -0
  590. data/ext/lpsolver-highs/extern/metis/libmetis/fm.c +527 -0
  591. data/ext/lpsolver-highs/extern/metis/libmetis/gklib.c +55 -0
  592. data/ext/lpsolver-highs/extern/metis/libmetis/gklib_defs.h +33 -0
  593. data/ext/lpsolver-highs/extern/metis/libmetis/graph.c +268 -0
  594. data/ext/lpsolver-highs/extern/metis/libmetis/initpart.c +385 -0
  595. data/ext/lpsolver-highs/extern/metis/libmetis/macros.h +59 -0
  596. data/ext/lpsolver-highs/extern/metis/libmetis/mcutil.c +162 -0
  597. data/ext/lpsolver-highs/extern/metis/libmetis/metislib.h +35 -0
  598. data/ext/lpsolver-highs/extern/metis/libmetis/mmd.c +598 -0
  599. data/ext/lpsolver-highs/extern/metis/libmetis/ometis.c +661 -0
  600. data/ext/lpsolver-highs/extern/metis/libmetis/options.c +260 -0
  601. data/ext/lpsolver-highs/extern/metis/libmetis/proto.h +172 -0
  602. data/ext/lpsolver-highs/extern/metis/libmetis/refine.c +99 -0
  603. data/ext/lpsolver-highs/extern/metis/libmetis/separator.c +57 -0
  604. data/ext/lpsolver-highs/extern/metis/libmetis/sfm.c +581 -0
  605. data/ext/lpsolver-highs/extern/metis/libmetis/srefine.c +152 -0
  606. data/ext/lpsolver-highs/extern/metis/libmetis/stdheaders.h +29 -0
  607. data/ext/lpsolver-highs/extern/metis/libmetis/struct.h +117 -0
  608. data/ext/lpsolver-highs/extern/metis/libmetis/util.c +59 -0
  609. data/ext/lpsolver-highs/extern/metis/libmetis/wspace.c +91 -0
  610. data/ext/lpsolver-highs/extern/metis/metis.h +271 -0
  611. data/ext/lpsolver-highs/extern/pdqsort/license.txt +16 -0
  612. data/ext/lpsolver-highs/extern/pdqsort/pdqsort.h +532 -0
  613. data/ext/lpsolver-highs/extern/rcm/LICENSE +19 -0
  614. data/ext/lpsolver-highs/extern/rcm/rcm.cpp +873 -0
  615. data/ext/lpsolver-highs/extern/rcm/rcm.h +22 -0
  616. data/ext/lpsolver-highs/extern/zstr/LICENSE +21 -0
  617. data/ext/lpsolver-highs/extern/zstr/strict_fstream.hpp +237 -0
  618. data/ext/lpsolver-highs/extern/zstr/zstr.hpp +473 -0
  619. data/ext/lpsolver-highs/flake.lock +61 -0
  620. data/ext/lpsolver-highs/flake.nix +73 -0
  621. data/ext/lpsolver-highs/highs/CMakeLists.txt +499 -0
  622. data/ext/lpsolver-highs/highs/HConfig.h.bazel.in +25 -0
  623. data/ext/lpsolver-highs/highs/HConfig.h.in +22 -0
  624. data/ext/lpsolver-highs/highs/HConfig.h.meson.in +17 -0
  625. data/ext/lpsolver-highs/highs/Highs.h +1812 -0
  626. data/ext/lpsolver-highs/highs/HighsRun.md +143 -0
  627. data/ext/lpsolver-highs/highs/highs_bindings.cpp +1826 -0
  628. data/ext/lpsolver-highs/highs/highspy/__init__.py +93 -0
  629. data/ext/lpsolver-highs/highs/highspy/__init__.pyi +91 -0
  630. data/ext/lpsolver-highs/highs/highspy/_core/__init__.pyi +1058 -0
  631. data/ext/lpsolver-highs/highs/highspy/_core/cb.pyi +118 -0
  632. data/ext/lpsolver-highs/highs/highspy/_core/simplex_constants.pyi +472 -0
  633. data/ext/lpsolver-highs/highs/highspy/highs.py +2430 -0
  634. data/ext/lpsolver-highs/highs/interfaces/highs_c_api.cpp +1812 -0
  635. data/ext/lpsolver-highs/highs/interfaces/highs_c_api.h +2651 -0
  636. data/ext/lpsolver-highs/highs/interfaces/highs_csharp_api.cs +1142 -0
  637. data/ext/lpsolver-highs/highs/interfaces/highs_fortran_api.f90 +873 -0
  638. data/ext/lpsolver-highs/highs/io/Filereader.cpp +87 -0
  639. data/ext/lpsolver-highs/highs/io/Filereader.h +45 -0
  640. data/ext/lpsolver-highs/highs/io/FilereaderLp.cpp +539 -0
  641. data/ext/lpsolver-highs/highs/io/FilereaderLp.h +49 -0
  642. data/ext/lpsolver-highs/highs/io/FilereaderMps.cpp +86 -0
  643. data/ext/lpsolver-highs/highs/io/FilereaderMps.h +27 -0
  644. data/ext/lpsolver-highs/highs/io/HMPSIO.cpp +1001 -0
  645. data/ext/lpsolver-highs/highs/io/HMPSIO.h +78 -0
  646. data/ext/lpsolver-highs/highs/io/HMpsFF.cpp +2113 -0
  647. data/ext/lpsolver-highs/highs/io/HMpsFF.h +245 -0
  648. data/ext/lpsolver-highs/highs/io/HighsIO.cpp +371 -0
  649. data/ext/lpsolver-highs/highs/io/HighsIO.h +118 -0
  650. data/ext/lpsolver-highs/highs/io/LoadOptions.cpp +60 -0
  651. data/ext/lpsolver-highs/highs/io/LoadOptions.h +24 -0
  652. data/ext/lpsolver-highs/highs/io/filereaderlp/LICENSE +19 -0
  653. data/ext/lpsolver-highs/highs/io/filereaderlp/builder.hpp +25 -0
  654. data/ext/lpsolver-highs/highs/io/filereaderlp/def.hpp +19 -0
  655. data/ext/lpsolver-highs/highs/io/filereaderlp/model.hpp +68 -0
  656. data/ext/lpsolver-highs/highs/io/filereaderlp/reader.cpp +1375 -0
  657. data/ext/lpsolver-highs/highs/io/filereaderlp/reader.hpp +10 -0
  658. data/ext/lpsolver-highs/highs/ipm/IpxSolution.h +32 -0
  659. data/ext/lpsolver-highs/highs/ipm/IpxWrapper.cpp +1526 -0
  660. data/ext/lpsolver-highs/highs/ipm/IpxWrapper.h +106 -0
  661. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu.h +161 -0
  662. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_factorize.c +132 -0
  663. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_factorize.h +247 -0
  664. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_get_factors.c +148 -0
  665. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_get_factors.h +108 -0
  666. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_initialize.c +24 -0
  667. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_initialize.h +119 -0
  668. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_factorize.h +34 -0
  669. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_free.h +19 -0
  670. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_get_factors.h +34 -0
  671. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_initialize.h +46 -0
  672. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_solve_dense.h +29 -0
  673. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_solve_for_update.h +42 -0
  674. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_solve_sparse.h +32 -0
  675. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_update.h +31 -0
  676. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_object.c +325 -0
  677. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_object.h +30 -0
  678. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_solve_dense.c +46 -0
  679. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_solve_dense.h +75 -0
  680. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_solve_for_update.c +79 -0
  681. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_solve_for_update.h +169 -0
  682. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_solve_sparse.c +63 -0
  683. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_solve_sparse.h +112 -0
  684. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_update.c +44 -0
  685. data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_update.h +125 -0
  686. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_build_factors.c +441 -0
  687. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_condest.c +124 -0
  688. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_def.h +39 -0
  689. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_dfs.c +141 -0
  690. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_factorize_bump.c +56 -0
  691. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_file.c +184 -0
  692. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_file.h +21 -0
  693. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_garbage_perm.c +53 -0
  694. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_initialize.c +56 -0
  695. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_internal.c +352 -0
  696. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_internal.h +220 -0
  697. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_list.h +173 -0
  698. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_markowitz.c +188 -0
  699. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_matrix_norm.c +51 -0
  700. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_pivot.c +1247 -0
  701. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_residual_test.c +155 -0
  702. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_setup_bump.c +198 -0
  703. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_singletons.c +511 -0
  704. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_solve_dense.c +129 -0
  705. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_solve_for_update.c +360 -0
  706. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_solve_sparse.c +284 -0
  707. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_solve_symbolic.c +48 -0
  708. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_solve_triangular.c +140 -0
  709. data/ext/lpsolver-highs/highs/ipm/basiclu/lu_update.c +908 -0
  710. data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/Auxiliary.cpp +301 -0
  711. data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/Auxiliary.h +104 -0
  712. data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/IntConfig.h +27 -0
  713. data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/KrylovMethods.cpp +193 -0
  714. data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/KrylovMethods.h +30 -0
  715. data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/Log.cpp +60 -0
  716. data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/Log.h +62 -0
  717. data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/OrderingPrint.h +10 -0
  718. data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/VectorOperations.cpp +117 -0
  719. data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/VectorOperations.h +59 -0
  720. data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/mycblas.h +85 -0
  721. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Analyse.cpp +1367 -0
  722. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Analyse.h +122 -0
  723. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/CallAndTimeBlas.cpp +114 -0
  724. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/CallAndTimeBlas.h +46 -0
  725. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/CliqueStack.cpp +82 -0
  726. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/CliqueStack.h +83 -0
  727. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/DataCollector.cpp +326 -0
  728. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/DataCollector.h +86 -0
  729. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/DenseFact.h +48 -0
  730. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/DenseFactHybrid.cpp +279 -0
  731. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/DenseFactKernel.cpp +284 -0
  732. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/DgemmParallel.cpp +38 -0
  733. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/DgemmParallel.h +32 -0
  734. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/FactorHiGHS.cpp +57 -0
  735. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/FactorHiGHS.h +112 -0
  736. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/FactorHiGHSSettings.h +63 -0
  737. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Factorise.cpp +405 -0
  738. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Factorise.h +85 -0
  739. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/FormatHandler.cpp +46 -0
  740. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/FormatHandler.h +95 -0
  741. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/HybridHybridFormatHandler.cpp +238 -0
  742. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/HybridHybridFormatHandler.h +31 -0
  743. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/HybridSolveHandler.cpp +272 -0
  744. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/HybridSolveHandler.h +26 -0
  745. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/KrylovMethodsIpm.cpp +83 -0
  746. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/KrylovMethodsIpm.h +45 -0
  747. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Numeric.cpp +54 -0
  748. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Numeric.h +46 -0
  749. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/ReturnValues.h +19 -0
  750. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/SolveHandler.cpp +10 -0
  751. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/SolveHandler.h +48 -0
  752. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Swaps.cpp +70 -0
  753. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Swaps.h +19 -0
  754. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Symbolic.cpp +101 -0
  755. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Symbolic.h +220 -0
  756. data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Timing.h +114 -0
  757. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Control.cpp +38 -0
  758. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Control.h +41 -0
  759. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/FactorHiGHSSolver.cpp +887 -0
  760. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/FactorHiGHSSolver.h +92 -0
  761. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Info.h +58 -0
  762. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/IpmData.cpp +8 -0
  763. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/IpmData.h +37 -0
  764. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Iterate.cpp +640 -0
  765. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Iterate.h +172 -0
  766. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/LinearSolver.h +81 -0
  767. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/LogHighs.cpp +71 -0
  768. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/LogHighs.h +33 -0
  769. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Model.cpp +403 -0
  770. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Model.h +136 -0
  771. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Options.h +35 -0
  772. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Parameters.h +63 -0
  773. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/PreProcess.cpp +646 -0
  774. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/PreProcess.h +94 -0
  775. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Refine.cpp +214 -0
  776. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Solver.cpp +1346 -0
  777. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Solver.h +338 -0
  778. data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Status.h +88 -0
  779. data/ext/lpsolver-highs/highs/ipm/ipx/basiclu_kernel.cc +71 -0
  780. data/ext/lpsolver-highs/highs/ipm/ipx/basiclu_kernel.h +20 -0
  781. data/ext/lpsolver-highs/highs/ipm/ipx/basiclu_wrapper.cc +299 -0
  782. data/ext/lpsolver-highs/highs/ipm/ipx/basiclu_wrapper.h +47 -0
  783. data/ext/lpsolver-highs/highs/ipm/ipx/basis.cc +966 -0
  784. data/ext/lpsolver-highs/highs/ipm/ipx/basis.h +350 -0
  785. data/ext/lpsolver-highs/highs/ipm/ipx/conjugate_residuals.cc +217 -0
  786. data/ext/lpsolver-highs/highs/ipm/ipx/conjugate_residuals.h +74 -0
  787. data/ext/lpsolver-highs/highs/ipm/ipx/control.cc +151 -0
  788. data/ext/lpsolver-highs/highs/ipm/ipx/control.h +167 -0
  789. data/ext/lpsolver-highs/highs/ipm/ipx/crossover.cc +479 -0
  790. data/ext/lpsolver-highs/highs/ipm/ipx/crossover.h +157 -0
  791. data/ext/lpsolver-highs/highs/ipm/ipx/diagonal_precond.cc +70 -0
  792. data/ext/lpsolver-highs/highs/ipm/ipx/diagonal_precond.h +45 -0
  793. data/ext/lpsolver-highs/highs/ipm/ipx/forrest_tomlin.cc +360 -0
  794. data/ext/lpsolver-highs/highs/ipm/ipx/forrest_tomlin.h +102 -0
  795. data/ext/lpsolver-highs/highs/ipm/ipx/guess_basis.cc +233 -0
  796. data/ext/lpsolver-highs/highs/ipm/ipx/guess_basis.h +21 -0
  797. data/ext/lpsolver-highs/highs/ipm/ipx/indexed_vector.cc +30 -0
  798. data/ext/lpsolver-highs/highs/ipm/ipx/indexed_vector.h +113 -0
  799. data/ext/lpsolver-highs/highs/ipm/ipx/info.cc +124 -0
  800. data/ext/lpsolver-highs/highs/ipm/ipx/info.h +27 -0
  801. data/ext/lpsolver-highs/highs/ipm/ipx/ipm.cc +897 -0
  802. data/ext/lpsolver-highs/highs/ipm/ipx/ipm.h +94 -0
  803. data/ext/lpsolver-highs/highs/ipm/ipx/ipx_c.cc +83 -0
  804. data/ext/lpsolver-highs/highs/ipm/ipx/ipx_c.h +47 -0
  805. data/ext/lpsolver-highs/highs/ipm/ipx/ipx_config.h +9 -0
  806. data/ext/lpsolver-highs/highs/ipm/ipx/ipx_info.h +111 -0
  807. data/ext/lpsolver-highs/highs/ipm/ipx/ipx_internal.h +89 -0
  808. data/ext/lpsolver-highs/highs/ipm/ipx/ipx_parameters.h +76 -0
  809. data/ext/lpsolver-highs/highs/ipm/ipx/ipx_status.h +57 -0
  810. data/ext/lpsolver-highs/highs/ipm/ipx/iterate.cc +683 -0
  811. data/ext/lpsolver-highs/highs/ipm/ipx/iterate.h +331 -0
  812. data/ext/lpsolver-highs/highs/ipm/ipx/kkt_solver.cc +23 -0
  813. data/ext/lpsolver-highs/highs/ipm/ipx/kkt_solver.h +70 -0
  814. data/ext/lpsolver-highs/highs/ipm/ipx/kkt_solver_basis.cc +387 -0
  815. data/ext/lpsolver-highs/highs/ipm/ipx/kkt_solver_basis.h +66 -0
  816. data/ext/lpsolver-highs/highs/ipm/ipx/kkt_solver_diag.cc +120 -0
  817. data/ext/lpsolver-highs/highs/ipm/ipx/kkt_solver_diag.h +48 -0
  818. data/ext/lpsolver-highs/highs/ipm/ipx/linear_operator.cc +10 -0
  819. data/ext/lpsolver-highs/highs/ipm/ipx/linear_operator.h +26 -0
  820. data/ext/lpsolver-highs/highs/ipm/ipx/lp_solver.cc +686 -0
  821. data/ext/lpsolver-highs/highs/ipm/ipx/lp_solver.h +204 -0
  822. data/ext/lpsolver-highs/highs/ipm/ipx/lu_factorization.cc +131 -0
  823. data/ext/lpsolver-highs/highs/ipm/ipx/lu_factorization.h +79 -0
  824. data/ext/lpsolver-highs/highs/ipm/ipx/lu_update.cc +62 -0
  825. data/ext/lpsolver-highs/highs/ipm/ipx/lu_update.h +129 -0
  826. data/ext/lpsolver-highs/highs/ipm/ipx/maxvolume.cc +337 -0
  827. data/ext/lpsolver-highs/highs/ipm/ipx/maxvolume.h +54 -0
  828. data/ext/lpsolver-highs/highs/ipm/ipx/model.cc +1528 -0
  829. data/ext/lpsolver-highs/highs/ipm/ipx/model.h +413 -0
  830. data/ext/lpsolver-highs/highs/ipm/ipx/multistream.h +52 -0
  831. data/ext/lpsolver-highs/highs/ipm/ipx/normal_matrix.cc +126 -0
  832. data/ext/lpsolver-highs/highs/ipm/ipx/normal_matrix.h +44 -0
  833. data/ext/lpsolver-highs/highs/ipm/ipx/power_method.h +44 -0
  834. data/ext/lpsolver-highs/highs/ipm/ipx/sparse_matrix.cc +382 -0
  835. data/ext/lpsolver-highs/highs/ipm/ipx/sparse_matrix.h +195 -0
  836. data/ext/lpsolver-highs/highs/ipm/ipx/sparse_utils.cc +92 -0
  837. data/ext/lpsolver-highs/highs/ipm/ipx/sparse_utils.h +58 -0
  838. data/ext/lpsolver-highs/highs/ipm/ipx/splitted_normal_matrix.cc +117 -0
  839. data/ext/lpsolver-highs/highs/ipm/ipx/splitted_normal_matrix.h +63 -0
  840. data/ext/lpsolver-highs/highs/ipm/ipx/starting_basis.cc +182 -0
  841. data/ext/lpsolver-highs/highs/ipm/ipx/starting_basis.h +39 -0
  842. data/ext/lpsolver-highs/highs/ipm/ipx/symbolic_invert.cc +183 -0
  843. data/ext/lpsolver-highs/highs/ipm/ipx/symbolic_invert.h +29 -0
  844. data/ext/lpsolver-highs/highs/ipm/ipx/timer.cc +16 -0
  845. data/ext/lpsolver-highs/highs/ipm/ipx/timer.h +25 -0
  846. data/ext/lpsolver-highs/highs/ipm/ipx/utils.cc +95 -0
  847. data/ext/lpsolver-highs/highs/ipm/ipx/utils.h +37 -0
  848. data/ext/lpsolver-highs/highs/lp_data/HConst.h +430 -0
  849. data/ext/lpsolver-highs/highs/lp_data/HStruct.h +213 -0
  850. data/ext/lpsolver-highs/highs/lp_data/Highs.cpp +4949 -0
  851. data/ext/lpsolver-highs/highs/lp_data/HighsAnalysis.h +23 -0
  852. data/ext/lpsolver-highs/highs/lp_data/HighsCallback.cpp +323 -0
  853. data/ext/lpsolver-highs/highs/lp_data/HighsCallback.h +104 -0
  854. data/ext/lpsolver-highs/highs/lp_data/HighsCallbackStruct.h +70 -0
  855. data/ext/lpsolver-highs/highs/lp_data/HighsDebug.cpp +54 -0
  856. data/ext/lpsolver-highs/highs/lp_data/HighsDebug.h +34 -0
  857. data/ext/lpsolver-highs/highs/lp_data/HighsDeprecated.cpp +181 -0
  858. data/ext/lpsolver-highs/highs/lp_data/HighsIis.cpp +1290 -0
  859. data/ext/lpsolver-highs/highs/lp_data/HighsIis.h +139 -0
  860. data/ext/lpsolver-highs/highs/lp_data/HighsInfo.cpp +426 -0
  861. data/ext/lpsolver-highs/highs/lp_data/HighsInfo.h +421 -0
  862. data/ext/lpsolver-highs/highs/lp_data/HighsInfoDebug.cpp +175 -0
  863. data/ext/lpsolver-highs/highs/lp_data/HighsInfoDebug.h +27 -0
  864. data/ext/lpsolver-highs/highs/lp_data/HighsInterface.cpp +4344 -0
  865. data/ext/lpsolver-highs/highs/lp_data/HighsLp.cpp +564 -0
  866. data/ext/lpsolver-highs/highs/lp_data/HighsLp.h +97 -0
  867. data/ext/lpsolver-highs/highs/lp_data/HighsLpSolverObject.h +47 -0
  868. data/ext/lpsolver-highs/highs/lp_data/HighsLpUtils.cpp +3794 -0
  869. data/ext/lpsolver-highs/highs/lp_data/HighsLpUtils.h +330 -0
  870. data/ext/lpsolver-highs/highs/lp_data/HighsModelUtils.cpp +1650 -0
  871. data/ext/lpsolver-highs/highs/lp_data/HighsModelUtils.h +129 -0
  872. data/ext/lpsolver-highs/highs/lp_data/HighsOptions.cpp +1176 -0
  873. data/ext/lpsolver-highs/highs/lp_data/HighsOptions.h +1715 -0
  874. data/ext/lpsolver-highs/highs/lp_data/HighsRanging.cpp +733 -0
  875. data/ext/lpsolver-highs/highs/lp_data/HighsRanging.h +43 -0
  876. data/ext/lpsolver-highs/highs/lp_data/HighsSolution.cpp +2194 -0
  877. data/ext/lpsolver-highs/highs/lp_data/HighsSolution.h +179 -0
  878. data/ext/lpsolver-highs/highs/lp_data/HighsSolutionDebug.cpp +490 -0
  879. data/ext/lpsolver-highs/highs/lp_data/HighsSolutionDebug.h +87 -0
  880. data/ext/lpsolver-highs/highs/lp_data/HighsSolve.cpp +747 -0
  881. data/ext/lpsolver-highs/highs/lp_data/HighsSolve.h +29 -0
  882. data/ext/lpsolver-highs/highs/lp_data/HighsStatus.cpp +48 -0
  883. data/ext/lpsolver-highs/highs/lp_data/HighsStatus.h +29 -0
  884. data/ext/lpsolver-highs/highs/lp_data/Iis.md +113 -0
  885. data/ext/lpsolver-highs/highs/meson.build +433 -0
  886. data/ext/lpsolver-highs/highs/mip/HighsCliqueTable.cpp +2236 -0
  887. data/ext/lpsolver-highs/highs/mip/HighsCliqueTable.h +329 -0
  888. data/ext/lpsolver-highs/highs/mip/HighsConflictPool.cpp +201 -0
  889. data/ext/lpsolver-highs/highs/mip/HighsConflictPool.h +109 -0
  890. data/ext/lpsolver-highs/highs/mip/HighsCutGeneration.cpp +1491 -0
  891. data/ext/lpsolver-highs/highs/mip/HighsCutGeneration.h +108 -0
  892. data/ext/lpsolver-highs/highs/mip/HighsCutPool.cpp +526 -0
  893. data/ext/lpsolver-highs/highs/mip/HighsCutPool.h +168 -0
  894. data/ext/lpsolver-highs/highs/mip/HighsDebugSol.cpp +313 -0
  895. data/ext/lpsolver-highs/highs/mip/HighsDebugSol.h +133 -0
  896. data/ext/lpsolver-highs/highs/mip/HighsDomain.cpp +3861 -0
  897. data/ext/lpsolver-highs/highs/mip/HighsDomain.h +657 -0
  898. data/ext/lpsolver-highs/highs/mip/HighsDomainChange.h +48 -0
  899. data/ext/lpsolver-highs/highs/mip/HighsDynamicRowMatrix.cpp +199 -0
  900. data/ext/lpsolver-highs/highs/mip/HighsDynamicRowMatrix.h +104 -0
  901. data/ext/lpsolver-highs/highs/mip/HighsFeasibilityJump.cpp +139 -0
  902. data/ext/lpsolver-highs/highs/mip/HighsGFkSolve.cpp +106 -0
  903. data/ext/lpsolver-highs/highs/mip/HighsGFkSolve.h +439 -0
  904. data/ext/lpsolver-highs/highs/mip/HighsImplications.cpp +915 -0
  905. data/ext/lpsolver-highs/highs/mip/HighsImplications.h +194 -0
  906. data/ext/lpsolver-highs/highs/mip/HighsLpAggregator.cpp +56 -0
  907. data/ext/lpsolver-highs/highs/mip/HighsLpAggregator.h +50 -0
  908. data/ext/lpsolver-highs/highs/mip/HighsLpRelaxation.cpp +1609 -0
  909. data/ext/lpsolver-highs/highs/mip/HighsLpRelaxation.h +361 -0
  910. data/ext/lpsolver-highs/highs/mip/HighsMipAnalysis.cpp +313 -0
  911. data/ext/lpsolver-highs/highs/mip/HighsMipAnalysis.h +71 -0
  912. data/ext/lpsolver-highs/highs/mip/HighsMipSolver.cpp +1002 -0
  913. data/ext/lpsolver-highs/highs/mip/HighsMipSolver.h +159 -0
  914. data/ext/lpsolver-highs/highs/mip/HighsMipSolverData.cpp +2936 -0
  915. data/ext/lpsolver-highs/highs/mip/HighsMipSolverData.h +313 -0
  916. data/ext/lpsolver-highs/highs/mip/HighsModkSeparator.cpp +267 -0
  917. data/ext/lpsolver-highs/highs/mip/HighsModkSeparator.h +60 -0
  918. data/ext/lpsolver-highs/highs/mip/HighsNodeQueue.cpp +443 -0
  919. data/ext/lpsolver-highs/highs/mip/HighsNodeQueue.h +312 -0
  920. data/ext/lpsolver-highs/highs/mip/HighsObjectiveFunction.cpp +124 -0
  921. data/ext/lpsolver-highs/highs/mip/HighsObjectiveFunction.h +71 -0
  922. data/ext/lpsolver-highs/highs/mip/HighsPathSeparator.cpp +549 -0
  923. data/ext/lpsolver-highs/highs/mip/HighsPathSeparator.h +39 -0
  924. data/ext/lpsolver-highs/highs/mip/HighsPrimalHeuristics.cpp +1673 -0
  925. data/ext/lpsolver-highs/highs/mip/HighsPrimalHeuristics.h +75 -0
  926. data/ext/lpsolver-highs/highs/mip/HighsPseudocost.cpp +129 -0
  927. data/ext/lpsolver-highs/highs/mip/HighsPseudocost.h +366 -0
  928. data/ext/lpsolver-highs/highs/mip/HighsRedcostFixing.cpp +316 -0
  929. data/ext/lpsolver-highs/highs/mip/HighsRedcostFixing.h +42 -0
  930. data/ext/lpsolver-highs/highs/mip/HighsSearch.cpp +1881 -0
  931. data/ext/lpsolver-highs/highs/mip/HighsSearch.h +241 -0
  932. data/ext/lpsolver-highs/highs/mip/HighsSeparation.cpp +186 -0
  933. data/ext/lpsolver-highs/highs/mip/HighsSeparation.h +41 -0
  934. data/ext/lpsolver-highs/highs/mip/HighsSeparator.cpp +39 -0
  935. data/ext/lpsolver-highs/highs/mip/HighsSeparator.h +60 -0
  936. data/ext/lpsolver-highs/highs/mip/HighsTableauSeparator.cpp +244 -0
  937. data/ext/lpsolver-highs/highs/mip/HighsTableauSeparator.h +34 -0
  938. data/ext/lpsolver-highs/highs/mip/HighsTransformedLp.cpp +563 -0
  939. data/ext/lpsolver-highs/highs/mip/HighsTransformedLp.h +63 -0
  940. data/ext/lpsolver-highs/highs/mip/MipTimer.h +544 -0
  941. data/ext/lpsolver-highs/highs/mip/feasibilityjump.hh +800 -0
  942. data/ext/lpsolver-highs/highs/model/HighsHessian.cpp +263 -0
  943. data/ext/lpsolver-highs/highs/model/HighsHessian.h +54 -0
  944. data/ext/lpsolver-highs/highs/model/HighsHessianUtils.cpp +584 -0
  945. data/ext/lpsolver-highs/highs/model/HighsHessianUtils.h +47 -0
  946. data/ext/lpsolver-highs/highs/model/HighsModel.cpp +46 -0
  947. data/ext/lpsolver-highs/highs/model/HighsModel.h +42 -0
  948. data/ext/lpsolver-highs/highs/parallel/HighsBinarySemaphore.h +108 -0
  949. data/ext/lpsolver-highs/highs/parallel/HighsCacheAlign.h +82 -0
  950. data/ext/lpsolver-highs/highs/parallel/HighsCombinable.h +116 -0
  951. data/ext/lpsolver-highs/highs/parallel/HighsMutex.h +124 -0
  952. data/ext/lpsolver-highs/highs/parallel/HighsParallel.h +128 -0
  953. data/ext/lpsolver-highs/highs/parallel/HighsRaceTimer.h +38 -0
  954. data/ext/lpsolver-highs/highs/parallel/HighsSchedulerConstants.h +19 -0
  955. data/ext/lpsolver-highs/highs/parallel/HighsSpinMutex.h +48 -0
  956. data/ext/lpsolver-highs/highs/parallel/HighsSplitDeque.h +606 -0
  957. data/ext/lpsolver-highs/highs/parallel/HighsTask.h +170 -0
  958. data/ext/lpsolver-highs/highs/parallel/HighsTaskExecutor.cpp +43 -0
  959. data/ext/lpsolver-highs/highs/parallel/HighsTaskExecutor.h +217 -0
  960. data/ext/lpsolver-highs/highs/pdlp/CupdlpWrapper.cpp +848 -0
  961. data/ext/lpsolver-highs/highs/pdlp/CupdlpWrapper.h +108 -0
  962. data/ext/lpsolver-highs/highs/pdlp/HiPdlpTimer.h +155 -0
  963. data/ext/lpsolver-highs/highs/pdlp/HiPdlpWrapper.cpp +141 -0
  964. data/ext/lpsolver-highs/highs/pdlp/HiPdlpWrapper.h +26 -0
  965. data/ext/lpsolver-highs/highs/pdlp/cupdlp/Diff +12 -0
  966. data/ext/lpsolver-highs/highs/pdlp/cupdlp/Meld +7 -0
  967. data/ext/lpsolver-highs/highs/pdlp/cupdlp/Merge +2 -0
  968. data/ext/lpsolver-highs/highs/pdlp/cupdlp/README.md +95 -0
  969. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cuda/CMakeLists.txt +58 -0
  970. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cuda/cupdlp_cuda_kernels.cu +338 -0
  971. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cuda/cupdlp_cuda_kernels.cuh +319 -0
  972. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cuda/cupdlp_cudalinalg.cu +386 -0
  973. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cuda/cupdlp_cudalinalg.cuh +149 -0
  974. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cuda/test_cublas.c +154 -0
  975. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cuda/test_cuda_linalg.c +79 -0
  976. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp.h +16 -0
  977. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_cs.c +214 -0
  978. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_cs.h +40 -0
  979. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_defs.h +447 -0
  980. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_linalg.c +802 -0
  981. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_linalg.h +189 -0
  982. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_proj.c +148 -0
  983. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_proj.h +19 -0
  984. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_restart.c +124 -0
  985. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_restart.h +31 -0
  986. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_scaling.c +425 -0
  987. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_scaling.h +26 -0
  988. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_solver.c +1498 -0
  989. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_solver.h +105 -0
  990. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_step.c +478 -0
  991. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_step.h +37 -0
  992. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_utils.c +1850 -0
  993. data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_utils.h +212 -0
  994. data/ext/lpsolver-highs/highs/pdlp/cupdlp/glbopts.h +342 -0
  995. data/ext/lpsolver-highs/highs/pdlp/hipdlp/defs.hpp +222 -0
  996. data/ext/lpsolver-highs/highs/pdlp/hipdlp/linalg.cc +231 -0
  997. data/ext/lpsolver-highs/highs/pdlp/hipdlp/linalg.hpp +61 -0
  998. data/ext/lpsolver-highs/highs/pdlp/hipdlp/logger.cc +225 -0
  999. data/ext/lpsolver-highs/highs/pdlp/hipdlp/logger.hpp +80 -0
  1000. data/ext/lpsolver-highs/highs/pdlp/hipdlp/pdhg.cc +2798 -0
  1001. data/ext/lpsolver-highs/highs/pdlp/hipdlp/pdhg.cu +497 -0
  1002. data/ext/lpsolver-highs/highs/pdlp/hipdlp/pdhg.hpp +358 -0
  1003. data/ext/lpsolver-highs/highs/pdlp/hipdlp/pdhg_kernels.hpp +77 -0
  1004. data/ext/lpsolver-highs/highs/pdlp/hipdlp/pdlp_gpu_debug.hpp +62 -0
  1005. data/ext/lpsolver-highs/highs/pdlp/hipdlp/restart.cc +132 -0
  1006. data/ext/lpsolver-highs/highs/pdlp/hipdlp/restart.hpp +96 -0
  1007. data/ext/lpsolver-highs/highs/pdlp/hipdlp/scaling.cc +307 -0
  1008. data/ext/lpsolver-highs/highs/pdlp/hipdlp/scaling.hpp +74 -0
  1009. data/ext/lpsolver-highs/highs/pdlp/hipdlp/solver_results.hpp +65 -0
  1010. data/ext/lpsolver-highs/highs/presolve/HPresolve.cpp +8511 -0
  1011. data/ext/lpsolver-highs/highs/presolve/HPresolve.h +505 -0
  1012. data/ext/lpsolver-highs/highs/presolve/HPresolveAnalysis.cpp +239 -0
  1013. data/ext/lpsolver-highs/highs/presolve/HPresolveAnalysis.h +52 -0
  1014. data/ext/lpsolver-highs/highs/presolve/HighsPostsolveStack.cpp +1368 -0
  1015. data/ext/lpsolver-highs/highs/presolve/HighsPostsolveStack.h +943 -0
  1016. data/ext/lpsolver-highs/highs/presolve/HighsSymmetry.cpp +1921 -0
  1017. data/ext/lpsolver-highs/highs/presolve/HighsSymmetry.h +284 -0
  1018. data/ext/lpsolver-highs/highs/presolve/ICrash.cpp +474 -0
  1019. data/ext/lpsolver-highs/highs/presolve/ICrash.h +124 -0
  1020. data/ext/lpsolver-highs/highs/presolve/ICrashUtil.cpp +267 -0
  1021. data/ext/lpsolver-highs/highs/presolve/ICrashUtil.h +62 -0
  1022. data/ext/lpsolver-highs/highs/presolve/ICrashX.cpp +173 -0
  1023. data/ext/lpsolver-highs/highs/presolve/ICrashX.h +23 -0
  1024. data/ext/lpsolver-highs/highs/presolve/PresolveComponent.cpp +45 -0
  1025. data/ext/lpsolver-highs/highs/presolve/PresolveComponent.h +90 -0
  1026. data/ext/lpsolver-highs/highs/qpsolver/README.md +185 -0
  1027. data/ext/lpsolver-highs/highs/qpsolver/a_asm.cpp +139 -0
  1028. data/ext/lpsolver-highs/highs/qpsolver/a_asm.hpp +77 -0
  1029. data/ext/lpsolver-highs/highs/qpsolver/a_quass.cpp +194 -0
  1030. data/ext/lpsolver-highs/highs/qpsolver/a_quass.hpp +22 -0
  1031. data/ext/lpsolver-highs/highs/qpsolver/basis.cpp +443 -0
  1032. data/ext/lpsolver-highs/highs/qpsolver/basis.hpp +159 -0
  1033. data/ext/lpsolver-highs/highs/qpsolver/crashsolution.hpp +20 -0
  1034. data/ext/lpsolver-highs/highs/qpsolver/dantzigpricing.hpp +80 -0
  1035. data/ext/lpsolver-highs/highs/qpsolver/devexharrispricing.hpp +98 -0
  1036. data/ext/lpsolver-highs/highs/qpsolver/devexpricing.hpp +108 -0
  1037. data/ext/lpsolver-highs/highs/qpsolver/eventhandler.hpp +30 -0
  1038. data/ext/lpsolver-highs/highs/qpsolver/factor.hpp +408 -0
  1039. data/ext/lpsolver-highs/highs/qpsolver/feasibility_bounded.hpp +114 -0
  1040. data/ext/lpsolver-highs/highs/qpsolver/feasibility_highs.hpp +301 -0
  1041. data/ext/lpsolver-highs/highs/qpsolver/gradient.hpp +46 -0
  1042. data/ext/lpsolver-highs/highs/qpsolver/instance.hpp +70 -0
  1043. data/ext/lpsolver-highs/highs/qpsolver/matrix.hpp +342 -0
  1044. data/ext/lpsolver-highs/highs/qpsolver/perturbation.cpp +41 -0
  1045. data/ext/lpsolver-highs/highs/qpsolver/perturbation.hpp +15 -0
  1046. data/ext/lpsolver-highs/highs/qpsolver/pricing.hpp +22 -0
  1047. data/ext/lpsolver-highs/highs/qpsolver/qpconst.hpp +34 -0
  1048. data/ext/lpsolver-highs/highs/qpsolver/qpvector.hpp +242 -0
  1049. data/ext/lpsolver-highs/highs/qpsolver/quass.cpp +551 -0
  1050. data/ext/lpsolver-highs/highs/qpsolver/quass.hpp +27 -0
  1051. data/ext/lpsolver-highs/highs/qpsolver/ratiotest.cpp +146 -0
  1052. data/ext/lpsolver-highs/highs/qpsolver/ratiotest.hpp +26 -0
  1053. data/ext/lpsolver-highs/highs/qpsolver/reducedcosts.hpp +46 -0
  1054. data/ext/lpsolver-highs/highs/qpsolver/reducedgradient.hpp +95 -0
  1055. data/ext/lpsolver-highs/highs/qpsolver/runtime.hpp +45 -0
  1056. data/ext/lpsolver-highs/highs/qpsolver/scaling.cpp +123 -0
  1057. data/ext/lpsolver-highs/highs/qpsolver/scaling.hpp +15 -0
  1058. data/ext/lpsolver-highs/highs/qpsolver/settings.hpp +84 -0
  1059. data/ext/lpsolver-highs/highs/qpsolver/snippets.hpp +36 -0
  1060. data/ext/lpsolver-highs/highs/qpsolver/statistics.hpp +30 -0
  1061. data/ext/lpsolver-highs/highs/qpsolver/steepestedgepricing.hpp +173 -0
  1062. data/ext/lpsolver-highs/highs/simplex/HApp.h +550 -0
  1063. data/ext/lpsolver-highs/highs/simplex/HEkk.cpp +4404 -0
  1064. data/ext/lpsolver-highs/highs/simplex/HEkk.h +419 -0
  1065. data/ext/lpsolver-highs/highs/simplex/HEkkControl.cpp +146 -0
  1066. data/ext/lpsolver-highs/highs/simplex/HEkkDebug.cpp +1722 -0
  1067. data/ext/lpsolver-highs/highs/simplex/HEkkDual.cpp +3003 -0
  1068. data/ext/lpsolver-highs/highs/simplex/HEkkDual.h +513 -0
  1069. data/ext/lpsolver-highs/highs/simplex/HEkkDualMulti.cpp +1020 -0
  1070. data/ext/lpsolver-highs/highs/simplex/HEkkDualRHS.cpp +535 -0
  1071. data/ext/lpsolver-highs/highs/simplex/HEkkDualRHS.h +134 -0
  1072. data/ext/lpsolver-highs/highs/simplex/HEkkDualRow.cpp +697 -0
  1073. data/ext/lpsolver-highs/highs/simplex/HEkkDualRow.h +201 -0
  1074. data/ext/lpsolver-highs/highs/simplex/HEkkInterface.cpp +26 -0
  1075. data/ext/lpsolver-highs/highs/simplex/HEkkPrimal.cpp +2984 -0
  1076. data/ext/lpsolver-highs/highs/simplex/HEkkPrimal.h +191 -0
  1077. data/ext/lpsolver-highs/highs/simplex/HSimplex.cpp +330 -0
  1078. data/ext/lpsolver-highs/highs/simplex/HSimplex.h +42 -0
  1079. data/ext/lpsolver-highs/highs/simplex/HSimplexDebug.cpp +145 -0
  1080. data/ext/lpsolver-highs/highs/simplex/HSimplexDebug.h +48 -0
  1081. data/ext/lpsolver-highs/highs/simplex/HSimplexNla.cpp +517 -0
  1082. data/ext/lpsolver-highs/highs/simplex/HSimplexNla.h +158 -0
  1083. data/ext/lpsolver-highs/highs/simplex/HSimplexNlaDebug.cpp +373 -0
  1084. data/ext/lpsolver-highs/highs/simplex/HSimplexNlaFreeze.cpp +28 -0
  1085. data/ext/lpsolver-highs/highs/simplex/HSimplexNlaProductForm.cpp +113 -0
  1086. data/ext/lpsolver-highs/highs/simplex/HSimplexReport.cpp +77 -0
  1087. data/ext/lpsolver-highs/highs/simplex/HSimplexReport.h +21 -0
  1088. data/ext/lpsolver-highs/highs/simplex/HighsSimplexAnalysis.cpp +1495 -0
  1089. data/ext/lpsolver-highs/highs/simplex/HighsSimplexAnalysis.h +500 -0
  1090. data/ext/lpsolver-highs/highs/simplex/SimplexConst.h +273 -0
  1091. data/ext/lpsolver-highs/highs/simplex/SimplexStruct.h +263 -0
  1092. data/ext/lpsolver-highs/highs/simplex/SimplexTimer.h +414 -0
  1093. data/ext/lpsolver-highs/highs/test_kkt/DevKkt.cpp +469 -0
  1094. data/ext/lpsolver-highs/highs/test_kkt/DevKkt.h +143 -0
  1095. data/ext/lpsolver-highs/highs/test_kkt/KktCh2.cpp +305 -0
  1096. data/ext/lpsolver-highs/highs/test_kkt/KktCh2.h +79 -0
  1097. data/ext/lpsolver-highs/highs/util/FactorTimer.h +199 -0
  1098. data/ext/lpsolver-highs/highs/util/HFactor.cpp +2597 -0
  1099. data/ext/lpsolver-highs/highs/util/HFactor.h +587 -0
  1100. data/ext/lpsolver-highs/highs/util/HFactorConst.h +81 -0
  1101. data/ext/lpsolver-highs/highs/util/HFactorDebug.cpp +231 -0
  1102. data/ext/lpsolver-highs/highs/util/HFactorDebug.h +55 -0
  1103. data/ext/lpsolver-highs/highs/util/HFactorExtend.cpp +229 -0
  1104. data/ext/lpsolver-highs/highs/util/HFactorRefactor.cpp +304 -0
  1105. data/ext/lpsolver-highs/highs/util/HFactorUtils.cpp +122 -0
  1106. data/ext/lpsolver-highs/highs/util/HSet.cpp +197 -0
  1107. data/ext/lpsolver-highs/highs/util/HSet.h +89 -0
  1108. data/ext/lpsolver-highs/highs/util/HVector.h +22 -0
  1109. data/ext/lpsolver-highs/highs/util/HVectorBase.cpp +271 -0
  1110. data/ext/lpsolver-highs/highs/util/HVectorBase.h +102 -0
  1111. data/ext/lpsolver-highs/highs/util/HighsCDouble.h +323 -0
  1112. data/ext/lpsolver-highs/highs/util/HighsComponent.h +53 -0
  1113. data/ext/lpsolver-highs/highs/util/HighsDataStack.h +83 -0
  1114. data/ext/lpsolver-highs/highs/util/HighsDisjointSets.h +107 -0
  1115. data/ext/lpsolver-highs/highs/util/HighsHash.cpp +10 -0
  1116. data/ext/lpsolver-highs/highs/util/HighsHash.h +1274 -0
  1117. data/ext/lpsolver-highs/highs/util/HighsHashTree.h +1461 -0
  1118. data/ext/lpsolver-highs/highs/util/HighsInt.h +36 -0
  1119. data/ext/lpsolver-highs/highs/util/HighsIntegers.h +212 -0
  1120. data/ext/lpsolver-highs/highs/util/HighsLinearSumBounds.cpp +267 -0
  1121. data/ext/lpsolver-highs/highs/util/HighsLinearSumBounds.h +203 -0
  1122. data/ext/lpsolver-highs/highs/util/HighsMatrixPic.cpp +146 -0
  1123. data/ext/lpsolver-highs/highs/util/HighsMatrixPic.h +37 -0
  1124. data/ext/lpsolver-highs/highs/util/HighsMatrixSlice.h +561 -0
  1125. data/ext/lpsolver-highs/highs/util/HighsMatrixUtils.cpp +407 -0
  1126. data/ext/lpsolver-highs/highs/util/HighsMatrixUtils.h +57 -0
  1127. data/ext/lpsolver-highs/highs/util/HighsMemoryAllocation.h +63 -0
  1128. data/ext/lpsolver-highs/highs/util/HighsRandom.h +242 -0
  1129. data/ext/lpsolver-highs/highs/util/HighsRbTree.h +452 -0
  1130. data/ext/lpsolver-highs/highs/util/HighsSort.cpp +364 -0
  1131. data/ext/lpsolver-highs/highs/util/HighsSort.h +131 -0
  1132. data/ext/lpsolver-highs/highs/util/HighsSparseMatrix.cpp +1746 -0
  1133. data/ext/lpsolver-highs/highs/util/HighsSparseMatrix.h +151 -0
  1134. data/ext/lpsolver-highs/highs/util/HighsSparseVectorSum.h +95 -0
  1135. data/ext/lpsolver-highs/highs/util/HighsSplay.h +135 -0
  1136. data/ext/lpsolver-highs/highs/util/HighsTimer.h +385 -0
  1137. data/ext/lpsolver-highs/highs/util/HighsUtils.cpp +1259 -0
  1138. data/ext/lpsolver-highs/highs/util/HighsUtils.h +272 -0
  1139. data/ext/lpsolver-highs/highs/util/stringutil.cpp +131 -0
  1140. data/ext/lpsolver-highs/highs/util/stringutil.h +46 -0
  1141. data/ext/lpsolver-highs/highs.pc.in +12 -0
  1142. data/ext/lpsolver-highs/meson.build +198 -0
  1143. data/ext/lpsolver-highs/meson_options.txt +31 -0
  1144. data/ext/lpsolver-highs/nuget/HiGHS_Logo.png +0 -0
  1145. data/ext/lpsolver-highs/nuget/Highs.csproj +25 -0
  1146. data/ext/lpsolver-highs/nuget/Highs.csproj.in +36 -0
  1147. data/ext/lpsolver-highs/nuget/HowToAlternative.md +77 -0
  1148. data/ext/lpsolver-highs/nuget/README.md +38 -0
  1149. data/ext/lpsolver-highs/nuget/arm-toolchain.cmake +15 -0
  1150. data/ext/lpsolver-highs/nuget/build_linux-arm.sh +13 -0
  1151. data/ext/lpsolver-highs/nuget/build_linux.sh +10 -0
  1152. data/ext/lpsolver-highs/nuget/build_windows.ps1 +27 -0
  1153. data/ext/lpsolver-highs/nuget/generatePackage.ps1 +28 -0
  1154. data/ext/lpsolver-highs/pyproject.toml +221 -0
  1155. data/ext/lpsolver-highs/subprojects/pybind11.wrap +13 -0
  1156. data/ext/lpsolver-highs/tests/test_highspy.py +2310 -0
  1157. data/ext/lpsolver-highs/version.rc.in +50 -0
  1158. data/lib/lpsolver/highs +0 -0
  1159. data/lib/lpsolver/model.rb +35 -7
  1160. data/lib/lpsolver/native.so +0 -0
  1161. data/lib/lpsolver/native_model.rb +261 -0
  1162. data/lib/lpsolver/solution.rb +93 -8
  1163. data/lib/lpsolver/version.rb +1 -1
  1164. data/lpsolver.gemspec +4 -1
  1165. metadata +1176 -4
@@ -0,0 +1,1259 @@
1
+ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2
+ /* */
3
+ /* This file is part of the HiGHS linear optimization suite */
4
+ /* */
5
+ /* Available as open-source under the MIT License */
6
+ /* */
7
+ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
8
+ /**@file util/HighsUtils.cpp
9
+ * @brief Class-independent utilities for HiGHS
10
+ */
11
+
12
+ #include "util/HighsUtils.h"
13
+
14
+ #include <algorithm>
15
+ #include <cmath>
16
+ #include <cstdio>
17
+ #include <vector>
18
+
19
+ #include "util/HighsSort.h"
20
+
21
+ HighsInt create(HighsIndexCollection& index_collection, const HighsInt from_col,
22
+ const HighsInt to_col, const HighsInt dimension) {
23
+ if (from_col < 0) return kIndexCollectionCreateIllegalInterval;
24
+ if (to_col >= dimension) return kIndexCollectionCreateIllegalInterval;
25
+ index_collection.dimension_ = dimension;
26
+ index_collection.is_interval_ = true;
27
+ index_collection.from_ = from_col;
28
+ index_collection.to_ = to_col;
29
+ return kIndexCollectionCreateOk;
30
+ }
31
+
32
+ HighsInt create(HighsIndexCollection& index_collection,
33
+ const HighsInt num_set_entries, const HighsInt* set,
34
+ const HighsInt dimension) {
35
+ // Create an index collection for the given set - so long as it is strictly
36
+ // ordered
37
+ if (num_set_entries < 0) return kIndexCollectionCreateIllegalSetSize;
38
+ if (dimension < 0) return kIndexCollectionCreateIllegalSetDimension;
39
+ index_collection.dimension_ = dimension;
40
+ index_collection.is_set_ = true;
41
+ index_collection.set_ = {set, set + num_set_entries};
42
+ index_collection.set_num_entries_ = num_set_entries;
43
+ if (!increasingSetOk(index_collection.set_, 1, 0, true))
44
+ return kIndexCollectionCreateIllegalSetOrder;
45
+ for (HighsInt ix = 0; ix < num_set_entries; ix++)
46
+ if (set[ix] < 0 || set[ix] >= dimension) return -(ix + 1);
47
+ return kIndexCollectionCreateOk;
48
+ }
49
+
50
+ HighsInt create(HighsIndexCollection& index_collection, const HighsInt* mask,
51
+ const HighsInt dimension) {
52
+ // Create an index collection for the given mask
53
+ if (dimension < 0) return kIndexCollectionCreateIllegalMaskSize;
54
+ index_collection.dimension_ = dimension;
55
+ index_collection.is_mask_ = true;
56
+ index_collection.mask_ = {mask, mask + dimension};
57
+ return kIndexCollectionCreateOk;
58
+ }
59
+
60
+ void highsSparseTranspose(HighsInt numRow, HighsInt numCol,
61
+ const std::vector<HighsInt>& Astart,
62
+ const std::vector<HighsInt>& Aindex,
63
+ const std::vector<double>& Avalue,
64
+ std::vector<HighsInt>& ARstart,
65
+ std::vector<HighsInt>& ARindex,
66
+ std::vector<double>& ARvalue) {
67
+ // Make a AR copy
68
+ std::vector<HighsInt> iwork(numRow, 0);
69
+ ARstart.resize(numRow + 1, 0);
70
+ HighsInt AcountX = Aindex.size();
71
+ ARindex.resize(AcountX);
72
+ ARvalue.resize(AcountX);
73
+ for (HighsInt k = 0; k < AcountX; k++) {
74
+ assert(Aindex[k] < numRow);
75
+ iwork[Aindex[k]]++;
76
+ }
77
+ for (HighsInt i = 1; i <= numRow; i++)
78
+ ARstart[i] = ARstart[i - 1] + iwork[i - 1];
79
+ for (HighsInt i = 0; i < numRow; i++) iwork[i] = ARstart[i];
80
+ for (HighsInt iCol = 0; iCol < numCol; iCol++) {
81
+ for (HighsInt k = Astart[iCol]; k < Astart[iCol + 1]; k++) {
82
+ HighsInt iRow = Aindex[k];
83
+ HighsInt iPut = iwork[iRow]++;
84
+ ARindex[iPut] = iCol;
85
+ ARvalue[iPut] = Avalue[k];
86
+ }
87
+ }
88
+ }
89
+
90
+ bool ok(const HighsIndexCollection& index_collection) {
91
+ // Check parameter for each technique of defining an index collection
92
+ if (index_collection.is_interval_) {
93
+ // Changing by interval: check the parameters and that check set and mask
94
+ // are false
95
+ if (index_collection.is_set_) {
96
+ printf("Index collection is both interval and set\n");
97
+ return false;
98
+ }
99
+ if (index_collection.is_mask_) {
100
+ printf("Index collection is both interval and mask\n");
101
+ return false;
102
+ }
103
+ if (index_collection.from_ < 0) {
104
+ printf("Index interval lower limit is %" HIGHSINT_FORMAT " < 0\n",
105
+ index_collection.from_);
106
+ return false;
107
+ }
108
+ if (index_collection.to_ > index_collection.dimension_ - 1) {
109
+ printf("Index interval upper limit is %" HIGHSINT_FORMAT
110
+ " > %" HIGHSINT_FORMAT "\n",
111
+ index_collection.to_, index_collection.dimension_ - 1);
112
+ return false;
113
+ }
114
+ } else if (index_collection.is_set_) {
115
+ // Changing by set: check the parameters and check that interval and mask
116
+ // are false
117
+ if (index_collection.is_interval_) {
118
+ printf("Index collection is both set and interval\n");
119
+ return false;
120
+ }
121
+ if (index_collection.is_mask_) {
122
+ printf("Index collection is both set and mask\n");
123
+ return false;
124
+ }
125
+ if (index_collection.set_.empty()) {
126
+ printf("Index set is NULL\n");
127
+ return false;
128
+ }
129
+ // Check that the values in the vector of integers are ascending
130
+ const vector<HighsInt>& set = index_collection.set_;
131
+ const HighsInt num_entries = index_collection.set_num_entries_;
132
+ const HighsInt entry_upper = index_collection.dimension_ - 1;
133
+ HighsInt prev_set_entry = -1;
134
+ for (HighsInt k = 0; k < num_entries; k++) {
135
+ if (set[k] < 0 || set[k] > entry_upper) {
136
+ printf("Index set entry set[%" HIGHSINT_FORMAT "] = %" HIGHSINT_FORMAT
137
+ " is out of bounds [0, %" HIGHSINT_FORMAT "]\n",
138
+ k, set[k], entry_upper);
139
+ return false;
140
+ }
141
+ if (set[k] <= prev_set_entry) {
142
+ printf("Index set entry set[%" HIGHSINT_FORMAT "] = %" HIGHSINT_FORMAT
143
+ " is not greater than "
144
+ "previous entry %" HIGHSINT_FORMAT "\n",
145
+ k, set[k], prev_set_entry);
146
+ return false;
147
+ }
148
+ prev_set_entry = set[k];
149
+ }
150
+ // This was the old check done independently, and should be
151
+ // equivalent.
152
+ assert(increasingSetOk(set, 0, entry_upper, true));
153
+ } else if (index_collection.is_mask_) {
154
+ // Changing by mask: check the parameters and check that set and interval
155
+ // are false
156
+ if (index_collection.mask_.empty()) {
157
+ printf("Index mask is NULL\n");
158
+ return false;
159
+ }
160
+ if (index_collection.is_interval_) {
161
+ printf("Index collection is both mask and interval\n");
162
+ return false;
163
+ }
164
+ if (index_collection.is_set_) {
165
+ printf("Index collection is both mask and set\n");
166
+ return false;
167
+ }
168
+ } else {
169
+ // No method defined
170
+ printf("Undefined index collection\n");
171
+ return false;
172
+ }
173
+ return true;
174
+ }
175
+
176
+ void limits(const HighsIndexCollection& index_collection, HighsInt& from_k,
177
+ HighsInt& to_k) {
178
+ if (index_collection.is_interval_) {
179
+ from_k = index_collection.from_;
180
+ to_k = index_collection.to_;
181
+ } else if (index_collection.is_set_) {
182
+ from_k = 0;
183
+ to_k = index_collection.set_num_entries_ - 1;
184
+ } else if (index_collection.is_mask_) {
185
+ from_k = 0;
186
+ to_k = index_collection.dimension_ - 1;
187
+ } else {
188
+ assert(1 == 0);
189
+ }
190
+ }
191
+
192
+ void updateOutInIndex(const HighsIndexCollection& index_collection,
193
+ HighsInt& out_from_ix, HighsInt& out_to_ix,
194
+ HighsInt& in_from_ix, HighsInt& in_to_ix,
195
+ HighsInt& current_set_entry) {
196
+ if (index_collection.is_interval_) {
197
+ out_from_ix = index_collection.from_;
198
+ out_to_ix = index_collection.to_;
199
+ in_from_ix = index_collection.to_ + 1;
200
+ in_to_ix = index_collection.dimension_ - 1;
201
+ } else if (index_collection.is_set_) {
202
+ out_from_ix = index_collection.set_[current_set_entry];
203
+ out_to_ix = out_from_ix;
204
+ current_set_entry++;
205
+ HighsInt current_set_entry0 = current_set_entry;
206
+ for (HighsInt set_entry = current_set_entry0;
207
+ set_entry < index_collection.set_num_entries_; set_entry++) {
208
+ HighsInt ix = index_collection.set_[set_entry];
209
+ if (ix > out_to_ix + 1) break;
210
+ out_to_ix = index_collection.set_[current_set_entry];
211
+ current_set_entry++;
212
+ }
213
+ in_from_ix = out_to_ix + 1;
214
+ if (current_set_entry < index_collection.set_num_entries_) {
215
+ in_to_ix = index_collection.set_[current_set_entry] - 1;
216
+ } else {
217
+ // Account for getting to the end of the set
218
+ in_to_ix = index_collection.dimension_ - 1;
219
+ }
220
+ } else {
221
+ out_from_ix = in_to_ix + 1;
222
+ out_to_ix = index_collection.dimension_ - 1;
223
+ for (HighsInt ix = in_to_ix + 1; ix < index_collection.dimension_; ix++) {
224
+ if (!index_collection.mask_[ix]) {
225
+ out_to_ix = ix - 1;
226
+ break;
227
+ }
228
+ }
229
+ in_from_ix = out_to_ix + 1;
230
+ in_to_ix = index_collection.dimension_ - 1;
231
+ for (HighsInt ix = out_to_ix + 1; ix < index_collection.dimension_; ix++) {
232
+ if (index_collection.mask_[ix]) {
233
+ in_to_ix = ix - 1;
234
+ break;
235
+ }
236
+ }
237
+ }
238
+ }
239
+
240
+ HighsInt dataSize(const HighsIndexCollection& index_collection) {
241
+ if (index_collection.is_set_) {
242
+ return index_collection.set_num_entries_;
243
+ } else {
244
+ if (index_collection.is_interval_) {
245
+ return index_collection.to_ - index_collection.from_ + 1;
246
+ } else {
247
+ return index_collection.dimension_;
248
+ }
249
+ }
250
+ }
251
+
252
+ bool highsVarTypeUserDataNotNull(const HighsLogOptions& log_options,
253
+ const HighsVarType* user_data,
254
+ const std::string& name) {
255
+ bool null_data = false;
256
+ if (user_data == NULL) {
257
+ highsLogUser(log_options, HighsLogType::kError,
258
+ "User-supplied %s are NULL\n", name.c_str());
259
+ null_data = true;
260
+ }
261
+ assert(!null_data);
262
+ return null_data;
263
+ }
264
+
265
+ bool intUserDataNotNull(const HighsLogOptions& log_options,
266
+ const HighsInt* user_data, const std::string& name) {
267
+ bool null_data = false;
268
+ if (user_data == NULL) {
269
+ highsLogUser(log_options, HighsLogType::kError,
270
+ "User-supplied %s are NULL\n", name.c_str());
271
+ null_data = true;
272
+ }
273
+ assert(!null_data);
274
+ return null_data;
275
+ }
276
+
277
+ bool doubleUserDataNotNull(const HighsLogOptions& log_options,
278
+ const double* user_data, const std::string& name) {
279
+ bool null_data = false;
280
+ if (user_data == NULL) {
281
+ highsLogUser(log_options, HighsLogType::kError,
282
+ "User-supplied %s are NULL\n", name.c_str());
283
+ null_data = true;
284
+ }
285
+ assert(!null_data);
286
+ return null_data;
287
+ }
288
+
289
+ double getNorm2(const std::vector<double>& values) {
290
+ double sum = 0;
291
+ HighsInt values_size = values.size();
292
+ for (HighsInt i = 0; i < values_size; i++) sum += values[i] * values[i];
293
+ return sum;
294
+ }
295
+
296
+ bool highs_isInfinity(double val) {
297
+ if (val >= kHighsInf) return true;
298
+ return false;
299
+ }
300
+
301
+ double highsRelativeDifference(const double v0, const double v1) {
302
+ return fabs(v0 - v1) / std::max(v0, std::max(v1, 1.0));
303
+ }
304
+
305
+ void analyseVectorValues(const HighsLogOptions* log_options,
306
+ const std::string& message, HighsInt vecDim,
307
+ const std::vector<double>& vec, bool analyseValueList,
308
+ const std::string& model_name) {
309
+ assert(vecDim == int(vec.size()));
310
+ if (vecDim == 0) return;
311
+ double log10 = log(10.0);
312
+ const HighsInt nVK = 20;
313
+ HighsInt nNz = 0;
314
+ HighsInt nPosInfV = 0;
315
+ HighsInt nNegInfV = 0;
316
+ std::vector<HighsInt> posVK;
317
+ std::vector<HighsInt> negVK;
318
+ posVK.resize(nVK + 1, 0);
319
+ negVK.resize(nVK + 1, 0);
320
+
321
+ const HighsInt VLsMxZ = 10;
322
+ std::vector<HighsInt> VLsK;
323
+ std::vector<double> VLsV;
324
+ VLsK.resize(VLsMxZ, 0);
325
+ VLsV.resize(VLsMxZ, 0);
326
+ // Ensure that 1.0 and -1.0 are counted
327
+ const HighsInt PlusOneIx = 0;
328
+ const HighsInt MinusOneIx = 1;
329
+ bool excessVLsV = false;
330
+ HighsInt VLsZ = 2;
331
+ VLsV[PlusOneIx] = 1.0;
332
+ VLsV[MinusOneIx] = -1.0;
333
+ double min_abs_value = kHighsInf;
334
+ double max_abs_value = 0;
335
+ for (HighsInt ix = 0; ix < vecDim; ix++) {
336
+ double v = vec[ix];
337
+ double absV = std::fabs(v);
338
+ if (absV) {
339
+ min_abs_value = std::min(absV, min_abs_value);
340
+ max_abs_value = std::max(absV, max_abs_value);
341
+ }
342
+ HighsInt log10V;
343
+ if (absV > 0) {
344
+ // Nonzero value
345
+ nNz++;
346
+ if (highs_isInfinity(-v)) {
347
+ //-Inf value
348
+ nNegInfV++;
349
+ } else if (highs_isInfinity(v)) {
350
+ //+Inf value
351
+ nPosInfV++;
352
+ } else {
353
+ // Finite nonzero value
354
+ if (absV == 1) {
355
+ log10V = 0;
356
+ } else if (absV == 10) {
357
+ log10V = 1;
358
+ } else if (absV == 100) {
359
+ log10V = 2;
360
+ } else if (absV == 1000) {
361
+ log10V = 3;
362
+ } else {
363
+ log10V = log(absV) / log10;
364
+ }
365
+ if (log10V >= 0) {
366
+ HighsInt k = std::min(log10V, nVK);
367
+ posVK[k]++;
368
+ } else {
369
+ HighsInt k = std::min(-log10V, nVK);
370
+ negVK[k]++;
371
+ }
372
+ }
373
+ }
374
+ if (analyseValueList) {
375
+ if (v == 1.0) {
376
+ VLsK[PlusOneIx]++;
377
+ } else if (v == -1.0) {
378
+ VLsK[MinusOneIx]++;
379
+ } else {
380
+ HighsInt fdIx = -1;
381
+ for (HighsInt ix = 2; ix < VLsZ; ix++) {
382
+ if (v == VLsV[ix]) {
383
+ fdIx = ix;
384
+ break;
385
+ }
386
+ }
387
+ if (fdIx == -1) {
388
+ // New value
389
+ if (VLsZ < VLsMxZ) {
390
+ fdIx = VLsZ;
391
+ VLsV[fdIx] = v;
392
+ VLsK[fdIx]++;
393
+ VLsZ++;
394
+ } else {
395
+ excessVLsV = true;
396
+ }
397
+ } else {
398
+ // Existing value
399
+ VLsK[fdIx]++;
400
+ }
401
+ }
402
+ }
403
+ } // for (HighsInt ix = 0; ix < vecDim; ix++)
404
+ // If there are no nonzeros, min_abs_value retains its starting
405
+ // value of inf
406
+ if (!nNz) min_abs_value = 0;
407
+ highsReportDevInfo(
408
+ log_options,
409
+ highsFormatToString(
410
+ "%s of dimension %" HIGHSINT_FORMAT " with %" HIGHSINT_FORMAT
411
+ " nonzeros (%3d%%) in [%11.4g, %11.4g]\n",
412
+ message.c_str(), vecDim, nNz, int(1e2 * double(nNz) / double(vecDim)),
413
+ min_abs_value, max_abs_value));
414
+ if (nNegInfV > 0)
415
+ highsReportDevInfo(
416
+ log_options, highsFormatToString(
417
+ "%12" HIGHSINT_FORMAT " values are -Inf\n", nNegInfV));
418
+ if (nPosInfV > 0)
419
+ highsReportDevInfo(
420
+ log_options, highsFormatToString(
421
+ "%12" HIGHSINT_FORMAT " values are +Inf\n", nPosInfV));
422
+ HighsInt k = nVK;
423
+ HighsInt vK = posVK[k];
424
+ if (vK > 0)
425
+ highsReportDevInfo(log_options, highsFormatToString(
426
+ "%12" HIGHSINT_FORMAT
427
+ " values satisfy 10^(%3" HIGHSINT_FORMAT
428
+ ") <= v < Inf\n",
429
+ vK, k));
430
+ for (HighsInt k = nVK - 1; k >= 0; k--) {
431
+ HighsInt vK = posVK[k];
432
+ if (vK > 0)
433
+ highsReportDevInfo(
434
+ log_options,
435
+ highsFormatToString("%12" HIGHSINT_FORMAT
436
+ " values satisfy 10^(%3" HIGHSINT_FORMAT
437
+ ") <= v < 10^(%3" HIGHSINT_FORMAT ")\n",
438
+ vK, k - 1, k));
439
+ }
440
+ for (HighsInt k = 1; k <= nVK; k++) {
441
+ HighsInt vK = negVK[k];
442
+ if (vK > 0)
443
+ highsReportDevInfo(
444
+ log_options,
445
+ highsFormatToString("%12" HIGHSINT_FORMAT
446
+ " values satisfy 10^(%3" HIGHSINT_FORMAT
447
+ ") <= v < 10^(%3" HIGHSINT_FORMAT ")\n",
448
+ vK, -k - 1, -k));
449
+ }
450
+ vK = vecDim - nNz;
451
+ if (vK > 0)
452
+ highsReportDevInfo(
453
+ log_options,
454
+ highsFormatToString("%12" HIGHSINT_FORMAT " values are zero\n", vK));
455
+ if (analyseValueList) {
456
+ highsReportDevInfo(log_options,
457
+ highsFormatToString(" Value distribution:"));
458
+ if (excessVLsV)
459
+ highsReportDevInfo(
460
+ log_options,
461
+ highsFormatToString(
462
+ " More than %" HIGHSINT_FORMAT " different values", VLsZ));
463
+ highsReportDevInfo(
464
+ log_options, highsFormatToString("\n Value Count\n"));
465
+ for (HighsInt ix = 0; ix < VLsZ; ix++) {
466
+ if (!VLsK[ix]) continue;
467
+ HighsInt pct = ((100.0 * VLsK[ix]) / vecDim) + 0.5;
468
+ highsReportDevInfo(log_options,
469
+ highsFormatToString(" %12g %12" HIGHSINT_FORMAT
470
+ " (%3" HIGHSINT_FORMAT "%%)\n",
471
+ VLsV[ix], VLsK[ix], pct));
472
+ }
473
+ highsReportDevInfo(
474
+ log_options,
475
+ highsFormatToString("grep_value_distrib,%s,%" HIGHSINT_FORMAT "",
476
+ model_name.c_str(), VLsZ));
477
+ highsReportDevInfo(log_options, highsFormatToString(","));
478
+ if (excessVLsV) highsReportDevInfo(log_options, highsFormatToString("!"));
479
+ for (HighsInt ix = 0; ix < VLsZ; ix++)
480
+ highsReportDevInfo(log_options, highsFormatToString(",%g", VLsV[ix]));
481
+ highsReportDevInfo(log_options, highsFormatToString("\n"));
482
+ }
483
+ }
484
+
485
+ void analyseVectorValues(const HighsLogOptions* log_options,
486
+ const std::string& message, HighsInt vecDim,
487
+ const std::vector<HighsInt>& vec,
488
+ const std::string& model_name) {
489
+ if (vecDim == 0) return;
490
+ const HighsInt VLsMxZ = 10;
491
+ std::vector<std::pair<HighsInt, HighsInt>> VLs;
492
+ bool excessVLsV = false;
493
+ HighsInt VLsZ = 0;
494
+ HighsInt min_value = kHighsIInf;
495
+ HighsInt max_value = 0;
496
+ HighsInt nNz = 0;
497
+
498
+ for (HighsInt ix = 0; ix < vecDim; ix++) {
499
+ HighsInt v = vec[ix];
500
+ min_value = std::min(v, min_value);
501
+ max_value = std::max(v, max_value);
502
+ if (v != 0) nNz++;
503
+
504
+ HighsInt fdIx = -1;
505
+ for (HighsInt ix = 0; ix < VLsZ; ix++) {
506
+ if (v == VLs[ix].first) {
507
+ fdIx = ix;
508
+ break;
509
+ }
510
+ }
511
+ if (fdIx == -1) {
512
+ // New value
513
+ if (VLsZ < VLsMxZ) {
514
+ fdIx = VLsZ;
515
+ VLs.push_back(std::make_pair(v, 1));
516
+ VLsZ++;
517
+ } else {
518
+ excessVLsV = true;
519
+ }
520
+ } else {
521
+ // Existing value
522
+ VLs[fdIx].second++;
523
+ }
524
+ }
525
+ assert(VLsZ == int(VLs.size()));
526
+ std::sort(VLs.begin(), VLs.end());
527
+ highsReportDevInfo(
528
+ log_options,
529
+ highsFormatToString(
530
+ "%s of dimension %d with %d nonzeros (%3d%%) in [%d, %d]\n",
531
+ message.c_str(), int(vecDim), int(nNz), int(100 * nNz / vecDim),
532
+ int(min_value), int(max_value)));
533
+ highsReportDevInfo(log_options,
534
+ highsFormatToString(" Value distribution:"));
535
+ if (excessVLsV)
536
+ highsReportDevInfo(
537
+ log_options,
538
+ highsFormatToString(" More than %" HIGHSINT_FORMAT " different values",
539
+ VLsZ));
540
+ highsReportDevInfo(log_options,
541
+ highsFormatToString("\n Value Count\n"));
542
+ for (HighsInt ix = 0; ix < VLsZ; ix++) {
543
+ if (!VLs[ix].second) continue;
544
+ HighsInt pct = ((100.0 * VLs[ix].second) / vecDim) + 0.5;
545
+ highsReportDevInfo(log_options,
546
+ highsFormatToString(" %12d %12d (%3d%%)\n",
547
+ VLs[ix].first, VLs[ix].second, pct));
548
+ }
549
+ /*
550
+ highsReportDevInfo(log_options,
551
+ highsFormatToString("grep_value_distrib,%s,%"
552
+ HIGHSINT_FORMAT "", model_name.c_str(), VLsZ));
553
+ highsReportDevInfo(log_options, highsFormatToString(","));
554
+ if (excessVLsV) highsReportDevInfo(log_options, highsFormatToString("!"));
555
+ for (HighsInt ix = 0; ix < VLsZ; ix++)
556
+ highsReportDevInfo(log_options, highsFormatToString(",%g", VLs[ix].first));
557
+ highsReportDevInfo(log_options, highsFormatToString("\n"));
558
+ */
559
+ }
560
+
561
+ void analyseMatrixSparsity(const HighsLogOptions& log_options,
562
+ const char* message, HighsInt numCol,
563
+ HighsInt numRow, const std::vector<HighsInt>& Astart,
564
+ const std::vector<HighsInt>& Aindex) {
565
+ if (numCol == 0) return;
566
+ std::vector<HighsInt> rowCount;
567
+ std::vector<HighsInt> colCount;
568
+
569
+ rowCount.assign(numRow, 0);
570
+ colCount.resize(numCol);
571
+
572
+ for (HighsInt col = 0; col < numCol; col++) {
573
+ colCount[col] = Astart[col + 1] - Astart[col];
574
+ for (HighsInt el = Astart[col]; el < Astart[col + 1]; el++)
575
+ rowCount[Aindex[el]]++;
576
+ }
577
+ analyseVectorValues(&log_options, "Column counts", numCol, colCount);
578
+ analyseVectorValues(&log_options, "Row counts", numRow, rowCount);
579
+
580
+ const HighsInt maxCat = 10;
581
+ std::vector<HighsInt> CatV;
582
+ std::vector<HighsInt> rowCatK;
583
+ std::vector<HighsInt> colCatK;
584
+ CatV.resize(maxCat + 1);
585
+ rowCatK.assign(maxCat + 1, 0);
586
+ colCatK.assign(maxCat + 1, 0);
587
+
588
+ CatV[1] = 1;
589
+ for (HighsInt cat = 2; cat < maxCat + 1; cat++) {
590
+ CatV[cat] = 2 * CatV[cat - 1];
591
+ }
592
+
593
+ HighsInt maxRowCount = 0;
594
+ HighsInt maxColCount = 0;
595
+ for (HighsInt col = 0; col < numCol; col++) {
596
+ maxColCount = std::max(colCount[col], maxColCount);
597
+ HighsInt fdCat = maxCat;
598
+ for (HighsInt cat = 0; cat < maxCat - 1; cat++) {
599
+ if (colCount[col] < CatV[cat + 1]) {
600
+ fdCat = cat;
601
+ break;
602
+ }
603
+ }
604
+ colCatK[fdCat]++;
605
+ }
606
+
607
+ for (HighsInt row = 0; row < numRow; row++) {
608
+ maxRowCount = std::max(rowCount[row], maxRowCount);
609
+ HighsInt fdCat = maxCat;
610
+ for (HighsInt cat = 0; cat < maxCat - 1; cat++) {
611
+ if (rowCount[row] < CatV[cat + 1]) {
612
+ fdCat = cat;
613
+ break;
614
+ }
615
+ }
616
+ rowCatK[fdCat]++;
617
+ }
618
+
619
+ highsLogDev(log_options, HighsLogType::kInfo, "\n%s\n\n", message);
620
+ HighsInt lastRpCat = -1;
621
+ for (HighsInt cat = 0; cat < maxCat + 1; cat++) {
622
+ if (colCatK[cat]) lastRpCat = cat;
623
+ }
624
+ HighsInt cat = maxCat;
625
+ if (colCatK[cat]) lastRpCat = cat;
626
+ HighsInt pct;
627
+ double v;
628
+ for (HighsInt cat = 0; cat < lastRpCat; cat++) {
629
+ v = 100 * colCatK[cat];
630
+ v = v / numCol + 0.5;
631
+ pct = v;
632
+ highsLogDev(log_options, HighsLogType::kInfo,
633
+ "%12" HIGHSINT_FORMAT " (%3" HIGHSINT_FORMAT
634
+ "%%) columns of count in [%3" HIGHSINT_FORMAT
635
+ ", %3" HIGHSINT_FORMAT "]\n",
636
+ colCatK[cat], pct, CatV[cat], CatV[cat + 1] - 1);
637
+ }
638
+
639
+ cat = lastRpCat;
640
+ v = 100 * colCatK[cat];
641
+ v = v / numCol + 0.5;
642
+ pct = v;
643
+ if (cat == maxCat) {
644
+ highsLogDev(log_options, HighsLogType::kInfo,
645
+ "%12" HIGHSINT_FORMAT " (%3" HIGHSINT_FORMAT
646
+ "%%) columns of count in [%3" HIGHSINT_FORMAT ", inf]\n",
647
+ colCatK[cat], pct, CatV[cat]);
648
+ } else {
649
+ highsLogDev(log_options, HighsLogType::kInfo,
650
+ "%12" HIGHSINT_FORMAT " (%3" HIGHSINT_FORMAT
651
+ "%%) columns of count in [%3" HIGHSINT_FORMAT
652
+ ", %3" HIGHSINT_FORMAT "]\n",
653
+ colCatK[cat], pct, CatV[cat], CatV[cat + 1] - 1);
654
+ }
655
+ highsLogDev(log_options, HighsLogType::kInfo,
656
+ "Max count is %" HIGHSINT_FORMAT " / %" HIGHSINT_FORMAT "\n\n",
657
+ maxColCount, numRow);
658
+
659
+ lastRpCat = -1;
660
+ for (HighsInt cat = 0; cat < maxCat + 1; cat++) {
661
+ if (rowCatK[cat]) lastRpCat = cat;
662
+ }
663
+ cat = maxCat;
664
+ if (rowCatK[cat]) lastRpCat = cat;
665
+ pct = 0;
666
+ v = 0;
667
+ for (HighsInt cat = 0; cat < lastRpCat; cat++) {
668
+ v = 100 * rowCatK[cat];
669
+ v = v / numRow + 0.5;
670
+ pct = v;
671
+ highsLogDev(log_options, HighsLogType::kInfo,
672
+ "%12" HIGHSINT_FORMAT " (%3" HIGHSINT_FORMAT
673
+ "%%) rows of count in [%3" HIGHSINT_FORMAT
674
+ ", %3" HIGHSINT_FORMAT "]\n",
675
+ rowCatK[cat], pct, CatV[cat], CatV[cat + 1] - 1);
676
+ }
677
+
678
+ cat = lastRpCat;
679
+ v = 100 * rowCatK[cat];
680
+ v = v / numRow + 0.5;
681
+ pct = v;
682
+ if (cat == maxCat) {
683
+ highsLogDev(log_options, HighsLogType::kInfo,
684
+ "%12" HIGHSINT_FORMAT " (%3" HIGHSINT_FORMAT
685
+ "%%) rows of count in [%3" HIGHSINT_FORMAT ", inf]\n",
686
+ rowCatK[cat], pct, CatV[cat]);
687
+ } else {
688
+ highsLogDev(log_options, HighsLogType::kInfo,
689
+ "%12" HIGHSINT_FORMAT " (%3" HIGHSINT_FORMAT
690
+ "%%) rows of count in [%3" HIGHSINT_FORMAT
691
+ ", %3" HIGHSINT_FORMAT "]\n",
692
+ rowCatK[cat], pct, CatV[cat], CatV[cat + 1] - 1);
693
+ }
694
+ highsLogDev(log_options, HighsLogType::kInfo,
695
+ "Max count is %" HIGHSINT_FORMAT " / %" HIGHSINT_FORMAT "\n",
696
+ maxRowCount, numCol);
697
+ }
698
+
699
+ bool initialiseValueDistribution(const std::string& distribution_name,
700
+ const std::string& value_name,
701
+ const double min_value_limit,
702
+ const double max_value_limit,
703
+ const double base_value_limit,
704
+ HighsValueDistribution& value_distribution) {
705
+ assert(min_value_limit > 0);
706
+ assert(max_value_limit > 0);
707
+ assert(base_value_limit > 1);
708
+ value_distribution.distribution_name_ = distribution_name;
709
+ value_distribution.value_name_ = value_name;
710
+ if (min_value_limit <= 0) return false;
711
+ if (max_value_limit < min_value_limit) return false;
712
+ HighsInt num_count;
713
+ if (min_value_limit == max_value_limit) {
714
+ // For counting values below and above a value
715
+ num_count = 1;
716
+ } else {
717
+ if (base_value_limit <= 0) return false;
718
+ const double log_ratio = log(max_value_limit / min_value_limit);
719
+ const double log_base_value_limit = log(base_value_limit);
720
+ // printf("initialiseValueDistribution: log_ratio = %g;
721
+ // log_base_value_limit = %g; log_ratio/log_base_value_limit = %g\n",
722
+ // log_ratio, log_base_value_limit, log_ratio/log_base_value_limit);
723
+ num_count = log_ratio / log_base_value_limit + 1;
724
+ }
725
+ // printf("initialiseValueDistribution: num_count = %" HIGHSINT_FORMAT "\n",
726
+ // num_count);
727
+ value_distribution.count_.assign(num_count + 1, 0);
728
+ value_distribution.limit_.assign(num_count, 0);
729
+ value_distribution.limit_[0] = min_value_limit;
730
+ // printf("Interval 0 is [%10.4g, %10.4g)\n", 0.0,
731
+ // value_distribution.limit_[0]);
732
+ for (HighsInt i = 1; i < num_count; i++) {
733
+ value_distribution.limit_[i] =
734
+ base_value_limit * value_distribution.limit_[i - 1];
735
+ // printf("Interval %2" HIGHSINT_FORMAT " is [%10.4g, %10.4g)\n", i,
736
+ // value_distribution.limit_[i-1], value_distribution.limit_[i]);
737
+ }
738
+ // printf("Interval %2" HIGHSINT_FORMAT " is [%10.4g, inf)\n", num_count,
739
+ // value_distribution.limit_[num_count-1]);
740
+ value_distribution.num_count_ = num_count;
741
+ value_distribution.num_zero_ = 0;
742
+ value_distribution.num_one_ = 0;
743
+ value_distribution.min_value_ = kHighsInf;
744
+ value_distribution.max_value_ = 0;
745
+ value_distribution.sum_count_ = 0;
746
+ return true;
747
+ }
748
+
749
+ bool updateValueDistribution(const double value,
750
+ HighsValueDistribution& value_distribution) {
751
+ if (value_distribution.num_count_ < 0) return false;
752
+ value_distribution.sum_count_++;
753
+ const double abs_value = fabs(value);
754
+ value_distribution.min_value_ =
755
+ std::min(abs_value, value_distribution.min_value_);
756
+ value_distribution.max_value_ =
757
+ std::max(abs_value, value_distribution.max_value_);
758
+ if (!abs_value) {
759
+ value_distribution.num_zero_++;
760
+ return true;
761
+ }
762
+ if (abs_value == 1.0) {
763
+ value_distribution.num_one_++;
764
+ return true;
765
+ }
766
+ for (HighsInt i = 0; i < value_distribution.num_count_; i++) {
767
+ if (abs_value < value_distribution.limit_[i]) {
768
+ value_distribution.count_[i]++;
769
+ return true;
770
+ }
771
+ }
772
+ value_distribution.count_[value_distribution.num_count_]++;
773
+ return true;
774
+ }
775
+
776
+ double doublePercentage(const HighsInt of, const HighsInt in) {
777
+ return ((100.0 * of) / in);
778
+ }
779
+
780
+ HighsInt integerPercentage(const HighsInt of, const HighsInt in) {
781
+ const double double_percentage = ((100.0 * of) / in) + 0.4999;
782
+ return (HighsInt)double_percentage;
783
+ }
784
+
785
+ bool logValueDistribution(const HighsLogOptions& log_options,
786
+ const HighsValueDistribution& value_distribution,
787
+ const HighsInt mu) {
788
+ if (value_distribution.sum_count_ <= 0) return false;
789
+ const HighsInt num_count = value_distribution.num_count_;
790
+ if (num_count < 0) return false;
791
+ if (value_distribution.distribution_name_ != "")
792
+ highsLogDev(log_options, HighsLogType::kInfo, "\n%s\n",
793
+ value_distribution.distribution_name_.c_str());
794
+ std::string value_name = value_distribution.value_name_;
795
+ bool not_reported_ones = true;
796
+ HighsInt sum_count =
797
+ value_distribution.num_zero_ + value_distribution.num_one_;
798
+ const double min_value = value_distribution.min_value_;
799
+ for (HighsInt i = 0; i < num_count + 1; i++)
800
+ sum_count += value_distribution.count_[i];
801
+ if (!sum_count) return false;
802
+ highsLogDev(log_options, HighsLogType::kInfo, "Min value = %g\n", min_value);
803
+ highsLogDev(log_options, HighsLogType::kInfo,
804
+ " Minimum %svalue is %10.4g", value_name.c_str(), min_value);
805
+ if (mu > 0) {
806
+ highsLogDev(log_options, HighsLogType::kInfo,
807
+ " corresponding to %10" HIGHSINT_FORMAT
808
+ " / %10" HIGHSINT_FORMAT "\n",
809
+ (HighsInt)(min_value * mu), mu);
810
+ } else {
811
+ highsLogDev(log_options, HighsLogType::kInfo, "\n");
812
+ }
813
+ highsLogDev(log_options, HighsLogType::kInfo,
814
+ " Maximum %svalue is %10.4g", value_name.c_str(),
815
+ value_distribution.max_value_);
816
+ if (mu > 0) {
817
+ highsLogDev(log_options, HighsLogType::kInfo,
818
+ " corresponding to %10" HIGHSINT_FORMAT
819
+ " / %10" HIGHSINT_FORMAT "\n",
820
+ (HighsInt)(value_distribution.max_value_ * mu), mu);
821
+ } else {
822
+ highsLogDev(log_options, HighsLogType::kInfo, "\n");
823
+ }
824
+ HighsInt sum_report_count = 0;
825
+ double percentage;
826
+ HighsInt int_percentage;
827
+ HighsInt count = value_distribution.num_zero_;
828
+ if (count) {
829
+ percentage = doublePercentage(count, sum_count);
830
+ int_percentage = percentage;
831
+ highsLogDev(log_options, HighsLogType::kInfo,
832
+ "%12" HIGHSINT_FORMAT " %svalues (%3" HIGHSINT_FORMAT
833
+ "%%) are %10.4g\n",
834
+ count, value_name.c_str(), int_percentage, 0.0);
835
+ sum_report_count += count;
836
+ }
837
+ count = value_distribution.count_[0];
838
+ if (count) {
839
+ percentage = doublePercentage(count, sum_count);
840
+ int_percentage = percentage;
841
+ highsLogDev(log_options, HighsLogType::kInfo,
842
+ "%12" HIGHSINT_FORMAT " %svalues (%3" HIGHSINT_FORMAT
843
+ "%%) in (%10.4g, %10.4g)",
844
+ count, value_name.c_str(), int_percentage, 0.0,
845
+ value_distribution.limit_[0]);
846
+ sum_report_count += count;
847
+ if (mu > 0) {
848
+ highsLogDev(log_options, HighsLogType::kInfo,
849
+ " corresponding to (%10" HIGHSINT_FORMAT
850
+ ", %10" HIGHSINT_FORMAT ")\n",
851
+ 0, (HighsInt)(value_distribution.limit_[0] * mu));
852
+ } else {
853
+ highsLogDev(log_options, HighsLogType::kInfo, "\n");
854
+ }
855
+ }
856
+ for (HighsInt i = 1; i < num_count; i++) {
857
+ if (not_reported_ones && value_distribution.limit_[i - 1] >= 1.0) {
858
+ count = value_distribution.num_one_;
859
+ if (count) {
860
+ percentage = doublePercentage(count, sum_count);
861
+ int_percentage = percentage;
862
+ highsLogDev(log_options, HighsLogType::kInfo,
863
+ "%12" HIGHSINT_FORMAT " %svalues (%3" HIGHSINT_FORMAT
864
+ "%%) are %10.4g",
865
+ count, value_name.c_str(), int_percentage, 1.0);
866
+ sum_report_count += count;
867
+ if (mu > 0) {
868
+ highsLogDev(log_options, HighsLogType::kInfo,
869
+ " corresponding to %10" HIGHSINT_FORMAT "\n", mu);
870
+ } else {
871
+ highsLogDev(log_options, HighsLogType::kInfo, "\n");
872
+ }
873
+ }
874
+ not_reported_ones = false;
875
+ }
876
+ count = value_distribution.count_[i];
877
+ if (count) {
878
+ percentage = doublePercentage(count, sum_count);
879
+ int_percentage = percentage;
880
+ highsLogDev(log_options, HighsLogType::kInfo,
881
+ "%12" HIGHSINT_FORMAT " %svalues (%3" HIGHSINT_FORMAT
882
+ "%%) in [%10.4g, %10.4g)",
883
+ count, value_name.c_str(), int_percentage,
884
+ value_distribution.limit_[i - 1],
885
+ value_distribution.limit_[i]);
886
+ sum_report_count += count;
887
+ if (mu > 0) {
888
+ highsLogDev(log_options, HighsLogType::kInfo,
889
+ " corresponding to [%10" HIGHSINT_FORMAT
890
+ ", %10" HIGHSINT_FORMAT ")\n",
891
+ (HighsInt)(value_distribution.limit_[i - 1] * mu),
892
+ (HighsInt)(value_distribution.limit_[i] * mu));
893
+ } else {
894
+ highsLogDev(log_options, HighsLogType::kInfo, "\n");
895
+ }
896
+ }
897
+ }
898
+ if (not_reported_ones && value_distribution.limit_[num_count - 1] >= 1.0) {
899
+ count = value_distribution.num_one_;
900
+ if (count) {
901
+ percentage = doublePercentage(count, sum_count);
902
+ int_percentage = percentage;
903
+ highsLogDev(log_options, HighsLogType::kInfo,
904
+ "%12" HIGHSINT_FORMAT " %svalues (%3" HIGHSINT_FORMAT
905
+ "%%) are %10.4g",
906
+ count, value_name.c_str(), int_percentage, 1.0);
907
+ sum_report_count += count;
908
+ if (mu > 0) {
909
+ highsLogDev(log_options, HighsLogType::kInfo,
910
+ " corresponding to %10" HIGHSINT_FORMAT "\n", mu);
911
+ } else {
912
+ highsLogDev(log_options, HighsLogType::kInfo, "\n");
913
+ }
914
+ }
915
+ not_reported_ones = false;
916
+ }
917
+ count = value_distribution.count_[num_count];
918
+ if (count) {
919
+ percentage = doublePercentage(count, sum_count);
920
+ int_percentage = percentage;
921
+ highsLogDev(log_options, HighsLogType::kInfo,
922
+ "%12" HIGHSINT_FORMAT " %svalues (%3" HIGHSINT_FORMAT
923
+ "%%) in [%10.4g, inf)",
924
+ count, value_name.c_str(), int_percentage,
925
+ value_distribution.limit_[num_count - 1]);
926
+ sum_report_count += count;
927
+ if (mu > 0) {
928
+ highsLogDev(log_options, HighsLogType::kInfo,
929
+ " corresponding to [%10" HIGHSINT_FORMAT ", inf)\n",
930
+ (HighsInt)(value_distribution.limit_[num_count - 1] * mu));
931
+ } else {
932
+ highsLogDev(log_options, HighsLogType::kInfo, "\n");
933
+ }
934
+ }
935
+ if (not_reported_ones) {
936
+ count = value_distribution.num_one_;
937
+ if (count) {
938
+ percentage = doublePercentage(count, sum_count);
939
+ int_percentage = percentage;
940
+ highsLogDev(log_options, HighsLogType::kInfo,
941
+ "%12" HIGHSINT_FORMAT " %svalues (%3" HIGHSINT_FORMAT
942
+ "%%) are %10.4g",
943
+ count, value_name.c_str(), int_percentage, 1.0);
944
+ sum_report_count += count;
945
+ if (mu > 0) {
946
+ highsLogDev(log_options, HighsLogType::kInfo,
947
+ " corresponding to %10" HIGHSINT_FORMAT "\n", mu);
948
+ } else {
949
+ highsLogDev(log_options, HighsLogType::kInfo, "\n");
950
+ }
951
+ }
952
+ }
953
+ highsLogDev(log_options, HighsLogType::kInfo,
954
+ "%12" HIGHSINT_FORMAT " %svalues\n", sum_count,
955
+ value_name.c_str());
956
+ if (sum_report_count != sum_count)
957
+ highsLogDev(log_options, HighsLogType::kInfo,
958
+ "ERROR: %" HIGHSINT_FORMAT
959
+ " = sum_report_count != sum_count = %" HIGHSINT_FORMAT "\n",
960
+ sum_report_count, sum_count);
961
+ return true;
962
+ }
963
+
964
+ bool initialiseScatterData(const HighsInt max_num_point,
965
+ HighsScatterData& scatter_data) {
966
+ if (max_num_point < 1) return false;
967
+ scatter_data.max_num_point_ = max_num_point;
968
+ scatter_data.num_point_ = 0;
969
+ scatter_data.last_point_ = -1;
970
+ scatter_data.value0_.resize(max_num_point);
971
+ scatter_data.value1_.resize(max_num_point);
972
+ scatter_data.have_regression_coeff_ = false;
973
+ scatter_data.num_error_comparison_ = 0;
974
+ scatter_data.num_awful_linear_ = 0;
975
+ scatter_data.num_awful_log_ = 0;
976
+ scatter_data.num_bad_linear_ = 0;
977
+ scatter_data.num_bad_log_ = 0;
978
+ scatter_data.num_fair_linear_ = 0;
979
+ scatter_data.num_fair_log_ = 0;
980
+ scatter_data.num_better_linear_ = 0;
981
+ scatter_data.num_better_log_ = 0;
982
+ return true;
983
+ }
984
+
985
+ bool updateScatterData(const double value0, const double value1,
986
+ HighsScatterData& scatter_data) {
987
+ if (value0 <= 0 || value1 <= 0) return false;
988
+ scatter_data.num_point_++;
989
+ scatter_data.last_point_++;
990
+ if (scatter_data.last_point_ == scatter_data.max_num_point_)
991
+ scatter_data.last_point_ = 0;
992
+ scatter_data.value0_[scatter_data.last_point_] = value0;
993
+ scatter_data.value1_[scatter_data.last_point_] = value1;
994
+ return true;
995
+ }
996
+
997
+ bool regressScatterData(HighsScatterData& scatter_data) {
998
+ if (scatter_data.num_point_ < 5) return true;
999
+ double log_x;
1000
+ double log_y;
1001
+ double sum_log_x = 0;
1002
+ double sum_log_y = 0;
1003
+ double sum_log_xlog_x = 0;
1004
+ double sum_log_xlog_y = 0;
1005
+ double x;
1006
+ double y;
1007
+ double sum_x = 0;
1008
+ double sum_y = 0;
1009
+ double sum_xx = 0;
1010
+ double sum_xy = 0;
1011
+ HighsInt point_num = 0;
1012
+ for (HighsInt pass = 0; pass < 2; pass++) {
1013
+ HighsInt from_point;
1014
+ HighsInt to_point;
1015
+ if (pass == 0) {
1016
+ from_point = scatter_data.last_point_;
1017
+ to_point = std::min(scatter_data.num_point_, scatter_data.max_num_point_);
1018
+ } else {
1019
+ from_point = 0;
1020
+ to_point = scatter_data.last_point_;
1021
+ }
1022
+ for (HighsInt point = from_point; point < to_point; point++) {
1023
+ point_num++;
1024
+ x = scatter_data.value0_[point];
1025
+ y = scatter_data.value1_[point];
1026
+ sum_x += x;
1027
+ sum_y += y;
1028
+ sum_xx += x * x;
1029
+ sum_xy += x * y;
1030
+ log_x = log(x);
1031
+ log_y = log(y);
1032
+ sum_log_x += log_x;
1033
+ sum_log_y += log_y;
1034
+ sum_log_xlog_x += log_x * log_x;
1035
+ sum_log_xlog_y += log_x * log_y;
1036
+ }
1037
+ }
1038
+ double double_num = 1.0 * point_num;
1039
+ // Linear regression
1040
+ double det = double_num * sum_xx - sum_x * sum_x;
1041
+ if (fabs(det) < 1e-8) return true;
1042
+ scatter_data.linear_coeff0_ = (sum_xx * sum_y - sum_x * sum_xy) / det;
1043
+ scatter_data.linear_coeff1_ = (-sum_x * sum_y + double_num * sum_xy) / det;
1044
+ // Log regression
1045
+ det = double_num * sum_log_xlog_x - sum_log_x * sum_log_x;
1046
+ if (fabs(det) < 1e-8) return true;
1047
+ scatter_data.log_coeff0_ =
1048
+ (sum_log_xlog_x * sum_log_y - sum_log_x * sum_log_xlog_y) / det;
1049
+ scatter_data.log_coeff0_ = exp(scatter_data.log_coeff0_);
1050
+ scatter_data.log_coeff1_ =
1051
+ (-sum_log_x * sum_log_y + double_num * sum_log_xlog_y) / det;
1052
+ // Look at the errors in the two approaches
1053
+ scatter_data.have_regression_coeff_ = true;
1054
+ if (scatter_data.num_point_ < scatter_data.max_num_point_) return true;
1055
+
1056
+ scatter_data.num_error_comparison_++;
1057
+ computeScatterDataRegressionError(scatter_data);
1058
+ const double linear_error = scatter_data.linear_regression_error_;
1059
+ const double log_error = scatter_data.log_regression_error_;
1060
+
1061
+ const bool report_awful_error = false;
1062
+ if (linear_error > awful_regression_error ||
1063
+ log_error > awful_regression_error) {
1064
+ if (linear_error > awful_regression_error) {
1065
+ scatter_data.num_awful_linear_++;
1066
+ if (report_awful_error)
1067
+ printf("Awful linear regression error = %g\n", linear_error);
1068
+ }
1069
+ if (log_error > awful_regression_error) {
1070
+ scatter_data.num_awful_log_++;
1071
+ if (report_awful_error)
1072
+ printf("Awful log regression error = %g\n", log_error);
1073
+ }
1074
+ if (report_awful_error)
1075
+ computeScatterDataRegressionError(scatter_data, true);
1076
+ }
1077
+ if (linear_error > bad_regression_error) scatter_data.num_bad_linear_++;
1078
+ if (log_error > bad_regression_error) scatter_data.num_bad_log_++;
1079
+ if (linear_error > fair_regression_error) scatter_data.num_fair_linear_++;
1080
+ if (log_error > fair_regression_error) scatter_data.num_fair_log_++;
1081
+ if (linear_error < log_error) {
1082
+ scatter_data.num_better_linear_++;
1083
+ } else if (linear_error > log_error) {
1084
+ scatter_data.num_better_log_++;
1085
+ }
1086
+ // printf("Linear regression error = %g\n", linear_error);
1087
+ // printf("Log regression error = %g\n", log_error);
1088
+ return true;
1089
+ }
1090
+
1091
+ bool predictFromScatterData(const HighsScatterData& scatter_data,
1092
+ const double value0, double& predicted_value1,
1093
+ const bool log_regression) {
1094
+ if (!scatter_data.have_regression_coeff_) return false;
1095
+ if (log_regression) {
1096
+ predicted_value1 =
1097
+ scatter_data.log_coeff0_ * pow(value0, scatter_data.log_coeff1_);
1098
+ return true;
1099
+ } else {
1100
+ predicted_value1 =
1101
+ scatter_data.linear_coeff0_ + scatter_data.linear_coeff1_ * value0;
1102
+ return true;
1103
+ }
1104
+ }
1105
+
1106
+ bool computeScatterDataRegressionError(HighsScatterData& scatter_data,
1107
+ const bool print) {
1108
+ if (!scatter_data.have_regression_coeff_) return false;
1109
+ if (scatter_data.num_point_ < scatter_data.max_num_point_) return false;
1110
+ double sum_log_error = 0;
1111
+ if (print)
1112
+ printf(
1113
+ "Log regression\nPoint Value0 Value1 PredValue1 Error\n");
1114
+ for (HighsInt point = 0; point < scatter_data.max_num_point_; point++) {
1115
+ double value0 = scatter_data.value0_[point];
1116
+ double value1 = scatter_data.value1_[point];
1117
+ double predicted_value1;
1118
+ if (predictFromScatterData(scatter_data, value0, predicted_value1, true)) {
1119
+ double error = fabs(predicted_value1 - value1); // / fabs(value1);
1120
+ if (
1121
+ // 10*error > awful_regression_error &&
1122
+ print)
1123
+ printf("%5" HIGHSINT_FORMAT " %10.4g %10.4g %10.4g %10.4g\n", point,
1124
+ value0, value1, predicted_value1, error);
1125
+ sum_log_error += error;
1126
+ }
1127
+ }
1128
+ if (print)
1129
+ printf(" %10.4g\n", sum_log_error);
1130
+ double sum_linear_error = 0;
1131
+ if (print)
1132
+ printf(
1133
+ "Linear regression\nPoint Value0 Value1 PredValue1 "
1134
+ "Error\n");
1135
+ for (HighsInt point = 0; point < scatter_data.max_num_point_; point++) {
1136
+ double value0 = scatter_data.value0_[point];
1137
+ double value1 = scatter_data.value1_[point];
1138
+ double predicted_value1;
1139
+ if (predictFromScatterData(scatter_data, value0, predicted_value1)) {
1140
+ double error = fabs(predicted_value1 - value1); // / fabs(value1);
1141
+ if (
1142
+ // 10*error > awful_regression_error &&
1143
+ print)
1144
+ printf("%5" HIGHSINT_FORMAT " %10.4g %10.4g %10.4g %10.4g\n", point,
1145
+ value0, value1, predicted_value1, error);
1146
+ sum_linear_error += error;
1147
+ }
1148
+ }
1149
+ if (print)
1150
+ printf(" %10.4g\n", sum_linear_error);
1151
+ scatter_data.log_regression_error_ = sum_log_error;
1152
+ scatter_data.linear_regression_error_ = sum_linear_error;
1153
+ return true;
1154
+ }
1155
+
1156
+ bool printScatterData(const std::string& name,
1157
+ const HighsScatterData& scatter_data) {
1158
+ if (!scatter_data.num_point_) return true;
1159
+ double x;
1160
+ double y;
1161
+ HighsInt point_num = 0;
1162
+ printf("%s scatter data\n", name.c_str());
1163
+ const HighsInt to_point =
1164
+ std::min(scatter_data.num_point_, scatter_data.max_num_point_);
1165
+ for (HighsInt point = scatter_data.last_point_ + 1; point < to_point;
1166
+ point++) {
1167
+ point_num++;
1168
+ x = scatter_data.value0_[point];
1169
+ y = scatter_data.value1_[point];
1170
+ printf("%" HIGHSINT_FORMAT ",%10.4g,%10.4g,%" HIGHSINT_FORMAT "\n", point,
1171
+ x, y, point_num);
1172
+ }
1173
+ for (HighsInt point = 0; point <= scatter_data.last_point_; point++) {
1174
+ point_num++;
1175
+ x = scatter_data.value0_[point];
1176
+ y = scatter_data.value1_[point];
1177
+ printf("%" HIGHSINT_FORMAT ",%10.4g,%10.4g,%" HIGHSINT_FORMAT "\n", point,
1178
+ x, y, point_num);
1179
+ }
1180
+ printf("Linear regression coefficients,%10.4g,%10.4g\n",
1181
+ scatter_data.linear_coeff0_, scatter_data.linear_coeff1_);
1182
+ printf("Log regression coefficients,%10.4g,%10.4g\n",
1183
+ scatter_data.log_coeff0_, scatter_data.log_coeff1_);
1184
+ return true;
1185
+ }
1186
+
1187
+ void printScatterDataRegressionComparison(
1188
+ const std::string& name, const HighsScatterData& scatter_data) {
1189
+ if (!scatter_data.num_error_comparison_) return;
1190
+ printf("\n%s scatter data regression\n", name.c_str());
1191
+ printf("%10" HIGHSINT_FORMAT " regression error comparisons\n",
1192
+ scatter_data.num_error_comparison_);
1193
+ printf("%10" HIGHSINT_FORMAT " regression awful linear (>%10.4g)\n",
1194
+ scatter_data.num_awful_linear_, awful_regression_error);
1195
+ printf("%10" HIGHSINT_FORMAT " regression awful log (>%10.4g)\n",
1196
+ scatter_data.num_awful_log_, awful_regression_error);
1197
+ printf("%10" HIGHSINT_FORMAT " regression bad linear (>%10.4g)\n",
1198
+ scatter_data.num_bad_linear_, bad_regression_error);
1199
+ printf("%10" HIGHSINT_FORMAT " regression bad log (>%10.4g)\n",
1200
+ scatter_data.num_bad_log_, bad_regression_error);
1201
+ printf("%10" HIGHSINT_FORMAT " regression fair linear (>%10.4g)\n",
1202
+ scatter_data.num_fair_linear_, fair_regression_error);
1203
+ printf("%10" HIGHSINT_FORMAT " regression fair log (>%10.4g)\n",
1204
+ scatter_data.num_fair_log_, fair_regression_error);
1205
+ printf("%10" HIGHSINT_FORMAT " regression better linear\n",
1206
+ scatter_data.num_better_linear_);
1207
+ printf("%10" HIGHSINT_FORMAT " regression better log\n",
1208
+ scatter_data.num_better_log_);
1209
+ }
1210
+
1211
+ double nearestPowerOfTwoScale(const double value) {
1212
+ int exp_scale;
1213
+ // Decompose value into a normalized fraction and an integral power
1214
+ // of two.
1215
+ //
1216
+ // If arg is zero, returns zero and stores zero in *exp. Otherwise
1217
+ // (if arg is not zero), if no errors occur, returns the value x in
1218
+ // the range (-1;-0.5], [0.5; 1) and stores an integer value in *exp
1219
+ // such that x×2(*exp)=arg
1220
+ double check_x = std::frexp(value, &exp_scale);
1221
+ if (std::fabs(check_x) == 0.5) {
1222
+ check_x *= 2;
1223
+ exp_scale--;
1224
+ }
1225
+ const double check_value = check_x * std::pow(2, exp_scale);
1226
+ assert(check_value == value);
1227
+ exp_scale = -exp_scale;
1228
+ // Multiply a floating point value x(=1) by the number 2 raised to
1229
+ // the exp power
1230
+ double scale = std::ldexp(1, exp_scale);
1231
+ return scale;
1232
+ }
1233
+
1234
+ void highsAssert(const bool assert_condition, const std::string& message) {
1235
+ if (assert_condition) return;
1236
+ printf("Failing highsAssert(\"%s\")\n", message.c_str());
1237
+ #ifdef NDEBUG
1238
+ // Standard assert won't trigger abort, so do it explicitly
1239
+ printf("assert(%s) failed ...\n", message.c_str());
1240
+ fflush(stdout);
1241
+ abort();
1242
+ #else
1243
+ // Standard assert
1244
+ assert(assert_condition);
1245
+ #endif
1246
+ }
1247
+
1248
+ bool highsPause(const bool pause_condition, const std::string& message) {
1249
+ if (!pause_condition) return pause_condition;
1250
+ printf("Satisfying highsPause(\"%s\")\n", message.c_str());
1251
+ char str[100];
1252
+ printf("Enter any value to continue:");
1253
+ fflush(stdout);
1254
+ if (fgets(str, 100, stdin) != nullptr) {
1255
+ printf("You entered: \"%s\"\n", str);
1256
+ fflush(stdout);
1257
+ }
1258
+ return pause_condition;
1259
+ }