lpsolver 0.1.0 → 0.2.0
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.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +70 -26
- data/ext/lpsolver/Makefile +273 -0
- data/ext/lpsolver/ext.c +353 -0
- data/ext/lpsolver/ext.o +0 -0
- data/ext/lpsolver/extconf.rb +79 -0
- data/ext/lpsolver/native.so +0 -0
- data/ext/lpsolver-highs/AUTHORS +7 -0
- data/ext/lpsolver-highs/BUILD.bazel +243 -0
- data/ext/lpsolver-highs/CITATION.cff +29 -0
- data/ext/lpsolver-highs/CMakeCache.txt +406 -0
- data/ext/lpsolver-highs/CMakeFiles/3.31.4/CMakeCCompiler.cmake +81 -0
- data/ext/lpsolver-highs/CMakeFiles/3.31.4/CMakeCXXCompiler.cmake +101 -0
- data/ext/lpsolver-highs/CMakeFiles/3.31.4/CMakeDetermineCompilerABI_C.bin +0 -0
- data/ext/lpsolver-highs/CMakeFiles/3.31.4/CMakeDetermineCompilerABI_CXX.bin +0 -0
- data/ext/lpsolver-highs/CMakeFiles/3.31.4/CMakeSystem.cmake +15 -0
- data/ext/lpsolver-highs/CMakeFiles/3.31.4/CompilerIdC/CMakeCCompilerId.c +904 -0
- data/ext/lpsolver-highs/CMakeFiles/3.31.4/CompilerIdC/a.out +0 -0
- data/ext/lpsolver-highs/CMakeFiles/3.31.4/CompilerIdCXX/CMakeCXXCompilerId.cpp +919 -0
- data/ext/lpsolver-highs/CMakeFiles/3.31.4/CompilerIdCXX/a.out +0 -0
- data/ext/lpsolver-highs/CMakeFiles/CMakeConfigureLog.yaml +576 -0
- data/ext/lpsolver-highs/CMakeFiles/cmake.check_cache +1 -0
- data/ext/lpsolver-highs/CMakeLists.txt +983 -0
- data/ext/lpsolver-highs/CODE_OF_CONDUCT.md +128 -0
- data/ext/lpsolver-highs/CONTRIBUTING.md +31 -0
- data/ext/lpsolver-highs/FEATURES.md +61 -0
- data/ext/lpsolver-highs/LICENSE.txt +21 -0
- data/ext/lpsolver-highs/MODULE.bazel +38 -0
- data/ext/lpsolver-highs/README.md +281 -0
- data/ext/lpsolver-highs/THIRD_PARTY_NOTICES.md +78 -0
- data/ext/lpsolver-highs/Version.txt +4 -0
- data/ext/lpsolver-highs/WORKSPACE +33 -0
- data/ext/lpsolver-highs/app/CMakeLists.txt +110 -0
- data/ext/lpsolver-highs/app/HighsRuntimeOptions.h +292 -0
- data/ext/lpsolver-highs/app/RunHighs.cpp +147 -0
- data/ext/lpsolver-highs/app/highs_webdemo_shell.html +73 -0
- data/ext/lpsolver-highs/build/bin/highs +0 -0
- data/ext/lpsolver-highs/build/include/highs/HConfig.h +22 -0
- data/ext/lpsolver-highs/build/include/highs/Highs.h +1812 -0
- data/ext/lpsolver-highs/build/include/highs/interfaces/highs_c_api.h +2651 -0
- data/ext/lpsolver-highs/build/include/highs/io/Filereader.h +45 -0
- data/ext/lpsolver-highs/build/include/highs/io/FilereaderLp.h +49 -0
- data/ext/lpsolver-highs/build/include/highs/io/FilereaderMps.h +27 -0
- data/ext/lpsolver-highs/build/include/highs/io/HMPSIO.h +78 -0
- data/ext/lpsolver-highs/build/include/highs/io/HMpsFF.h +245 -0
- data/ext/lpsolver-highs/build/include/highs/io/HighsIO.h +118 -0
- data/ext/lpsolver-highs/build/include/highs/io/LoadOptions.h +24 -0
- data/ext/lpsolver-highs/build/include/highs/io/filereaderlp/builder.hpp +25 -0
- data/ext/lpsolver-highs/build/include/highs/io/filereaderlp/def.hpp +19 -0
- data/ext/lpsolver-highs/build/include/highs/io/filereaderlp/model.hpp +68 -0
- data/ext/lpsolver-highs/build/include/highs/io/filereaderlp/reader.hpp +10 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/IpxSolution.h +32 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/IpxWrapper.h +106 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu.h +161 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_factorize.h +247 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_get_factors.h +108 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_initialize.h +119 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_factorize.h +34 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_free.h +19 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_get_factors.h +34 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_initialize.h +46 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_solve_dense.h +29 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_solve_for_update.h +42 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_solve_sparse.h +32 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_obj_update.h +31 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_object.h +30 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_solve_dense.h +75 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_solve_for_update.h +169 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_solve_sparse.h +112 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/basiclu_update.h +125 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/lu_def.h +39 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/lu_file.h +21 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/lu_internal.h +220 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/basiclu/lu_list.h +173 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/basiclu_kernel.h +20 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/basiclu_wrapper.h +47 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/basis.h +350 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/conjugate_residuals.h +74 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/control.h +167 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/crossover.h +157 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/diagonal_precond.h +45 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/forrest_tomlin.h +102 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/guess_basis.h +21 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/indexed_vector.h +113 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/info.h +27 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/ipm.h +94 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/ipx_c.h +47 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/ipx_config.h +9 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/ipx_info.h +111 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/ipx_internal.h +89 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/ipx_parameters.h +76 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/ipx_status.h +57 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/iterate.h +331 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/kkt_solver.h +70 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/kkt_solver_basis.h +66 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/kkt_solver_diag.h +48 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/linear_operator.h +26 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/lp_solver.h +204 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/lu_factorization.h +79 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/lu_update.h +129 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/maxvolume.h +54 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/model.h +413 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/multistream.h +52 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/normal_matrix.h +44 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/power_method.h +44 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/sparse_matrix.h +195 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/sparse_utils.h +58 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/splitted_normal_matrix.h +63 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/starting_basis.h +39 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/symbolic_invert.h +29 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/timer.h +25 -0
- data/ext/lpsolver-highs/build/include/highs/ipm/ipx/utils.h +37 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HConst.h +430 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HStruct.h +213 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsAnalysis.h +23 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsCallback.h +104 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsCallbackStruct.h +70 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsDebug.h +34 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsIis.h +139 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsInfo.h +421 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsInfoDebug.h +27 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsLp.h +97 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsLpSolverObject.h +47 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsLpUtils.h +330 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsModelUtils.h +129 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsOptions.h +1715 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsRanging.h +43 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsSolution.h +179 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsSolutionDebug.h +87 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsSolve.h +29 -0
- data/ext/lpsolver-highs/build/include/highs/lp_data/HighsStatus.h +29 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsCliqueTable.h +329 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsConflictPool.h +109 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsCutGeneration.h +108 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsCutPool.h +168 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsDebugSol.h +133 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsDomain.h +657 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsDomainChange.h +48 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsDynamicRowMatrix.h +104 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsGFkSolve.h +439 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsImplications.h +194 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsLpAggregator.h +50 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsLpRelaxation.h +361 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsMipAnalysis.h +71 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsMipSolver.h +159 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsMipSolverData.h +313 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsModkSeparator.h +60 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsNodeQueue.h +312 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsObjectiveFunction.h +71 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsPathSeparator.h +39 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsPrimalHeuristics.h +75 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsPseudocost.h +366 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsRedcostFixing.h +42 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsSearch.h +241 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsSeparation.h +41 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsSeparator.h +60 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsTableauSeparator.h +34 -0
- data/ext/lpsolver-highs/build/include/highs/mip/HighsTransformedLp.h +63 -0
- data/ext/lpsolver-highs/build/include/highs/mip/MipTimer.h +544 -0
- data/ext/lpsolver-highs/build/include/highs/mip/feasibilityjump.hh +800 -0
- data/ext/lpsolver-highs/build/include/highs/model/HighsHessian.h +54 -0
- data/ext/lpsolver-highs/build/include/highs/model/HighsHessianUtils.h +47 -0
- data/ext/lpsolver-highs/build/include/highs/model/HighsModel.h +42 -0
- data/ext/lpsolver-highs/build/include/highs/parallel/HighsBinarySemaphore.h +108 -0
- data/ext/lpsolver-highs/build/include/highs/parallel/HighsCacheAlign.h +82 -0
- data/ext/lpsolver-highs/build/include/highs/parallel/HighsCombinable.h +116 -0
- data/ext/lpsolver-highs/build/include/highs/parallel/HighsMutex.h +124 -0
- data/ext/lpsolver-highs/build/include/highs/parallel/HighsParallel.h +128 -0
- data/ext/lpsolver-highs/build/include/highs/parallel/HighsRaceTimer.h +38 -0
- data/ext/lpsolver-highs/build/include/highs/parallel/HighsSchedulerConstants.h +19 -0
- data/ext/lpsolver-highs/build/include/highs/parallel/HighsSpinMutex.h +48 -0
- data/ext/lpsolver-highs/build/include/highs/parallel/HighsSplitDeque.h +606 -0
- data/ext/lpsolver-highs/build/include/highs/parallel/HighsTask.h +170 -0
- data/ext/lpsolver-highs/build/include/highs/parallel/HighsTaskExecutor.h +217 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/CupdlpWrapper.h +108 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/HiPdlpTimer.h +155 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/HiPdlpWrapper.h +26 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_cs.h +40 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_defs.h +447 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_linalg.h +189 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_proj.h +19 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_restart.h +31 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_scaling.h +26 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_solver.h +105 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_step.h +37 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/cupdlp/cupdlp_utils.c +1850 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/hipdlp/defs.hpp +222 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/hipdlp/linalg.hpp +61 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/hipdlp/logger.hpp +80 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/hipdlp/pdhg.hpp +358 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/hipdlp/restart.hpp +96 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/hipdlp/scaling.hpp +74 -0
- data/ext/lpsolver-highs/build/include/highs/pdlp/hipdlp/solver_results.hpp +65 -0
- data/ext/lpsolver-highs/build/include/highs/pdqsort/pdqsort.h +532 -0
- data/ext/lpsolver-highs/build/include/highs/presolve/HPresolve.h +505 -0
- data/ext/lpsolver-highs/build/include/highs/presolve/HPresolveAnalysis.h +52 -0
- data/ext/lpsolver-highs/build/include/highs/presolve/HighsPostsolveStack.h +943 -0
- data/ext/lpsolver-highs/build/include/highs/presolve/HighsSymmetry.h +284 -0
- data/ext/lpsolver-highs/build/include/highs/presolve/ICrash.h +124 -0
- data/ext/lpsolver-highs/build/include/highs/presolve/ICrashUtil.h +62 -0
- data/ext/lpsolver-highs/build/include/highs/presolve/ICrashX.h +23 -0
- data/ext/lpsolver-highs/build/include/highs/presolve/PresolveComponent.h +90 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/a_asm.hpp +77 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/a_quass.hpp +22 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/basis.hpp +159 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/crashsolution.hpp +20 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/dantzigpricing.hpp +80 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/devexpricing.hpp +108 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/eventhandler.hpp +30 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/factor.hpp +408 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/feasibility_bounded.hpp +114 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/feasibility_highs.hpp +301 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/gradient.hpp +46 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/instance.hpp +70 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/matrix.hpp +342 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/perturbation.hpp +15 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/pricing.hpp +22 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/qpconst.hpp +34 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/qpvector.hpp +242 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/quass.hpp +27 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/ratiotest.hpp +26 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/runtime.hpp +45 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/scaling.hpp +15 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/settings.hpp +84 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/snippets.hpp +36 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/statistics.hpp +30 -0
- data/ext/lpsolver-highs/build/include/highs/qpsolver/steepestedgepricing.hpp +173 -0
- data/ext/lpsolver-highs/build/include/highs/simplex/HApp.h +550 -0
- data/ext/lpsolver-highs/build/include/highs/simplex/HEkk.h +419 -0
- data/ext/lpsolver-highs/build/include/highs/simplex/HEkkDual.h +513 -0
- data/ext/lpsolver-highs/build/include/highs/simplex/HEkkDualRHS.h +134 -0
- data/ext/lpsolver-highs/build/include/highs/simplex/HEkkDualRow.h +201 -0
- data/ext/lpsolver-highs/build/include/highs/simplex/HEkkPrimal.h +191 -0
- data/ext/lpsolver-highs/build/include/highs/simplex/HSimplex.h +42 -0
- data/ext/lpsolver-highs/build/include/highs/simplex/HSimplexDebug.h +48 -0
- data/ext/lpsolver-highs/build/include/highs/simplex/HSimplexNla.h +158 -0
- data/ext/lpsolver-highs/build/include/highs/simplex/HSimplexReport.h +21 -0
- data/ext/lpsolver-highs/build/include/highs/simplex/HighsSimplexAnalysis.h +500 -0
- data/ext/lpsolver-highs/build/include/highs/simplex/SimplexConst.h +273 -0
- data/ext/lpsolver-highs/build/include/highs/simplex/SimplexStruct.h +263 -0
- data/ext/lpsolver-highs/build/include/highs/simplex/SimplexTimer.h +414 -0
- data/ext/lpsolver-highs/build/include/highs/test_kkt/DevKkt.h +143 -0
- data/ext/lpsolver-highs/build/include/highs/test_kkt/KktCh2.h +79 -0
- data/ext/lpsolver-highs/build/include/highs/util/FactorTimer.h +199 -0
- data/ext/lpsolver-highs/build/include/highs/util/HFactor.h +587 -0
- data/ext/lpsolver-highs/build/include/highs/util/HFactorConst.h +81 -0
- data/ext/lpsolver-highs/build/include/highs/util/HFactorDebug.h +55 -0
- data/ext/lpsolver-highs/build/include/highs/util/HSet.h +89 -0
- data/ext/lpsolver-highs/build/include/highs/util/HVector.h +22 -0
- data/ext/lpsolver-highs/build/include/highs/util/HVectorBase.h +102 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsCDouble.h +323 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsComponent.h +53 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsDataStack.h +83 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsDisjointSets.h +107 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsHash.h +1274 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsHashTree.h +1461 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsInt.h +36 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsIntegers.h +212 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsLinearSumBounds.h +203 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsMatrixPic.h +37 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsMatrixSlice.h +561 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsMatrixUtils.h +57 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsMemoryAllocation.h +63 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsRandom.h +242 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsRbTree.h +452 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsSort.h +131 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsSparseMatrix.h +151 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsSparseVectorSum.h +95 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsSplay.h +135 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsTimer.h +385 -0
- data/ext/lpsolver-highs/build/include/highs/util/HighsUtils.h +272 -0
- data/ext/lpsolver-highs/build/include/highs/util/stringutil.h +46 -0
- data/ext/lpsolver-highs/build/include/highs/zstr/strict_fstream.hpp +237 -0
- data/ext/lpsolver-highs/build/include/highs/zstr/zstr.hpp +473 -0
- data/ext/lpsolver-highs/build/include/highs_export.h +43 -0
- data/ext/lpsolver-highs/build/lib/cmake/highs/highs-config-version.cmake +65 -0
- data/ext/lpsolver-highs/build/lib/cmake/highs/highs-config.cmake +36 -0
- data/ext/lpsolver-highs/build/lib/cmake/highs/highs-targets-release.cmake +19 -0
- data/ext/lpsolver-highs/build/lib/cmake/highs/highs-targets.cmake +111 -0
- data/ext/lpsolver-highs/build/lib/libhighs.a +0 -0
- data/ext/lpsolver-highs/build/lib/pkgconfig/highs.pc +12 -0
- data/ext/lpsolver-highs/build/share/doc/HIGHS/AUTHORS +7 -0
- data/ext/lpsolver-highs/build/share/doc/HIGHS/CITATION.cff +29 -0
- data/ext/lpsolver-highs/build/share/doc/HIGHS/CODE_OF_CONDUCT.md +128 -0
- data/ext/lpsolver-highs/build/share/doc/HIGHS/CONTRIBUTING.md +31 -0
- data/ext/lpsolver-highs/build/share/doc/HIGHS/FEATURES.md +61 -0
- data/ext/lpsolver-highs/build/share/doc/HIGHS/LICENSE.txt +21 -0
- data/ext/lpsolver-highs/build/share/doc/HIGHS/README.md +281 -0
- data/ext/lpsolver-highs/build_webdemo.sh +46 -0
- data/ext/lpsolver-highs/check/Avgas.cpp +245 -0
- data/ext/lpsolver-highs/check/Avgas.h +44 -0
- data/ext/lpsolver-highs/check/CMakeLists.txt +573 -0
- data/ext/lpsolver-highs/check/HCheckConfig.h.bazel.in +6 -0
- data/ext/lpsolver-highs/check/HCheckConfig.h.in +12 -0
- data/ext/lpsolver-highs/check/HCheckConfig.h.meson.in +6 -0
- data/ext/lpsolver-highs/check/SpecialLps.h +405 -0
- data/ext/lpsolver-highs/check/TestAlienBasis.cpp +720 -0
- data/ext/lpsolver-highs/check/TestBasis.cpp +359 -0
- data/ext/lpsolver-highs/check/TestBasisSolves.cpp +669 -0
- data/ext/lpsolver-highs/check/TestCAPI.c +2513 -0
- data/ext/lpsolver-highs/check/TestCallbacks.cpp +608 -0
- data/ext/lpsolver-highs/check/TestCheckSolution.cpp +740 -0
- data/ext/lpsolver-highs/check/TestCrossover.cpp +111 -0
- data/ext/lpsolver-highs/check/TestDualize.cpp +172 -0
- data/ext/lpsolver-highs/check/TestEkk.cpp +100 -0
- data/ext/lpsolver-highs/check/TestFactor.cpp +389 -0
- data/ext/lpsolver-highs/check/TestFilereader.cpp +568 -0
- data/ext/lpsolver-highs/check/TestFortranAPI.f90 +65 -0
- data/ext/lpsolver-highs/check/TestHSet.cpp +80 -0
- data/ext/lpsolver-highs/check/TestHighsCDouble.cpp +109 -0
- data/ext/lpsolver-highs/check/TestHighsGFkSolve.cpp +102 -0
- data/ext/lpsolver-highs/check/TestHighsHash.cpp +126 -0
- data/ext/lpsolver-highs/check/TestHighsHessian.cpp +329 -0
- data/ext/lpsolver-highs/check/TestHighsIntegers.cpp +42 -0
- data/ext/lpsolver-highs/check/TestHighsModel.cpp +134 -0
- data/ext/lpsolver-highs/check/TestHighsParallel.cpp +277 -0
- data/ext/lpsolver-highs/check/TestHighsRbTree.cpp +109 -0
- data/ext/lpsolver-highs/check/TestHighsSparseMatrix.cpp +126 -0
- data/ext/lpsolver-highs/check/TestHighsVersion.cpp +61 -0
- data/ext/lpsolver-highs/check/TestHipo.cpp +122 -0
- data/ext/lpsolver-highs/check/TestICrash.cpp +46 -0
- data/ext/lpsolver-highs/check/TestIO.cpp +163 -0
- data/ext/lpsolver-highs/check/TestIis.cpp +1063 -0
- data/ext/lpsolver-highs/check/TestInfo.cpp +116 -0
- data/ext/lpsolver-highs/check/TestIpm.cpp +226 -0
- data/ext/lpsolver-highs/check/TestIpx.cpp +96 -0
- data/ext/lpsolver-highs/check/TestLPFileFormat.cpp +22 -0
- data/ext/lpsolver-highs/check/TestLogging.cpp +69 -0
- data/ext/lpsolver-highs/check/TestLpModification.cpp +2497 -0
- data/ext/lpsolver-highs/check/TestLpOrientation.cpp +121 -0
- data/ext/lpsolver-highs/check/TestLpSolvers.cpp +555 -0
- data/ext/lpsolver-highs/check/TestLpValidation.cpp +689 -0
- data/ext/lpsolver-highs/check/TestMain.cpp +6 -0
- data/ext/lpsolver-highs/check/TestMipSolver.cpp +1406 -0
- data/ext/lpsolver-highs/check/TestModelProperties.cpp +143 -0
- data/ext/lpsolver-highs/check/TestMultiObjective.cpp +198 -0
- data/ext/lpsolver-highs/check/TestNames.cpp +187 -0
- data/ext/lpsolver-highs/check/TestOptions.cpp +544 -0
- data/ext/lpsolver-highs/check/TestPdlp.cpp +327 -0
- data/ext/lpsolver-highs/check/TestPdlpHi.cpp +40 -0
- data/ext/lpsolver-highs/check/TestPresolve.cpp +912 -0
- data/ext/lpsolver-highs/check/TestQpSolver.cpp +1345 -0
- data/ext/lpsolver-highs/check/TestRanging.cpp +558 -0
- data/ext/lpsolver-highs/check/TestRays.cpp +1010 -0
- data/ext/lpsolver-highs/check/TestSemiVariables.cpp +329 -0
- data/ext/lpsolver-highs/check/TestSetup.cpp +12 -0
- data/ext/lpsolver-highs/check/TestSort.cpp +247 -0
- data/ext/lpsolver-highs/check/TestSpecialLps.cpp +775 -0
- data/ext/lpsolver-highs/check/TestThrow.cpp +83 -0
- data/ext/lpsolver-highs/check/TestTspSolver.cpp +19 -0
- data/ext/lpsolver-highs/check/TestUserScale.cpp +444 -0
- data/ext/lpsolver-highs/check/cublas_example.cpp +76 -0
- data/ext/lpsolver-highs/check/cublas_gpu_start.cpp +88 -0
- data/ext/lpsolver-highs/check/hipo_test_option_files/hipo_options_0 +1 -0
- data/ext/lpsolver-highs/check/instances/1448.lp +1 -0
- data/ext/lpsolver-highs/check/instances/1449a.lp +1 -0
- data/ext/lpsolver-highs/check/instances/1449b.lp +1 -0
- data/ext/lpsolver-highs/check/instances/1451.lp +8 -0
- data/ext/lpsolver-highs/check/instances/2122.lp +1822 -0
- data/ext/lpsolver-highs/check/instances/2171.mps +717 -0
- data/ext/lpsolver-highs/check/instances/25fv47.mps +6919 -0
- data/ext/lpsolver-highs/check/instances/2821-duplicate.mps +31 -0
- data/ext/lpsolver-highs/check/instances/2821-qmatrix.mps +31 -0
- data/ext/lpsolver-highs/check/instances/2821-quadobj.mps +29 -0
- data/ext/lpsolver-highs/check/instances/2821-summation.mps +30 -0
- data/ext/lpsolver-highs/check/instances/2821.mps +29 -0
- data/ext/lpsolver-highs/check/instances/2894.mps +89 -0
- data/ext/lpsolver-highs/check/instances/80bau3b.mps +23732 -0
- data/ext/lpsolver-highs/check/instances/WithInf.set +3 -0
- data/ext/lpsolver-highs/check/instances/adlittle.mps +335 -0
- data/ext/lpsolver-highs/check/instances/afiro.mps +83 -0
- data/ext/lpsolver-highs/check/instances/avgas.mps +51 -0
- data/ext/lpsolver-highs/check/instances/bell5.mps +384 -0
- data/ext/lpsolver-highs/check/instances/bgetam.mps +2112 -0
- data/ext/lpsolver-highs/check/instances/blending.mps +13 -0
- data/ext/lpsolver-highs/check/instances/box1.mps +1085 -0
- data/ext/lpsolver-highs/check/instances/chip.mps +13 -0
- data/ext/lpsolver-highs/check/instances/comment.mps +23 -0
- data/ext/lpsolver-highs/check/instances/cplex1.mps +9674 -0
- data/ext/lpsolver-highs/check/instances/dD2e.mps +10 -0
- data/ext/lpsolver-highs/check/instances/dcmulti.mps +2310 -0
- data/ext/lpsolver-highs/check/instances/e226.mps +1733 -0
- data/ext/lpsolver-highs/check/instances/egout-ac.mps +473 -0
- data/ext/lpsolver-highs/check/instances/egout.mps +403 -0
- data/ext/lpsolver-highs/check/instances/etamacro.mps +2084 -0
- data/ext/lpsolver-highs/check/instances/ex72a.mps +849 -0
- data/ext/lpsolver-highs/check/instances/fixed-binary.lp +11 -0
- data/ext/lpsolver-highs/check/instances/flugpl.mps +111 -0
- data/ext/lpsolver-highs/check/instances/flugpl_illegal_integer.sol +24 -0
- data/ext/lpsolver-highs/check/instances/flugpl_integer.sol +25 -0
- data/ext/lpsolver-highs/check/instances/forest6.mps +261 -0
- data/ext/lpsolver-highs/check/instances/galenet.mps +34 -0
- data/ext/lpsolver-highs/check/instances/gams10am.mps +478 -0
- data/ext/lpsolver-highs/check/instances/garbage.ems +3 -0
- data/ext/lpsolver-highs/check/instances/garbage.lp +3 -0
- data/ext/lpsolver-highs/check/instances/garbage.mps +3 -0
- data/ext/lpsolver-highs/check/instances/gas11.mps +2924 -0
- data/ext/lpsolver-highs/check/instances/gesa2.mps +5459 -0
- data/ext/lpsolver-highs/check/instances/greenbea.mps +19215 -0
- data/ext/lpsolver-highs/check/instances/gt2.mps +534 -0
- data/ext/lpsolver-highs/check/instances/infeasible-mip0.mps +140 -0
- data/ext/lpsolver-highs/check/instances/infeasible-mip1.mps +371 -0
- data/ext/lpsolver-highs/check/instances/israel.mps +1490 -0
- data/ext/lpsolver-highs/check/instances/issue-2095.mps +836 -0
- data/ext/lpsolver-highs/check/instances/issue-2173.mps +3331 -0
- data/ext/lpsolver-highs/check/instances/issue-2204.mps +143 -0
- data/ext/lpsolver-highs/check/instances/issue-2290.mps +158 -0
- data/ext/lpsolver-highs/check/instances/issue-2388.lp +76 -0
- data/ext/lpsolver-highs/check/instances/issue-2402.mps +435 -0
- data/ext/lpsolver-highs/check/instances/issue-2446.mps +9154 -0
- data/ext/lpsolver-highs/check/instances/issue-2585.lp +16 -0
- data/ext/lpsolver-highs/check/instances/issue-2874-3.mps +97 -0
- data/ext/lpsolver-highs/check/instances/klein1.mps +422 -0
- data/ext/lpsolver-highs/check/instances/lseu.mps +371 -0
- data/ext/lpsolver-highs/check/instances/model.xyz +1 -0
- data/ext/lpsolver-highs/check/instances/nan0.mps +13 -0
- data/ext/lpsolver-highs/check/instances/nan1.mps +13 -0
- data/ext/lpsolver-highs/check/instances/nan2.mps +13 -0
- data/ext/lpsolver-highs/check/instances/no-newline-eof.lp +5 -0
- data/ext/lpsolver-highs/check/instances/p01.mps +909 -0
- data/ext/lpsolver-highs/check/instances/p0548.mps +1992 -0
- data/ext/lpsolver-highs/check/instances/primal1.mps +3909 -0
- data/ext/lpsolver-highs/check/instances/qap04.mps +606 -0
- data/ext/lpsolver-highs/check/instances/qcqp.lp +8 -0
- data/ext/lpsolver-highs/check/instances/qjh.lp +9 -0
- data/ext/lpsolver-highs/check/instances/qjh.mps +18 -0
- data/ext/lpsolver-highs/check/instances/qjh_qmatrix.mps +19 -0
- data/ext/lpsolver-highs/check/instances/qjh_quadobj.mps +18 -0
- data/ext/lpsolver-highs/check/instances/qjh_quadobj_qmatrix.mps +25 -0
- data/ext/lpsolver-highs/check/instances/qjh_uncon.lp +10 -0
- data/ext/lpsolver-highs/check/instances/qjh_uncon.mps +17 -0
- data/ext/lpsolver-highs/check/instances/qpinfeasible.lp +8 -0
- data/ext/lpsolver-highs/check/instances/qptestnw.lp +7 -0
- data/ext/lpsolver-highs/check/instances/qpunbounded.lp +5 -0
- data/ext/lpsolver-highs/check/instances/refinery.mps +1882 -0
- data/ext/lpsolver-highs/check/instances/rgn.mps +559 -0
- data/ext/lpsolver-highs/check/instances/scrs8.mps +2717 -0
- data/ext/lpsolver-highs/check/instances/sctest.mps +66 -0
- data/ext/lpsolver-highs/check/instances/semi-continuous.lp +13 -0
- data/ext/lpsolver-highs/check/instances/semi-continuous.mps +24 -0
- data/ext/lpsolver-highs/check/instances/semi-integer.lp +15 -0
- data/ext/lpsolver-highs/check/instances/semi-integer.mps +22 -0
- data/ext/lpsolver-highs/check/instances/shell.mps +4039 -0
- data/ext/lpsolver-highs/check/instances/silly-names.mps +14 -0
- data/ext/lpsolver-highs/check/instances/small_mip.mps +87 -0
- data/ext/lpsolver-highs/check/instances/smalllp.mps +21 -0
- data/ext/lpsolver-highs/check/instances/sp150x300d.mps +1983 -0
- data/ext/lpsolver-highs/check/instances/stair.mps +2499 -0
- data/ext/lpsolver-highs/check/instances/standata.mps +2317 -0
- data/ext/lpsolver-highs/check/instances/standgub.mps +2428 -0
- data/ext/lpsolver-highs/check/instances/standmps.mps +2695 -0
- data/ext/lpsolver-highs/check/instances/test.mps +53 -0
- data/ext/lpsolver-highs/check/instances/vol1.mps +1895 -0
- data/ext/lpsolver-highs/check/instances/warnings.mps +68 -0
- data/ext/lpsolver-highs/check/instances/woodinfe.mps +216 -0
- data/ext/lpsolver-highs/check/matrix_multiplication.hpp +49 -0
- data/ext/lpsolver-highs/check/meson.build +92 -0
- data/ext/lpsolver-highs/check/pythontest.py +11 -0
- data/ext/lpsolver-highs/check/sample_options_file +8 -0
- data/ext/lpsolver-highs/cmake/CheckAtomic.cmake +74 -0
- data/ext/lpsolver-highs/cmake/FindCUDAConf.cmake +44 -0
- data/ext/lpsolver-highs/cmake/FindHipoDeps.cmake +351 -0
- data/ext/lpsolver-highs/cmake/README.md +243 -0
- data/ext/lpsolver-highs/cmake/cpp-highs.cmake +243 -0
- data/ext/lpsolver-highs/cmake/dotnet.cmake +94 -0
- data/ext/lpsolver-highs/cmake/highs-config.cmake.in +22 -0
- data/ext/lpsolver-highs/cmake/python-highs.cmake +74 -0
- data/ext/lpsolver-highs/cmake/set-version.cmake +26 -0
- data/ext/lpsolver-highs/cmake/sources-python.cmake +461 -0
- data/ext/lpsolver-highs/cmake/sources.cmake +618 -0
- data/ext/lpsolver-highs/docs/HiGHS_CopyrightHeader.pl +78 -0
- data/ext/lpsolver-highs/docs/HiGHS_CopyrightHeaderUpdateAll +32 -0
- data/ext/lpsolver-highs/docs/Project.toml +7 -0
- data/ext/lpsolver-highs/docs/README.md +27 -0
- data/ext/lpsolver-highs/docs/c_api_gen/HConfig.h +1 -0
- data/ext/lpsolver-highs/docs/c_api_gen/build.jl +48 -0
- data/ext/lpsolver-highs/docs/make.jl +115 -0
- data/ext/lpsolver-highs/docs/src/assets/logo.png +0 -0
- data/ext/lpsolver-highs/docs/src/callbacks.md +171 -0
- data/ext/lpsolver-highs/docs/src/executable.md +88 -0
- data/ext/lpsolver-highs/docs/src/guide/advanced.md +66 -0
- data/ext/lpsolver-highs/docs/src/guide/basic.md +116 -0
- data/ext/lpsolver-highs/docs/src/guide/further.md +193 -0
- data/ext/lpsolver-highs/docs/src/guide/gpu.md +58 -0
- data/ext/lpsolver-highs/docs/src/guide/index.md +18 -0
- data/ext/lpsolver-highs/docs/src/guide/kkt.md +219 -0
- data/ext/lpsolver-highs/docs/src/guide/numerics.md +55 -0
- data/ext/lpsolver-highs/docs/src/index.md +86 -0
- data/ext/lpsolver-highs/docs/src/installation.md +130 -0
- data/ext/lpsolver-highs/docs/src/interfaces/c_api.md +6 -0
- data/ext/lpsolver-highs/docs/src/interfaces/cpp/examples.md +1 -0
- data/ext/lpsolver-highs/docs/src/interfaces/cpp/index.md +29 -0
- data/ext/lpsolver-highs/docs/src/interfaces/cpp/library.md +107 -0
- data/ext/lpsolver-highs/docs/src/interfaces/csharp.md +55 -0
- data/ext/lpsolver-highs/docs/src/interfaces/fortran.md +11 -0
- data/ext/lpsolver-highs/docs/src/interfaces/julia/index.md +130 -0
- data/ext/lpsolver-highs/docs/src/interfaces/other.md +41 -0
- data/ext/lpsolver-highs/docs/src/interfaces/python/example-py.md +275 -0
- data/ext/lpsolver-highs/docs/src/interfaces/python/index.md +91 -0
- data/ext/lpsolver-highs/docs/src/interfaces/python/model-py.md +90 -0
- data/ext/lpsolver-highs/docs/src/options/definitions.md +529 -0
- data/ext/lpsolver-highs/docs/src/options/intro.md +46 -0
- data/ext/lpsolver-highs/docs/src/parallel.md +88 -0
- data/ext/lpsolver-highs/docs/src/solvers.md +168 -0
- data/ext/lpsolver-highs/docs/src/structures/classes/HighsHessian.md +9 -0
- data/ext/lpsolver-highs/docs/src/structures/classes/HighsIis.md +16 -0
- data/ext/lpsolver-highs/docs/src/structures/classes/HighsLp.md +19 -0
- data/ext/lpsolver-highs/docs/src/structures/classes/HighsModel.md +6 -0
- data/ext/lpsolver-highs/docs/src/structures/classes/HighsSparseMatrix.md +10 -0
- data/ext/lpsolver-highs/docs/src/structures/classes/index.md +11 -0
- data/ext/lpsolver-highs/docs/src/structures/enums.md +114 -0
- data/ext/lpsolver-highs/docs/src/structures/index.md +12 -0
- data/ext/lpsolver-highs/docs/src/structures/structs/HighsBasis.md +8 -0
- data/ext/lpsolver-highs/docs/src/structures/structs/HighsInfo.md +148 -0
- data/ext/lpsolver-highs/docs/src/structures/structs/HighsLinearObjective.md +11 -0
- data/ext/lpsolver-highs/docs/src/structures/structs/HighsSolution.md +10 -0
- data/ext/lpsolver-highs/docs/src/structures/structs/index.md +10 -0
- data/ext/lpsolver-highs/docs/src/terminology.md +163 -0
- data/ext/lpsolver-highs/examples/CMakeLists.txt +26 -0
- data/ext/lpsolver-highs/examples/Docs.py +104 -0
- data/ext/lpsolver-highs/examples/branch-and-price.py +465 -0
- data/ext/lpsolver-highs/examples/call_highs_from_c.c +685 -0
- data/ext/lpsolver-highs/examples/call_highs_from_c_minimal.c +659 -0
- data/ext/lpsolver-highs/examples/call_highs_from_cpp.cpp +178 -0
- data/ext/lpsolver-highs/examples/call_highs_from_csharp.cs +83 -0
- data/ext/lpsolver-highs/examples/call_highs_from_fortran.f90 +579 -0
- data/ext/lpsolver-highs/examples/call_highs_from_python.py +448 -0
- data/ext/lpsolver-highs/examples/call_highs_from_python_highspy.py +71 -0
- data/ext/lpsolver-highs/examples/call_highs_from_python_mps.py +59 -0
- data/ext/lpsolver-highs/examples/callback_gap.py +71 -0
- data/ext/lpsolver-highs/examples/chip.py +43 -0
- data/ext/lpsolver-highs/examples/chip0.py +29 -0
- data/ext/lpsolver-highs/examples/distillation.py +77 -0
- data/ext/lpsolver-highs/examples/knapsack.py +43 -0
- data/ext/lpsolver-highs/examples/minimal.py +11 -0
- data/ext/lpsolver-highs/examples/multi_objective.py +139 -0
- data/ext/lpsolver-highs/examples/multiple_objective.py +120 -0
- data/ext/lpsolver-highs/examples/network_flow.py +37 -0
- data/ext/lpsolver-highs/examples/nqueens.py +29 -0
- data/ext/lpsolver-highs/examples/plot_highs_log.py +134 -0
- data/ext/lpsolver-highs/extern/CLI11.hpp +11546 -0
- data/ext/lpsolver-highs/extern/LICENCE_1_0.txt +23 -0
- data/ext/lpsolver-highs/extern/amd/License.txt +35 -0
- data/ext/lpsolver-highs/extern/amd/SuiteSparse_config.c +54 -0
- data/ext/lpsolver-highs/extern/amd/SuiteSparse_config.h +56 -0
- data/ext/lpsolver-highs/extern/amd/amd.h +357 -0
- data/ext/lpsolver-highs/extern/amd/amd_1.c +172 -0
- data/ext/lpsolver-highs/extern/amd/amd_2.c +1761 -0
- data/ext/lpsolver-highs/extern/amd/amd_aat.c +179 -0
- data/ext/lpsolver-highs/extern/amd/amd_control.c +65 -0
- data/ext/lpsolver-highs/extern/amd/amd_defaults.c +37 -0
- data/ext/lpsolver-highs/extern/amd/amd_info.c +120 -0
- data/ext/lpsolver-highs/extern/amd/amd_internal.h +137 -0
- data/ext/lpsolver-highs/extern/amd/amd_order.c +195 -0
- data/ext/lpsolver-highs/extern/amd/amd_post_tree.c +105 -0
- data/ext/lpsolver-highs/extern/amd/amd_postorder.c +140 -0
- data/ext/lpsolver-highs/extern/amd/amd_preprocess.c +107 -0
- data/ext/lpsolver-highs/extern/amd/amd_valid.c +93 -0
- data/ext/lpsolver-highs/extern/amd/changes.txt +8 -0
- data/ext/lpsolver-highs/extern/catch.hpp +18861 -0
- data/ext/lpsolver-highs/extern/metis/Changes.txt +31 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/GKlib.h +62 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/error.c +21 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/gk_arch.h +64 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/gk_defs.h +19 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/gk_macros.h +50 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/gk_mkblas.h +51 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/gk_mkmemory.h +80 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/gk_mkpqueue.h +329 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/gk_mkrandom.h +89 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/gk_mksort.h +271 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/gk_ms_inttypes.h +41 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/gk_ms_stat.h +22 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/gk_ms_stdint.h +41 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/gk_proto.h +50 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/gk_struct.h +66 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/gk_types.h +15 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/mcore.c +176 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/memory.c +23 -0
- data/ext/lpsolver-highs/extern/metis/GKlib/random.c +37 -0
- data/ext/lpsolver-highs/extern/metis/LICENSE.txt +18 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/auxapi.c +27 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/balance.c +491 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/bucketsort.c +44 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/coarsen.c +895 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/compress.c +231 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/contig.c +83 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/defs.h +39 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/fm.c +527 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/gklib.c +55 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/gklib_defs.h +33 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/graph.c +268 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/initpart.c +385 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/macros.h +59 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/mcutil.c +162 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/metislib.h +35 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/mmd.c +598 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/ometis.c +661 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/options.c +260 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/proto.h +172 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/refine.c +99 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/separator.c +57 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/sfm.c +581 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/srefine.c +152 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/stdheaders.h +29 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/struct.h +117 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/util.c +59 -0
- data/ext/lpsolver-highs/extern/metis/libmetis/wspace.c +91 -0
- data/ext/lpsolver-highs/extern/metis/metis.h +271 -0
- data/ext/lpsolver-highs/extern/pdqsort/license.txt +16 -0
- data/ext/lpsolver-highs/extern/pdqsort/pdqsort.h +532 -0
- data/ext/lpsolver-highs/extern/rcm/LICENSE +19 -0
- data/ext/lpsolver-highs/extern/rcm/rcm.cpp +873 -0
- data/ext/lpsolver-highs/extern/rcm/rcm.h +22 -0
- data/ext/lpsolver-highs/extern/zstr/LICENSE +21 -0
- data/ext/lpsolver-highs/extern/zstr/strict_fstream.hpp +237 -0
- data/ext/lpsolver-highs/extern/zstr/zstr.hpp +473 -0
- data/ext/lpsolver-highs/flake.lock +61 -0
- data/ext/lpsolver-highs/flake.nix +73 -0
- data/ext/lpsolver-highs/highs/CMakeLists.txt +499 -0
- data/ext/lpsolver-highs/highs/HConfig.h.bazel.in +25 -0
- data/ext/lpsolver-highs/highs/HConfig.h.in +22 -0
- data/ext/lpsolver-highs/highs/HConfig.h.meson.in +17 -0
- data/ext/lpsolver-highs/highs/Highs.h +1812 -0
- data/ext/lpsolver-highs/highs/HighsRun.md +143 -0
- data/ext/lpsolver-highs/highs/highs_bindings.cpp +1826 -0
- data/ext/lpsolver-highs/highs/highspy/__init__.py +93 -0
- data/ext/lpsolver-highs/highs/highspy/__init__.pyi +91 -0
- data/ext/lpsolver-highs/highs/highspy/_core/__init__.pyi +1058 -0
- data/ext/lpsolver-highs/highs/highspy/_core/cb.pyi +118 -0
- data/ext/lpsolver-highs/highs/highspy/_core/simplex_constants.pyi +472 -0
- data/ext/lpsolver-highs/highs/highspy/highs.py +2430 -0
- data/ext/lpsolver-highs/highs/interfaces/highs_c_api.cpp +1812 -0
- data/ext/lpsolver-highs/highs/interfaces/highs_c_api.h +2651 -0
- data/ext/lpsolver-highs/highs/interfaces/highs_csharp_api.cs +1142 -0
- data/ext/lpsolver-highs/highs/interfaces/highs_fortran_api.f90 +873 -0
- data/ext/lpsolver-highs/highs/io/Filereader.cpp +87 -0
- data/ext/lpsolver-highs/highs/io/Filereader.h +45 -0
- data/ext/lpsolver-highs/highs/io/FilereaderLp.cpp +539 -0
- data/ext/lpsolver-highs/highs/io/FilereaderLp.h +49 -0
- data/ext/lpsolver-highs/highs/io/FilereaderMps.cpp +86 -0
- data/ext/lpsolver-highs/highs/io/FilereaderMps.h +27 -0
- data/ext/lpsolver-highs/highs/io/HMPSIO.cpp +1001 -0
- data/ext/lpsolver-highs/highs/io/HMPSIO.h +78 -0
- data/ext/lpsolver-highs/highs/io/HMpsFF.cpp +2113 -0
- data/ext/lpsolver-highs/highs/io/HMpsFF.h +245 -0
- data/ext/lpsolver-highs/highs/io/HighsIO.cpp +371 -0
- data/ext/lpsolver-highs/highs/io/HighsIO.h +118 -0
- data/ext/lpsolver-highs/highs/io/LoadOptions.cpp +60 -0
- data/ext/lpsolver-highs/highs/io/LoadOptions.h +24 -0
- data/ext/lpsolver-highs/highs/io/filereaderlp/LICENSE +19 -0
- data/ext/lpsolver-highs/highs/io/filereaderlp/builder.hpp +25 -0
- data/ext/lpsolver-highs/highs/io/filereaderlp/def.hpp +19 -0
- data/ext/lpsolver-highs/highs/io/filereaderlp/model.hpp +68 -0
- data/ext/lpsolver-highs/highs/io/filereaderlp/reader.cpp +1375 -0
- data/ext/lpsolver-highs/highs/io/filereaderlp/reader.hpp +10 -0
- data/ext/lpsolver-highs/highs/ipm/IpxSolution.h +32 -0
- data/ext/lpsolver-highs/highs/ipm/IpxWrapper.cpp +1526 -0
- data/ext/lpsolver-highs/highs/ipm/IpxWrapper.h +106 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu.h +161 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_factorize.c +132 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_factorize.h +247 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_get_factors.c +148 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_get_factors.h +108 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_initialize.c +24 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_initialize.h +119 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_factorize.h +34 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_free.h +19 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_get_factors.h +34 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_initialize.h +46 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_solve_dense.h +29 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_solve_for_update.h +42 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_solve_sparse.h +32 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_obj_update.h +31 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_object.c +325 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_object.h +30 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_solve_dense.c +46 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_solve_dense.h +75 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_solve_for_update.c +79 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_solve_for_update.h +169 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_solve_sparse.c +63 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_solve_sparse.h +112 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_update.c +44 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/basiclu_update.h +125 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_build_factors.c +441 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_condest.c +124 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_def.h +39 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_dfs.c +141 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_factorize_bump.c +56 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_file.c +184 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_file.h +21 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_garbage_perm.c +53 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_initialize.c +56 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_internal.c +352 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_internal.h +220 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_list.h +173 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_markowitz.c +188 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_matrix_norm.c +51 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_pivot.c +1247 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_residual_test.c +155 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_setup_bump.c +198 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_singletons.c +511 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_solve_dense.c +129 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_solve_for_update.c +360 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_solve_sparse.c +284 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_solve_symbolic.c +48 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_solve_triangular.c +140 -0
- data/ext/lpsolver-highs/highs/ipm/basiclu/lu_update.c +908 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/Auxiliary.cpp +301 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/Auxiliary.h +104 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/IntConfig.h +27 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/KrylovMethods.cpp +193 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/KrylovMethods.h +30 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/Log.cpp +60 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/Log.h +62 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/OrderingPrint.h +10 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/VectorOperations.cpp +117 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/VectorOperations.h +59 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/auxiliary/mycblas.h +85 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Analyse.cpp +1367 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Analyse.h +122 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/CallAndTimeBlas.cpp +114 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/CallAndTimeBlas.h +46 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/CliqueStack.cpp +82 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/CliqueStack.h +83 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/DataCollector.cpp +326 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/DataCollector.h +86 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/DenseFact.h +48 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/DenseFactHybrid.cpp +279 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/DenseFactKernel.cpp +284 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/DgemmParallel.cpp +38 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/DgemmParallel.h +32 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/FactorHiGHS.cpp +57 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/FactorHiGHS.h +112 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/FactorHiGHSSettings.h +63 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Factorise.cpp +405 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Factorise.h +85 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/FormatHandler.cpp +46 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/FormatHandler.h +95 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/HybridHybridFormatHandler.cpp +238 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/HybridHybridFormatHandler.h +31 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/HybridSolveHandler.cpp +272 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/HybridSolveHandler.h +26 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/KrylovMethodsIpm.cpp +83 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/KrylovMethodsIpm.h +45 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Numeric.cpp +54 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Numeric.h +46 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/ReturnValues.h +19 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/SolveHandler.cpp +10 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/SolveHandler.h +48 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Swaps.cpp +70 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Swaps.h +19 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Symbolic.cpp +101 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Symbolic.h +220 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/factorhighs/Timing.h +114 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Control.cpp +38 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Control.h +41 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/FactorHiGHSSolver.cpp +887 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/FactorHiGHSSolver.h +92 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Info.h +58 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/IpmData.cpp +8 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/IpmData.h +37 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Iterate.cpp +640 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Iterate.h +172 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/LinearSolver.h +81 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/LogHighs.cpp +71 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/LogHighs.h +33 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Model.cpp +403 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Model.h +136 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Options.h +35 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Parameters.h +63 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/PreProcess.cpp +646 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/PreProcess.h +94 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Refine.cpp +214 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Solver.cpp +1346 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Solver.h +338 -0
- data/ext/lpsolver-highs/highs/ipm/hipo/ipm/Status.h +88 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/basiclu_kernel.cc +71 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/basiclu_kernel.h +20 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/basiclu_wrapper.cc +299 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/basiclu_wrapper.h +47 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/basis.cc +966 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/basis.h +350 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/conjugate_residuals.cc +217 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/conjugate_residuals.h +74 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/control.cc +151 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/control.h +167 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/crossover.cc +479 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/crossover.h +157 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/diagonal_precond.cc +70 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/diagonal_precond.h +45 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/forrest_tomlin.cc +360 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/forrest_tomlin.h +102 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/guess_basis.cc +233 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/guess_basis.h +21 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/indexed_vector.cc +30 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/indexed_vector.h +113 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/info.cc +124 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/info.h +27 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/ipm.cc +897 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/ipm.h +94 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/ipx_c.cc +83 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/ipx_c.h +47 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/ipx_config.h +9 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/ipx_info.h +111 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/ipx_internal.h +89 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/ipx_parameters.h +76 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/ipx_status.h +57 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/iterate.cc +683 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/iterate.h +331 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/kkt_solver.cc +23 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/kkt_solver.h +70 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/kkt_solver_basis.cc +387 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/kkt_solver_basis.h +66 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/kkt_solver_diag.cc +120 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/kkt_solver_diag.h +48 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/linear_operator.cc +10 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/linear_operator.h +26 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/lp_solver.cc +686 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/lp_solver.h +204 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/lu_factorization.cc +131 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/lu_factorization.h +79 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/lu_update.cc +62 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/lu_update.h +129 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/maxvolume.cc +337 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/maxvolume.h +54 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/model.cc +1528 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/model.h +413 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/multistream.h +52 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/normal_matrix.cc +126 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/normal_matrix.h +44 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/power_method.h +44 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/sparse_matrix.cc +382 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/sparse_matrix.h +195 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/sparse_utils.cc +92 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/sparse_utils.h +58 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/splitted_normal_matrix.cc +117 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/splitted_normal_matrix.h +63 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/starting_basis.cc +182 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/starting_basis.h +39 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/symbolic_invert.cc +183 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/symbolic_invert.h +29 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/timer.cc +16 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/timer.h +25 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/utils.cc +95 -0
- data/ext/lpsolver-highs/highs/ipm/ipx/utils.h +37 -0
- data/ext/lpsolver-highs/highs/lp_data/HConst.h +430 -0
- data/ext/lpsolver-highs/highs/lp_data/HStruct.h +213 -0
- data/ext/lpsolver-highs/highs/lp_data/Highs.cpp +4949 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsAnalysis.h +23 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsCallback.cpp +323 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsCallback.h +104 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsCallbackStruct.h +70 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsDebug.cpp +54 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsDebug.h +34 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsDeprecated.cpp +181 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsIis.cpp +1290 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsIis.h +139 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsInfo.cpp +426 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsInfo.h +421 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsInfoDebug.cpp +175 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsInfoDebug.h +27 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsInterface.cpp +4344 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsLp.cpp +564 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsLp.h +97 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsLpSolverObject.h +47 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsLpUtils.cpp +3794 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsLpUtils.h +330 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsModelUtils.cpp +1650 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsModelUtils.h +129 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsOptions.cpp +1176 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsOptions.h +1715 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsRanging.cpp +733 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsRanging.h +43 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsSolution.cpp +2194 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsSolution.h +179 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsSolutionDebug.cpp +490 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsSolutionDebug.h +87 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsSolve.cpp +747 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsSolve.h +29 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsStatus.cpp +48 -0
- data/ext/lpsolver-highs/highs/lp_data/HighsStatus.h +29 -0
- data/ext/lpsolver-highs/highs/lp_data/Iis.md +113 -0
- data/ext/lpsolver-highs/highs/meson.build +433 -0
- data/ext/lpsolver-highs/highs/mip/HighsCliqueTable.cpp +2236 -0
- data/ext/lpsolver-highs/highs/mip/HighsCliqueTable.h +329 -0
- data/ext/lpsolver-highs/highs/mip/HighsConflictPool.cpp +201 -0
- data/ext/lpsolver-highs/highs/mip/HighsConflictPool.h +109 -0
- data/ext/lpsolver-highs/highs/mip/HighsCutGeneration.cpp +1491 -0
- data/ext/lpsolver-highs/highs/mip/HighsCutGeneration.h +108 -0
- data/ext/lpsolver-highs/highs/mip/HighsCutPool.cpp +526 -0
- data/ext/lpsolver-highs/highs/mip/HighsCutPool.h +168 -0
- data/ext/lpsolver-highs/highs/mip/HighsDebugSol.cpp +313 -0
- data/ext/lpsolver-highs/highs/mip/HighsDebugSol.h +133 -0
- data/ext/lpsolver-highs/highs/mip/HighsDomain.cpp +3861 -0
- data/ext/lpsolver-highs/highs/mip/HighsDomain.h +657 -0
- data/ext/lpsolver-highs/highs/mip/HighsDomainChange.h +48 -0
- data/ext/lpsolver-highs/highs/mip/HighsDynamicRowMatrix.cpp +199 -0
- data/ext/lpsolver-highs/highs/mip/HighsDynamicRowMatrix.h +104 -0
- data/ext/lpsolver-highs/highs/mip/HighsFeasibilityJump.cpp +139 -0
- data/ext/lpsolver-highs/highs/mip/HighsGFkSolve.cpp +106 -0
- data/ext/lpsolver-highs/highs/mip/HighsGFkSolve.h +439 -0
- data/ext/lpsolver-highs/highs/mip/HighsImplications.cpp +915 -0
- data/ext/lpsolver-highs/highs/mip/HighsImplications.h +194 -0
- data/ext/lpsolver-highs/highs/mip/HighsLpAggregator.cpp +56 -0
- data/ext/lpsolver-highs/highs/mip/HighsLpAggregator.h +50 -0
- data/ext/lpsolver-highs/highs/mip/HighsLpRelaxation.cpp +1609 -0
- data/ext/lpsolver-highs/highs/mip/HighsLpRelaxation.h +361 -0
- data/ext/lpsolver-highs/highs/mip/HighsMipAnalysis.cpp +313 -0
- data/ext/lpsolver-highs/highs/mip/HighsMipAnalysis.h +71 -0
- data/ext/lpsolver-highs/highs/mip/HighsMipSolver.cpp +1002 -0
- data/ext/lpsolver-highs/highs/mip/HighsMipSolver.h +159 -0
- data/ext/lpsolver-highs/highs/mip/HighsMipSolverData.cpp +2936 -0
- data/ext/lpsolver-highs/highs/mip/HighsMipSolverData.h +313 -0
- data/ext/lpsolver-highs/highs/mip/HighsModkSeparator.cpp +267 -0
- data/ext/lpsolver-highs/highs/mip/HighsModkSeparator.h +60 -0
- data/ext/lpsolver-highs/highs/mip/HighsNodeQueue.cpp +443 -0
- data/ext/lpsolver-highs/highs/mip/HighsNodeQueue.h +312 -0
- data/ext/lpsolver-highs/highs/mip/HighsObjectiveFunction.cpp +124 -0
- data/ext/lpsolver-highs/highs/mip/HighsObjectiveFunction.h +71 -0
- data/ext/lpsolver-highs/highs/mip/HighsPathSeparator.cpp +549 -0
- data/ext/lpsolver-highs/highs/mip/HighsPathSeparator.h +39 -0
- data/ext/lpsolver-highs/highs/mip/HighsPrimalHeuristics.cpp +1673 -0
- data/ext/lpsolver-highs/highs/mip/HighsPrimalHeuristics.h +75 -0
- data/ext/lpsolver-highs/highs/mip/HighsPseudocost.cpp +129 -0
- data/ext/lpsolver-highs/highs/mip/HighsPseudocost.h +366 -0
- data/ext/lpsolver-highs/highs/mip/HighsRedcostFixing.cpp +316 -0
- data/ext/lpsolver-highs/highs/mip/HighsRedcostFixing.h +42 -0
- data/ext/lpsolver-highs/highs/mip/HighsSearch.cpp +1881 -0
- data/ext/lpsolver-highs/highs/mip/HighsSearch.h +241 -0
- data/ext/lpsolver-highs/highs/mip/HighsSeparation.cpp +186 -0
- data/ext/lpsolver-highs/highs/mip/HighsSeparation.h +41 -0
- data/ext/lpsolver-highs/highs/mip/HighsSeparator.cpp +39 -0
- data/ext/lpsolver-highs/highs/mip/HighsSeparator.h +60 -0
- data/ext/lpsolver-highs/highs/mip/HighsTableauSeparator.cpp +244 -0
- data/ext/lpsolver-highs/highs/mip/HighsTableauSeparator.h +34 -0
- data/ext/lpsolver-highs/highs/mip/HighsTransformedLp.cpp +563 -0
- data/ext/lpsolver-highs/highs/mip/HighsTransformedLp.h +63 -0
- data/ext/lpsolver-highs/highs/mip/MipTimer.h +544 -0
- data/ext/lpsolver-highs/highs/mip/feasibilityjump.hh +800 -0
- data/ext/lpsolver-highs/highs/model/HighsHessian.cpp +263 -0
- data/ext/lpsolver-highs/highs/model/HighsHessian.h +54 -0
- data/ext/lpsolver-highs/highs/model/HighsHessianUtils.cpp +584 -0
- data/ext/lpsolver-highs/highs/model/HighsHessianUtils.h +47 -0
- data/ext/lpsolver-highs/highs/model/HighsModel.cpp +46 -0
- data/ext/lpsolver-highs/highs/model/HighsModel.h +42 -0
- data/ext/lpsolver-highs/highs/parallel/HighsBinarySemaphore.h +108 -0
- data/ext/lpsolver-highs/highs/parallel/HighsCacheAlign.h +82 -0
- data/ext/lpsolver-highs/highs/parallel/HighsCombinable.h +116 -0
- data/ext/lpsolver-highs/highs/parallel/HighsMutex.h +124 -0
- data/ext/lpsolver-highs/highs/parallel/HighsParallel.h +128 -0
- data/ext/lpsolver-highs/highs/parallel/HighsRaceTimer.h +38 -0
- data/ext/lpsolver-highs/highs/parallel/HighsSchedulerConstants.h +19 -0
- data/ext/lpsolver-highs/highs/parallel/HighsSpinMutex.h +48 -0
- data/ext/lpsolver-highs/highs/parallel/HighsSplitDeque.h +606 -0
- data/ext/lpsolver-highs/highs/parallel/HighsTask.h +170 -0
- data/ext/lpsolver-highs/highs/parallel/HighsTaskExecutor.cpp +43 -0
- data/ext/lpsolver-highs/highs/parallel/HighsTaskExecutor.h +217 -0
- data/ext/lpsolver-highs/highs/pdlp/CupdlpWrapper.cpp +848 -0
- data/ext/lpsolver-highs/highs/pdlp/CupdlpWrapper.h +108 -0
- data/ext/lpsolver-highs/highs/pdlp/HiPdlpTimer.h +155 -0
- data/ext/lpsolver-highs/highs/pdlp/HiPdlpWrapper.cpp +141 -0
- data/ext/lpsolver-highs/highs/pdlp/HiPdlpWrapper.h +26 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/Diff +12 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/Meld +7 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/Merge +2 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/README.md +95 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cuda/CMakeLists.txt +58 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cuda/cupdlp_cuda_kernels.cu +338 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cuda/cupdlp_cuda_kernels.cuh +319 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cuda/cupdlp_cudalinalg.cu +386 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cuda/cupdlp_cudalinalg.cuh +149 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cuda/test_cublas.c +154 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cuda/test_cuda_linalg.c +79 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp.h +16 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_cs.c +214 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_cs.h +40 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_defs.h +447 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_linalg.c +802 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_linalg.h +189 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_proj.c +148 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_proj.h +19 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_restart.c +124 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_restart.h +31 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_scaling.c +425 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_scaling.h +26 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_solver.c +1498 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_solver.h +105 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_step.c +478 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_step.h +37 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_utils.c +1850 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/cupdlp_utils.h +212 -0
- data/ext/lpsolver-highs/highs/pdlp/cupdlp/glbopts.h +342 -0
- data/ext/lpsolver-highs/highs/pdlp/hipdlp/defs.hpp +222 -0
- data/ext/lpsolver-highs/highs/pdlp/hipdlp/linalg.cc +231 -0
- data/ext/lpsolver-highs/highs/pdlp/hipdlp/linalg.hpp +61 -0
- data/ext/lpsolver-highs/highs/pdlp/hipdlp/logger.cc +225 -0
- data/ext/lpsolver-highs/highs/pdlp/hipdlp/logger.hpp +80 -0
- data/ext/lpsolver-highs/highs/pdlp/hipdlp/pdhg.cc +2798 -0
- data/ext/lpsolver-highs/highs/pdlp/hipdlp/pdhg.cu +497 -0
- data/ext/lpsolver-highs/highs/pdlp/hipdlp/pdhg.hpp +358 -0
- data/ext/lpsolver-highs/highs/pdlp/hipdlp/pdhg_kernels.hpp +77 -0
- data/ext/lpsolver-highs/highs/pdlp/hipdlp/pdlp_gpu_debug.hpp +62 -0
- data/ext/lpsolver-highs/highs/pdlp/hipdlp/restart.cc +132 -0
- data/ext/lpsolver-highs/highs/pdlp/hipdlp/restart.hpp +96 -0
- data/ext/lpsolver-highs/highs/pdlp/hipdlp/scaling.cc +307 -0
- data/ext/lpsolver-highs/highs/pdlp/hipdlp/scaling.hpp +74 -0
- data/ext/lpsolver-highs/highs/pdlp/hipdlp/solver_results.hpp +65 -0
- data/ext/lpsolver-highs/highs/presolve/HPresolve.cpp +8511 -0
- data/ext/lpsolver-highs/highs/presolve/HPresolve.h +505 -0
- data/ext/lpsolver-highs/highs/presolve/HPresolveAnalysis.cpp +239 -0
- data/ext/lpsolver-highs/highs/presolve/HPresolveAnalysis.h +52 -0
- data/ext/lpsolver-highs/highs/presolve/HighsPostsolveStack.cpp +1368 -0
- data/ext/lpsolver-highs/highs/presolve/HighsPostsolveStack.h +943 -0
- data/ext/lpsolver-highs/highs/presolve/HighsSymmetry.cpp +1921 -0
- data/ext/lpsolver-highs/highs/presolve/HighsSymmetry.h +284 -0
- data/ext/lpsolver-highs/highs/presolve/ICrash.cpp +474 -0
- data/ext/lpsolver-highs/highs/presolve/ICrash.h +124 -0
- data/ext/lpsolver-highs/highs/presolve/ICrashUtil.cpp +267 -0
- data/ext/lpsolver-highs/highs/presolve/ICrashUtil.h +62 -0
- data/ext/lpsolver-highs/highs/presolve/ICrashX.cpp +173 -0
- data/ext/lpsolver-highs/highs/presolve/ICrashX.h +23 -0
- data/ext/lpsolver-highs/highs/presolve/PresolveComponent.cpp +45 -0
- data/ext/lpsolver-highs/highs/presolve/PresolveComponent.h +90 -0
- data/ext/lpsolver-highs/highs/qpsolver/README.md +185 -0
- data/ext/lpsolver-highs/highs/qpsolver/a_asm.cpp +139 -0
- data/ext/lpsolver-highs/highs/qpsolver/a_asm.hpp +77 -0
- data/ext/lpsolver-highs/highs/qpsolver/a_quass.cpp +194 -0
- data/ext/lpsolver-highs/highs/qpsolver/a_quass.hpp +22 -0
- data/ext/lpsolver-highs/highs/qpsolver/basis.cpp +443 -0
- data/ext/lpsolver-highs/highs/qpsolver/basis.hpp +159 -0
- data/ext/lpsolver-highs/highs/qpsolver/crashsolution.hpp +20 -0
- data/ext/lpsolver-highs/highs/qpsolver/dantzigpricing.hpp +80 -0
- data/ext/lpsolver-highs/highs/qpsolver/devexharrispricing.hpp +98 -0
- data/ext/lpsolver-highs/highs/qpsolver/devexpricing.hpp +108 -0
- data/ext/lpsolver-highs/highs/qpsolver/eventhandler.hpp +30 -0
- data/ext/lpsolver-highs/highs/qpsolver/factor.hpp +408 -0
- data/ext/lpsolver-highs/highs/qpsolver/feasibility_bounded.hpp +114 -0
- data/ext/lpsolver-highs/highs/qpsolver/feasibility_highs.hpp +301 -0
- data/ext/lpsolver-highs/highs/qpsolver/gradient.hpp +46 -0
- data/ext/lpsolver-highs/highs/qpsolver/instance.hpp +70 -0
- data/ext/lpsolver-highs/highs/qpsolver/matrix.hpp +342 -0
- data/ext/lpsolver-highs/highs/qpsolver/perturbation.cpp +41 -0
- data/ext/lpsolver-highs/highs/qpsolver/perturbation.hpp +15 -0
- data/ext/lpsolver-highs/highs/qpsolver/pricing.hpp +22 -0
- data/ext/lpsolver-highs/highs/qpsolver/qpconst.hpp +34 -0
- data/ext/lpsolver-highs/highs/qpsolver/qpvector.hpp +242 -0
- data/ext/lpsolver-highs/highs/qpsolver/quass.cpp +551 -0
- data/ext/lpsolver-highs/highs/qpsolver/quass.hpp +27 -0
- data/ext/lpsolver-highs/highs/qpsolver/ratiotest.cpp +146 -0
- data/ext/lpsolver-highs/highs/qpsolver/ratiotest.hpp +26 -0
- data/ext/lpsolver-highs/highs/qpsolver/reducedcosts.hpp +46 -0
- data/ext/lpsolver-highs/highs/qpsolver/reducedgradient.hpp +95 -0
- data/ext/lpsolver-highs/highs/qpsolver/runtime.hpp +45 -0
- data/ext/lpsolver-highs/highs/qpsolver/scaling.cpp +123 -0
- data/ext/lpsolver-highs/highs/qpsolver/scaling.hpp +15 -0
- data/ext/lpsolver-highs/highs/qpsolver/settings.hpp +84 -0
- data/ext/lpsolver-highs/highs/qpsolver/snippets.hpp +36 -0
- data/ext/lpsolver-highs/highs/qpsolver/statistics.hpp +30 -0
- data/ext/lpsolver-highs/highs/qpsolver/steepestedgepricing.hpp +173 -0
- data/ext/lpsolver-highs/highs/simplex/HApp.h +550 -0
- data/ext/lpsolver-highs/highs/simplex/HEkk.cpp +4404 -0
- data/ext/lpsolver-highs/highs/simplex/HEkk.h +419 -0
- data/ext/lpsolver-highs/highs/simplex/HEkkControl.cpp +146 -0
- data/ext/lpsolver-highs/highs/simplex/HEkkDebug.cpp +1722 -0
- data/ext/lpsolver-highs/highs/simplex/HEkkDual.cpp +3003 -0
- data/ext/lpsolver-highs/highs/simplex/HEkkDual.h +513 -0
- data/ext/lpsolver-highs/highs/simplex/HEkkDualMulti.cpp +1020 -0
- data/ext/lpsolver-highs/highs/simplex/HEkkDualRHS.cpp +535 -0
- data/ext/lpsolver-highs/highs/simplex/HEkkDualRHS.h +134 -0
- data/ext/lpsolver-highs/highs/simplex/HEkkDualRow.cpp +697 -0
- data/ext/lpsolver-highs/highs/simplex/HEkkDualRow.h +201 -0
- data/ext/lpsolver-highs/highs/simplex/HEkkInterface.cpp +26 -0
- data/ext/lpsolver-highs/highs/simplex/HEkkPrimal.cpp +2984 -0
- data/ext/lpsolver-highs/highs/simplex/HEkkPrimal.h +191 -0
- data/ext/lpsolver-highs/highs/simplex/HSimplex.cpp +330 -0
- data/ext/lpsolver-highs/highs/simplex/HSimplex.h +42 -0
- data/ext/lpsolver-highs/highs/simplex/HSimplexDebug.cpp +145 -0
- data/ext/lpsolver-highs/highs/simplex/HSimplexDebug.h +48 -0
- data/ext/lpsolver-highs/highs/simplex/HSimplexNla.cpp +517 -0
- data/ext/lpsolver-highs/highs/simplex/HSimplexNla.h +158 -0
- data/ext/lpsolver-highs/highs/simplex/HSimplexNlaDebug.cpp +373 -0
- data/ext/lpsolver-highs/highs/simplex/HSimplexNlaFreeze.cpp +28 -0
- data/ext/lpsolver-highs/highs/simplex/HSimplexNlaProductForm.cpp +113 -0
- data/ext/lpsolver-highs/highs/simplex/HSimplexReport.cpp +77 -0
- data/ext/lpsolver-highs/highs/simplex/HSimplexReport.h +21 -0
- data/ext/lpsolver-highs/highs/simplex/HighsSimplexAnalysis.cpp +1495 -0
- data/ext/lpsolver-highs/highs/simplex/HighsSimplexAnalysis.h +500 -0
- data/ext/lpsolver-highs/highs/simplex/SimplexConst.h +273 -0
- data/ext/lpsolver-highs/highs/simplex/SimplexStruct.h +263 -0
- data/ext/lpsolver-highs/highs/simplex/SimplexTimer.h +414 -0
- data/ext/lpsolver-highs/highs/test_kkt/DevKkt.cpp +469 -0
- data/ext/lpsolver-highs/highs/test_kkt/DevKkt.h +143 -0
- data/ext/lpsolver-highs/highs/test_kkt/KktCh2.cpp +305 -0
- data/ext/lpsolver-highs/highs/test_kkt/KktCh2.h +79 -0
- data/ext/lpsolver-highs/highs/util/FactorTimer.h +199 -0
- data/ext/lpsolver-highs/highs/util/HFactor.cpp +2597 -0
- data/ext/lpsolver-highs/highs/util/HFactor.h +587 -0
- data/ext/lpsolver-highs/highs/util/HFactorConst.h +81 -0
- data/ext/lpsolver-highs/highs/util/HFactorDebug.cpp +231 -0
- data/ext/lpsolver-highs/highs/util/HFactorDebug.h +55 -0
- data/ext/lpsolver-highs/highs/util/HFactorExtend.cpp +229 -0
- data/ext/lpsolver-highs/highs/util/HFactorRefactor.cpp +304 -0
- data/ext/lpsolver-highs/highs/util/HFactorUtils.cpp +122 -0
- data/ext/lpsolver-highs/highs/util/HSet.cpp +197 -0
- data/ext/lpsolver-highs/highs/util/HSet.h +89 -0
- data/ext/lpsolver-highs/highs/util/HVector.h +22 -0
- data/ext/lpsolver-highs/highs/util/HVectorBase.cpp +271 -0
- data/ext/lpsolver-highs/highs/util/HVectorBase.h +102 -0
- data/ext/lpsolver-highs/highs/util/HighsCDouble.h +323 -0
- data/ext/lpsolver-highs/highs/util/HighsComponent.h +53 -0
- data/ext/lpsolver-highs/highs/util/HighsDataStack.h +83 -0
- data/ext/lpsolver-highs/highs/util/HighsDisjointSets.h +107 -0
- data/ext/lpsolver-highs/highs/util/HighsHash.cpp +10 -0
- data/ext/lpsolver-highs/highs/util/HighsHash.h +1274 -0
- data/ext/lpsolver-highs/highs/util/HighsHashTree.h +1461 -0
- data/ext/lpsolver-highs/highs/util/HighsInt.h +36 -0
- data/ext/lpsolver-highs/highs/util/HighsIntegers.h +212 -0
- data/ext/lpsolver-highs/highs/util/HighsLinearSumBounds.cpp +267 -0
- data/ext/lpsolver-highs/highs/util/HighsLinearSumBounds.h +203 -0
- data/ext/lpsolver-highs/highs/util/HighsMatrixPic.cpp +146 -0
- data/ext/lpsolver-highs/highs/util/HighsMatrixPic.h +37 -0
- data/ext/lpsolver-highs/highs/util/HighsMatrixSlice.h +561 -0
- data/ext/lpsolver-highs/highs/util/HighsMatrixUtils.cpp +407 -0
- data/ext/lpsolver-highs/highs/util/HighsMatrixUtils.h +57 -0
- data/ext/lpsolver-highs/highs/util/HighsMemoryAllocation.h +63 -0
- data/ext/lpsolver-highs/highs/util/HighsRandom.h +242 -0
- data/ext/lpsolver-highs/highs/util/HighsRbTree.h +452 -0
- data/ext/lpsolver-highs/highs/util/HighsSort.cpp +364 -0
- data/ext/lpsolver-highs/highs/util/HighsSort.h +131 -0
- data/ext/lpsolver-highs/highs/util/HighsSparseMatrix.cpp +1746 -0
- data/ext/lpsolver-highs/highs/util/HighsSparseMatrix.h +151 -0
- data/ext/lpsolver-highs/highs/util/HighsSparseVectorSum.h +95 -0
- data/ext/lpsolver-highs/highs/util/HighsSplay.h +135 -0
- data/ext/lpsolver-highs/highs/util/HighsTimer.h +385 -0
- data/ext/lpsolver-highs/highs/util/HighsUtils.cpp +1259 -0
- data/ext/lpsolver-highs/highs/util/HighsUtils.h +272 -0
- data/ext/lpsolver-highs/highs/util/stringutil.cpp +131 -0
- data/ext/lpsolver-highs/highs/util/stringutil.h +46 -0
- data/ext/lpsolver-highs/highs.pc.in +12 -0
- data/ext/lpsolver-highs/meson.build +198 -0
- data/ext/lpsolver-highs/meson_options.txt +31 -0
- data/ext/lpsolver-highs/nuget/HiGHS_Logo.png +0 -0
- data/ext/lpsolver-highs/nuget/Highs.csproj +25 -0
- data/ext/lpsolver-highs/nuget/Highs.csproj.in +36 -0
- data/ext/lpsolver-highs/nuget/HowToAlternative.md +77 -0
- data/ext/lpsolver-highs/nuget/README.md +38 -0
- data/ext/lpsolver-highs/nuget/arm-toolchain.cmake +15 -0
- data/ext/lpsolver-highs/nuget/build_linux-arm.sh +13 -0
- data/ext/lpsolver-highs/nuget/build_linux.sh +10 -0
- data/ext/lpsolver-highs/nuget/build_windows.ps1 +27 -0
- data/ext/lpsolver-highs/nuget/generatePackage.ps1 +28 -0
- data/ext/lpsolver-highs/pyproject.toml +221 -0
- data/ext/lpsolver-highs/subprojects/pybind11.wrap +13 -0
- data/ext/lpsolver-highs/tests/test_highspy.py +2310 -0
- data/ext/lpsolver-highs/version.rc.in +50 -0
- data/lib/lpsolver/highs +0 -0
- data/lib/lpsolver/model.rb +28 -4
- data/lib/lpsolver/native.so +0 -0
- data/lib/lpsolver/native_model.rb +261 -0
- data/lib/lpsolver/solution.rb +72 -7
- data/lib/lpsolver/version.rb +1 -1
- data/lpsolver.gemspec +4 -1
- metadata +1176 -4
|
@@ -0,0 +1,1346 @@
|
|
|
1
|
+
#include "Solver.h"
|
|
2
|
+
|
|
3
|
+
#include <cassert>
|
|
4
|
+
#include <cmath>
|
|
5
|
+
#include <iostream>
|
|
6
|
+
|
|
7
|
+
#include "ipm/IpxWrapper.h"
|
|
8
|
+
#include "ipm/hipo/auxiliary/Log.h"
|
|
9
|
+
#include "lp_data/HighsSolution.h"
|
|
10
|
+
#include "parallel/HighsParallel.h"
|
|
11
|
+
|
|
12
|
+
namespace hipo {
|
|
13
|
+
|
|
14
|
+
Int Solver::load(const HighsLp& lp, const HighsHessian& Q) {
|
|
15
|
+
if (model_.init(lp, Q)) {
|
|
16
|
+
logH_.printDevInfo("Error with model\n");
|
|
17
|
+
return kStatusBadModel;
|
|
18
|
+
}
|
|
19
|
+
return kStatusOk;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
void Solver::setOptions(const HighsOptions& highs_options) {
|
|
23
|
+
options_.display = true;
|
|
24
|
+
if (!highs_options.output_flag | !highs_options.log_to_console)
|
|
25
|
+
options_.display = false;
|
|
26
|
+
|
|
27
|
+
options_.log_options = &highs_options.log_options;
|
|
28
|
+
|
|
29
|
+
// Debug option is already considered through log_options.log_dev_level in
|
|
30
|
+
// hipo::LogHighs::debug
|
|
31
|
+
|
|
32
|
+
options_.timeless_log = highs_options.timeless_log;
|
|
33
|
+
options_.feasibility_tol =
|
|
34
|
+
std::min(highs_options.primal_feasibility_tolerance,
|
|
35
|
+
highs_options.dual_feasibility_tolerance);
|
|
36
|
+
options_.optimality_tol = highs_options.ipm_optimality_tolerance;
|
|
37
|
+
options_.crossover_tol = highs_options.start_crossover_tolerance;
|
|
38
|
+
|
|
39
|
+
if (highs_options.kkt_tolerance != kDefaultKktTolerance) {
|
|
40
|
+
options_.feasibility_tol = highs_options.kkt_tolerance;
|
|
41
|
+
options_.optimality_tol = 1e-1 * highs_options.kkt_tolerance;
|
|
42
|
+
options_.crossover_tol = 1e-1 * highs_options.kkt_tolerance;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// hipo uses same timer as highs, so it is fine to pass the same time limit
|
|
46
|
+
options_.time_limit = highs_options.time_limit;
|
|
47
|
+
|
|
48
|
+
options_.max_iter = highs_options.ipm_iteration_limit;
|
|
49
|
+
options_.crossover = highs_options.run_crossover;
|
|
50
|
+
options_.parallel = highs_options.parallel;
|
|
51
|
+
options_.parallel_type = highs_options.hipo_parallel_type;
|
|
52
|
+
options_.nla = highs_options.hipo_system;
|
|
53
|
+
options_.ordering = highs_options.hipo_ordering;
|
|
54
|
+
options_.block_size = highs_options.hipo_block_size;
|
|
55
|
+
|
|
56
|
+
options_orig_ = options_;
|
|
57
|
+
Hoptions_ = highs_options;
|
|
58
|
+
resetOptions();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
void Solver::resetOptions() {
|
|
62
|
+
options_ = options_orig_;
|
|
63
|
+
if (options_.display) logH_.setOptions(options_.log_options);
|
|
64
|
+
control_.setOptions(options_);
|
|
65
|
+
}
|
|
66
|
+
void Solver::setCallback(HighsCallback& callback) {
|
|
67
|
+
control_.setCallback(callback);
|
|
68
|
+
}
|
|
69
|
+
void Solver::setTimer(const HighsTimer& timer) { control_.setTimer(timer); }
|
|
70
|
+
|
|
71
|
+
void Solver::reset() {
|
|
72
|
+
m_ = model_.m();
|
|
73
|
+
n_ = model_.n();
|
|
74
|
+
|
|
75
|
+
info_ = Info{};
|
|
76
|
+
|
|
77
|
+
info_.ipx_used = false;
|
|
78
|
+
info_.m_solver = m_;
|
|
79
|
+
info_.n_solver = n_;
|
|
80
|
+
info_.m_original = model_.m_orig();
|
|
81
|
+
info_.n_original = model_.n_orig();
|
|
82
|
+
|
|
83
|
+
resetOptions();
|
|
84
|
+
|
|
85
|
+
iter_ = 0;
|
|
86
|
+
alpha_primal_ = 0.0;
|
|
87
|
+
alpha_dual_ = 0.0;
|
|
88
|
+
sigma_ = 0.0;
|
|
89
|
+
regul_ = Regularisation{};
|
|
90
|
+
|
|
91
|
+
LS_.reset();
|
|
92
|
+
it_.reset();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
void Solver::solve() {
|
|
96
|
+
if (!model_.ready()) {
|
|
97
|
+
info_.status = kStatusBadModel;
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
reset();
|
|
102
|
+
|
|
103
|
+
// iterate object needs to be initialised before potentially interrupting
|
|
104
|
+
it_.reset(new Iterate(model_, regul_));
|
|
105
|
+
|
|
106
|
+
if (checkInterrupt()) return;
|
|
107
|
+
|
|
108
|
+
printInfo();
|
|
109
|
+
|
|
110
|
+
runIpm();
|
|
111
|
+
refineWithIpx();
|
|
112
|
+
it_->finalResiduals(info_);
|
|
113
|
+
printSummary();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
void Solver::runIpm() {
|
|
117
|
+
if (initialise()) return;
|
|
118
|
+
|
|
119
|
+
while (iter_ < options_.max_iter) {
|
|
120
|
+
if (prepareIter()) break;
|
|
121
|
+
if (predictor()) break;
|
|
122
|
+
if (correctors()) break;
|
|
123
|
+
makeStep();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
terminate();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
bool Solver::initialise() {
|
|
130
|
+
// Prepare ipm for execution.
|
|
131
|
+
// Return true if an error occurred.
|
|
132
|
+
|
|
133
|
+
start_time_ = control_.elapsed();
|
|
134
|
+
|
|
135
|
+
// initialise linear solver
|
|
136
|
+
LS_.reset(
|
|
137
|
+
new FactorHiGHSSolver(options_, model_, regul_, info_, it_->data, logH_));
|
|
138
|
+
if (Int status = LS_->setup()) {
|
|
139
|
+
info_.status = (Status)status;
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
LS_->clear();
|
|
143
|
+
|
|
144
|
+
it_->data.append();
|
|
145
|
+
|
|
146
|
+
if (checkInterrupt()) return true;
|
|
147
|
+
|
|
148
|
+
// decide number of correctors to use
|
|
149
|
+
maxCorrectors();
|
|
150
|
+
|
|
151
|
+
if (startingPoint()) return true;
|
|
152
|
+
|
|
153
|
+
it_->residual1234();
|
|
154
|
+
it_->computeMu();
|
|
155
|
+
it_->indicators();
|
|
156
|
+
|
|
157
|
+
printOutput();
|
|
158
|
+
|
|
159
|
+
if (checkInterrupt()) return true;
|
|
160
|
+
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
void Solver::terminate() {
|
|
165
|
+
info_.ipm_iter = iter_;
|
|
166
|
+
if (info_.status == kStatusNotRun) info_.status = kStatusMaxIter;
|
|
167
|
+
|
|
168
|
+
info_.num_dense_cols = model_.numDenseCols();
|
|
169
|
+
info_.max_col_density = model_.maxColDensity();
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
bool Solver::prepareIter() {
|
|
173
|
+
// Prepare next iteration.
|
|
174
|
+
// Return true if Ipm main loop should be stopped
|
|
175
|
+
|
|
176
|
+
if (checkIterate()) return true;
|
|
177
|
+
if (checkBadIter()) return true;
|
|
178
|
+
if (checkTermination()) return true;
|
|
179
|
+
if (checkInterrupt()) return true;
|
|
180
|
+
|
|
181
|
+
++iter_;
|
|
182
|
+
|
|
183
|
+
// Clear Newton direction
|
|
184
|
+
it_->clearDir();
|
|
185
|
+
|
|
186
|
+
// Clear any existing data in the linear solver
|
|
187
|
+
LS_->clear();
|
|
188
|
+
|
|
189
|
+
it_->data.append();
|
|
190
|
+
|
|
191
|
+
// compute theta inverse
|
|
192
|
+
it_->computeScaling();
|
|
193
|
+
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
bool Solver::predictor() {
|
|
198
|
+
// Compute affine scaling direction.
|
|
199
|
+
// Return true if an error occurred.
|
|
200
|
+
|
|
201
|
+
if (checkInterrupt()) return true;
|
|
202
|
+
|
|
203
|
+
// compute sigma and residuals for affine scaling direction
|
|
204
|
+
sigmaAffine();
|
|
205
|
+
it_->residual56(sigma_);
|
|
206
|
+
|
|
207
|
+
if (solveNewtonSystem(it_->delta)) return true;
|
|
208
|
+
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
bool Solver::correctors() {
|
|
213
|
+
// Compute multiple centrality correctors.
|
|
214
|
+
// Return true if an error occurred.
|
|
215
|
+
|
|
216
|
+
if (checkInterrupt()) return true;
|
|
217
|
+
|
|
218
|
+
sigmaCorrectors();
|
|
219
|
+
if (centralityCorrectors()) return true;
|
|
220
|
+
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
bool Solver::prepareIpx() {
|
|
225
|
+
// Return true if an error occurred;
|
|
226
|
+
|
|
227
|
+
assert(!model_.qp());
|
|
228
|
+
|
|
229
|
+
ipx::Parameters ipx_param;
|
|
230
|
+
ipx_param.display = options_.display;
|
|
231
|
+
ipx_param.highs_logging = true;
|
|
232
|
+
ipx_param.log_options = options_.log_options;
|
|
233
|
+
ipx_param.dualize = 0;
|
|
234
|
+
|
|
235
|
+
if (options_.crossover == kHighsOnString)
|
|
236
|
+
ipx_param.run_crossover = 1;
|
|
237
|
+
else if (options_.crossover == kHighsOffString)
|
|
238
|
+
ipx_param.run_crossover = 0;
|
|
239
|
+
else
|
|
240
|
+
ipx_param.run_crossover = -1;
|
|
241
|
+
|
|
242
|
+
ipx_param.ipm_feasibility_tol = options_.feasibility_tol;
|
|
243
|
+
ipx_param.ipm_optimality_tol = options_.optimality_tol;
|
|
244
|
+
ipx_param.start_crossover_tol = options_.crossover_tol;
|
|
245
|
+
ipx_param.time_limit = options_.time_limit;
|
|
246
|
+
ipx_param.timeless_log = options_.timeless_log;
|
|
247
|
+
ipx_param.ipm_maxiter = options_.max_iter - iter_;
|
|
248
|
+
ipx_lps_.SetParameters(ipx_param);
|
|
249
|
+
|
|
250
|
+
ipx_lps_.SetCallback(control_.callback());
|
|
251
|
+
|
|
252
|
+
Int load_status = model_.loadIntoIpx(ipx_lps_);
|
|
253
|
+
|
|
254
|
+
if (load_status) {
|
|
255
|
+
logH_.printDevInfo("Error loading model into IPX\n");
|
|
256
|
+
return true;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
std::vector<double> x, xl, xu, slack, y, zl, zu;
|
|
260
|
+
getInteriorSolution(x, xl, xu, slack, y, zl, zu);
|
|
261
|
+
|
|
262
|
+
Int start_point_status = ipx_lps_.LoadIPMStartingPoint(
|
|
263
|
+
x.data(), xl.data(), xu.data(), slack.data(), y.data(), zl.data(),
|
|
264
|
+
zu.data());
|
|
265
|
+
|
|
266
|
+
if (start_point_status) {
|
|
267
|
+
logH_.printDevInfo("Error loading starting point into IPX\n");
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
void Solver::refineWithIpx() {
|
|
275
|
+
if (checkInterrupt()) return;
|
|
276
|
+
|
|
277
|
+
if (statusNeedsRefinement() && refinementIsOn()) {
|
|
278
|
+
logH_.print("\nRestarting with IPX\n");
|
|
279
|
+
} else if (statusAllowsCrossover() && crossoverIsOn()) {
|
|
280
|
+
logH_.print("\nRunning crossover with IPX\n");
|
|
281
|
+
} else {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (prepareIpx()) return;
|
|
286
|
+
|
|
287
|
+
ipx_lps_.Solve();
|
|
288
|
+
info_.ipx_used = true;
|
|
289
|
+
|
|
290
|
+
info_.ipx_info = ipx_lps_.GetInfo();
|
|
291
|
+
|
|
292
|
+
// Convert between ipx and hipo status
|
|
293
|
+
info_.status = IpxToHipoStatus(info_.ipx_info.status_ipm);
|
|
294
|
+
|
|
295
|
+
std::stringstream log_stream;
|
|
296
|
+
log_stream << "IPX reports: ipm "
|
|
297
|
+
<< ipx::StatusString(info_.ipx_info.status_ipm);
|
|
298
|
+
if (info_.ipx_info.status_crossover != IPX_STATUS_not_run)
|
|
299
|
+
log_stream << ", crossover "
|
|
300
|
+
<< ipx::StatusString(info_.ipx_info.status_crossover);
|
|
301
|
+
log_stream << '\n';
|
|
302
|
+
logH_.print(log_stream);
|
|
303
|
+
|
|
304
|
+
if (info_.ipx_info.status_crossover == IPX_STATUS_optimal) {
|
|
305
|
+
info_.status = kStatusBasic;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
bool Solver::solveNewtonSystem(NewtonDir& delta) {
|
|
310
|
+
solve6x6(delta, it_->res);
|
|
311
|
+
refine(delta);
|
|
312
|
+
|
|
313
|
+
// Check for NaN of Inf
|
|
314
|
+
if (it_->isDirNan(delta)) {
|
|
315
|
+
logH_.printDevInfo("Direction is nan\n");
|
|
316
|
+
info_.status = kStatusError;
|
|
317
|
+
return true;
|
|
318
|
+
} else if (it_->isDirInf(delta)) {
|
|
319
|
+
logH_.printDevInfo("Direction is inf\n");
|
|
320
|
+
info_.status = kStatusError;
|
|
321
|
+
return true;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return false;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
bool Solver::solve2x2(NewtonDir& delta, const Residuals& rhs) {
|
|
328
|
+
std::vector<double>& theta_inv = it_->scaling;
|
|
329
|
+
|
|
330
|
+
std::vector<double> res7 = it_->residual7(rhs);
|
|
331
|
+
|
|
332
|
+
// NORMAL EQUATIONS
|
|
333
|
+
if (options_.nla == kHipoNormalEqString) {
|
|
334
|
+
std::vector<double> res8 = it_->residual8(rhs, res7);
|
|
335
|
+
|
|
336
|
+
// factorise normal equations, if not yet done
|
|
337
|
+
if (!LS_->valid_) {
|
|
338
|
+
if (Int status = LS_->factorNE(theta_inv)) {
|
|
339
|
+
logH_.printe("Error while factorising normal equations\n");
|
|
340
|
+
info_.status = (Status)status;
|
|
341
|
+
return true;
|
|
342
|
+
}
|
|
343
|
+
it_->getReg(*LS_, options_.nla);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// solve with normal equations
|
|
347
|
+
if (Int status = LS_->solveNE(res8, delta.y)) {
|
|
348
|
+
logH_.printe("Error while solving normal equations\n");
|
|
349
|
+
info_.status = (Status)status;
|
|
350
|
+
return true;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// Compute delta.x
|
|
354
|
+
// Deltax = A^T * Deltay - res7;
|
|
355
|
+
delta.x = res7;
|
|
356
|
+
model_.A().alphaProductPlusY(-1.0, delta.y, delta.x, true);
|
|
357
|
+
vectorScale(delta.x, -1.0);
|
|
358
|
+
|
|
359
|
+
// Deltax = (Theta^-1+Rp+Q)^-1 * Deltax
|
|
360
|
+
for (Int i = 0; i < n_; ++i) {
|
|
361
|
+
double denom = theta_inv[i] + regul_.primal;
|
|
362
|
+
if (model_.qp()) denom += model_.sense() * model_.Q().diag(i);
|
|
363
|
+
delta.x[i] /= denom;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// AUGMENTED SYSTEM
|
|
369
|
+
else {
|
|
370
|
+
// factorise augmented system, if not yet done
|
|
371
|
+
if (!LS_->valid_) {
|
|
372
|
+
if (Int status = LS_->factorAS(theta_inv)) {
|
|
373
|
+
logH_.printe("Error while factorising augmented system\n");
|
|
374
|
+
info_.status = (Status)status;
|
|
375
|
+
return true;
|
|
376
|
+
}
|
|
377
|
+
it_->getReg(*LS_, options_.nla);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// solve with augmented system
|
|
381
|
+
if (Int status = LS_->solveAS(res7, rhs.r1, delta.x, delta.y)) {
|
|
382
|
+
logH_.printe("Error while solving augmented system\n");
|
|
383
|
+
info_.status = (Status)status;
|
|
384
|
+
return true;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
return false;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
bool Solver::solve6x6(NewtonDir& delta, const Residuals& rhs) {
|
|
392
|
+
if (solve2x2(delta, rhs)) return true;
|
|
393
|
+
recoverDirection(delta, rhs);
|
|
394
|
+
return false;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
void Solver::recoverDirection(NewtonDir& delta, const Residuals& rhs) const {
|
|
398
|
+
// Recover components xl, xu, zl, zu of partial direction delta.
|
|
399
|
+
const std::vector<double>& xl = it_->xl;
|
|
400
|
+
const std::vector<double>& xu = it_->xu;
|
|
401
|
+
const std::vector<double>& zl = it_->zl;
|
|
402
|
+
const std::vector<double>& zu = it_->zu;
|
|
403
|
+
const std::vector<double>& res2 = rhs.r2;
|
|
404
|
+
const std::vector<double>& res3 = rhs.r3;
|
|
405
|
+
const std::vector<double>& res4 = rhs.r4;
|
|
406
|
+
const std::vector<double>& res5 = rhs.r5;
|
|
407
|
+
const std::vector<double>& res6 = rhs.r6;
|
|
408
|
+
|
|
409
|
+
for (Int i = 0; i < n_; ++i) {
|
|
410
|
+
if (model_.hasLb(i) || model_.hasUb(i)) {
|
|
411
|
+
delta.xl[i] = delta.x[i] - res2[i];
|
|
412
|
+
delta.zl[i] = (res5[i] - zl[i] * delta.xl[i]) / xl[i];
|
|
413
|
+
} else {
|
|
414
|
+
delta.xl[i] = 0.0;
|
|
415
|
+
delta.zl[i] = 0.0;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
for (Int i = 0; i < n_; ++i) {
|
|
419
|
+
if (model_.hasLb(i) || model_.hasUb(i)) {
|
|
420
|
+
delta.xu[i] = res3[i] - delta.x[i];
|
|
421
|
+
delta.zu[i] = (res6[i] - zu[i] * delta.xu[i]) / xu[i];
|
|
422
|
+
} else {
|
|
423
|
+
delta.xu[i] = 0.0;
|
|
424
|
+
delta.zu[i] = 0.0;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
double Solver::stepToBoundary(const std::vector<double>& x,
|
|
430
|
+
const std::vector<double>& dx,
|
|
431
|
+
const std::vector<double>* cor, double weight,
|
|
432
|
+
bool lo, Int* block) const {
|
|
433
|
+
// Compute the largest alpha s.t. x + alpha * dx >= 0.
|
|
434
|
+
// If cor is valid, consider x + alpha * (dx + w * cor) instead.
|
|
435
|
+
// Use lo=1 for xl and zl, lo=0 for xu and zu.
|
|
436
|
+
// Return the blocking index in block.
|
|
437
|
+
|
|
438
|
+
const double damp = 1.0 - 1e3 * std::numeric_limits<double>::epsilon();
|
|
439
|
+
|
|
440
|
+
double alpha = 1.0;
|
|
441
|
+
Int bl = -1;
|
|
442
|
+
|
|
443
|
+
for (Int i = 0; i < n_; ++i) {
|
|
444
|
+
if ((lo && model_.hasLb(i)) || (!lo && model_.hasUb(i))) {
|
|
445
|
+
double c = (cor ? (*cor)[i] * weight : 0.0);
|
|
446
|
+
if (x[i] + alpha * (dx[i] + c) < 0.0) {
|
|
447
|
+
alpha = -(x[i] * damp) / (dx[i] + c);
|
|
448
|
+
bl = i;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
if (block) *block = bl;
|
|
453
|
+
return alpha;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
void Solver::stepsToBoundary(double& alpha_primal, double& alpha_dual,
|
|
457
|
+
const NewtonDir& delta, const NewtonDir* cor,
|
|
458
|
+
double weight) const {
|
|
459
|
+
// compute primal and dual steps to boundary, given direction, corrector and
|
|
460
|
+
// weight.
|
|
461
|
+
|
|
462
|
+
Int block;
|
|
463
|
+
double axl = stepToBoundary(it_->xl, delta.xl, cor ? &(cor->xl) : nullptr,
|
|
464
|
+
weight, true);
|
|
465
|
+
double axu = stepToBoundary(it_->xu, delta.xu, cor ? &(cor->xu) : nullptr,
|
|
466
|
+
weight, false);
|
|
467
|
+
double azl = stepToBoundary(it_->zl, delta.zl, cor ? &(cor->zl) : nullptr,
|
|
468
|
+
weight, true);
|
|
469
|
+
double azu = stepToBoundary(it_->zu, delta.zu, cor ? &(cor->zu) : nullptr,
|
|
470
|
+
weight, false);
|
|
471
|
+
|
|
472
|
+
alpha_primal = std::min(axl, axu);
|
|
473
|
+
alpha_primal = std::min(alpha_primal, 1.0);
|
|
474
|
+
alpha_dual = std::min(azl, azu);
|
|
475
|
+
alpha_dual = std::min(alpha_dual, 1.0);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
void Solver::stepSizes() {
|
|
479
|
+
// Compute primal and dual stepsizes.
|
|
480
|
+
std::vector<double>& xl = it_->xl;
|
|
481
|
+
std::vector<double>& xu = it_->xu;
|
|
482
|
+
std::vector<double>& zl = it_->zl;
|
|
483
|
+
std::vector<double>& zu = it_->zu;
|
|
484
|
+
std::vector<double>& dxl = it_->delta.xl;
|
|
485
|
+
std::vector<double>& dxu = it_->delta.xu;
|
|
486
|
+
std::vector<double>& dzl = it_->delta.zl;
|
|
487
|
+
std::vector<double>& dzu = it_->delta.zu;
|
|
488
|
+
|
|
489
|
+
// parameters for Mehrotra heuristic
|
|
490
|
+
const double gamma_f = 0.9;
|
|
491
|
+
const double gamma_a = 1.0 / (1.0 - gamma_f);
|
|
492
|
+
|
|
493
|
+
// compute stepsizes and blocking components
|
|
494
|
+
Int block_xl, block_xu, block_zl, block_zu;
|
|
495
|
+
double alpha_xl = stepToBoundary(xl, dxl, nullptr, 0, true, &block_xl);
|
|
496
|
+
double alpha_xu = stepToBoundary(xu, dxu, nullptr, 0, false, &block_xu);
|
|
497
|
+
double alpha_zl = stepToBoundary(zl, dzl, nullptr, 0, true, &block_zl);
|
|
498
|
+
double alpha_zu = stepToBoundary(zu, dzu, nullptr, 0, false, &block_zu);
|
|
499
|
+
|
|
500
|
+
double max_p = std::min(alpha_xl, alpha_xu);
|
|
501
|
+
double max_d = std::min(alpha_zl, alpha_zu);
|
|
502
|
+
|
|
503
|
+
// compute mu with current stepsizes
|
|
504
|
+
double mu_full = 0.0;
|
|
505
|
+
Int num_finite = 0;
|
|
506
|
+
for (Int i = 0; i < n_; ++i) {
|
|
507
|
+
if (model_.hasLb(i)) {
|
|
508
|
+
mu_full += (xl[i] + max_p * dxl[i]) * (zl[i] + max_d * dzl[i]);
|
|
509
|
+
++num_finite;
|
|
510
|
+
}
|
|
511
|
+
if (model_.hasUb(i)) {
|
|
512
|
+
mu_full += (xu[i] + max_p * dxu[i]) * (zu[i] + max_d * dzu[i]);
|
|
513
|
+
++num_finite;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
mu_full /= num_finite;
|
|
517
|
+
mu_full /= gamma_a;
|
|
518
|
+
|
|
519
|
+
// compute new stepsizes based on Mehrotra heuristic
|
|
520
|
+
|
|
521
|
+
// primal
|
|
522
|
+
double alpha_p = 1.0;
|
|
523
|
+
Int block_p = -1;
|
|
524
|
+
if (max_p < 1.0) {
|
|
525
|
+
if (alpha_xl <= alpha_xu) {
|
|
526
|
+
block_p = block_xl;
|
|
527
|
+
double temp = mu_full / (zl[block_p] + max_d * dzl[block_p]);
|
|
528
|
+
alpha_p = (temp - xl[block_p]) / dxl[block_p];
|
|
529
|
+
} else {
|
|
530
|
+
block_p = block_xu;
|
|
531
|
+
double temp = mu_full / (zu[block_p] + max_d * dzu[block_p]);
|
|
532
|
+
alpha_p = (temp - xu[block_p]) / dxu[block_p];
|
|
533
|
+
}
|
|
534
|
+
alpha_p = std::max(alpha_p, gamma_f * max_p);
|
|
535
|
+
alpha_p = std::min(alpha_p, 1.0);
|
|
536
|
+
assert(block_p >= 0);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
// dual
|
|
540
|
+
double alpha_d = 1.0;
|
|
541
|
+
Int block_d = -1;
|
|
542
|
+
if (max_d < 1.0) {
|
|
543
|
+
if (alpha_zl <= alpha_zu) {
|
|
544
|
+
block_d = block_zl;
|
|
545
|
+
double temp = mu_full / (xl[block_d] + max_p * dxl[block_d]);
|
|
546
|
+
alpha_d = (temp - zl[block_d]) / dzl[block_d];
|
|
547
|
+
} else {
|
|
548
|
+
block_d = block_zu;
|
|
549
|
+
double temp = mu_full / (xu[block_d] + max_p * dxu[block_d]);
|
|
550
|
+
alpha_d = (temp - zu[block_d]) / dzu[block_d];
|
|
551
|
+
}
|
|
552
|
+
alpha_d = std::max(alpha_d, gamma_f * max_d);
|
|
553
|
+
alpha_d = std::min(alpha_d, 1.0);
|
|
554
|
+
assert(block_d >= 0);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
alpha_primal_ = std::min(alpha_p, 1.0 - 1e-4);
|
|
558
|
+
alpha_dual_ = std::min(alpha_d, 1.0 - 1e-4);
|
|
559
|
+
|
|
560
|
+
assert(alpha_primal_ > 0 && alpha_primal_ < 1 && alpha_dual_ > 0 &&
|
|
561
|
+
alpha_dual_ < 1);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
void Solver::makeStep() {
|
|
565
|
+
stepSizes();
|
|
566
|
+
it_->makeStep(alpha_primal_, alpha_dual_);
|
|
567
|
+
it_->residual1234();
|
|
568
|
+
it_->computeMu();
|
|
569
|
+
it_->indicators();
|
|
570
|
+
printOutput();
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
bool Solver::startingPoint() {
|
|
574
|
+
// Return true if an error occurred
|
|
575
|
+
|
|
576
|
+
std::vector<double>& x = it_->x;
|
|
577
|
+
std::vector<double>& xl = it_->xl;
|
|
578
|
+
std::vector<double>& xu = it_->xu;
|
|
579
|
+
std::vector<double>& y = it_->y;
|
|
580
|
+
std::vector<double>& zl = it_->zl;
|
|
581
|
+
std::vector<double>& zu = it_->zu;
|
|
582
|
+
|
|
583
|
+
// *********************************************************************
|
|
584
|
+
// x starting point
|
|
585
|
+
// *********************************************************************
|
|
586
|
+
// compute feasible x
|
|
587
|
+
for (Int i = 0; i < n_; ++i) {
|
|
588
|
+
x[i] = 0.0;
|
|
589
|
+
x[i] = std::max(x[i], model_.lb(i));
|
|
590
|
+
x[i] = std::min(x[i], model_.ub(i));
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
const std::vector<double> empty_scaling;
|
|
594
|
+
std::vector<double> temp_m(m_);
|
|
595
|
+
|
|
596
|
+
// store b in y
|
|
597
|
+
y = model_.b();
|
|
598
|
+
if (norm2(y) < 1e-6) vectorAdd(y, 1e-3);
|
|
599
|
+
|
|
600
|
+
if (options_.nla == kHipoNormalEqString) {
|
|
601
|
+
// use y to store b-A*x
|
|
602
|
+
model_.A().alphaProductPlusY(-1.0, x, y);
|
|
603
|
+
|
|
604
|
+
// solve A*A^T * dx = b-A*x with factorisation and store the result in
|
|
605
|
+
// temp_m
|
|
606
|
+
|
|
607
|
+
// factorise A*A^T
|
|
608
|
+
if (Int status = LS_->factorNE(empty_scaling)) {
|
|
609
|
+
logH_.printe("Error while factorising normal equations\n");
|
|
610
|
+
info_.status = (Status)status;
|
|
611
|
+
return true;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
if (Int status = LS_->solveNE(y, temp_m)) {
|
|
615
|
+
logH_.printe("Error while solving normal equations\n");
|
|
616
|
+
info_.status = (Status)status;
|
|
617
|
+
return true;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
} else if (options_.nla == kHipoAugmentedString) {
|
|
621
|
+
// obtain solution of A*A^T * dx = b-A*x by solving
|
|
622
|
+
// [ -I A^T] [...] = [ -x]
|
|
623
|
+
// [ A 0 ] [ dx] = [ b ]
|
|
624
|
+
|
|
625
|
+
if (Int status = LS_->factorAS(empty_scaling)) {
|
|
626
|
+
logH_.printe("Error while factorising augmented system\n");
|
|
627
|
+
info_.status = (Status)status;
|
|
628
|
+
return true;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
std::vector<double> rhs_x(n_);
|
|
632
|
+
for (Int i = 0; i < n_; ++i) rhs_x[i] = -x[i];
|
|
633
|
+
std::vector<double> lhs_x(n_);
|
|
634
|
+
if (Int status = LS_->solveAS(rhs_x, y, lhs_x, temp_m)) {
|
|
635
|
+
logH_.printe("Error while solving augmented system\n");
|
|
636
|
+
info_.status = (Status)status;
|
|
637
|
+
return true;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
// compute dx = A^T * (A*A^T)^{-1} * (b-A*x) and store the result in xl
|
|
642
|
+
xl.assign(n_, 0.0);
|
|
643
|
+
model_.A().alphaProductPlusY(1.0, temp_m, xl, true);
|
|
644
|
+
|
|
645
|
+
// x += dx;
|
|
646
|
+
vectorAdd(x, xl, 1.0);
|
|
647
|
+
// *********************************************************************
|
|
648
|
+
|
|
649
|
+
// *********************************************************************
|
|
650
|
+
// xl, xu starting point
|
|
651
|
+
// *********************************************************************
|
|
652
|
+
// compute xl, xu that satisfy linear constraints
|
|
653
|
+
{
|
|
654
|
+
double violation{};
|
|
655
|
+
for (Int i = 0; i < n_; ++i) {
|
|
656
|
+
if (model_.hasLb(i)) {
|
|
657
|
+
xl[i] = x[i] - model_.lb(i);
|
|
658
|
+
violation = std::min(violation, xl[i]);
|
|
659
|
+
} else {
|
|
660
|
+
xl[i] = 0.0;
|
|
661
|
+
}
|
|
662
|
+
if (model_.hasUb(i)) {
|
|
663
|
+
xu[i] = model_.ub(i) - x[i];
|
|
664
|
+
violation = std::min(violation, xu[i]);
|
|
665
|
+
} else {
|
|
666
|
+
xu[i] = 0.0;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
// shift to be positive
|
|
671
|
+
violation = 1.0 + std::max(0.0, -1.5 * violation);
|
|
672
|
+
vectorAdd(xl, violation);
|
|
673
|
+
vectorAdd(xu, violation);
|
|
674
|
+
}
|
|
675
|
+
// *********************************************************************
|
|
676
|
+
|
|
677
|
+
// *********************************************************************
|
|
678
|
+
// y starting point
|
|
679
|
+
// *********************************************************************
|
|
680
|
+
|
|
681
|
+
std::vector<double> cPlusQx = model_.c();
|
|
682
|
+
if (norm2(cPlusQx) < 1e-6) vectorAdd(cPlusQx, 1e-3);
|
|
683
|
+
if (model_.qp()) model_.Q().alphaProductPlusY(model_.sense(), x, cPlusQx);
|
|
684
|
+
|
|
685
|
+
double max_norm_x = std::max(infNorm(x), std::max(infNorm(xl), infNorm(xu)));
|
|
686
|
+
if (infNorm(cPlusQx) > max_norm_x * 1e3) cPlusQx = model_.c();
|
|
687
|
+
|
|
688
|
+
if (options_.nla == kHipoNormalEqString) {
|
|
689
|
+
// compute A*(c+Qx)
|
|
690
|
+
std::fill(temp_m.begin(), temp_m.end(), 0.0);
|
|
691
|
+
model_.A().alphaProductPlusY(1.0, cPlusQx, temp_m);
|
|
692
|
+
|
|
693
|
+
if (Int status = LS_->solveNE(temp_m, y)) {
|
|
694
|
+
logH_.printe("Error while solvingF normal equations\n");
|
|
695
|
+
info_.status = (Status)status;
|
|
696
|
+
return true;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
} else if (options_.nla == kHipoAugmentedString) {
|
|
700
|
+
// obtain solution of A*A^T * y = A*(c+Qx) by solving
|
|
701
|
+
// [ -I A^T] [...] = [ c+Qx ]
|
|
702
|
+
// [ A 0 ] [ y ] = [ 0 ]
|
|
703
|
+
|
|
704
|
+
std::vector<double> rhs_y(m_, 0.0);
|
|
705
|
+
std::vector<double> lhs_x(n_);
|
|
706
|
+
|
|
707
|
+
if (Int status = LS_->solveAS(cPlusQx, rhs_y, lhs_x, y)) {
|
|
708
|
+
logH_.printe("Error while solving augmented system\n");
|
|
709
|
+
info_.status = (Status)status;
|
|
710
|
+
return true;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
// *********************************************************************
|
|
714
|
+
|
|
715
|
+
// *********************************************************************
|
|
716
|
+
// zl, zu starting point
|
|
717
|
+
// *********************************************************************
|
|
718
|
+
// compute c + Q * x - A^T * y and store in zl
|
|
719
|
+
zl = cPlusQx;
|
|
720
|
+
model_.A().alphaProductPlusY(-1.0, y, zl, true);
|
|
721
|
+
|
|
722
|
+
// split result between zl and zu
|
|
723
|
+
{
|
|
724
|
+
double violation = 0.0;
|
|
725
|
+
for (Int i = 0; i < n_; ++i) {
|
|
726
|
+
double val = zl[i];
|
|
727
|
+
zl[i] = 0.0;
|
|
728
|
+
zu[i] = 0.0;
|
|
729
|
+
|
|
730
|
+
if (model_.hasLb(i) && model_.hasUb(i)) {
|
|
731
|
+
zl[i] = 0.5 * val;
|
|
732
|
+
zu[i] = -0.5 * val;
|
|
733
|
+
} else if (model_.hasLb(i)) {
|
|
734
|
+
zl[i] = val;
|
|
735
|
+
} else if (model_.hasUb(i)) {
|
|
736
|
+
zu[i] = -val;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
violation = std::min(violation, zl[i]);
|
|
740
|
+
violation = std::min(violation, zu[i]);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
// shift to be positive
|
|
744
|
+
|
|
745
|
+
violation = 1.0 + std::max(0.0, -1.5 * violation);
|
|
746
|
+
for (Int i = 0; i < n_; ++i) {
|
|
747
|
+
if (model_.hasLb(i)) {
|
|
748
|
+
zl[i] += violation;
|
|
749
|
+
}
|
|
750
|
+
if (model_.hasUb(i)) {
|
|
751
|
+
zu[i] += violation;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
// *********************************************************************
|
|
756
|
+
|
|
757
|
+
// *********************************************************************
|
|
758
|
+
// improve centrality
|
|
759
|
+
// *********************************************************************
|
|
760
|
+
{
|
|
761
|
+
double xsum{1.0};
|
|
762
|
+
double zsum{1.0};
|
|
763
|
+
double mu{1.0};
|
|
764
|
+
|
|
765
|
+
for (Int i = 0; i < n_; ++i) {
|
|
766
|
+
if (model_.hasLb(i)) {
|
|
767
|
+
xsum += xl[i];
|
|
768
|
+
zsum += zl[i];
|
|
769
|
+
mu += xl[i] * zl[i];
|
|
770
|
+
}
|
|
771
|
+
if (model_.hasUb(i)) {
|
|
772
|
+
xsum += xu[i];
|
|
773
|
+
zsum += zu[i];
|
|
774
|
+
mu += xu[i] * zu[i];
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
double dx = 0.5 * mu / zsum;
|
|
779
|
+
double dz = 0.5 * mu / xsum;
|
|
780
|
+
|
|
781
|
+
vectorAdd(xl, dx);
|
|
782
|
+
vectorAdd(xu, dx);
|
|
783
|
+
for (Int i = 0; i < n_; ++i) {
|
|
784
|
+
if (model_.hasLb(i)) {
|
|
785
|
+
zl[i] += dz;
|
|
786
|
+
}
|
|
787
|
+
if (model_.hasUb(i)) {
|
|
788
|
+
zu[i] += dz;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
// *********************************************************************
|
|
793
|
+
|
|
794
|
+
return false;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
void Solver::sigmaAffine() {
|
|
798
|
+
sigma_ = kSigmaAffine;
|
|
799
|
+
|
|
800
|
+
it_->data.back().sigma_aff = sigma_;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
void Solver::sigmaCorrectors() {
|
|
804
|
+
if ((alpha_primal_ > 0.5 && alpha_dual_ > 0.5) || iter_ == 1) {
|
|
805
|
+
sigma_ = 0.01;
|
|
806
|
+
} else if (alpha_primal_ > 0.2 && alpha_dual_ > 0.2) {
|
|
807
|
+
sigma_ = 0.1;
|
|
808
|
+
} else if (alpha_primal_ > 0.1 && alpha_dual_ > 0.1) {
|
|
809
|
+
sigma_ = 0.25;
|
|
810
|
+
} else if (alpha_primal_ > 0.05 && alpha_dual_ > 0.05) {
|
|
811
|
+
sigma_ = 0.5;
|
|
812
|
+
} else {
|
|
813
|
+
sigma_ = 0.9;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
it_->data.back().sigma = sigma_;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
void Solver::residualsMcc() {
|
|
820
|
+
// compute right-hand side for multiple centrality correctors
|
|
821
|
+
std::vector<double>& xl = it_->xl;
|
|
822
|
+
std::vector<double>& xu = it_->xu;
|
|
823
|
+
std::vector<double>& zl = it_->zl;
|
|
824
|
+
std::vector<double>& zu = it_->zu;
|
|
825
|
+
std::vector<double>& res5 = it_->res.r5;
|
|
826
|
+
std::vector<double>& res6 = it_->res.r6;
|
|
827
|
+
double& mu = it_->mu;
|
|
828
|
+
|
|
829
|
+
// clear existing residuals
|
|
830
|
+
it_->clearRes();
|
|
831
|
+
|
|
832
|
+
// stepsizes of current direction
|
|
833
|
+
double alpha_p, alpha_d;
|
|
834
|
+
stepsToBoundary(alpha_p, alpha_d, it_->delta);
|
|
835
|
+
|
|
836
|
+
// compute increased stepsizes
|
|
837
|
+
alpha_p = std::max(1.0, alpha_p + kMccIncreaseAlpha);
|
|
838
|
+
alpha_d = std::max(1.0, alpha_d + kMccIncreaseAlpha);
|
|
839
|
+
|
|
840
|
+
// compute trial point
|
|
841
|
+
std::vector<double> xlt = xl;
|
|
842
|
+
std::vector<double> xut = xu;
|
|
843
|
+
std::vector<double> zlt = zl;
|
|
844
|
+
std::vector<double> zut = zu;
|
|
845
|
+
vectorAdd(xlt, it_->delta.xl, alpha_p);
|
|
846
|
+
vectorAdd(xut, it_->delta.xu, alpha_p);
|
|
847
|
+
vectorAdd(zlt, it_->delta.zl, alpha_d);
|
|
848
|
+
vectorAdd(zut, it_->delta.zu, alpha_d);
|
|
849
|
+
|
|
850
|
+
// compute right-hand side for mcc
|
|
851
|
+
for (Int i = 0; i < n_; ++i) {
|
|
852
|
+
// res5
|
|
853
|
+
if (model_.hasLb(i)) {
|
|
854
|
+
double prod = xlt[i] * zlt[i];
|
|
855
|
+
if (prod < sigma_ * mu * kGammaCorrector) {
|
|
856
|
+
// prod is small, we add something positive to res5
|
|
857
|
+
|
|
858
|
+
double temp = sigma_ * mu * kGammaCorrector - prod;
|
|
859
|
+
res5[i] += temp;
|
|
860
|
+
|
|
861
|
+
} else if (prod > sigma_ * mu / kGammaCorrector) {
|
|
862
|
+
// prod is large, we may subtract something large from res5.
|
|
863
|
+
// limit the amount to subtract to -sigma*mu/gamma
|
|
864
|
+
|
|
865
|
+
double temp = sigma_ * mu / kGammaCorrector - prod;
|
|
866
|
+
temp = std::max(temp, -sigma_ * mu / kGammaCorrector);
|
|
867
|
+
res5[i] += temp;
|
|
868
|
+
}
|
|
869
|
+
} else {
|
|
870
|
+
res5[i] = 0.0;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
// res6
|
|
874
|
+
if (model_.hasUb(i)) {
|
|
875
|
+
double prod = xut[i] * zut[i];
|
|
876
|
+
if (prod < sigma_ * mu * kGammaCorrector) {
|
|
877
|
+
// prod is small, we add something positive to res6
|
|
878
|
+
|
|
879
|
+
double temp = sigma_ * mu * kGammaCorrector - prod;
|
|
880
|
+
res6[i] += temp;
|
|
881
|
+
|
|
882
|
+
} else if (prod > sigma_ * mu / kGammaCorrector) {
|
|
883
|
+
// prod is large, we may subtract something large from res6.
|
|
884
|
+
// limit the amount to subtract to -sigma*mu/gamma
|
|
885
|
+
|
|
886
|
+
double temp = sigma_ * mu / kGammaCorrector - prod;
|
|
887
|
+
temp = std::max(temp, -sigma_ * mu / kGammaCorrector);
|
|
888
|
+
res6[i] += temp;
|
|
889
|
+
}
|
|
890
|
+
} else {
|
|
891
|
+
res6[i] = 0.0;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
bool Solver::centralityCorrectors() {
|
|
897
|
+
// compute stepsizes of current direction
|
|
898
|
+
double alpha_p_old, alpha_d_old;
|
|
899
|
+
stepsToBoundary(alpha_p_old, alpha_d_old, it_->delta);
|
|
900
|
+
|
|
901
|
+
Int cor;
|
|
902
|
+
for (cor = 0; cor < info_.correctors; ++cor) {
|
|
903
|
+
// compute rhs for corrector
|
|
904
|
+
residualsMcc();
|
|
905
|
+
|
|
906
|
+
// compute corrector
|
|
907
|
+
NewtonDir corr(m_, n_);
|
|
908
|
+
if (solveNewtonSystem(corr)) return true;
|
|
909
|
+
|
|
910
|
+
double alpha_p, alpha_d;
|
|
911
|
+
double wp = alpha_p_old * alpha_d_old;
|
|
912
|
+
double wd = wp;
|
|
913
|
+
bestWeight(it_->delta, corr, wp, wd, alpha_p, alpha_d);
|
|
914
|
+
|
|
915
|
+
if (alpha_p < alpha_p_old + kMccIncreaseAlpha * kMccIncreaseMin &&
|
|
916
|
+
alpha_d < alpha_d_old + kMccIncreaseAlpha * kMccIncreaseMin) {
|
|
917
|
+
// reject corrector
|
|
918
|
+
break;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
if (alpha_p >= alpha_p_old + kMccIncreaseAlpha * kMccIncreaseMin) {
|
|
922
|
+
// accept primal corrector
|
|
923
|
+
vectorAdd(it_->delta.x, corr.x, wp);
|
|
924
|
+
vectorAdd(it_->delta.xl, corr.xl, wp);
|
|
925
|
+
vectorAdd(it_->delta.xu, corr.xu, wp);
|
|
926
|
+
alpha_p_old = alpha_p;
|
|
927
|
+
}
|
|
928
|
+
if (alpha_d >= alpha_d_old + kMccIncreaseAlpha * kMccIncreaseMin) {
|
|
929
|
+
// accept dual corrector
|
|
930
|
+
vectorAdd(it_->delta.y, corr.y, wd);
|
|
931
|
+
vectorAdd(it_->delta.zl, corr.zl, wd);
|
|
932
|
+
vectorAdd(it_->delta.zu, corr.zu, wd);
|
|
933
|
+
alpha_d_old = alpha_d;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
if (alpha_p > 0.95 && alpha_d > 0.95) {
|
|
937
|
+
// stepsizes are large enough, stop
|
|
938
|
+
++cor;
|
|
939
|
+
break;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
// else, keep computing correctors
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
it_->data.back().correctors = cor;
|
|
946
|
+
|
|
947
|
+
return false;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
void Solver::bestWeight(const NewtonDir& delta, const NewtonDir& corrector,
|
|
951
|
+
double& wp, double& wd, double& alpha_p,
|
|
952
|
+
double& alpha_d) const {
|
|
953
|
+
// Find the best primal and dual weights for the corrector in the interval
|
|
954
|
+
// [alpha_p_old * alpha_d_old, 1].
|
|
955
|
+
// Upon return, wp and wd are the optimal weights, alpha_p and alpha_d are the
|
|
956
|
+
// corresponding stepsizes.
|
|
957
|
+
|
|
958
|
+
// keep track of best stepsizes
|
|
959
|
+
alpha_p = 0.0;
|
|
960
|
+
alpha_d = 0.0;
|
|
961
|
+
|
|
962
|
+
// initial weight
|
|
963
|
+
double w = wp;
|
|
964
|
+
|
|
965
|
+
// divide interval into 9 points
|
|
966
|
+
const double step = (1.0 - w) / 8;
|
|
967
|
+
|
|
968
|
+
// for each weight, compute stepsizes and save best ones
|
|
969
|
+
for (; w <= 1.0; w += step) {
|
|
970
|
+
double ap, ad;
|
|
971
|
+
stepsToBoundary(ap, ad, delta, &corrector, w);
|
|
972
|
+
if (ap > alpha_p) {
|
|
973
|
+
alpha_p = ap;
|
|
974
|
+
wp = w;
|
|
975
|
+
}
|
|
976
|
+
if (ad > alpha_d) {
|
|
977
|
+
alpha_d = ad;
|
|
978
|
+
wd = w;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
if (step == 0.0) break;
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
bool Solver::checkIterate() {
|
|
986
|
+
// Check that iterate is not NaN or Inf
|
|
987
|
+
if (it_->isNan()) {
|
|
988
|
+
logH_.printDevInfo("\nIterate is nan\n");
|
|
989
|
+
info_.status = kStatusError;
|
|
990
|
+
return true;
|
|
991
|
+
} else if (it_->isInf()) {
|
|
992
|
+
logH_.printDevInfo("\nIterate is inf\n");
|
|
993
|
+
info_.status = kStatusError;
|
|
994
|
+
return true;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
// check that no component is negative
|
|
998
|
+
for (Int i = 0; i < n_; ++i) {
|
|
999
|
+
if ((model_.hasLb(i) && it_->xl[i] < 0) ||
|
|
1000
|
+
(model_.hasLb(i) && it_->zl[i] < 0) ||
|
|
1001
|
+
(model_.hasUb(i) && it_->xu[i] < 0) ||
|
|
1002
|
+
(model_.hasUb(i) && it_->zu[i] < 0)) {
|
|
1003
|
+
logH_.printDevInfo("\nIterate has negative component\n");
|
|
1004
|
+
return true;
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
return false;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
bool Solver::checkStagnation() {
|
|
1012
|
+
std::stringstream log_stream;
|
|
1013
|
+
bool stagnation = it_->stagnation(log_stream);
|
|
1014
|
+
logH_.printDevInfo(log_stream);
|
|
1015
|
+
return stagnation;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
bool Solver::checkBadIter() {
|
|
1019
|
+
bool terminate = false;
|
|
1020
|
+
bool stagnation = iter_ > 0 ? checkStagnation() : false;
|
|
1021
|
+
|
|
1022
|
+
// check for infeasibility
|
|
1023
|
+
bool mu_is_large =
|
|
1024
|
+
it_->best_mu > 0.0 ? it_->mu > it_->best_mu * kDivergeTol : false;
|
|
1025
|
+
bool pobj_is_very_large =
|
|
1026
|
+
it_->pobj <
|
|
1027
|
+
-std::max(std::abs(it_->dobj) * kDivergeTol * kDivergeTol, 1.0);
|
|
1028
|
+
bool dobj_is_very_large =
|
|
1029
|
+
it_->dobj >
|
|
1030
|
+
std::max(std::abs(it_->pobj) * kDivergeTol * kDivergeTol, 1.0);
|
|
1031
|
+
bool clearly_infeasible =
|
|
1032
|
+
iter_ > 5 && (pobj_is_very_large || dobj_is_very_large);
|
|
1033
|
+
|
|
1034
|
+
if (stagnation || mu_is_large || clearly_infeasible) {
|
|
1035
|
+
bool pobj_is_larger =
|
|
1036
|
+
it_->pobj < -std::max(std::abs(it_->dobj) * kDivergeTol, 1.0);
|
|
1037
|
+
bool dobj_is_larger =
|
|
1038
|
+
it_->dobj > std::max(std::abs(it_->pobj) * kDivergeTol, 1.0);
|
|
1039
|
+
|
|
1040
|
+
if (pobj_is_larger) {
|
|
1041
|
+
// problem is likely to be primal unbounded, i.e. dual infeasible
|
|
1042
|
+
logH_.print("=== Dual infeasible\n");
|
|
1043
|
+
info_.status = kStatusDualInfeasible;
|
|
1044
|
+
terminate = true;
|
|
1045
|
+
} else if (dobj_is_larger) {
|
|
1046
|
+
// problem is likely to be dual unbounded, i.e. primal infeasible
|
|
1047
|
+
logH_.print("=== Primal infeasible\n");
|
|
1048
|
+
info_.status = kStatusPrimalInfeasible;
|
|
1049
|
+
terminate = true;
|
|
1050
|
+
} else if (stagnation) {
|
|
1051
|
+
// stagnation detected, solution may still be good for highs kktCheck
|
|
1052
|
+
if (info_.status != kStatusPDFeas && checkTerminationKkt()) {
|
|
1053
|
+
logH_.printw(
|
|
1054
|
+
"HiPO stagnated but HiGHS considers the solution acceptable\n");
|
|
1055
|
+
logH_.print("=== Primal-dual feasible point found\n");
|
|
1056
|
+
info_.status = kStatusPDFeas;
|
|
1057
|
+
} else
|
|
1058
|
+
info_.status = kStatusNoProgress;
|
|
1059
|
+
terminate = true;
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
return terminate;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
bool Solver::checkTermination() {
|
|
1067
|
+
bool feasible = it_->pinf < options_.feasibility_tol &&
|
|
1068
|
+
it_->dinf < options_.feasibility_tol;
|
|
1069
|
+
bool optimal = it_->pdgap < options_.optimality_tol;
|
|
1070
|
+
|
|
1071
|
+
bool terminate = false;
|
|
1072
|
+
|
|
1073
|
+
if (feasible && optimal) {
|
|
1074
|
+
if (crossoverIsOn()) {
|
|
1075
|
+
if (info_.status != kStatusPDFeas)
|
|
1076
|
+
logH_.print("=== Primal-dual feasible point found\n");
|
|
1077
|
+
info_.status = kStatusPDFeas;
|
|
1078
|
+
bool ready_for_crossover =
|
|
1079
|
+
it_->infeasAfterDropping() < options_.crossover_tol;
|
|
1080
|
+
if (ready_for_crossover) {
|
|
1081
|
+
logH_.print("=== Ready for crossover\n");
|
|
1082
|
+
terminate = true;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
} else {
|
|
1086
|
+
terminate = model_.qp() ? true : checkTerminationKkt();
|
|
1087
|
+
if (terminate) {
|
|
1088
|
+
assert(info_.status != kStatusPDFeas);
|
|
1089
|
+
logH_.print("=== Primal-dual feasible point found\n");
|
|
1090
|
+
info_.status = kStatusPDFeas;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
return terminate;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
bool Solver::checkTerminationKkt() {
|
|
1099
|
+
assert(!model_.qp());
|
|
1100
|
+
|
|
1101
|
+
logH_.printDevInfo("Solution may be optimal, perform kktCheck\n");
|
|
1102
|
+
HighsModelStatus model_status = HighsModelStatus::kOptimal;
|
|
1103
|
+
HighsInfo highs_info;
|
|
1104
|
+
HighsSolution highs_solution;
|
|
1105
|
+
|
|
1106
|
+
// Allow kktCheck to print only in debug mode (this is a copy of highs
|
|
1107
|
+
// options, not the original)
|
|
1108
|
+
Hoptions_.output_flag = logH_.debug(2);
|
|
1109
|
+
|
|
1110
|
+
if (!model_.lpOrig()) return false;
|
|
1111
|
+
|
|
1112
|
+
getHipoNonVertexSolution(Hoptions_, *model_.lpOrig(), model_.n_orig(),
|
|
1113
|
+
model_.m_orig(), model_.rhsOrig(),
|
|
1114
|
+
model_.constraintsOrig(), *this, model_status,
|
|
1115
|
+
highs_solution);
|
|
1116
|
+
|
|
1117
|
+
lpNoBasisKktCheck(model_status, highs_info, *model_.lpOrig(), highs_solution,
|
|
1118
|
+
Hoptions_, "During HiPO solve");
|
|
1119
|
+
|
|
1120
|
+
if (model_status == HighsModelStatus::kOptimal) {
|
|
1121
|
+
logH_.printDevInfo("Check successfull\n");
|
|
1122
|
+
return true;
|
|
1123
|
+
} else
|
|
1124
|
+
logH_.printDevInfo("Check failed\n");
|
|
1125
|
+
|
|
1126
|
+
return false;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
bool Solver::checkInterrupt() {
|
|
1130
|
+
bool terminate = false;
|
|
1131
|
+
Int status = control_.interruptCheck(iter_);
|
|
1132
|
+
if (status) {
|
|
1133
|
+
info_.status = (Status)status;
|
|
1134
|
+
terminate = true;
|
|
1135
|
+
}
|
|
1136
|
+
return terminate;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
void Solver::printHeader() const {
|
|
1140
|
+
if (iter_ % 20 == 0) {
|
|
1141
|
+
std::stringstream log_stream;
|
|
1142
|
+
log_stream << " iter primal obj dual obj"
|
|
1143
|
+
<< " pinf dinf gap";
|
|
1144
|
+
|
|
1145
|
+
if (!options_.timeless_log) log_stream << " time";
|
|
1146
|
+
|
|
1147
|
+
if (logH_.debug(1)) {
|
|
1148
|
+
log_stream << " alpha p/d sigma af/co cor solv"
|
|
1149
|
+
<< " static reg p/d minT maxT"
|
|
1150
|
+
<< " (xj * zj / mu)_range_&_num max_res";
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
log_stream << "\n";
|
|
1154
|
+
logH_.print(log_stream);
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
void Solver::printOutput() const {
|
|
1159
|
+
printHeader();
|
|
1160
|
+
|
|
1161
|
+
std::stringstream log_stream;
|
|
1162
|
+
log_stream << integer(iter_, 5);
|
|
1163
|
+
log_stream << " " << sci(it_->pobj, 16, 8);
|
|
1164
|
+
log_stream << " " << sci(it_->dobj, 16, 8);
|
|
1165
|
+
log_stream << " " << sci(it_->pinf, 10, 2);
|
|
1166
|
+
log_stream << " " << sci(it_->dinf, 10, 2);
|
|
1167
|
+
log_stream << " " << sci(it_->pdgap, 9, 2);
|
|
1168
|
+
if (!options_.timeless_log)
|
|
1169
|
+
log_stream << " " << fix(control_.elapsed(), 7, 1);
|
|
1170
|
+
|
|
1171
|
+
if (logH_.debug(1)) {
|
|
1172
|
+
const IpmIterData& data = it_->data.back();
|
|
1173
|
+
|
|
1174
|
+
log_stream << " " << fix(alpha_primal_, 6, 2);
|
|
1175
|
+
log_stream << " " << fix(alpha_dual_, 6, 2);
|
|
1176
|
+
log_stream << " " << fix(data.sigma_aff, 6, 2);
|
|
1177
|
+
log_stream << " " << fix(data.sigma, 6, 2);
|
|
1178
|
+
log_stream << " " << integer(data.correctors, 5);
|
|
1179
|
+
log_stream << " " << integer(data.num_solves, 5);
|
|
1180
|
+
log_stream << " " << sci(regul_.primal, 8, 1);
|
|
1181
|
+
log_stream << " " << sci(regul_.dual, 8, 1);
|
|
1182
|
+
log_stream << " " << sci(data.min_theta, 8, 1);
|
|
1183
|
+
log_stream << " " << sci(data.max_theta, 8, 1);
|
|
1184
|
+
log_stream << " " << sci(data.min_prod, 8, 1);
|
|
1185
|
+
log_stream << " " << sci(data.max_prod, 8, 1);
|
|
1186
|
+
log_stream << " " << integer(data.num_small_prod, 4);
|
|
1187
|
+
log_stream << " " << integer(data.num_large_prod, 4);
|
|
1188
|
+
log_stream << " " << sci(data.omega, 9, 1);
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
log_stream << "\n";
|
|
1192
|
+
logH_.print(log_stream);
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
void Solver::printInfo() const {
|
|
1196
|
+
std::stringstream log_stream;
|
|
1197
|
+
log_stream << "\nRunning HiPO\n";
|
|
1198
|
+
|
|
1199
|
+
// Print number of threads
|
|
1200
|
+
if (options_.parallel == kHighsOffString)
|
|
1201
|
+
log_stream << textline("Threads:") << 1 << '\n';
|
|
1202
|
+
else
|
|
1203
|
+
log_stream << textline("Threads:") << highs::parallel::num_threads()
|
|
1204
|
+
<< '\n';
|
|
1205
|
+
|
|
1206
|
+
logH_.print(log_stream);
|
|
1207
|
+
|
|
1208
|
+
// print information about model
|
|
1209
|
+
model_.print(logH_);
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
void Solver::printSummary() const {
|
|
1213
|
+
std::stringstream log_stream;
|
|
1214
|
+
|
|
1215
|
+
log_stream << "\nSummary\n";
|
|
1216
|
+
if (!options_.timeless_log)
|
|
1217
|
+
log_stream << textline("HiPO runtime:")
|
|
1218
|
+
<< fix(control_.elapsed() - start_time_, 0, 2) << "\n";
|
|
1219
|
+
|
|
1220
|
+
log_stream << textline("Status:") << statusString(info_.status) << "\n";
|
|
1221
|
+
log_stream << textline("HiPO iterations:") << integer(iter_) << "\n";
|
|
1222
|
+
if (info_.ipx_used)
|
|
1223
|
+
log_stream << textline("IPX iterations:") << integer(info_.ipx_info.iter)
|
|
1224
|
+
<< "\n";
|
|
1225
|
+
|
|
1226
|
+
if (logH_.debug(1)) {
|
|
1227
|
+
log_stream << textline("Correctors:") << integer(info_.correctors) << '\n';
|
|
1228
|
+
log_stream << textline("Factorisations:") << integer(info_.factor_number)
|
|
1229
|
+
<< '\n';
|
|
1230
|
+
log_stream << textline("Solves:") << integer(info_.solve_number) << '\n';
|
|
1231
|
+
|
|
1232
|
+
if (!options_.timeless_log) {
|
|
1233
|
+
log_stream << textline("Analyse AS time:")
|
|
1234
|
+
<< fix(info_.analyse_AS_time, 0, 2) << '\n';
|
|
1235
|
+
log_stream << textline("Analyse NE time:")
|
|
1236
|
+
<< fix(info_.analyse_NE_time, 0, 2) << '\n';
|
|
1237
|
+
log_stream << textline("Matrix time:") << fix(info_.matrix_time, 0, 2)
|
|
1238
|
+
<< '\n';
|
|
1239
|
+
log_stream << textline("AS structure time:")
|
|
1240
|
+
<< fix(info_.AS_structure_time, 0, 2) << '\n';
|
|
1241
|
+
log_stream << textline("NE structure time:")
|
|
1242
|
+
<< fix(info_.NE_structure_time, 0, 2) << '\n';
|
|
1243
|
+
log_stream << textline("Factorisation time:")
|
|
1244
|
+
<< fix(info_.factor_time, 0, 2) << '\n';
|
|
1245
|
+
log_stream << textline("Solve time:") << fix(info_.solve_time, 0, 2)
|
|
1246
|
+
<< '\n';
|
|
1247
|
+
log_stream << textline("Residual time:") << fix(info_.residual_time, 0, 2)
|
|
1248
|
+
<< '\n';
|
|
1249
|
+
log_stream << textline("Omega time:") << fix(info_.omega_time, 0, 2)
|
|
1250
|
+
<< '\n';
|
|
1251
|
+
log_stream << textline("Avg time per factorisation:")
|
|
1252
|
+
<< sci(info_.factor_time / info_.factor_number, 0, 2) << '\n';
|
|
1253
|
+
log_stream << textline("Avg time per solve:")
|
|
1254
|
+
<< sci(info_.solve_time / info_.solve_number, 0, 2) << '\n';
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
logH_.print(log_stream);
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
void Solver::getOriginalDims(Int& num_row, Int& num_col) const {
|
|
1262
|
+
num_row = model_.m_orig();
|
|
1263
|
+
num_col = model_.n_orig();
|
|
1264
|
+
}
|
|
1265
|
+
const Info& Solver::getInfo() const { return info_; }
|
|
1266
|
+
void Solver::getInteriorSolution(
|
|
1267
|
+
std::vector<double>& x, std::vector<double>& xl, std::vector<double>& xu,
|
|
1268
|
+
std::vector<double>& slack, std::vector<double>& y, std::vector<double>& zl,
|
|
1269
|
+
std::vector<double>& zu) const {
|
|
1270
|
+
// prepare and return solution with internal format
|
|
1271
|
+
|
|
1272
|
+
if (!info_.ipx_used) {
|
|
1273
|
+
model_.postprocess(x, xl, xu, slack, y, zl, zu, *it_);
|
|
1274
|
+
} else {
|
|
1275
|
+
ipx_lps_.GetInteriorSolution(x.data(), xl.data(), xu.data(), slack.data(),
|
|
1276
|
+
y.data(), zl.data(), zu.data());
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
Int Solver::getBasicSolution(std::vector<double>& x, std::vector<double>& slack,
|
|
1281
|
+
std::vector<double>& y, std::vector<double>& z,
|
|
1282
|
+
Int* cbasis, Int* vbasis) const {
|
|
1283
|
+
// interface to ipx getBasicSolution
|
|
1284
|
+
return ipx_lps_.GetBasicSolution(x.data(), slack.data(), y.data(), z.data(),
|
|
1285
|
+
cbasis, vbasis);
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
void Solver::maxCorrectors() {
|
|
1289
|
+
if (kMaxCorrectors > 0) {
|
|
1290
|
+
// Compute estimate of effort to factorise and solve
|
|
1291
|
+
|
|
1292
|
+
// Effort to factorise depends on the number of flops
|
|
1293
|
+
double fact_effort = LS_->flops() + 100 * LS_->spops();
|
|
1294
|
+
|
|
1295
|
+
// Effort to solve depends on the number of nonzeros of L multiplied by 2,
|
|
1296
|
+
// because there are two sweeps through L (forward and backward).
|
|
1297
|
+
double solv_effort = 2.0 * LS_->nz();
|
|
1298
|
+
|
|
1299
|
+
// The factorise phase uses BLAS-3 and can be parallelised, the solve phase
|
|
1300
|
+
// uses BLAS-2 and cannot be parallelised. To account for this, the
|
|
1301
|
+
// factorisation effort is multiplied by a coefficient < 1, estimated
|
|
1302
|
+
// empirically.
|
|
1303
|
+
double alpha = 1.0 / 112.0;
|
|
1304
|
+
|
|
1305
|
+
double ratio = alpha * fact_effort / solv_effort;
|
|
1306
|
+
|
|
1307
|
+
// At each ipm iteration, there are up to (1+k) directions computed, where k
|
|
1308
|
+
// is the number of correctors. Each direction requires up (1+f) solves,
|
|
1309
|
+
// where f is the number of refinement steps. So, up to (1+k)(1+f) solves
|
|
1310
|
+
// are performed per iteration. However, not all refinement steps are used
|
|
1311
|
+
// all the time, so use f/2.
|
|
1312
|
+
// Therefore, we want (1+k)(1+f/2) < ratio.
|
|
1313
|
+
|
|
1314
|
+
double thresh = ratio / (1.0 + kMaxIterRefine / 2.0) - 1;
|
|
1315
|
+
|
|
1316
|
+
info_.correctors = std::floor(thresh);
|
|
1317
|
+
info_.correctors = std::max(info_.correctors, (Int)1);
|
|
1318
|
+
info_.correctors = std::min(info_.correctors, kMaxCorrectors);
|
|
1319
|
+
|
|
1320
|
+
} else {
|
|
1321
|
+
info_.correctors = -kMaxCorrectors;
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
bool Solver::statusIsSolved() const { return info_.status >= kStatusSolved; }
|
|
1326
|
+
bool Solver::statusIsStopped() const { return info_.status < kStatusFailed; }
|
|
1327
|
+
bool Solver::statusIsFailed() const {
|
|
1328
|
+
return info_.status >= kStatusFailed && info_.status < kStatusSolved;
|
|
1329
|
+
}
|
|
1330
|
+
bool Solver::statusAllowsCrossover() const {
|
|
1331
|
+
return info_.status >= kStatusPDFeas;
|
|
1332
|
+
}
|
|
1333
|
+
bool Solver::statusNeedsRefinement() const {
|
|
1334
|
+
return info_.status == kStatusNoProgress || info_.status == kStatusImprecise;
|
|
1335
|
+
}
|
|
1336
|
+
bool Solver::refinementIsOn() const {
|
|
1337
|
+
return options_.refine_with_ipx && !model_.qp();
|
|
1338
|
+
}
|
|
1339
|
+
bool Solver::crossoverIsOn() const {
|
|
1340
|
+
return options_.crossover == kHighsOnString && !model_.qp();
|
|
1341
|
+
}
|
|
1342
|
+
bool Solver::solved() const { return statusIsSolved(); }
|
|
1343
|
+
bool Solver::stopped() const { return statusIsStopped(); }
|
|
1344
|
+
bool Solver::failed() const { return statusIsFailed(); }
|
|
1345
|
+
|
|
1346
|
+
} // namespace hipo
|