lpsolver 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +104 -26
- data/ext/lpsolver/Makefile +269 -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 +35 -7
- data/lib/lpsolver/native.so +0 -0
- data/lib/lpsolver/native_model.rb +261 -0
- data/lib/lpsolver/solution.rb +93 -8
- data/lib/lpsolver/version.rb +1 -1
- data/lpsolver.gemspec +4 -1
- metadata +1176 -4
|
@@ -0,0 +1,1345 @@
|
|
|
1
|
+
#include <algorithm>
|
|
2
|
+
#include <cstdio>
|
|
3
|
+
|
|
4
|
+
#include "HCheckConfig.h"
|
|
5
|
+
#include "Highs.h"
|
|
6
|
+
#include "catch.hpp"
|
|
7
|
+
#include "io/FilereaderLp.h"
|
|
8
|
+
|
|
9
|
+
const bool dev_run = false;
|
|
10
|
+
const double inf = kHighsInf;
|
|
11
|
+
const double double_equal_tolerance = 1e-5;
|
|
12
|
+
|
|
13
|
+
const std::vector<std::string> solvers{kQpAsmString
|
|
14
|
+
#ifdef HIPO
|
|
15
|
+
,
|
|
16
|
+
kHipoString
|
|
17
|
+
#endif
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
HighsModelStatus unboundedStatus(const std::string& solver) {
|
|
21
|
+
return solver == kQpAsmString ? HighsModelStatus::kUnbounded
|
|
22
|
+
: HighsModelStatus::kUnboundedOrInfeasible;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
bool okValueDifference(const double& v_test, const double& v_true) {
|
|
26
|
+
double difference = fabs(v_test - v_true) / std::max(1.0, fabs(v_true));
|
|
27
|
+
return difference < double_equal_tolerance;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
void testPrimalDualObjective(Highs& h,
|
|
31
|
+
const double required_objective_function_value) {
|
|
32
|
+
const HighsInfo& info = h.getInfo();
|
|
33
|
+
double objective_function_value = info.objective_function_value;
|
|
34
|
+
const HighsSolution& solution = h.getSolution();
|
|
35
|
+
double alt_objective_function_value =
|
|
36
|
+
h.getModel().objectiveValue(solution.col_value);
|
|
37
|
+
double dual_objective_function_value;
|
|
38
|
+
REQUIRE(h.getDualObjectiveValue(dual_objective_function_value) ==
|
|
39
|
+
HighsStatus::kOk);
|
|
40
|
+
double alt_objective_function_value_error =
|
|
41
|
+
fabs(objective_function_value - alt_objective_function_value);
|
|
42
|
+
if (dev_run)
|
|
43
|
+
printf(
|
|
44
|
+
"(Primal, Alt, Dual) objective = (%17.10g, %17.10g, %17.10g) alt error "
|
|
45
|
+
"= %17.10g; P-D error = %17.10g\n",
|
|
46
|
+
objective_function_value, alt_objective_function_value,
|
|
47
|
+
dual_objective_function_value, alt_objective_function_value_error,
|
|
48
|
+
info.primal_dual_objective_error);
|
|
49
|
+
REQUIRE(okValueDifference(objective_function_value,
|
|
50
|
+
required_objective_function_value));
|
|
51
|
+
REQUIRE(okValueDifference(dual_objective_function_value,
|
|
52
|
+
required_objective_function_value));
|
|
53
|
+
REQUIRE(okValueDifference(alt_objective_function_value,
|
|
54
|
+
required_objective_function_value));
|
|
55
|
+
double optimality_tolerance;
|
|
56
|
+
h.getOptionValue("optimality_tolerance", optimality_tolerance);
|
|
57
|
+
REQUIRE(fabs(info.primal_dual_objective_error) < optimality_tolerance);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
TEST_CASE("qp-unbounded", "[qpsolver]") {
|
|
61
|
+
std::string filename;
|
|
62
|
+
filename = std::string(HIGHS_DIR) + "/check/instances/qpunbounded.lp";
|
|
63
|
+
|
|
64
|
+
Highs highs;
|
|
65
|
+
highs.setOptionValue("output_flag", dev_run);
|
|
66
|
+
REQUIRE(highs.readModel(filename) == HighsStatus::kOk);
|
|
67
|
+
|
|
68
|
+
for (auto& solver : solvers) {
|
|
69
|
+
highs.setOptionValue("solver", solver);
|
|
70
|
+
REQUIRE(highs.run() == HighsStatus::kOk);
|
|
71
|
+
REQUIRE(highs.getModelStatus() == unboundedStatus(solver));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
highs.resetGlobalScheduler(true);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
TEST_CASE("qp-infeasible", "[qpsolver]") {
|
|
78
|
+
std::string filename;
|
|
79
|
+
filename = std::string(HIGHS_DIR) + "/check/instances/qpinfeasible.lp";
|
|
80
|
+
|
|
81
|
+
Highs highs;
|
|
82
|
+
highs.setOptionValue("output_flag", dev_run);
|
|
83
|
+
REQUIRE(highs.readModel(filename) == HighsStatus::kOk);
|
|
84
|
+
|
|
85
|
+
for (auto& solver : solvers) {
|
|
86
|
+
highs.setOptionValue("solver", solver);
|
|
87
|
+
REQUIRE(highs.run() == HighsStatus::kOk);
|
|
88
|
+
REQUIRE(highs.getModelStatus() == HighsModelStatus::kInfeasible);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
highs.resetGlobalScheduler(true);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
TEST_CASE("qpsolver", "[qpsolver]") {
|
|
95
|
+
const std::string test_name = Catch::getResultCapture().getCurrentTestName();
|
|
96
|
+
double required_objective_function_value;
|
|
97
|
+
double required_x0;
|
|
98
|
+
double required_x1;
|
|
99
|
+
double required_x2;
|
|
100
|
+
std::string filename;
|
|
101
|
+
|
|
102
|
+
const double required_col_dual0 = 0;
|
|
103
|
+
const double required_col_dual1 = 0;
|
|
104
|
+
const double required_row_dual0 = 0.8;
|
|
105
|
+
const double required_row_dual1 = 0;
|
|
106
|
+
|
|
107
|
+
// At the optimal solution g-Qx = [0.8, -1.6] with only constraint 0
|
|
108
|
+
// active. It has normal [1, -2], so dual of 0.8 is correct
|
|
109
|
+
|
|
110
|
+
Highs highs;
|
|
111
|
+
highs.setOptionValue("output_flag", dev_run);
|
|
112
|
+
|
|
113
|
+
for (auto& solver : solvers) {
|
|
114
|
+
highs.setOptionValue("solver", solver);
|
|
115
|
+
const HighsInfo& info = highs.getInfo();
|
|
116
|
+
const HighsSolution& solution = highs.getSolution();
|
|
117
|
+
const double& objective_function_value = info.objective_function_value;
|
|
118
|
+
|
|
119
|
+
filename = std::string(HIGHS_DIR) + "/check/instances/qptestnw.lp";
|
|
120
|
+
required_objective_function_value = -6.45;
|
|
121
|
+
required_x0 = 1.4;
|
|
122
|
+
required_x1 = 1.7;
|
|
123
|
+
|
|
124
|
+
HighsStatus return_status = highs.readModel(filename);
|
|
125
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
126
|
+
|
|
127
|
+
// Zero the QP regularization so "true" solution is obtained
|
|
128
|
+
REQUIRE(highs.setOptionValue("qp_regularization_value", 0) ==
|
|
129
|
+
HighsStatus::kOk);
|
|
130
|
+
|
|
131
|
+
return_status = highs.run();
|
|
132
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
133
|
+
|
|
134
|
+
testPrimalDualObjective(highs, required_objective_function_value);
|
|
135
|
+
|
|
136
|
+
REQUIRE(fabs(solution.col_value[0] - required_x0) < double_equal_tolerance);
|
|
137
|
+
REQUIRE(fabs(solution.col_value[1] - required_x1) < double_equal_tolerance);
|
|
138
|
+
|
|
139
|
+
REQUIRE(fabs(solution.col_dual[0] - required_col_dual0) <
|
|
140
|
+
double_equal_tolerance);
|
|
141
|
+
REQUIRE(fabs(solution.col_dual[1] - required_col_dual1) <
|
|
142
|
+
double_equal_tolerance);
|
|
143
|
+
REQUIRE(fabs(solution.row_dual[0] - required_row_dual0) <
|
|
144
|
+
double_equal_tolerance);
|
|
145
|
+
REQUIRE(fabs(solution.row_dual[1] - required_row_dual1) <
|
|
146
|
+
double_equal_tolerance);
|
|
147
|
+
REQUIRE(fabs(solution.row_dual[1] - required_row_dual1) <
|
|
148
|
+
double_equal_tolerance);
|
|
149
|
+
|
|
150
|
+
if (dev_run) highs.writeSolution("", 1);
|
|
151
|
+
|
|
152
|
+
// Check with qjh.mps
|
|
153
|
+
filename = std::string(HIGHS_DIR) + "/check/instances/qjh.mps";
|
|
154
|
+
required_objective_function_value = -5.25;
|
|
155
|
+
required_x0 = 0.5;
|
|
156
|
+
required_x1 = 5.0;
|
|
157
|
+
required_x2 = 1.5;
|
|
158
|
+
|
|
159
|
+
return_status = highs.readModel(filename);
|
|
160
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
161
|
+
|
|
162
|
+
// Zero the QP regularization so "true" solution is obtained
|
|
163
|
+
REQUIRE(highs.setOptionValue("qp_regularization_value", 0) ==
|
|
164
|
+
HighsStatus::kOk);
|
|
165
|
+
|
|
166
|
+
return_status = highs.run();
|
|
167
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
168
|
+
|
|
169
|
+
if (dev_run) printf("Objective = %g\n", objective_function_value);
|
|
170
|
+
|
|
171
|
+
testPrimalDualObjective(highs, required_objective_function_value);
|
|
172
|
+
|
|
173
|
+
REQUIRE(fabs(solution.col_value[0] - required_x0) < double_equal_tolerance);
|
|
174
|
+
REQUIRE(fabs(solution.col_value[1] - required_x1) < double_equal_tolerance);
|
|
175
|
+
REQUIRE(fabs(solution.col_value[2] - required_x2) < double_equal_tolerance);
|
|
176
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
177
|
+
|
|
178
|
+
// Test writeModel by writing out qjh.mps...
|
|
179
|
+
filename = test_name + ".mps";
|
|
180
|
+
highs.writeModel(filename);
|
|
181
|
+
|
|
182
|
+
// ... and reading it in again
|
|
183
|
+
return_status = highs.readModel(filename);
|
|
184
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
185
|
+
|
|
186
|
+
return_status = highs.run();
|
|
187
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
188
|
+
|
|
189
|
+
if (dev_run) printf("Objective = %g\n", objective_function_value);
|
|
190
|
+
|
|
191
|
+
testPrimalDualObjective(highs, required_objective_function_value);
|
|
192
|
+
|
|
193
|
+
REQUIRE(fabs(solution.col_value[0] - required_x0) < double_equal_tolerance);
|
|
194
|
+
REQUIRE(fabs(solution.col_value[1] - required_x1) < double_equal_tolerance);
|
|
195
|
+
REQUIRE(fabs(solution.col_value[2] - required_x2) < double_equal_tolerance);
|
|
196
|
+
std::remove(filename.c_str());
|
|
197
|
+
|
|
198
|
+
// Test that attempting to solve MIQP yields error
|
|
199
|
+
highs.setOptionValue("solve_relaxation", false);
|
|
200
|
+
HighsInt num_col = highs.getNumCol();
|
|
201
|
+
std::vector<HighsVarType> integrality;
|
|
202
|
+
integrality.assign(num_col, HighsVarType::kInteger);
|
|
203
|
+
REQUIRE(highs.changeColsIntegrality(0, num_col - 1, integrality.data()) ==
|
|
204
|
+
HighsStatus::kOk);
|
|
205
|
+
return_status = highs.run();
|
|
206
|
+
REQUIRE(return_status == HighsStatus::kError);
|
|
207
|
+
|
|
208
|
+
// Test that attempting to solve MIQP relaxation is OK
|
|
209
|
+
highs.setOptionValue("solve_relaxation", true);
|
|
210
|
+
return_status = highs.run();
|
|
211
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
highs.resetGlobalScheduler(true);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
TEST_CASE("test-qod", "[qpsolver]") {
|
|
218
|
+
HighsStatus return_status;
|
|
219
|
+
HighsModelStatus model_status;
|
|
220
|
+
double required_objective_function_value;
|
|
221
|
+
double required_x0;
|
|
222
|
+
double required_x1;
|
|
223
|
+
|
|
224
|
+
Highs highs;
|
|
225
|
+
|
|
226
|
+
for (auto& solver : solvers) {
|
|
227
|
+
HighsModel local_model;
|
|
228
|
+
HighsLp& lp = local_model.lp_;
|
|
229
|
+
HighsHessian& hessian = local_model.hessian_;
|
|
230
|
+
|
|
231
|
+
// Oscar's edge case
|
|
232
|
+
//
|
|
233
|
+
// min 1/4 + x^2 + x = 1/4 + x(x + 1)
|
|
234
|
+
//
|
|
235
|
+
// x* = -1/2; f* = 0
|
|
236
|
+
|
|
237
|
+
lp.model_name_ = "qod";
|
|
238
|
+
lp.num_col_ = 1;
|
|
239
|
+
lp.num_row_ = 0;
|
|
240
|
+
lp.col_cost_ = {1.0};
|
|
241
|
+
lp.col_lower_ = {-inf};
|
|
242
|
+
lp.col_upper_ = {inf};
|
|
243
|
+
lp.sense_ = ObjSense::kMinimize;
|
|
244
|
+
lp.offset_ = 0.25;
|
|
245
|
+
hessian.dim_ = lp.num_col_;
|
|
246
|
+
hessian.start_ = {0, 1};
|
|
247
|
+
hessian.index_ = {0};
|
|
248
|
+
hessian.value_ = {2.0};
|
|
249
|
+
|
|
250
|
+
highs.setOptionValue("output_flag", dev_run);
|
|
251
|
+
const HighsInfo& info = highs.getInfo();
|
|
252
|
+
const HighsSolution& solution = highs.getSolution();
|
|
253
|
+
const double& objective_function_value = info.objective_function_value;
|
|
254
|
+
|
|
255
|
+
return_status = highs.passModel(local_model);
|
|
256
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
257
|
+
if (dev_run) highs.writeModel("");
|
|
258
|
+
// Zero the QP regularization so "true" solution is obtained
|
|
259
|
+
REQUIRE(highs.setOptionValue("qp_regularization_value", 0) ==
|
|
260
|
+
HighsStatus::kOk);
|
|
261
|
+
|
|
262
|
+
highs.setOptionValue("solver", solver);
|
|
263
|
+
return_status = highs.run();
|
|
264
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
265
|
+
|
|
266
|
+
if (dev_run) {
|
|
267
|
+
printf("\nOne variable unconstrained QP: objective = %g; solution:\n",
|
|
268
|
+
objective_function_value);
|
|
269
|
+
highs.writeSolution("", kSolutionStylePretty);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
required_objective_function_value = 0;
|
|
273
|
+
required_x0 = -0.5;
|
|
274
|
+
|
|
275
|
+
testPrimalDualObjective(highs, required_objective_function_value);
|
|
276
|
+
|
|
277
|
+
REQUIRE(fabs(solution.col_value[0] - required_x0) < double_equal_tolerance);
|
|
278
|
+
|
|
279
|
+
// Add a variable x1 with objective x1^2 - x1
|
|
280
|
+
//
|
|
281
|
+
// Add the variable
|
|
282
|
+
highs.addCol(-1, -inf, inf, 0, NULL, NULL);
|
|
283
|
+
if (dev_run) highs.writeModel("");
|
|
284
|
+
|
|
285
|
+
// Can solve the model before the Hessian has been replaced
|
|
286
|
+
if (dev_run)
|
|
287
|
+
printf(
|
|
288
|
+
"\nTwo variable unconstrained QP with semi-definite Hessian - is "
|
|
289
|
+
"unbounded\n");
|
|
290
|
+
// Reinstate the QP regularization since the Hessian is only semi-definite
|
|
291
|
+
REQUIRE(highs.setOptionValue("qp_regularization_value",
|
|
292
|
+
kHessianRegularizationValue) ==
|
|
293
|
+
HighsStatus::kOk);
|
|
294
|
+
return_status = highs.run();
|
|
295
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
296
|
+
|
|
297
|
+
model_status = highs.getModelStatus();
|
|
298
|
+
REQUIRE(model_status == unboundedStatus(solver));
|
|
299
|
+
|
|
300
|
+
// Pass the new Hessian
|
|
301
|
+
hessian.dim_ = 2;
|
|
302
|
+
hessian.start_ = {0, 1, 2};
|
|
303
|
+
hessian.index_ = {0, 1};
|
|
304
|
+
hessian.value_ = {2.0, 2.0};
|
|
305
|
+
return_status = highs.passHessian(hessian);
|
|
306
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
307
|
+
|
|
308
|
+
// Zero the QP regularization so "true" solution is obtained
|
|
309
|
+
REQUIRE(highs.setOptionValue("qp_regularization_value", 0) ==
|
|
310
|
+
HighsStatus::kOk);
|
|
311
|
+
return_status = highs.run();
|
|
312
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
313
|
+
|
|
314
|
+
if (dev_run) {
|
|
315
|
+
printf("Two variable unconstrained QP: objective = %g; solution:\n",
|
|
316
|
+
objective_function_value);
|
|
317
|
+
highs.writeSolution("", kSolutionStylePretty);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
required_objective_function_value = -0.25;
|
|
321
|
+
required_x1 = 0.5;
|
|
322
|
+
|
|
323
|
+
testPrimalDualObjective(highs, required_objective_function_value);
|
|
324
|
+
|
|
325
|
+
REQUIRE(fabs(solution.col_value[0] - required_x0) < double_equal_tolerance);
|
|
326
|
+
REQUIRE(fabs(solution.col_value[1] - required_x1) < double_equal_tolerance);
|
|
327
|
+
|
|
328
|
+
// Illustrate methods for getting and changing the offset by getting
|
|
329
|
+
// the current offset, shifting it by the current objective and
|
|
330
|
+
// checking that the objective value is changed accordingly
|
|
331
|
+
|
|
332
|
+
double offset;
|
|
333
|
+
return_status = highs.getObjectiveOffset(offset);
|
|
334
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
335
|
+
double dl_offset = -objective_function_value;
|
|
336
|
+
offset += dl_offset;
|
|
337
|
+
return_status = highs.changeObjectiveOffset(offset);
|
|
338
|
+
required_objective_function_value += dl_offset;
|
|
339
|
+
REQUIRE(fabs(objective_function_value - required_objective_function_value) <
|
|
340
|
+
double_equal_tolerance);
|
|
341
|
+
|
|
342
|
+
// Add the constraint 0.5 <= x0 + x1
|
|
343
|
+
lp.a_matrix_.index_ = {0, 1};
|
|
344
|
+
lp.a_matrix_.value_ = {1, 1};
|
|
345
|
+
highs.addRow(0.5, inf, 2, lp.a_matrix_.index_.data(),
|
|
346
|
+
lp.a_matrix_.value_.data());
|
|
347
|
+
if (dev_run) highs.writeModel("");
|
|
348
|
+
return_status = highs.run();
|
|
349
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
350
|
+
|
|
351
|
+
if (dev_run) {
|
|
352
|
+
printf("Two variable constrained QP: objective = %g; solution:\n",
|
|
353
|
+
objective_function_value);
|
|
354
|
+
highs.writeSolution("", kSolutionStylePretty);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
required_objective_function_value = 0.125;
|
|
358
|
+
required_x0 = -0.25;
|
|
359
|
+
required_x1 = 0.75;
|
|
360
|
+
|
|
361
|
+
testPrimalDualObjective(highs, required_objective_function_value);
|
|
362
|
+
|
|
363
|
+
REQUIRE(fabs(solution.col_value[0] - required_x0) < double_equal_tolerance);
|
|
364
|
+
REQUIRE(fabs(solution.col_value[1] - required_x1) < double_equal_tolerance);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
highs.resetGlobalScheduler(true);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
TEST_CASE("test-qjh", "[qpsolver]") {
|
|
371
|
+
// Test passing/reading and solving the problem qjh
|
|
372
|
+
//
|
|
373
|
+
// minimize -x_2 - 3x_3 + (1/2)(2x_1^2 - 2x_1x_3 + 0.2x_2^2 + 2x_3^2)
|
|
374
|
+
//
|
|
375
|
+
// subject to x_1 + x_3 <= 2; x>=0
|
|
376
|
+
HighsStatus return_status;
|
|
377
|
+
HighsModelStatus model_status;
|
|
378
|
+
double required_objective_function_value;
|
|
379
|
+
|
|
380
|
+
Highs highs;
|
|
381
|
+
|
|
382
|
+
for (auto& solver : solvers) {
|
|
383
|
+
HighsModel local_model;
|
|
384
|
+
HighsLp& lp = local_model.lp_;
|
|
385
|
+
HighsHessian& hessian = local_model.hessian_;
|
|
386
|
+
// Start with an unconstrained QP
|
|
387
|
+
lp.model_name_ = "qjh";
|
|
388
|
+
lp.num_col_ = 3;
|
|
389
|
+
lp.num_row_ = 0;
|
|
390
|
+
lp.col_cost_ = {0.0, -1.0, -3.0};
|
|
391
|
+
lp.col_lower_ = {-inf, -inf, -inf};
|
|
392
|
+
lp.col_upper_ = {inf, inf, inf};
|
|
393
|
+
lp.sense_ = ObjSense::kMinimize;
|
|
394
|
+
lp.offset_ = 0;
|
|
395
|
+
hessian.dim_ = lp.num_col_;
|
|
396
|
+
|
|
397
|
+
// hessian.format_ = HessianFormat::kSquare;
|
|
398
|
+
// hessian.start_ = {0, 2, 3, 5};
|
|
399
|
+
// hessian.index_ = {0, 2, 1, 0, 2};
|
|
400
|
+
// hessian.value_ = {2.0, -1.0, 0.2, -1.0, 2.0};
|
|
401
|
+
|
|
402
|
+
hessian.format_ = HessianFormat::kTriangular;
|
|
403
|
+
hessian.start_ = {0, 2, 3, 4};
|
|
404
|
+
hessian.index_ = {0, 2, 1, 2};
|
|
405
|
+
hessian.value_ = {2.0, -1.0, 0.2, 2.0};
|
|
406
|
+
|
|
407
|
+
highs.setOptionValue("output_flag", dev_run);
|
|
408
|
+
highs.setOptionValue("solver", solver);
|
|
409
|
+
const HighsInfo& info = highs.getInfo();
|
|
410
|
+
const double& objective_function_value = info.objective_function_value;
|
|
411
|
+
return_status = highs.passModel(local_model);
|
|
412
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
413
|
+
if (dev_run) highs.writeModel("");
|
|
414
|
+
// Zero the QP regularization so "true" solution is obtained
|
|
415
|
+
REQUIRE(highs.setOptionValue("qp_regularization_value", 0) ==
|
|
416
|
+
HighsStatus::kOk);
|
|
417
|
+
return_status = highs.run();
|
|
418
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
419
|
+
|
|
420
|
+
required_objective_function_value = -5.50;
|
|
421
|
+
testPrimalDualObjective(highs, required_objective_function_value);
|
|
422
|
+
|
|
423
|
+
if (dev_run) printf("Objective = %g\n", objective_function_value);
|
|
424
|
+
if (dev_run) highs.writeSolution("", kSolutionStylePretty);
|
|
425
|
+
|
|
426
|
+
// Now with a constraint
|
|
427
|
+
lp.num_row_ = 1;
|
|
428
|
+
lp.col_lower_ = {0.0, 0.0, 0.0};
|
|
429
|
+
lp.row_lower_ = {-inf};
|
|
430
|
+
lp.row_upper_ = {2};
|
|
431
|
+
lp.a_matrix_.start_ = {0, 1, 1, 2};
|
|
432
|
+
lp.a_matrix_.index_ = {0, 0};
|
|
433
|
+
lp.a_matrix_.value_ = {1.0, 1.0};
|
|
434
|
+
lp.a_matrix_.format_ = MatrixFormat::kColwise;
|
|
435
|
+
return_status = highs.passModel(local_model);
|
|
436
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
437
|
+
if (dev_run) highs.writeModel("");
|
|
438
|
+
return_status = highs.run();
|
|
439
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
440
|
+
|
|
441
|
+
required_objective_function_value = -5.25;
|
|
442
|
+
testPrimalDualObjective(highs, required_objective_function_value);
|
|
443
|
+
|
|
444
|
+
if (dev_run) printf("Objective = %g\n", objective_function_value);
|
|
445
|
+
if (dev_run) highs.writeSolution("", kSolutionStylePretty);
|
|
446
|
+
|
|
447
|
+
// Make the problem infeasible
|
|
448
|
+
return_status = highs.changeColBounds(0, 3, inf);
|
|
449
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
450
|
+
return_status = highs.changeColBounds(2, 3, inf);
|
|
451
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
452
|
+
return_status = highs.run();
|
|
453
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
454
|
+
|
|
455
|
+
if (dev_run) highs.writeSolution("", kSolutionStylePretty);
|
|
456
|
+
model_status = highs.getModelStatus();
|
|
457
|
+
if (dev_run)
|
|
458
|
+
printf("Infeasible QP status: %s\n",
|
|
459
|
+
highs.modelStatusToString(model_status).c_str());
|
|
460
|
+
REQUIRE(model_status == HighsModelStatus::kInfeasible);
|
|
461
|
+
|
|
462
|
+
return_status = highs.clearModel();
|
|
463
|
+
|
|
464
|
+
std::string filename;
|
|
465
|
+
for (HighsInt test_k = 0; test_k < 4; test_k++) {
|
|
466
|
+
if (test_k == 0) {
|
|
467
|
+
filename = std::string(HIGHS_DIR) + "/check/instances/qjh.mps";
|
|
468
|
+
} else if (test_k == 1) {
|
|
469
|
+
filename = std::string(HIGHS_DIR) + "/check/instances/qjh_quadobj.mps";
|
|
470
|
+
} else if (test_k == 2) {
|
|
471
|
+
filename = std::string(HIGHS_DIR) + "/check/instances/qjh_qmatrix.mps";
|
|
472
|
+
} else {
|
|
473
|
+
// This instance has both quadobj and qmatrix sections, and
|
|
474
|
+
// both correspond to identical Hessians. They are added so
|
|
475
|
+
// objective changes
|
|
476
|
+
filename =
|
|
477
|
+
std::string(HIGHS_DIR) + "/check/instances/qjh_quadobj_qmatrix.mps";
|
|
478
|
+
required_objective_function_value = -2.75;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
return_status = highs.readModel(filename);
|
|
482
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
483
|
+
return_status = highs.run();
|
|
484
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
485
|
+
|
|
486
|
+
testPrimalDualObjective(highs, required_objective_function_value);
|
|
487
|
+
|
|
488
|
+
return_status = highs.clearModel();
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
highs.resetGlobalScheduler(true);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
TEST_CASE("test-min-negative-definite", "[qpsolver]") {
|
|
496
|
+
HighsModel model;
|
|
497
|
+
model.lp_.model_name_ = "min-negative-definite";
|
|
498
|
+
model.lp_.num_col_ = 1;
|
|
499
|
+
model.lp_.num_row_ = 0;
|
|
500
|
+
model.lp_.col_cost_ = {0};
|
|
501
|
+
model.lp_.col_lower_ = {0};
|
|
502
|
+
model.lp_.col_upper_ = {inf};
|
|
503
|
+
model.hessian_.dim_ = model.lp_.num_col_;
|
|
504
|
+
model.hessian_.start_ = {0, 1};
|
|
505
|
+
model.hessian_.index_ = {0};
|
|
506
|
+
model.hessian_.value_ = {-0.5};
|
|
507
|
+
Highs highs;
|
|
508
|
+
highs.setOptionValue("output_flag", dev_run);
|
|
509
|
+
|
|
510
|
+
// Should load OK
|
|
511
|
+
REQUIRE(highs.passModel(model) == HighsStatus::kOk);
|
|
512
|
+
|
|
513
|
+
for (auto& solver : solvers) {
|
|
514
|
+
if (dev_run) printf("Testing solver %s\n", solver.c_str());
|
|
515
|
+
// Run should fail since objective is non-convex
|
|
516
|
+
if (dev_run)
|
|
517
|
+
printf("test-min-negative-definite for solver %s\n", solver.c_str());
|
|
518
|
+
REQUIRE(highs.run() == HighsStatus::kError);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
highs.resetGlobalScheduler(true);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
TEST_CASE("test-max-negative-definite", "[qpsolver]") {
|
|
525
|
+
HighsLp lp;
|
|
526
|
+
HighsHessian hessian;
|
|
527
|
+
// Construct a QP with negative definite Hessian
|
|
528
|
+
const double col_lower = 0;
|
|
529
|
+
const double col_upper = inf; // 10.0;
|
|
530
|
+
|
|
531
|
+
lp.model_name_ = "max-negative-definite";
|
|
532
|
+
lp.num_col_ = 3;
|
|
533
|
+
lp.num_row_ = 1;
|
|
534
|
+
lp.offset_ = -1.0;
|
|
535
|
+
lp.col_cost_ = {1.0, 1.0, 2.0};
|
|
536
|
+
lp.col_lower_ = {col_lower, col_lower, col_lower};
|
|
537
|
+
lp.col_upper_ = {col_upper, col_upper, col_upper};
|
|
538
|
+
lp.row_lower_ = {4};
|
|
539
|
+
lp.row_upper_ = {inf};
|
|
540
|
+
lp.a_matrix_.format_ = MatrixFormat::kRowwise;
|
|
541
|
+
lp.a_matrix_.start_ = {0, 3};
|
|
542
|
+
lp.a_matrix_.index_ = {0, 1, 2};
|
|
543
|
+
lp.a_matrix_.value_ = {1.0, 1.0, 1.0};
|
|
544
|
+
Highs highs;
|
|
545
|
+
highs.setOptionValue("output_flag", dev_run);
|
|
546
|
+
|
|
547
|
+
REQUIRE(highs.passModel(lp) == HighsStatus::kOk);
|
|
548
|
+
hessian.dim_ = lp.num_col_;
|
|
549
|
+
hessian.start_ = {0, 2, 3, 4};
|
|
550
|
+
hessian.index_ = {0, 2, 1, 2};
|
|
551
|
+
hessian.value_ = {-2.0, -1, -1.0, -1};
|
|
552
|
+
if (dev_run) {
|
|
553
|
+
printf("\nNegative definite Hessian\n");
|
|
554
|
+
hessian.print();
|
|
555
|
+
}
|
|
556
|
+
// Should load OK
|
|
557
|
+
REQUIRE(highs.passHessian(hessian) == HighsStatus::kOk);
|
|
558
|
+
// Make the problem a maximization
|
|
559
|
+
REQUIRE(highs.changeObjectiveSense(ObjSense::kMaximize) == HighsStatus::kOk);
|
|
560
|
+
// Zero the QP regularization so "true" solution is obtained
|
|
561
|
+
REQUIRE(highs.setOptionValue("qp_regularization_value", 0) ==
|
|
562
|
+
HighsStatus::kOk);
|
|
563
|
+
|
|
564
|
+
for (auto& solver : solvers) {
|
|
565
|
+
highs.setOptionValue("solver", solver);
|
|
566
|
+
REQUIRE(highs.run() == HighsStatus::kOk);
|
|
567
|
+
if (dev_run) highs.writeSolution("", kSolutionStylePretty);
|
|
568
|
+
|
|
569
|
+
const double required_objective_function_value = 1.25;
|
|
570
|
+
|
|
571
|
+
testPrimalDualObjective(highs, required_objective_function_value);
|
|
572
|
+
|
|
573
|
+
const HighsSolution& solution = highs.getSolution();
|
|
574
|
+
REQUIRE(fabs(solution.col_value[0] - 0.0) < double_equal_tolerance);
|
|
575
|
+
REQUIRE(fabs(solution.col_value[1] - 1.5) < double_equal_tolerance);
|
|
576
|
+
REQUIRE(fabs(solution.col_value[2] - 2.5) < double_equal_tolerance);
|
|
577
|
+
REQUIRE(fabs(solution.col_dual[0] + 1.0) < double_equal_tolerance);
|
|
578
|
+
REQUIRE(fabs(solution.row_dual[0] + 0.5) < double_equal_tolerance);
|
|
579
|
+
}
|
|
580
|
+
highs.resetGlobalScheduler(true);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
TEST_CASE("test-semi-definite0", "[qpsolver]") {
|
|
584
|
+
HighsStatus return_status;
|
|
585
|
+
|
|
586
|
+
HighsModel local_model;
|
|
587
|
+
HighsLp& lp = local_model.lp_;
|
|
588
|
+
HighsHessian& hessian = local_model.hessian_;
|
|
589
|
+
// Construct a QP with positive semi-definite Hessian
|
|
590
|
+
const double col_lower = 0;
|
|
591
|
+
const double col_upper = inf; // 10.0;
|
|
592
|
+
|
|
593
|
+
lp.model_name_ = "semi-definite";
|
|
594
|
+
lp.num_col_ = 3;
|
|
595
|
+
lp.num_row_ = 1;
|
|
596
|
+
lp.col_cost_ = {1.0, 1.0, 2.0};
|
|
597
|
+
lp.col_lower_ = {col_lower, col_lower, col_lower};
|
|
598
|
+
lp.col_upper_ = {col_upper, col_upper, col_upper};
|
|
599
|
+
lp.row_lower_ = {2};
|
|
600
|
+
lp.row_upper_ = {inf};
|
|
601
|
+
lp.a_matrix_.format_ = MatrixFormat::kColwise;
|
|
602
|
+
lp.a_matrix_.start_ = {0, 1, 2, 3};
|
|
603
|
+
lp.a_matrix_.index_ = {0, 0, 0};
|
|
604
|
+
lp.a_matrix_.value_ = {1.0, 1.0, 1.0};
|
|
605
|
+
hessian.dim_ = lp.num_col_;
|
|
606
|
+
hessian.start_ = {0, 2, 2, 3};
|
|
607
|
+
hessian.index_ = {0, 2, 2};
|
|
608
|
+
hessian.value_ = {2.0, -1.0, 1.0};
|
|
609
|
+
|
|
610
|
+
Highs highs;
|
|
611
|
+
highs.setOptionValue("output_flag", dev_run);
|
|
612
|
+
return_status = highs.passModel(local_model);
|
|
613
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
614
|
+
|
|
615
|
+
// highs.writeModel("semi-definite.mps");
|
|
616
|
+
|
|
617
|
+
// Zero the QP regularization so "true" solution is obtained
|
|
618
|
+
REQUIRE(highs.setOptionValue("qp_regularization_value", 0) ==
|
|
619
|
+
HighsStatus::kOk);
|
|
620
|
+
|
|
621
|
+
for (auto& solver : solvers) {
|
|
622
|
+
highs.setOptionValue("solver", solver);
|
|
623
|
+
return_status = highs.run();
|
|
624
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
625
|
+
if (dev_run) highs.writeSolution("", kSolutionStylePretty);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
highs.resetGlobalScheduler(true);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
TEST_CASE("test-semi-definite1", "[qpsolver]") {
|
|
632
|
+
HighsLp lp;
|
|
633
|
+
HighsHessian hessian;
|
|
634
|
+
|
|
635
|
+
lp.model_name_ = "semi-definite";
|
|
636
|
+
lp.num_col_ = 2;
|
|
637
|
+
lp.num_row_ = 1;
|
|
638
|
+
lp.col_cost_ = {-2.0, 0.0};
|
|
639
|
+
lp.col_lower_ = {-inf, -inf};
|
|
640
|
+
lp.col_upper_ = {inf, inf};
|
|
641
|
+
lp.sense_ = ObjSense::kMinimize;
|
|
642
|
+
lp.offset_ = 0;
|
|
643
|
+
lp.row_lower_ = {1};
|
|
644
|
+
lp.row_upper_ = {1};
|
|
645
|
+
lp.a_matrix_.format_ = MatrixFormat::kRowwise;
|
|
646
|
+
lp.a_matrix_.start_ = {0, 2};
|
|
647
|
+
lp.a_matrix_.index_ = {0, 1};
|
|
648
|
+
lp.a_matrix_.value_ = {1.0, 1.0};
|
|
649
|
+
|
|
650
|
+
Highs highs;
|
|
651
|
+
highs.setOptionValue("output_flag", dev_run);
|
|
652
|
+
REQUIRE(highs.passModel(lp) == HighsStatus::kOk);
|
|
653
|
+
|
|
654
|
+
hessian.dim_ = lp.num_col_;
|
|
655
|
+
hessian.start_ = {0, 2, 3};
|
|
656
|
+
hessian.index_ = {0, 1, 1};
|
|
657
|
+
hessian.value_ = {1.0, -1.0, 1.0};
|
|
658
|
+
REQUIRE(highs.passHessian(hessian) == HighsStatus::kOk);
|
|
659
|
+
|
|
660
|
+
// Zero the QP regularization so "true" solution is obtained
|
|
661
|
+
REQUIRE(highs.setOptionValue("qp_regularization_value", 0) ==
|
|
662
|
+
HighsStatus::kOk);
|
|
663
|
+
|
|
664
|
+
for (auto& solver : solvers) {
|
|
665
|
+
highs.setOptionValue("solver", solver);
|
|
666
|
+
REQUIRE(highs.run() == HighsStatus::kOk);
|
|
667
|
+
if (dev_run) highs.writeSolution("", kSolutionStylePretty);
|
|
668
|
+
|
|
669
|
+
const double required_objective_function_value = -1.5;
|
|
670
|
+
|
|
671
|
+
testPrimalDualObjective(highs, required_objective_function_value);
|
|
672
|
+
|
|
673
|
+
const HighsSolution& solution = highs.getSolution();
|
|
674
|
+
REQUIRE(fabs(solution.col_value[0] - 1) < double_equal_tolerance);
|
|
675
|
+
REQUIRE(fabs(solution.col_value[1]) < double_equal_tolerance);
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
highs.resetGlobalScheduler(true);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
TEST_CASE("test-semi-definite2", "[qpsolver]") {
|
|
682
|
+
HighsLp lp;
|
|
683
|
+
HighsHessian hessian;
|
|
684
|
+
|
|
685
|
+
lp.model_name_ = "semi-definite";
|
|
686
|
+
lp.num_col_ = 2;
|
|
687
|
+
lp.num_row_ = 1;
|
|
688
|
+
lp.col_cost_ = {0.0, -1.0};
|
|
689
|
+
lp.col_lower_ = {-inf, -inf};
|
|
690
|
+
lp.col_upper_ = {inf, inf};
|
|
691
|
+
lp.sense_ = ObjSense::kMinimize;
|
|
692
|
+
lp.offset_ = 0;
|
|
693
|
+
lp.row_lower_ = {-inf};
|
|
694
|
+
lp.row_upper_ = {1};
|
|
695
|
+
lp.a_matrix_.format_ = MatrixFormat::kRowwise;
|
|
696
|
+
lp.a_matrix_.start_ = {0, 2};
|
|
697
|
+
lp.a_matrix_.index_ = {0, 1};
|
|
698
|
+
lp.a_matrix_.value_ = {1.0, 1.0};
|
|
699
|
+
|
|
700
|
+
Highs highs;
|
|
701
|
+
highs.setOptionValue("output_flag", dev_run);
|
|
702
|
+
REQUIRE(highs.passModel(lp) == HighsStatus::kOk);
|
|
703
|
+
// Illustrates how final entries of 0 on the diagonal are handled
|
|
704
|
+
hessian.dim_ = lp.num_col_;
|
|
705
|
+
hessian.start_ = {0, 1, 1};
|
|
706
|
+
hessian.index_ = {0};
|
|
707
|
+
hessian.value_ = {1.0};
|
|
708
|
+
REQUIRE(highs.passHessian(hessian) == HighsStatus::kOk);
|
|
709
|
+
|
|
710
|
+
// Zero the QP regularization so "true" solution is obtained
|
|
711
|
+
REQUIRE(highs.setOptionValue("qp_regularization_value", 0) ==
|
|
712
|
+
HighsStatus::kOk);
|
|
713
|
+
|
|
714
|
+
for (auto& solver : solvers) {
|
|
715
|
+
highs.setOptionValue("solver", solver);
|
|
716
|
+
REQUIRE(highs.run() == HighsStatus::kOk);
|
|
717
|
+
if (dev_run) highs.writeSolution("", kSolutionStylePretty);
|
|
718
|
+
|
|
719
|
+
const double required_objective_function_value = -1.5;
|
|
720
|
+
|
|
721
|
+
testPrimalDualObjective(highs, required_objective_function_value);
|
|
722
|
+
|
|
723
|
+
const HighsSolution& solution = highs.getSolution();
|
|
724
|
+
REQUIRE(fabs(solution.col_value[0] + 1) < double_equal_tolerance);
|
|
725
|
+
REQUIRE(fabs(solution.col_value[1] - 2) < double_equal_tolerance);
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
highs.resetGlobalScheduler(true);
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
TEST_CASE("test-qp-modification", "[qpsolver]") {
|
|
732
|
+
// HighsStatus return_status;
|
|
733
|
+
// HighsModelStatus model_status;
|
|
734
|
+
// double required_objective_function_value;
|
|
735
|
+
|
|
736
|
+
for (auto& solver : solvers) {
|
|
737
|
+
HighsModel model;
|
|
738
|
+
|
|
739
|
+
HighsLp& lp = model.lp_;
|
|
740
|
+
HighsHessian& hessian = model.hessian_;
|
|
741
|
+
|
|
742
|
+
lp.num_col_ = 2;
|
|
743
|
+
lp.num_row_ = 1;
|
|
744
|
+
lp.col_cost_ = {1.0, -1.0};
|
|
745
|
+
lp.col_lower_ = {-inf, -inf};
|
|
746
|
+
lp.col_upper_ = {inf, inf};
|
|
747
|
+
lp.sense_ = ObjSense::kMinimize;
|
|
748
|
+
lp.offset_ = 0;
|
|
749
|
+
lp.row_lower_ = {-inf};
|
|
750
|
+
lp.row_upper_ = {1};
|
|
751
|
+
lp.a_matrix_.format_ = MatrixFormat::kRowwise;
|
|
752
|
+
lp.a_matrix_.start_ = {0, 2};
|
|
753
|
+
lp.a_matrix_.index_ = {0, 1};
|
|
754
|
+
lp.a_matrix_.value_ = {1.0, 1.0};
|
|
755
|
+
hessian.dim_ = 1;
|
|
756
|
+
hessian.start_ = {0, 1};
|
|
757
|
+
hessian.value_ = {1.0};
|
|
758
|
+
|
|
759
|
+
Highs highs;
|
|
760
|
+
highs.setOptionValue("output_flag", dev_run);
|
|
761
|
+
highs.setOptionValue("solver", solver);
|
|
762
|
+
const HighsModel& incumbent_model = highs.getModel();
|
|
763
|
+
// Cannot have Hessian with index exceeding hessian.dim_-1
|
|
764
|
+
hessian.index_ = {1};
|
|
765
|
+
REQUIRE(highs.passModel(model) == HighsStatus::kError);
|
|
766
|
+
|
|
767
|
+
// Correct the Hessian index
|
|
768
|
+
hessian.index_[0] = 0;
|
|
769
|
+
REQUIRE(highs.passModel(model) == HighsStatus::kOk);
|
|
770
|
+
if (dev_run) {
|
|
771
|
+
printf("\nNow solve the QP\n\n");
|
|
772
|
+
incumbent_model.hessian_.print();
|
|
773
|
+
}
|
|
774
|
+
// Zero the QP regularization so "true" solution is obtained
|
|
775
|
+
REQUIRE(highs.setOptionValue("qp_regularization_value", 0) ==
|
|
776
|
+
HighsStatus::kOk);
|
|
777
|
+
|
|
778
|
+
highs.run();
|
|
779
|
+
if (dev_run) highs.writeSolution("", kSolutionStylePretty);
|
|
780
|
+
// Add a new variables and ensure that the Hessian dimension is correct
|
|
781
|
+
std::vector<HighsInt> index = {0};
|
|
782
|
+
std::vector<double> value = {1};
|
|
783
|
+
REQUIRE(highs.addCol(-1, 0, 1, 1, index.data(), value.data()) ==
|
|
784
|
+
HighsStatus::kOk);
|
|
785
|
+
REQUIRE((incumbent_model.hessian_.dim_ == 0 ||
|
|
786
|
+
incumbent_model.hessian_.dim_ == incumbent_model.lp_.num_col_));
|
|
787
|
+
if (dev_run) {
|
|
788
|
+
printf("\nNow solve the QP after adding new variable\n\n");
|
|
789
|
+
incumbent_model.hessian_.print();
|
|
790
|
+
}
|
|
791
|
+
highs.run();
|
|
792
|
+
if (dev_run) highs.writeSolution("", kSolutionStylePretty);
|
|
793
|
+
|
|
794
|
+
HighsInt dim = incumbent_model.lp_.num_col_;
|
|
795
|
+
std::vector<double> arg0;
|
|
796
|
+
std::vector<double> arg1;
|
|
797
|
+
std::vector<double> result0;
|
|
798
|
+
std::vector<double> result1;
|
|
799
|
+
arg0.resize(dim);
|
|
800
|
+
HighsRandom random;
|
|
801
|
+
for (HighsInt iCol = 0; iCol < dim; iCol++) arg0[iCol] = random.fraction();
|
|
802
|
+
HighsHessian hessian0 = incumbent_model.hessian_;
|
|
803
|
+
arg1 = arg0;
|
|
804
|
+
|
|
805
|
+
// Deleting column 1 removes no nonzeros from the Hessian
|
|
806
|
+
HighsInt delete_col = 1;
|
|
807
|
+
REQUIRE(highs.deleteCols(delete_col, delete_col) == HighsStatus::kOk);
|
|
808
|
+
REQUIRE((incumbent_model.hessian_.dim_ == 0 ||
|
|
809
|
+
incumbent_model.hessian_.dim_ == incumbent_model.lp_.num_col_));
|
|
810
|
+
if (dev_run) {
|
|
811
|
+
printf("\nNow solve the QP after deleting column 1\n\n");
|
|
812
|
+
incumbent_model.hessian_.print();
|
|
813
|
+
}
|
|
814
|
+
highs.run();
|
|
815
|
+
if (dev_run) highs.writeSolution("", kSolutionStylePretty);
|
|
816
|
+
|
|
817
|
+
dim--;
|
|
818
|
+
for (HighsInt iCol = delete_col; iCol < dim; iCol++)
|
|
819
|
+
arg1[iCol] = arg1[iCol + 1];
|
|
820
|
+
arg0[delete_col] = 0;
|
|
821
|
+
hessian0.product(arg0, result0);
|
|
822
|
+
for (HighsInt iCol = delete_col; iCol < dim; iCol++)
|
|
823
|
+
result0[iCol] = result0[iCol + 1];
|
|
824
|
+
|
|
825
|
+
arg1.resize(dim);
|
|
826
|
+
incumbent_model.hessian_.product(arg1, result1);
|
|
827
|
+
for (HighsInt iCol = 0; iCol < dim; iCol++)
|
|
828
|
+
REQUIRE(result0[iCol] == result1[iCol]);
|
|
829
|
+
|
|
830
|
+
// Deleting column 0 removes only nonzero from the Hessian, so problem is an
|
|
831
|
+
// LP
|
|
832
|
+
delete_col = 0;
|
|
833
|
+
REQUIRE(highs.deleteCols(delete_col, delete_col) == HighsStatus::kOk);
|
|
834
|
+
REQUIRE((incumbent_model.hessian_.dim_ == 0 ||
|
|
835
|
+
incumbent_model.hessian_.dim_ == incumbent_model.lp_.num_col_));
|
|
836
|
+
if (dev_run) {
|
|
837
|
+
printf("\nNow solve the LP after deleting column 0\n\n");
|
|
838
|
+
incumbent_model.hessian_.print();
|
|
839
|
+
}
|
|
840
|
+
highs.run();
|
|
841
|
+
if (dev_run) highs.writeSolution("", kSolutionStylePretty);
|
|
842
|
+
|
|
843
|
+
highs.resetGlobalScheduler(true);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
TEST_CASE("test-qp-delete-col", "[qpsolver]") {
|
|
848
|
+
HighsModel model;
|
|
849
|
+
HighsLp& lp = model.lp_;
|
|
850
|
+
HighsHessian& hessian = model.hessian_;
|
|
851
|
+
|
|
852
|
+
lp.num_col_ = 5;
|
|
853
|
+
lp.num_row_ = 1;
|
|
854
|
+
lp.col_cost_ = {-2, -1, 0, 1, 2};
|
|
855
|
+
lp.col_lower_ = {0, 0, 0, 0, 0};
|
|
856
|
+
lp.col_upper_ = {inf, inf, inf, inf, inf};
|
|
857
|
+
lp.sense_ = ObjSense::kMinimize;
|
|
858
|
+
lp.offset_ = 0;
|
|
859
|
+
lp.row_lower_ = {-inf};
|
|
860
|
+
lp.row_upper_ = {1};
|
|
861
|
+
lp.a_matrix_.format_ = MatrixFormat::kRowwise;
|
|
862
|
+
lp.a_matrix_.start_ = {0, 5};
|
|
863
|
+
lp.a_matrix_.index_ = {0, 1, 2, 3, 4};
|
|
864
|
+
lp.a_matrix_.value_ = {1, 1, 1, 1, 1};
|
|
865
|
+
hessian.dim_ = 5;
|
|
866
|
+
hessian.start_ = {0, 4, 7, 10, 11, 12};
|
|
867
|
+
hessian.index_ = {0, 1, 3, 4, 1, 2, 4, 2, 3, 4, 3, 4};
|
|
868
|
+
hessian.value_ = {11, 21, 41, 51, 22, 32, 52, 33, 43, 53, 44, 55};
|
|
869
|
+
|
|
870
|
+
Highs highs;
|
|
871
|
+
highs.setOptionValue("output_flag", dev_run);
|
|
872
|
+
const HighsModel& incumbent_model = highs.getModel();
|
|
873
|
+
REQUIRE(highs.passModel(model) == HighsStatus::kOk);
|
|
874
|
+
if (dev_run) incumbent_model.hessian_.print();
|
|
875
|
+
|
|
876
|
+
HighsInt dim = incumbent_model.lp_.num_col_;
|
|
877
|
+
std::vector<double> arg0;
|
|
878
|
+
std::vector<double> arg1;
|
|
879
|
+
std::vector<double> result0;
|
|
880
|
+
std::vector<double> result1;
|
|
881
|
+
arg0.resize(dim);
|
|
882
|
+
HighsRandom random;
|
|
883
|
+
for (HighsInt iCol = 0; iCol < dim; iCol++) arg0[iCol] = random.fraction();
|
|
884
|
+
HighsHessian hessian0 = incumbent_model.hessian_;
|
|
885
|
+
arg1 = arg0;
|
|
886
|
+
|
|
887
|
+
std::vector<HighsInt> set = {1, 3};
|
|
888
|
+
REQUIRE(highs.deleteCols(2, set.data()) == HighsStatus::kOk);
|
|
889
|
+
if (dev_run) incumbent_model.hessian_.print();
|
|
890
|
+
|
|
891
|
+
arg1[1] = arg1[2];
|
|
892
|
+
arg1[2] = arg1[4];
|
|
893
|
+
arg0[1] = 0;
|
|
894
|
+
arg0[3] = 0;
|
|
895
|
+
hessian0.product(arg0, result0);
|
|
896
|
+
result0[1] = result0[2];
|
|
897
|
+
result0[2] = result0[4];
|
|
898
|
+
|
|
899
|
+
dim = 3;
|
|
900
|
+
arg1.resize(dim);
|
|
901
|
+
incumbent_model.hessian_.product(arg1, result1);
|
|
902
|
+
for (HighsInt iCol = 0; iCol < dim; iCol++)
|
|
903
|
+
REQUIRE(result0[iCol] == result1[iCol]);
|
|
904
|
+
|
|
905
|
+
dim = 100;
|
|
906
|
+
lp.clear();
|
|
907
|
+
lp.num_col_ = dim;
|
|
908
|
+
lp.num_row_ = 1;
|
|
909
|
+
|
|
910
|
+
lp.col_cost_.resize(dim);
|
|
911
|
+
lp.col_lower_.resize(dim);
|
|
912
|
+
lp.col_upper_.resize(dim);
|
|
913
|
+
lp.a_matrix_.index_.resize(dim);
|
|
914
|
+
lp.a_matrix_.value_.resize(dim);
|
|
915
|
+
|
|
916
|
+
for (HighsInt iCol = 0; iCol < dim; iCol++) {
|
|
917
|
+
lp.col_cost_[iCol] = double(iCol);
|
|
918
|
+
lp.col_lower_[iCol] = 0;
|
|
919
|
+
lp.col_upper_[iCol] = inf;
|
|
920
|
+
lp.a_matrix_.index_[iCol] = iCol;
|
|
921
|
+
lp.a_matrix_.value_[iCol] = 1;
|
|
922
|
+
}
|
|
923
|
+
lp.a_matrix_.start_.push_back(dim);
|
|
924
|
+
|
|
925
|
+
lp.sense_ = ObjSense::kMinimize;
|
|
926
|
+
lp.offset_ = 0;
|
|
927
|
+
lp.row_lower_ = {-inf};
|
|
928
|
+
lp.row_upper_ = {1};
|
|
929
|
+
lp.a_matrix_.format_ = MatrixFormat::kRowwise;
|
|
930
|
+
|
|
931
|
+
hessian.clear();
|
|
932
|
+
hessian.dim_ = dim;
|
|
933
|
+
std::vector<double> hessian_col(dim);
|
|
934
|
+
for (HighsInt iCol = 0; iCol < dim; iCol++) {
|
|
935
|
+
hessian_col.assign(dim, 0);
|
|
936
|
+
HighsInt kmax = std::max(HighsInt(1), (dim - iCol) / 3);
|
|
937
|
+
hessian_col[iCol] = dim * iCol + iCol;
|
|
938
|
+
if (iCol < dim - 1) {
|
|
939
|
+
for (HighsInt k = 0; k < kmax; k++) {
|
|
940
|
+
HighsInt iRow = iCol + 1 + random.integer(dim - iCol - 1);
|
|
941
|
+
assert(iRow >= 0);
|
|
942
|
+
assert(iRow < dim);
|
|
943
|
+
hessian_col[iRow] = dim * iCol + iRow;
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
for (HighsInt iRow = iCol; iRow < dim; iRow++) {
|
|
947
|
+
if (hessian_col[iRow]) {
|
|
948
|
+
hessian.index_.push_back(iRow);
|
|
949
|
+
hessian.value_.push_back(hessian_col[iRow]);
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
hessian.start_.push_back(HighsInt(hessian.index_.size()));
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
REQUIRE(highs.passModel(model) == HighsStatus::kOk);
|
|
956
|
+
if (dev_run && dim < 20) incumbent_model.hessian_.print();
|
|
957
|
+
|
|
958
|
+
arg0.resize(dim);
|
|
959
|
+
for (HighsInt iCol = 0; iCol < dim; iCol++) arg0[iCol] = random.fraction();
|
|
960
|
+
hessian0 = incumbent_model.hessian_;
|
|
961
|
+
arg1 = arg0;
|
|
962
|
+
|
|
963
|
+
std::vector<HighsInt> mask;
|
|
964
|
+
mask.assign(dim, 0);
|
|
965
|
+
|
|
966
|
+
HighsInt kmax = std::max(HighsInt(1), dim / 3);
|
|
967
|
+
for (HighsInt k = 0; k < kmax; k++) {
|
|
968
|
+
HighsInt iRow = random.integer(dim);
|
|
969
|
+
assert(iRow >= 0);
|
|
970
|
+
assert(iRow < dim);
|
|
971
|
+
mask[iRow] = 1;
|
|
972
|
+
}
|
|
973
|
+
highs.deleteCols(mask.data());
|
|
974
|
+
if (dev_run && dim < 20) incumbent_model.hessian_.print();
|
|
975
|
+
|
|
976
|
+
for (HighsInt iCol = 0; iCol < dim; iCol++) {
|
|
977
|
+
HighsInt iRow = mask[iCol];
|
|
978
|
+
if (iRow < 0) {
|
|
979
|
+
arg0[iCol] = 0;
|
|
980
|
+
} else {
|
|
981
|
+
arg1[iRow] = arg1[iCol];
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
hessian0.product(arg0, result0);
|
|
985
|
+
for (HighsInt iCol = 0; iCol < dim; iCol++) {
|
|
986
|
+
HighsInt iRow = mask[iCol];
|
|
987
|
+
if (iRow >= 0) result0[iRow] = result0[iCol];
|
|
988
|
+
}
|
|
989
|
+
dim = incumbent_model.hessian_.dim_;
|
|
990
|
+
arg1.resize(dim);
|
|
991
|
+
incumbent_model.hessian_.product(arg1, result1);
|
|
992
|
+
|
|
993
|
+
for (HighsInt iCol = 0; iCol < dim; iCol++) {
|
|
994
|
+
REQUIRE(fabs(result0[iCol] - result1[iCol]) < 1e-8);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
TEST_CASE("test-qp-hot-start", "[qpsolver]") {
|
|
999
|
+
// Test hot start
|
|
1000
|
+
HighsStatus return_status;
|
|
1001
|
+
Highs highs;
|
|
1002
|
+
highs.setOptionValue("output_flag", dev_run);
|
|
1003
|
+
const HighsInfo& info = highs.getInfo();
|
|
1004
|
+
|
|
1005
|
+
double required_objective_function_value = 0;
|
|
1006
|
+
for (HighsInt k = 0; k < 2; k++) {
|
|
1007
|
+
if (dev_run)
|
|
1008
|
+
printf(
|
|
1009
|
+
"\n"
|
|
1010
|
+
"===================\n"
|
|
1011
|
+
"Hot start test %d\n"
|
|
1012
|
+
"===================\n",
|
|
1013
|
+
int(k));
|
|
1014
|
+
if (k == 1) {
|
|
1015
|
+
const std::string filename =
|
|
1016
|
+
std::string(HIGHS_DIR) + "/check/instances/primal1.mps";
|
|
1017
|
+
REQUIRE(highs.readModel(filename) == HighsStatus::kOk);
|
|
1018
|
+
required_objective_function_value = -0.035012965733477348;
|
|
1019
|
+
} else if (k == 2) {
|
|
1020
|
+
// Not currently tested
|
|
1021
|
+
const std::string filename =
|
|
1022
|
+
std::string(HIGHS_DIR) + "/check/instances/qptestnw.lp";
|
|
1023
|
+
REQUIRE(highs.readModel(filename) == HighsStatus::kOk);
|
|
1024
|
+
} else {
|
|
1025
|
+
HighsModel model;
|
|
1026
|
+
model.lp_.num_col_ = 2;
|
|
1027
|
+
model.lp_.num_row_ = 1;
|
|
1028
|
+
model.lp_.col_cost_ = {-2, -2};
|
|
1029
|
+
model.lp_.col_lower_ = {-inf, -inf};
|
|
1030
|
+
model.lp_.col_upper_ = {inf, inf};
|
|
1031
|
+
model.lp_.row_lower_ = {1};
|
|
1032
|
+
model.lp_.row_upper_ = {inf};
|
|
1033
|
+
model.lp_.a_matrix_.format_ = MatrixFormat::kRowwise;
|
|
1034
|
+
model.lp_.a_matrix_.start_ = {0, 2};
|
|
1035
|
+
model.lp_.a_matrix_.index_ = {0, 1};
|
|
1036
|
+
model.lp_.a_matrix_.value_ = {1, 1};
|
|
1037
|
+
model.hessian_.dim_ = 2;
|
|
1038
|
+
model.hessian_.start_ = {0, 1, 2};
|
|
1039
|
+
model.hessian_.index_ = {0, 1};
|
|
1040
|
+
model.hessian_.value_ = {2, 2};
|
|
1041
|
+
REQUIRE(highs.passModel(model) == HighsStatus::kOk);
|
|
1042
|
+
required_objective_function_value = -2;
|
|
1043
|
+
}
|
|
1044
|
+
// Zero the QP regularization so "true" solution is obtained
|
|
1045
|
+
REQUIRE(highs.setOptionValue("qp_regularization_value", 0) ==
|
|
1046
|
+
HighsStatus::kOk);
|
|
1047
|
+
return_status = highs.run();
|
|
1048
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
1049
|
+
|
|
1050
|
+
testPrimalDualObjective(highs, required_objective_function_value);
|
|
1051
|
+
|
|
1052
|
+
if (dev_run) highs.writeSolution("", 1);
|
|
1053
|
+
|
|
1054
|
+
HighsBasis basis = highs.getBasis();
|
|
1055
|
+
HighsSolution solution = highs.getSolution();
|
|
1056
|
+
if (dev_run) printf("Saved basis has validity = %d\n", basis.valid);
|
|
1057
|
+
|
|
1058
|
+
if (dev_run)
|
|
1059
|
+
printf(
|
|
1060
|
+
"================\n"
|
|
1061
|
+
"Hot start re-run\n"
|
|
1062
|
+
"================\n");
|
|
1063
|
+
return_status = highs.run();
|
|
1064
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
1065
|
+
REQUIRE(info.qp_iteration_count == 0);
|
|
1066
|
+
|
|
1067
|
+
if (dev_run)
|
|
1068
|
+
printf(
|
|
1069
|
+
"===========================\n"
|
|
1070
|
+
"Hot start using saved basis\n"
|
|
1071
|
+
"===========================\n");
|
|
1072
|
+
highs.setBasis(basis);
|
|
1073
|
+
return_status = highs.run();
|
|
1074
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
1075
|
+
REQUIRE(info.qp_iteration_count == 0);
|
|
1076
|
+
|
|
1077
|
+
// QP Hot start needs a saved solution as well as a basis after
|
|
1078
|
+
// clearSolver()
|
|
1079
|
+
if (dev_run)
|
|
1080
|
+
printf(
|
|
1081
|
+
"==============================================================\n"
|
|
1082
|
+
"Hot start using saved basis and solution after clearing solver\n"
|
|
1083
|
+
"==============================================================\n");
|
|
1084
|
+
highs.clearSolver();
|
|
1085
|
+
highs.setSolution(solution);
|
|
1086
|
+
highs.setBasis(basis);
|
|
1087
|
+
return_status = highs.run();
|
|
1088
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
1089
|
+
REQUIRE(info.qp_iteration_count == 0);
|
|
1090
|
+
/*
|
|
1091
|
+
if (dev_run)
|
|
1092
|
+
printf("=================================================\n"
|
|
1093
|
+
"Hot start using saved basis after clearing solver\n"
|
|
1094
|
+
"=================================================\n");
|
|
1095
|
+
highs.clearSolver();
|
|
1096
|
+
highs.setBasis(basis);
|
|
1097
|
+
return_status = highs.run();
|
|
1098
|
+
REQUIRE(return_status == HighsStatus::kOk);
|
|
1099
|
+
REQUIRE(info.qp_iteration_count == 0);
|
|
1100
|
+
*/
|
|
1101
|
+
// QP Hot start needs a saved solution as well as a basis after
|
|
1102
|
+
// clearSolver()
|
|
1103
|
+
if (dev_run)
|
|
1104
|
+
printf(
|
|
1105
|
+
"==============================================================\n"
|
|
1106
|
+
"Hot start using alien basis and solution after clearing solver\n"
|
|
1107
|
+
"==============================================================\n");
|
|
1108
|
+
highs.clearSolver();
|
|
1109
|
+
highs.setSolution(solution);
|
|
1110
|
+
basis.alien = true;
|
|
1111
|
+
highs.setBasis(basis);
|
|
1112
|
+
REQUIRE(highs.run() == HighsStatus::kOk);
|
|
1113
|
+
REQUIRE(info.qp_iteration_count == 0);
|
|
1114
|
+
if (k == 0) {
|
|
1115
|
+
// Modify the constraint so that the solution and basis are not
|
|
1116
|
+
// feasible and one iteration is needed
|
|
1117
|
+
REQUIRE(highs.changeCoeff(0, 1, 2.0) == HighsStatus::kOk);
|
|
1118
|
+
REQUIRE(highs.changeRowBounds(0, 4.0, kHighsInf) == HighsStatus::kOk);
|
|
1119
|
+
highs.clearSolver();
|
|
1120
|
+
basis.alien = false;
|
|
1121
|
+
highs.setBasis(basis);
|
|
1122
|
+
highs.setSolution(solution);
|
|
1123
|
+
return_status = highs.run();
|
|
1124
|
+
REQUIRE(info.qp_iteration_count == 1);
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
highs.resetGlobalScheduler(true);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
TEST_CASE("test-qp-terminations", "[qpsolver]") {
|
|
1132
|
+
Highs highs;
|
|
1133
|
+
highs.setOptionValue("output_flag", dev_run);
|
|
1134
|
+
std::string filename =
|
|
1135
|
+
std::string(HIGHS_DIR) + "/check/instances/qptestnw.lp";
|
|
1136
|
+
REQUIRE(highs.readModel(filename) == HighsStatus::kOk);
|
|
1137
|
+
|
|
1138
|
+
highs.setOptionValue("solver", kQpAsmString);
|
|
1139
|
+
|
|
1140
|
+
highs.setOptionValue("qp_iteration_limit", 1);
|
|
1141
|
+
REQUIRE(highs.run() == HighsStatus::kWarning);
|
|
1142
|
+
REQUIRE(highs.getModelStatus() == HighsModelStatus::kIterationLimit);
|
|
1143
|
+
highs.clearSolver();
|
|
1144
|
+
highs.setOptionValue("qp_iteration_limit", kHighsIInf);
|
|
1145
|
+
|
|
1146
|
+
highs.setOptionValue("time_limit", 0);
|
|
1147
|
+
REQUIRE(highs.run() == HighsStatus::kWarning);
|
|
1148
|
+
REQUIRE(highs.getModelStatus() == HighsModelStatus::kTimeLimit);
|
|
1149
|
+
highs.setOptionValue("time_limit", kHighsInf);
|
|
1150
|
+
|
|
1151
|
+
filename = std::string(HIGHS_DIR) + "/check/instances/primal1.mps";
|
|
1152
|
+
REQUIRE(highs.readModel(filename) == HighsStatus::kOk);
|
|
1153
|
+
|
|
1154
|
+
highs.setOptionValue("qp_nullspace_limit", 1);
|
|
1155
|
+
REQUIRE(highs.run() == HighsStatus::kError);
|
|
1156
|
+
REQUIRE(highs.getModelStatus() == HighsModelStatus::kSolveError);
|
|
1157
|
+
highs.setOptionValue("qp_nullspace_limit", 4000);
|
|
1158
|
+
|
|
1159
|
+
#ifdef HIPO
|
|
1160
|
+
highs.setOptionValue("solver", kHipoString);
|
|
1161
|
+
|
|
1162
|
+
highs.setOptionValue("ipm_iteration_limit", 1);
|
|
1163
|
+
REQUIRE(highs.run() == HighsStatus::kWarning);
|
|
1164
|
+
REQUIRE(highs.getModelStatus() == HighsModelStatus::kIterationLimit);
|
|
1165
|
+
highs.clearSolver();
|
|
1166
|
+
highs.setOptionValue("ipm_iteration_limit", kHighsIInf);
|
|
1167
|
+
|
|
1168
|
+
highs.setOptionValue("time_limit", 0);
|
|
1169
|
+
REQUIRE(highs.run() == HighsStatus::kWarning);
|
|
1170
|
+
REQUIRE(highs.getModelStatus() == HighsModelStatus::kTimeLimit);
|
|
1171
|
+
highs.setOptionValue("time_limit", kHighsInf);
|
|
1172
|
+
#endif
|
|
1173
|
+
|
|
1174
|
+
highs.resetGlobalScheduler(true);
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
TEST_CASE("rowless-qp", "[qpsolver]") {
|
|
1178
|
+
HighsModel model;
|
|
1179
|
+
HighsLp& lp = model.lp_;
|
|
1180
|
+
HighsHessian& hessian = model.hessian_;
|
|
1181
|
+
|
|
1182
|
+
lp.num_col_ = 2;
|
|
1183
|
+
lp.num_row_ = 0;
|
|
1184
|
+
lp.col_cost_ = {0, -3};
|
|
1185
|
+
lp.col_lower_ = {0, 0};
|
|
1186
|
+
lp.col_upper_ = {inf, inf};
|
|
1187
|
+
lp.sense_ = ObjSense::kMinimize;
|
|
1188
|
+
lp.offset_ = 0;
|
|
1189
|
+
hessian.dim_ = 2;
|
|
1190
|
+
hessian.start_ = {0, 2, 3};
|
|
1191
|
+
hessian.index_ = {0, 1, 1};
|
|
1192
|
+
hessian.value_ = {2, 1, 2};
|
|
1193
|
+
|
|
1194
|
+
Highs highs;
|
|
1195
|
+
highs.setOptionValue("output_flag", dev_run);
|
|
1196
|
+
|
|
1197
|
+
REQUIRE(highs.passModel(model) == HighsStatus::kOk);
|
|
1198
|
+
// Zero the QP regularization so "true" solution is obtained
|
|
1199
|
+
REQUIRE(highs.setOptionValue("qp_regularization_value", 0) ==
|
|
1200
|
+
HighsStatus::kOk);
|
|
1201
|
+
|
|
1202
|
+
for (auto& solver : solvers) {
|
|
1203
|
+
highs.setOptionValue("solver", solver);
|
|
1204
|
+
REQUIRE(highs.run() == HighsStatus::kOk);
|
|
1205
|
+
REQUIRE(highs.writeSolution("", kSolutionStylePretty) ==
|
|
1206
|
+
HighsStatus::kWarning);
|
|
1207
|
+
|
|
1208
|
+
const double required_objective_function_value = -2.25;
|
|
1209
|
+
|
|
1210
|
+
testPrimalDualObjective(highs, required_objective_function_value);
|
|
1211
|
+
|
|
1212
|
+
const std::vector<double>& col_value = highs.getSolution().col_value;
|
|
1213
|
+
if (dev_run)
|
|
1214
|
+
printf("Solution (%24.18g, %24.18g)\n", col_value[0], col_value[1]);
|
|
1215
|
+
double dl_solution = std::fabs(col_value[0]);
|
|
1216
|
+
REQUIRE(dl_solution < 1e-6);
|
|
1217
|
+
dl_solution = std::fabs(col_value[1] - 1.5);
|
|
1218
|
+
REQUIRE(dl_solution < 1e-6);
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
highs.resetGlobalScheduler(true);
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
TEST_CASE("issue-2489", "[qpsolver]") {
|
|
1225
|
+
// This QP is
|
|
1226
|
+
//
|
|
1227
|
+
// Min, x^2/2 + x
|
|
1228
|
+
//
|
|
1229
|
+
// 0*x + 0*y <= 1
|
|
1230
|
+
//
|
|
1231
|
+
// -10 <= (x, y) <= 10
|
|
1232
|
+
//
|
|
1233
|
+
// Hence it has a constraint, but its coefficients are zero
|
|
1234
|
+
Highs h;
|
|
1235
|
+
h.setOptionValue("output_flag", dev_run);
|
|
1236
|
+
REQUIRE(h.setOptionValue("log_dev_level", 3) == HighsStatus::kOk);
|
|
1237
|
+
REQUIRE(h.setOptionValue("time_limit", 3) == HighsStatus::kOk);
|
|
1238
|
+
REQUIRE(h.setOptionValue("qp_iteration_limit", 10) == HighsStatus::kOk);
|
|
1239
|
+
REQUIRE(h.addCol(1.0, -10.0, 10.0, 0, NULL, NULL) == HighsStatus::kOk);
|
|
1240
|
+
REQUIRE(h.addCol(0.0, -10.0, 10.0, 0, NULL, NULL) == HighsStatus::kOk);
|
|
1241
|
+
REQUIRE(h.addRow(0.0, 0.0, 0, NULL, NULL) == HighsStatus::kOk);
|
|
1242
|
+
HighsHessian hessian;
|
|
1243
|
+
hessian.dim_ = 1;
|
|
1244
|
+
hessian.format_ = HessianFormat::kTriangular;
|
|
1245
|
+
hessian.start_ = {0, 1};
|
|
1246
|
+
hessian.index_ = {0};
|
|
1247
|
+
hessian.value_ = {1.0};
|
|
1248
|
+
REQUIRE(h.passHessian(hessian) == HighsStatus::kOk);
|
|
1249
|
+
|
|
1250
|
+
for (auto& solver : solvers) {
|
|
1251
|
+
h.setOptionValue("solver", solver);
|
|
1252
|
+
HighsStatus run_status = h.run();
|
|
1253
|
+
if (dev_run)
|
|
1254
|
+
printf("Test 2489: run_status = %s\n",
|
|
1255
|
+
run_status == HighsStatus::kError ? "Error"
|
|
1256
|
+
: run_status == HighsStatus::kWarning ? "Warning"
|
|
1257
|
+
: "OK");
|
|
1258
|
+
|
|
1259
|
+
// test fails using asm, but succeeds using hipo
|
|
1260
|
+
const HighsStatus expected_status =
|
|
1261
|
+
(solver == kQpAsmString ? HighsStatus::kWarning : HighsStatus::kOk);
|
|
1262
|
+
REQUIRE(run_status == expected_status);
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
h.resetGlobalScheduler(true);
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
TEST_CASE("issue-2821", "[qpsolver]") {
|
|
1269
|
+
Highs h;
|
|
1270
|
+
h.setOptionValue("output_flag", dev_run);
|
|
1271
|
+
const HighsInfo& info = h.getInfo();
|
|
1272
|
+
const std::string dirname = std::string(HIGHS_DIR) + "/check/instances/";
|
|
1273
|
+
std::string filename, model;
|
|
1274
|
+
const double optimal_objective_value = -6.0;
|
|
1275
|
+
HighsStatus read_status;
|
|
1276
|
+
// Warnings are not returned by readModel
|
|
1277
|
+
HighsStatus read_warning_status = HighsStatus::kOk;
|
|
1278
|
+
for (HighsInt k = 0; k < 6; k++) {
|
|
1279
|
+
if (k == 0) {
|
|
1280
|
+
// QUADOBJ with two upper triangular entries
|
|
1281
|
+
model = "2821";
|
|
1282
|
+
read_status = read_warning_status;
|
|
1283
|
+
} else if (k == 1) {
|
|
1284
|
+
// QUADOBJ with two upper triangular entries, and not in
|
|
1285
|
+
// conventional order
|
|
1286
|
+
model = "2821-quadobj";
|
|
1287
|
+
read_status = read_warning_status;
|
|
1288
|
+
} else if (k == 2) {
|
|
1289
|
+
// QMATRIX with entries not in conventional order
|
|
1290
|
+
model = "2821-qmatrix";
|
|
1291
|
+
read_status = HighsStatus::kOk;
|
|
1292
|
+
} else if (k == 3) {
|
|
1293
|
+
// QUADOBJ with duplicate entries summed, and two upper
|
|
1294
|
+
// triangular entries
|
|
1295
|
+
model = "2821-duplicate";
|
|
1296
|
+
read_status = read_warning_status;
|
|
1297
|
+
} else if (k == 4) {
|
|
1298
|
+
// QUADOBJ with two upper triangular entries, one leading to
|
|
1299
|
+
// summation
|
|
1300
|
+
model = "2821-summation";
|
|
1301
|
+
read_status = read_warning_status;
|
|
1302
|
+
} else {
|
|
1303
|
+
// QMATRIX with pair of asymmetric entries
|
|
1304
|
+
model = "2821-asymmetric";
|
|
1305
|
+
read_status = HighsStatus::kError;
|
|
1306
|
+
}
|
|
1307
|
+
if (dev_run)
|
|
1308
|
+
printf("\nTest with model %s\n===============\n", model.c_str());
|
|
1309
|
+
filename = dirname + model + ".mps";
|
|
1310
|
+
REQUIRE(h.readModel(filename) == read_status);
|
|
1311
|
+
if (read_status == HighsStatus::kOk ||
|
|
1312
|
+
read_status == HighsStatus::kWarning) {
|
|
1313
|
+
REQUIRE(h.run() == HighsStatus::kOk);
|
|
1314
|
+
REQUIRE(okValueDifference(info.objective_function_value,
|
|
1315
|
+
optimal_objective_value));
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
h.resetGlobalScheduler(true);
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
/*
|
|
1322
|
+
// This case causes a segfault with the meson build, but not with
|
|
1323
|
+
// cmake. Might be indicative of the bug causing the degeneracy
|
|
1324
|
+
// failure. Hence, for now, the unite test is commented out
|
|
1325
|
+
//
|
|
1326
|
+
TEST_CASE("issue-2894", "[qpsolver]") {
|
|
1327
|
+
Highs h;
|
|
1328
|
+
h.setOptionValue("output_flag", dev_run);
|
|
1329
|
+
const std::string dirname = std::string(HIGHS_DIR) + "/check/instances/";
|
|
1330
|
+
std::string model = "2894";
|
|
1331
|
+
std::string filename = dirname + model + ".mps";
|
|
1332
|
+
REQUIRE(h.readModel(filename) == HighsStatus::kOk);
|
|
1333
|
+
for (auto& solver : solvers) {
|
|
1334
|
+
REQUIRE(h.setOptionValue("solver", solver) == HighsStatus::kOk);
|
|
1335
|
+
if (solver == kQpAsmString) {
|
|
1336
|
+
REQUIRE(h.run() == HighsStatus::kError);
|
|
1337
|
+
REQUIRE(h.getModelStatus() == HighsModelStatus::kSolveError);
|
|
1338
|
+
} else {
|
|
1339
|
+
REQUIRE(h.run() == HighsStatus::kOk);
|
|
1340
|
+
REQUIRE(h.getModelStatus() == HighsModelStatus::kOptimal);
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
h.resetGlobalScheduler(true);
|
|
1344
|
+
}
|
|
1345
|
+
*/
|