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,1722 @@
|
|
|
1
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
2
|
+
/* */
|
|
3
|
+
/* This file is part of the HiGHS linear optimization suite */
|
|
4
|
+
/* */
|
|
5
|
+
/* Available as open-source under the MIT License */
|
|
6
|
+
/* */
|
|
7
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
8
|
+
/**@file lp_data/HEkkDebug.cpp
|
|
9
|
+
* @brief
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
#include <cassert>
|
|
13
|
+
#include <cmath>
|
|
14
|
+
#include <string>
|
|
15
|
+
|
|
16
|
+
#include "lp_data/HighsDebug.h"
|
|
17
|
+
#include "lp_data/HighsModelUtils.h"
|
|
18
|
+
#include "simplex/HEkk.h"
|
|
19
|
+
#include "simplex/HSimplexReport.h"
|
|
20
|
+
#include "simplex/SimplexTimer.h"
|
|
21
|
+
|
|
22
|
+
using std::abs;
|
|
23
|
+
using std::max;
|
|
24
|
+
|
|
25
|
+
const double ok_feasibility_difference = 1e-3;
|
|
26
|
+
|
|
27
|
+
const double large_basic_dual = 1e-12;
|
|
28
|
+
const double excessive_basic_dual = sqrt(large_basic_dual);
|
|
29
|
+
|
|
30
|
+
const double large_residual_error = 1e-12;
|
|
31
|
+
const double excessive_residual_error = sqrt(large_residual_error);
|
|
32
|
+
|
|
33
|
+
const double updated_dual_small_relative_error = 1e-12;
|
|
34
|
+
const double updated_dual_large_relative_error =
|
|
35
|
+
sqrt(updated_dual_small_relative_error);
|
|
36
|
+
const double updated_dual_small_absolute_error = 1e-6;
|
|
37
|
+
const double updated_dual_large_absolute_error =
|
|
38
|
+
sqrt(updated_dual_small_absolute_error);
|
|
39
|
+
|
|
40
|
+
void HEkk::debugInitialise() {
|
|
41
|
+
debug_solve_call_num_++;
|
|
42
|
+
debug_initial_build_synthetic_tick_ = build_synthetic_tick_;
|
|
43
|
+
const HighsInt debug_from_solve_call_num = -12;
|
|
44
|
+
const HighsInt debug_num_solve = 3;
|
|
45
|
+
const HighsInt debug_to_solve_call_num =
|
|
46
|
+
debug_from_solve_call_num + debug_num_solve - 1;
|
|
47
|
+
const HighsInt debug_build_synthetic_tick = 445560;
|
|
48
|
+
if (debug_solve_call_num_ < debug_from_solve_call_num) {
|
|
49
|
+
debug_solve_report_ = false;
|
|
50
|
+
} else if (debug_solve_call_num_ == debug_from_solve_call_num) {
|
|
51
|
+
debug_solve_report_ = build_synthetic_tick_ == debug_build_synthetic_tick;
|
|
52
|
+
} else if (debug_solve_call_num_ > debug_to_solve_call_num) {
|
|
53
|
+
debug_solve_report_ = false;
|
|
54
|
+
}
|
|
55
|
+
const HighsInt time_from_solve_call_num = -1;
|
|
56
|
+
const HighsInt time_to_solve_call_num = time_from_solve_call_num;
|
|
57
|
+
time_report_ = debug_solve_call_num_ >= time_from_solve_call_num &&
|
|
58
|
+
debug_solve_call_num_ <= time_to_solve_call_num;
|
|
59
|
+
const HighsInt debug_basis_id = -999;
|
|
60
|
+
debug_basis_report_ = basis_.debug_id == debug_basis_id;
|
|
61
|
+
if (debug_solve_report_) {
|
|
62
|
+
printf("HEkk::solve call %d\n", (int)debug_solve_call_num_);
|
|
63
|
+
debugReporting(-1);
|
|
64
|
+
debugReporting(0, kHighsLogDevLevelVerbose); // Detailed); //
|
|
65
|
+
}
|
|
66
|
+
if (time_report_) {
|
|
67
|
+
timeReporting(-1);
|
|
68
|
+
timeReporting(0);
|
|
69
|
+
}
|
|
70
|
+
if (debug_basis_report_) {
|
|
71
|
+
printf("HEkk::solve basis %d\n", (int)debug_basis_id);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
void HEkk::debugReportInitialBasis() {
|
|
76
|
+
HighsInt num_col_basic = 0;
|
|
77
|
+
HighsInt num_col_lower = 0;
|
|
78
|
+
HighsInt num_col_upper = 0;
|
|
79
|
+
HighsInt num_col_fixed = 0;
|
|
80
|
+
HighsInt num_col_free = 0;
|
|
81
|
+
HighsInt num_row_basic = 0;
|
|
82
|
+
HighsInt num_row_lower = 0;
|
|
83
|
+
HighsInt num_row_upper = 0;
|
|
84
|
+
HighsInt num_row_fixed = 0;
|
|
85
|
+
HighsInt num_row_free = 0;
|
|
86
|
+
std::vector<double>& lower = info_.workLower_;
|
|
87
|
+
std::vector<double>& upper = info_.workUpper_;
|
|
88
|
+
std::vector<double>& value = info_.workValue_;
|
|
89
|
+
const bool detail = lp_.num_col_ + lp_.num_row_ < 25;
|
|
90
|
+
for (HighsInt iCol = 0; iCol < lp_.num_col_; iCol++) {
|
|
91
|
+
HighsInt iVar = iCol;
|
|
92
|
+
if (!basis_.nonbasicFlag_[iVar]) {
|
|
93
|
+
num_col_basic++;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (basis_.nonbasicMove_[iVar] > 0) {
|
|
97
|
+
num_col_lower++;
|
|
98
|
+
} else if (basis_.nonbasicMove_[iVar] < 0) {
|
|
99
|
+
num_col_upper++;
|
|
100
|
+
} else if (lower[iCol] == upper[iCol]) {
|
|
101
|
+
num_col_fixed++;
|
|
102
|
+
} else {
|
|
103
|
+
num_col_free++;
|
|
104
|
+
}
|
|
105
|
+
if (detail)
|
|
106
|
+
highsLogDev(options_->log_options, HighsLogType::kInfo,
|
|
107
|
+
"Col %3d [%11.4g, %11.4g, %11.4g] %3d %3d %3d %3d\n",
|
|
108
|
+
(int)iCol, lower[iCol], value[iVar], upper[iCol],
|
|
109
|
+
num_col_lower, num_col_upper, num_col_fixed, num_col_free);
|
|
110
|
+
}
|
|
111
|
+
for (HighsInt iRow = 0; iRow < lp_.num_row_; iRow++) {
|
|
112
|
+
HighsInt iVar = lp_.num_col_ + iRow;
|
|
113
|
+
if (!basis_.nonbasicFlag_[iVar]) {
|
|
114
|
+
num_row_basic++;
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
if (basis_.nonbasicMove_[iVar] > 0) {
|
|
118
|
+
num_row_lower++;
|
|
119
|
+
} else if (basis_.nonbasicMove_[iVar] < 0) {
|
|
120
|
+
num_row_upper++;
|
|
121
|
+
} else if (lower[iVar] == upper[iVar]) {
|
|
122
|
+
num_row_fixed++;
|
|
123
|
+
} else {
|
|
124
|
+
num_row_free++;
|
|
125
|
+
}
|
|
126
|
+
if (detail)
|
|
127
|
+
highsLogDev(options_->log_options, HighsLogType::kInfo,
|
|
128
|
+
"Row %3d [%11.4g, %11.4g, %11.4g] %3d %3d %3d %3d\n",
|
|
129
|
+
(int)iRow, lower[iVar], value[iVar], upper[iVar],
|
|
130
|
+
num_row_lower, num_row_upper, num_row_fixed, num_row_free);
|
|
131
|
+
}
|
|
132
|
+
HighsInt num_col_nonbasic =
|
|
133
|
+
num_col_lower + num_col_upper + num_col_fixed + num_col_free;
|
|
134
|
+
HighsInt num_row_nonbasic =
|
|
135
|
+
num_row_lower + num_row_upper + num_row_fixed + num_row_free;
|
|
136
|
+
assert(num_col_basic + num_row_basic == lp_.num_row_);
|
|
137
|
+
assert(num_col_nonbasic + num_row_nonbasic == lp_.num_col_);
|
|
138
|
+
highsLogDev(options_->log_options, HighsLogType::kInfo,
|
|
139
|
+
"For %d columns and %d rows\n"
|
|
140
|
+
" NonBasic | Lower Upper Fixed Free | Basic\n"
|
|
141
|
+
"Col %7d |%7d%7d%7d%7d | %7d\n"
|
|
142
|
+
"Row %7d |%7d%7d%7d%7d | %7d\n"
|
|
143
|
+
"----------------------------------------------------\n"
|
|
144
|
+
" %7d |%7d%7d%7d%7d | %7d\n",
|
|
145
|
+
(int)lp_.num_col_, (int)lp_.num_row_, (int)num_col_nonbasic,
|
|
146
|
+
(int)num_col_lower, (int)num_col_upper, (int)num_col_fixed,
|
|
147
|
+
(int)num_col_free, (int)num_col_basic, (int)num_row_nonbasic,
|
|
148
|
+
(int)num_row_lower, (int)num_row_upper, (int)num_row_fixed,
|
|
149
|
+
(int)num_row_free, (int)num_row_basic,
|
|
150
|
+
(int)num_col_nonbasic + (int)num_row_nonbasic,
|
|
151
|
+
(int)num_col_lower + (int)num_row_lower,
|
|
152
|
+
(int)num_col_upper + (int)num_row_upper,
|
|
153
|
+
(int)num_col_fixed + (int)num_row_fixed,
|
|
154
|
+
(int)num_col_free + (int)num_row_free,
|
|
155
|
+
(int)num_col_basic + (int)num_row_basic);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
void HEkk::timeReporting(const HighsInt save_mod_recover) {
|
|
159
|
+
static HighsInt highs_analysis_level;
|
|
160
|
+
if (save_mod_recover == -1) {
|
|
161
|
+
highs_analysis_level = options_->highs_analysis_level;
|
|
162
|
+
} else if (save_mod_recover == 0) {
|
|
163
|
+
// Ensure that kHighsAnalysisLevelSolverTime is set
|
|
164
|
+
if (!(kHighsAnalysisLevelSolverTime & highs_analysis_level))
|
|
165
|
+
this->options_->highs_analysis_level += kHighsAnalysisLevelSolverTime;
|
|
166
|
+
} else {
|
|
167
|
+
options_->highs_analysis_level = highs_analysis_level;
|
|
168
|
+
SimplexTimer simplex_timer;
|
|
169
|
+
const bool non_null_report = simplex_timer.reportSimplexInnerClock(
|
|
170
|
+
this->analysis_.thread_simplex_clocks[0], 20);
|
|
171
|
+
this->analysis_.analyse_simplex_time =
|
|
172
|
+
kHighsAnalysisLevelSolverTime & options_->highs_analysis_level;
|
|
173
|
+
if (non_null_report) {
|
|
174
|
+
HighsLogOptions log_options;
|
|
175
|
+
bool output_flag = true;
|
|
176
|
+
bool log_to_console = false;
|
|
177
|
+
HighsInt log_dev_level = kHighsLogDevLevelVerbose;
|
|
178
|
+
log_options.log_stream = stdout;
|
|
179
|
+
log_options.output_flag = &output_flag;
|
|
180
|
+
log_options.log_to_console = &log_to_console;
|
|
181
|
+
log_options.log_dev_level = &log_dev_level;
|
|
182
|
+
reportSimplexPhaseIterations(log_options, this->iteration_count_,
|
|
183
|
+
this->info_);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
void HEkk::debugReporting(const HighsInt save_mod_recover,
|
|
189
|
+
const HighsInt log_dev_level_) {
|
|
190
|
+
static bool output_flag;
|
|
191
|
+
static HighsInt log_dev_level;
|
|
192
|
+
static HighsInt highs_analysis_level;
|
|
193
|
+
static HighsInt highs_debug_level;
|
|
194
|
+
static bool analyse_simplex_runtime_data;
|
|
195
|
+
if (save_mod_recover == -1) {
|
|
196
|
+
output_flag = options_->output_flag;
|
|
197
|
+
log_dev_level = options_->log_dev_level;
|
|
198
|
+
highs_analysis_level = options_->highs_analysis_level;
|
|
199
|
+
highs_debug_level = options_->highs_debug_level;
|
|
200
|
+
analyse_simplex_runtime_data = analysis_.analyse_simplex_runtime_data;
|
|
201
|
+
} else if (save_mod_recover == 0) {
|
|
202
|
+
this->options_->output_flag = true;
|
|
203
|
+
this->options_->log_dev_level = log_dev_level_;
|
|
204
|
+
this->options_->highs_analysis_level =
|
|
205
|
+
// kHighsAnalysisLevelSolverSummaryData +
|
|
206
|
+
kHighsAnalysisLevelSolverRuntimeData;
|
|
207
|
+
this->options_->highs_debug_level = kHighsDebugLevelCostly;
|
|
208
|
+
if (log_dev_level_ == kHighsLogDevLevelVerbose)
|
|
209
|
+
this->analysis_.analyse_simplex_runtime_data = true;
|
|
210
|
+
} else {
|
|
211
|
+
options_->output_flag = output_flag;
|
|
212
|
+
options_->log_dev_level = log_dev_level;
|
|
213
|
+
options_->highs_analysis_level = highs_analysis_level;
|
|
214
|
+
options_->highs_debug_level = highs_debug_level;
|
|
215
|
+
analysis_.analyse_simplex_runtime_data = analyse_simplex_runtime_data;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
HighsDebugStatus HEkk::debugSimplex(const std::string message,
|
|
220
|
+
const SimplexAlgorithm algorithm,
|
|
221
|
+
const HighsInt phase,
|
|
222
|
+
const bool initialise) const {
|
|
223
|
+
if (this->options_->highs_debug_level < kHighsDebugLevelCheap)
|
|
224
|
+
return HighsDebugStatus::kNotChecked;
|
|
225
|
+
static double max_max_basic_dual;
|
|
226
|
+
static double max_max_primal_residual;
|
|
227
|
+
static double max_max_dual_residual;
|
|
228
|
+
if (initialise) {
|
|
229
|
+
max_max_basic_dual = 0;
|
|
230
|
+
max_max_primal_residual = 0;
|
|
231
|
+
max_max_dual_residual = 0;
|
|
232
|
+
return ::HighsDebugStatus::kOk;
|
|
233
|
+
}
|
|
234
|
+
HighsDebugStatus return_status = HighsDebugStatus::kOk;
|
|
235
|
+
const HighsLp& lp = this->lp_;
|
|
236
|
+
const HighsSimplexInfo& info = this->info_;
|
|
237
|
+
const SimplexBasis& basis = this->basis_;
|
|
238
|
+
const HighsOptions& options = *(this->options_);
|
|
239
|
+
|
|
240
|
+
const HighsInt num_col = lp.num_col_;
|
|
241
|
+
const HighsInt num_row = lp.num_row_;
|
|
242
|
+
const HighsInt num_tot = num_col + num_row;
|
|
243
|
+
const HighsInt iteration_count = this->iteration_count_;
|
|
244
|
+
std::string value_adjective;
|
|
245
|
+
HighsLogType report_level;
|
|
246
|
+
|
|
247
|
+
// Check the nonbasic flags are all kNonbasicFlagTrue or kNonbasicFlagFalse
|
|
248
|
+
for (HighsInt iVar = 0; iVar < num_tot; iVar++) {
|
|
249
|
+
HighsInt flag = basis.nonbasicFlag_[iVar];
|
|
250
|
+
bool flag_error = flag != kNonbasicFlagTrue && flag != kNonbasicFlagFalse;
|
|
251
|
+
if (flag_error) {
|
|
252
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
253
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
254
|
+
" Variable %" HIGHSINT_FORMAT
|
|
255
|
+
" has "
|
|
256
|
+
"nonbasic flag = %" HIGHSINT_FORMAT "\n",
|
|
257
|
+
message.c_str(), iteration_count, iVar, flag);
|
|
258
|
+
assert(!flag_error);
|
|
259
|
+
return HighsDebugStatus::kLogicalError;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
const double primal_feasibility_tolerance =
|
|
263
|
+
options.primal_feasibility_tolerance;
|
|
264
|
+
const double dual_feasibility_tolerance = options.dual_feasibility_tolerance;
|
|
265
|
+
HighsInt num_dual_infeasibility = 0;
|
|
266
|
+
double max_dual_infeasibility = 0;
|
|
267
|
+
double sum_dual_infeasibility = 0;
|
|
268
|
+
HighsInt num_primal_infeasibility = 0;
|
|
269
|
+
double max_primal_infeasibility = 0;
|
|
270
|
+
double sum_primal_infeasibility = 0;
|
|
271
|
+
// Check the nonbasic variables
|
|
272
|
+
for (HighsInt iVar = 0; iVar < num_tot; iVar++) {
|
|
273
|
+
if (basis.nonbasicFlag_[iVar] == kNonbasicFlagFalse) continue;
|
|
274
|
+
// For nonbasic variables, check that they are on a bound (or free
|
|
275
|
+
// at 0 with correct nonbasic move. Determine dual infeasibilities
|
|
276
|
+
double dual = info.workDual_[iVar];
|
|
277
|
+
double lower = info.workLower_[iVar];
|
|
278
|
+
double upper = info.workUpper_[iVar];
|
|
279
|
+
double value = info.workValue_[iVar];
|
|
280
|
+
double primal_error = 0;
|
|
281
|
+
double dual_infeasibility = 0;
|
|
282
|
+
HighsInt move;
|
|
283
|
+
if (lower == upper) {
|
|
284
|
+
primal_error = abs(lower - value);
|
|
285
|
+
move = kNonbasicMoveZe;
|
|
286
|
+
} else if (value == lower) {
|
|
287
|
+
move = kNonbasicMoveUp;
|
|
288
|
+
dual_infeasibility = max(-dual, 0.);
|
|
289
|
+
} else if (value == upper) {
|
|
290
|
+
move = kNonbasicMoveDn;
|
|
291
|
+
dual_infeasibility = max(dual, 0.);
|
|
292
|
+
} else {
|
|
293
|
+
// If not fixed or at a bound, only valid status can be zero and free
|
|
294
|
+
primal_error = abs(value);
|
|
295
|
+
move = kNonbasicMoveZe;
|
|
296
|
+
dual_infeasibility = abs(dual);
|
|
297
|
+
}
|
|
298
|
+
if (dual_infeasibility > 0) {
|
|
299
|
+
if (dual_infeasibility > dual_feasibility_tolerance) {
|
|
300
|
+
num_dual_infeasibility++;
|
|
301
|
+
}
|
|
302
|
+
max_dual_infeasibility = max(dual_infeasibility, max_dual_infeasibility);
|
|
303
|
+
sum_dual_infeasibility += dual_infeasibility;
|
|
304
|
+
}
|
|
305
|
+
if (primal_error) {
|
|
306
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
307
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
308
|
+
" Nonbasic variable %" HIGHSINT_FORMAT
|
|
309
|
+
" "
|
|
310
|
+
"has primal error "
|
|
311
|
+
"= %g for [%g, %g, %g]\n",
|
|
312
|
+
message.c_str(), iteration_count, iVar, primal_error, lower,
|
|
313
|
+
value, upper);
|
|
314
|
+
assert(!primal_error);
|
|
315
|
+
return HighsDebugStatus::kLogicalError;
|
|
316
|
+
}
|
|
317
|
+
bool move_error = move != basis.nonbasicMove_[iVar];
|
|
318
|
+
if (move_error) {
|
|
319
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
320
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
321
|
+
" Nonbasic variable %" HIGHSINT_FORMAT
|
|
322
|
+
" "
|
|
323
|
+
"has move error "
|
|
324
|
+
"[%" HIGHSINT_FORMAT " <> %" HIGHSINT_FORMAT
|
|
325
|
+
"] for [%g, %g, %g]\n",
|
|
326
|
+
message.c_str(), iteration_count, iVar, move,
|
|
327
|
+
basis.nonbasicMove_[iVar], lower, value, upper);
|
|
328
|
+
assert(!move_error);
|
|
329
|
+
return HighsDebugStatus::kLogicalError;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
// Check the basic variables
|
|
333
|
+
double max_basic_dual = 0;
|
|
334
|
+
const double base =
|
|
335
|
+
info.primal_simplex_phase1_cost_perturbation_multiplier * 5e-7;
|
|
336
|
+
for (HighsInt iRow = 0; iRow < num_row; iRow++) {
|
|
337
|
+
HighsInt iVar = basis.basicIndex_[iRow];
|
|
338
|
+
// For basic variables, check that the nonbasic flag isn't set,
|
|
339
|
+
// that nonbasicMove is zero, that baseLower/Upper are correct,
|
|
340
|
+
// that the dual is zero and, in primal phase 1, that the cost is
|
|
341
|
+
// correct. Determine primal infeasibilities
|
|
342
|
+
bool nonbasicFlag_error = basis.nonbasicFlag_[iVar] == kNonbasicFlagTrue;
|
|
343
|
+
if (nonbasicFlag_error) {
|
|
344
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
345
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
346
|
+
" Basic variable %" HIGHSINT_FORMAT
|
|
347
|
+
" "
|
|
348
|
+
"has nonbasicFlag = %" HIGHSINT_FORMAT "\n",
|
|
349
|
+
message.c_str(), iteration_count, iVar,
|
|
350
|
+
basis.nonbasicFlag_[iVar]);
|
|
351
|
+
assert(!nonbasicFlag_error);
|
|
352
|
+
return HighsDebugStatus::kLogicalError;
|
|
353
|
+
}
|
|
354
|
+
bool nonbasicMove_error = (basis.nonbasicMove_[iVar] != 0);
|
|
355
|
+
if (nonbasicMove_error) {
|
|
356
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
357
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
358
|
+
" Basic variable %" HIGHSINT_FORMAT
|
|
359
|
+
" "
|
|
360
|
+
"has nonbasicMove = %" HIGHSINT_FORMAT "\n",
|
|
361
|
+
message.c_str(), iteration_count, iVar,
|
|
362
|
+
basis.nonbasicMove_[iVar]);
|
|
363
|
+
assert(!nonbasicMove_error);
|
|
364
|
+
return HighsDebugStatus::kLogicalError;
|
|
365
|
+
}
|
|
366
|
+
double workLower = info.workLower_[iVar];
|
|
367
|
+
double workUpper = info.workUpper_[iVar];
|
|
368
|
+
double cost = info.workCost_[iVar];
|
|
369
|
+
double dual = info.workDual_[iVar];
|
|
370
|
+
double lower = info.baseLower_[iRow];
|
|
371
|
+
double upper = info.baseUpper_[iRow];
|
|
372
|
+
double value = info.baseValue_[iRow];
|
|
373
|
+
bool baseBound_error = workLower != lower || workUpper != upper;
|
|
374
|
+
if (baseBound_error) {
|
|
375
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
376
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
377
|
+
" Basic variable %" HIGHSINT_FORMAT
|
|
378
|
+
" "
|
|
379
|
+
"(in row %" HIGHSINT_FORMAT
|
|
380
|
+
") has "
|
|
381
|
+
"baseBound [%g, %g] and workBound [%g, %g]\n",
|
|
382
|
+
message.c_str(), iteration_count, iVar, iRow, lower, upper,
|
|
383
|
+
workLower, workUpper);
|
|
384
|
+
assert(!baseBound_error);
|
|
385
|
+
return HighsDebugStatus::kLogicalError;
|
|
386
|
+
}
|
|
387
|
+
max_basic_dual = max(abs(dual), max_basic_dual);
|
|
388
|
+
HighsInt bound_violated = 0;
|
|
389
|
+
if (value < lower - primal_feasibility_tolerance) {
|
|
390
|
+
bound_violated = -1;
|
|
391
|
+
} else if (value > upper + primal_feasibility_tolerance) {
|
|
392
|
+
bound_violated = 1;
|
|
393
|
+
}
|
|
394
|
+
if (algorithm == SimplexAlgorithm::kPrimal && phase == 1) {
|
|
395
|
+
double primal_phase1_cost = bound_violated;
|
|
396
|
+
if (base) primal_phase1_cost *= 1 + base * info.numTotRandomValue_[iRow];
|
|
397
|
+
bool primal_phase1_cost_error = (abs(cost - primal_phase1_cost) != 0.0);
|
|
398
|
+
if (primal_phase1_cost_error) {
|
|
399
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
400
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
401
|
+
" Basic variable %" HIGHSINT_FORMAT
|
|
402
|
+
" "
|
|
403
|
+
"(in row %" HIGHSINT_FORMAT
|
|
404
|
+
") has "
|
|
405
|
+
"primal phase 1 cost %g for [%g, %g, %g]\n",
|
|
406
|
+
message.c_str(), iteration_count, iVar, iRow, cost, lower,
|
|
407
|
+
value, upper);
|
|
408
|
+
assert(!primal_phase1_cost_error);
|
|
409
|
+
return HighsDebugStatus::kLogicalError;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
if (!bound_violated) continue;
|
|
413
|
+
// @primal_infeasibility calculation
|
|
414
|
+
double primal_infeasibility = 0;
|
|
415
|
+
if (bound_violated < 0) {
|
|
416
|
+
primal_infeasibility = lower - value;
|
|
417
|
+
} else {
|
|
418
|
+
primal_infeasibility = value - upper;
|
|
419
|
+
}
|
|
420
|
+
if (primal_infeasibility > primal_feasibility_tolerance)
|
|
421
|
+
num_primal_infeasibility++;
|
|
422
|
+
max_primal_infeasibility =
|
|
423
|
+
max(primal_infeasibility, max_primal_infeasibility);
|
|
424
|
+
sum_primal_infeasibility += primal_infeasibility;
|
|
425
|
+
}
|
|
426
|
+
// Report on basic dual values
|
|
427
|
+
if (max_basic_dual > excessive_basic_dual) {
|
|
428
|
+
value_adjective = "Excessive";
|
|
429
|
+
report_level = HighsLogType::kInfo;
|
|
430
|
+
return_status = debugWorseStatus(HighsDebugStatus::kError, return_status);
|
|
431
|
+
} else if (max_basic_dual > large_basic_dual) {
|
|
432
|
+
value_adjective = "Large";
|
|
433
|
+
report_level = HighsLogType::kDetailed;
|
|
434
|
+
return_status = debugWorseStatus(HighsDebugStatus::kWarning, return_status);
|
|
435
|
+
} else {
|
|
436
|
+
value_adjective = "OK";
|
|
437
|
+
report_level = HighsLogType::kVerbose;
|
|
438
|
+
return_status = debugWorseStatus(HighsDebugStatus::kOk, return_status);
|
|
439
|
+
}
|
|
440
|
+
if (max_basic_dual > 2 * max_max_basic_dual) {
|
|
441
|
+
highsLogDev(options.log_options, report_level,
|
|
442
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
443
|
+
" %-9s max basic dual = %9.4g\n",
|
|
444
|
+
message.c_str(), iteration_count, value_adjective.c_str(),
|
|
445
|
+
max_basic_dual);
|
|
446
|
+
max_max_basic_dual = max_basic_dual;
|
|
447
|
+
}
|
|
448
|
+
// Check that the number, max and sums of primal and dual infeasibilities (if
|
|
449
|
+
// known) are correct
|
|
450
|
+
const HighsInt info_num_primal_infeasibility =
|
|
451
|
+
this->info_.num_primal_infeasibilities;
|
|
452
|
+
if (info_num_primal_infeasibility >= 0) {
|
|
453
|
+
const bool illegal_num_primal_infeasibility =
|
|
454
|
+
num_primal_infeasibility != info_num_primal_infeasibility;
|
|
455
|
+
if (illegal_num_primal_infeasibility) {
|
|
456
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
457
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
458
|
+
" Should have %" HIGHSINT_FORMAT
|
|
459
|
+
" not "
|
|
460
|
+
"%" HIGHSINT_FORMAT " primal infeasibilities\n",
|
|
461
|
+
message.c_str(), iteration_count, num_primal_infeasibility,
|
|
462
|
+
info_num_primal_infeasibility);
|
|
463
|
+
assert(!illegal_num_primal_infeasibility);
|
|
464
|
+
return HighsDebugStatus::kLogicalError;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
const double info_max_primal_infeasibility =
|
|
468
|
+
this->info_.max_primal_infeasibility;
|
|
469
|
+
if (info_max_primal_infeasibility != kHighsIllegalInfeasibilityMeasure) {
|
|
470
|
+
const bool illegal_max_primal_infeasibility =
|
|
471
|
+
abs(max_primal_infeasibility - info_max_primal_infeasibility) >
|
|
472
|
+
ok_feasibility_difference;
|
|
473
|
+
if (illegal_max_primal_infeasibility) {
|
|
474
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
475
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
476
|
+
" Should have %g not "
|
|
477
|
+
"%g max primal infeasibility\n",
|
|
478
|
+
message.c_str(), iteration_count, max_primal_infeasibility,
|
|
479
|
+
info_max_primal_infeasibility);
|
|
480
|
+
assert(!illegal_max_primal_infeasibility);
|
|
481
|
+
return HighsDebugStatus::kLogicalError;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
const double info_sum_primal_infeasibility =
|
|
485
|
+
this->info_.sum_primal_infeasibilities;
|
|
486
|
+
if (info_sum_primal_infeasibility != kHighsIllegalInfeasibilityMeasure) {
|
|
487
|
+
const bool illegal_sum_primal_infeasibility =
|
|
488
|
+
abs(sum_primal_infeasibility - info_sum_primal_infeasibility) >
|
|
489
|
+
ok_feasibility_difference;
|
|
490
|
+
if (illegal_sum_primal_infeasibility) {
|
|
491
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
492
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
493
|
+
" Should have %g not "
|
|
494
|
+
"%g sum primal infeasibilities\n",
|
|
495
|
+
message.c_str(), iteration_count, sum_primal_infeasibility,
|
|
496
|
+
info_sum_primal_infeasibility);
|
|
497
|
+
assert(!illegal_sum_primal_infeasibility);
|
|
498
|
+
return HighsDebugStatus::kLogicalError;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
const HighsInt info_num_dual_infeasibility =
|
|
502
|
+
this->info_.num_dual_infeasibilities;
|
|
503
|
+
if (info_num_dual_infeasibility >= 0) {
|
|
504
|
+
const bool illegal_num_dual_infeasibility =
|
|
505
|
+
num_dual_infeasibility != info_num_dual_infeasibility;
|
|
506
|
+
if (illegal_num_dual_infeasibility) {
|
|
507
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
508
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
509
|
+
" Should have %" HIGHSINT_FORMAT
|
|
510
|
+
" not "
|
|
511
|
+
"%" HIGHSINT_FORMAT " dual infeasibilities\n",
|
|
512
|
+
message.c_str(), iteration_count, num_dual_infeasibility,
|
|
513
|
+
info_num_dual_infeasibility);
|
|
514
|
+
assert(!illegal_num_dual_infeasibility);
|
|
515
|
+
return HighsDebugStatus::kLogicalError;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
const double info_max_dual_infeasibility = this->info_.max_dual_infeasibility;
|
|
519
|
+
if (info_max_dual_infeasibility != kHighsIllegalInfeasibilityMeasure) {
|
|
520
|
+
const bool illegal_max_dual_infeasibility =
|
|
521
|
+
abs(max_dual_infeasibility - info_max_dual_infeasibility) >
|
|
522
|
+
ok_feasibility_difference;
|
|
523
|
+
if (illegal_max_dual_infeasibility) {
|
|
524
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
525
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
526
|
+
" Should have %g not "
|
|
527
|
+
"%g max dual infeasibility\n",
|
|
528
|
+
message.c_str(), iteration_count, max_dual_infeasibility,
|
|
529
|
+
info_max_dual_infeasibility);
|
|
530
|
+
assert(!illegal_max_dual_infeasibility);
|
|
531
|
+
return HighsDebugStatus::kLogicalError;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
const double info_sum_dual_infeasibility =
|
|
535
|
+
this->info_.sum_dual_infeasibilities;
|
|
536
|
+
if (info_sum_dual_infeasibility != kHighsIllegalInfeasibilityMeasure) {
|
|
537
|
+
const bool illegal_sum_dual_infeasibility =
|
|
538
|
+
abs(sum_dual_infeasibility - info_sum_dual_infeasibility) >
|
|
539
|
+
ok_feasibility_difference;
|
|
540
|
+
if (illegal_sum_dual_infeasibility) {
|
|
541
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
542
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
543
|
+
" Should have %g not "
|
|
544
|
+
"%g sum dual infeasibilities\n",
|
|
545
|
+
message.c_str(), iteration_count, sum_dual_infeasibility,
|
|
546
|
+
info_sum_dual_infeasibility);
|
|
547
|
+
assert(!illegal_sum_dual_infeasibility);
|
|
548
|
+
return HighsDebugStatus::kLogicalError;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
// Check any assumed feasibility
|
|
552
|
+
bool require_primal_feasible_in_primal_simplex =
|
|
553
|
+
algorithm == SimplexAlgorithm::kPrimal && (phase == 0 || phase == 2);
|
|
554
|
+
bool require_primal_feasible_in_dual_simplex =
|
|
555
|
+
algorithm == SimplexAlgorithm::kDual && phase == 0;
|
|
556
|
+
bool require_primal_feasible = require_primal_feasible_in_primal_simplex ||
|
|
557
|
+
require_primal_feasible_in_dual_simplex;
|
|
558
|
+
bool illegal_primal_infeasibility =
|
|
559
|
+
require_primal_feasible && num_primal_infeasibility > 0;
|
|
560
|
+
if (illegal_primal_infeasibility) {
|
|
561
|
+
// Should be primal feasible, but isn't
|
|
562
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
563
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
564
|
+
" Should be primal "
|
|
565
|
+
"feasible, but num / max "
|
|
566
|
+
"/ sum primal infeasibility is %" HIGHSINT_FORMAT
|
|
567
|
+
" / %g / %g\n",
|
|
568
|
+
message.c_str(), iteration_count, num_primal_infeasibility,
|
|
569
|
+
max_primal_infeasibility, sum_primal_infeasibility);
|
|
570
|
+
assert(!illegal_primal_infeasibility);
|
|
571
|
+
return HighsDebugStatus::kLogicalError;
|
|
572
|
+
}
|
|
573
|
+
bool require_dual_feasible_in_dual_simplex =
|
|
574
|
+
algorithm == SimplexAlgorithm::kDual && this->status_.has_fresh_rebuild &&
|
|
575
|
+
this->info_.allow_cost_perturbation;
|
|
576
|
+
|
|
577
|
+
bool illegal_dual_infeasibility =
|
|
578
|
+
(require_dual_feasible_in_dual_simplex || phase == 0) &&
|
|
579
|
+
num_dual_infeasibility > 0;
|
|
580
|
+
if (illegal_dual_infeasibility) {
|
|
581
|
+
// Dual simplex or optimal but has dual infeasibilities
|
|
582
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
583
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
584
|
+
" Should be dual "
|
|
585
|
+
"feasible, but num / max / "
|
|
586
|
+
"sum dual infeasibility is %" HIGHSINT_FORMAT
|
|
587
|
+
" / %g / %g; Phase = %" HIGHSINT_FORMAT "; status = %s\n",
|
|
588
|
+
message.c_str(), iteration_count, num_dual_infeasibility,
|
|
589
|
+
max_dual_infeasibility, sum_dual_infeasibility, phase,
|
|
590
|
+
utilModelStatusToString(this->model_status_).c_str());
|
|
591
|
+
assert(!illegal_dual_infeasibility);
|
|
592
|
+
return HighsDebugStatus::kLogicalError;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
if (this->options_->highs_debug_level < kHighsDebugLevelCostly)
|
|
596
|
+
return return_status;
|
|
597
|
+
// Now determine the primal and dual residuals.
|
|
598
|
+
//
|
|
599
|
+
// This uses the primal values for the columns to determine row
|
|
600
|
+
// activities that are checked against the primal values for the
|
|
601
|
+
// rows. It uses the pi vector to determine column duals. The
|
|
602
|
+
// entries of the pi vector are the negated duals for nonbasic rows,
|
|
603
|
+
// and costs for basic rows. The latter are normally zero, but will
|
|
604
|
+
// be nonzero if the constraint is violated in primal phase 1, or if
|
|
605
|
+
// the row cost is a perturbed zero in dual simplex.
|
|
606
|
+
vector<double> primal_value(num_tot);
|
|
607
|
+
vector<double> dual_value(num_tot);
|
|
608
|
+
for (HighsInt iVar = 0; iVar < num_tot; iVar++) {
|
|
609
|
+
primal_value[iVar] = info.workValue_[iVar];
|
|
610
|
+
dual_value[iVar] = info.workDual_[iVar];
|
|
611
|
+
}
|
|
612
|
+
for (HighsInt iRow = 0; iRow < num_row; iRow++) {
|
|
613
|
+
HighsInt iVar = basis.basicIndex_[iRow];
|
|
614
|
+
primal_value[iVar] = info.baseValue_[iRow];
|
|
615
|
+
dual_value[iVar] = -info.workCost_[iVar];
|
|
616
|
+
}
|
|
617
|
+
// Accumulate primal_activities
|
|
618
|
+
double max_dual_residual = 0;
|
|
619
|
+
vector<double> primal_activity(num_row, 0);
|
|
620
|
+
for (HighsInt iCol = 0; iCol < num_col; iCol++) {
|
|
621
|
+
double dual = info.workCost_[iCol];
|
|
622
|
+
double value = primal_value[iCol];
|
|
623
|
+
for (HighsInt iEl = lp.a_matrix_.start_[iCol];
|
|
624
|
+
iEl < lp.a_matrix_.start_[iCol + 1]; iEl++) {
|
|
625
|
+
HighsInt iRow = lp.a_matrix_.index_[iEl];
|
|
626
|
+
HighsInt iVar = num_col + iRow;
|
|
627
|
+
double Avalue = lp.a_matrix_.value_[iEl];
|
|
628
|
+
primal_activity[iRow] += value * Avalue;
|
|
629
|
+
dual += dual_value[iVar] * Avalue;
|
|
630
|
+
}
|
|
631
|
+
double dual_residual = abs(dual - info.workDual_[iCol]);
|
|
632
|
+
max_dual_residual = max(dual_residual, max_dual_residual);
|
|
633
|
+
}
|
|
634
|
+
// Remember that simplex row values are the negated row activities
|
|
635
|
+
double max_primal_residual = 0;
|
|
636
|
+
for (HighsInt iRow = 0; iRow < num_row; iRow++) {
|
|
637
|
+
HighsInt iVar = num_col + iRow;
|
|
638
|
+
double primal_residual = abs(primal_activity[iRow] + primal_value[iVar]);
|
|
639
|
+
max_primal_residual = max(primal_residual, max_primal_residual);
|
|
640
|
+
}
|
|
641
|
+
if (max_primal_residual > excessive_residual_error) {
|
|
642
|
+
value_adjective = "Excessive";
|
|
643
|
+
report_level = HighsLogType::kInfo;
|
|
644
|
+
return_status = debugWorseStatus(HighsDebugStatus::kError, return_status);
|
|
645
|
+
} else if (max_primal_residual > large_residual_error) {
|
|
646
|
+
value_adjective = "Large";
|
|
647
|
+
report_level = HighsLogType::kDetailed;
|
|
648
|
+
return_status = debugWorseStatus(HighsDebugStatus::kWarning, return_status);
|
|
649
|
+
} else {
|
|
650
|
+
value_adjective = "OK";
|
|
651
|
+
report_level = HighsLogType::kVerbose;
|
|
652
|
+
return_status = debugWorseStatus(HighsDebugStatus::kOk, return_status);
|
|
653
|
+
}
|
|
654
|
+
if (max_primal_residual > 2 * max_max_primal_residual) {
|
|
655
|
+
highsLogDev(options.log_options, report_level,
|
|
656
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
657
|
+
" %-9s max primal residual = %9.4g\n",
|
|
658
|
+
message.c_str(), iteration_count, value_adjective.c_str(),
|
|
659
|
+
max_primal_residual);
|
|
660
|
+
max_max_primal_residual = max_primal_residual;
|
|
661
|
+
}
|
|
662
|
+
if (max_dual_residual > excessive_residual_error) {
|
|
663
|
+
value_adjective = "Excessive";
|
|
664
|
+
report_level = HighsLogType::kInfo;
|
|
665
|
+
return_status = debugWorseStatus(HighsDebugStatus::kError, return_status);
|
|
666
|
+
} else if (max_dual_residual > large_residual_error) {
|
|
667
|
+
value_adjective = "Large";
|
|
668
|
+
report_level = HighsLogType::kDetailed;
|
|
669
|
+
return_status = debugWorseStatus(HighsDebugStatus::kWarning, return_status);
|
|
670
|
+
} else {
|
|
671
|
+
value_adjective = "OK";
|
|
672
|
+
report_level = HighsLogType::kVerbose;
|
|
673
|
+
return_status = debugWorseStatus(HighsDebugStatus::kOk, return_status);
|
|
674
|
+
}
|
|
675
|
+
if (max_dual_residual > 2 * max_max_dual_residual) {
|
|
676
|
+
highsLogDev(options.log_options, report_level,
|
|
677
|
+
"HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT
|
|
678
|
+
" %-9s max dual residual = %9.4g\n",
|
|
679
|
+
message.c_str(), iteration_count, value_adjective.c_str(),
|
|
680
|
+
max_dual_residual);
|
|
681
|
+
max_max_dual_residual = max_dual_residual;
|
|
682
|
+
}
|
|
683
|
+
return return_status;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
// Methods below are not called externally
|
|
687
|
+
|
|
688
|
+
void HEkk::debugReportReinvertOnNumericalTrouble(
|
|
689
|
+
const std::string method_name, const double numerical_trouble_measure,
|
|
690
|
+
const double alpha_from_col, const double alpha_from_row,
|
|
691
|
+
const double numerical_trouble_tolerance, const bool reinvert) const {
|
|
692
|
+
if (this->options_->highs_debug_level < kHighsDebugLevelCheap) return;
|
|
693
|
+
const double abs_alpha_from_col = abs(alpha_from_col);
|
|
694
|
+
const double abs_alpha_from_row = abs(alpha_from_row);
|
|
695
|
+
const double abs_alpha_diff = abs(abs_alpha_from_col - abs_alpha_from_row);
|
|
696
|
+
const HighsInt iteration_count = this->iteration_count_;
|
|
697
|
+
const HighsInt update_count = this->info_.update_count;
|
|
698
|
+
const std::string model_name = this->lp_.model_name_;
|
|
699
|
+
|
|
700
|
+
const bool numerical_trouble =
|
|
701
|
+
numerical_trouble_measure > numerical_trouble_tolerance;
|
|
702
|
+
const bool near_numerical_trouble =
|
|
703
|
+
10 * numerical_trouble_measure > numerical_trouble_tolerance;
|
|
704
|
+
|
|
705
|
+
const bool wrong_sign = alpha_from_col * alpha_from_row <= 0;
|
|
706
|
+
if (!near_numerical_trouble && !wrong_sign) return;
|
|
707
|
+
std::string adjective;
|
|
708
|
+
if (numerical_trouble) {
|
|
709
|
+
adjective = " exceeds";
|
|
710
|
+
} else if (near_numerical_trouble) {
|
|
711
|
+
adjective = "almost exceeds";
|
|
712
|
+
} else {
|
|
713
|
+
adjective = "clearly satisfies";
|
|
714
|
+
}
|
|
715
|
+
highsLogDev(this->options_->log_options, HighsLogType::kWarning,
|
|
716
|
+
"%s (%s) [Iter %" HIGHSINT_FORMAT "; Update %" HIGHSINT_FORMAT
|
|
717
|
+
"] Col: %11.4g; Row: %11.4g; Diff "
|
|
718
|
+
"= %11.4g: Measure %11.4g %s %11.4g\n",
|
|
719
|
+
method_name.c_str(), model_name.c_str(), iteration_count,
|
|
720
|
+
update_count, abs_alpha_from_col, abs_alpha_from_row,
|
|
721
|
+
abs_alpha_diff, numerical_trouble_measure, adjective.c_str(),
|
|
722
|
+
numerical_trouble_tolerance);
|
|
723
|
+
if (wrong_sign) {
|
|
724
|
+
highsLogDev(this->options_->log_options, HighsLogType::kWarning,
|
|
725
|
+
" Incompatible signs for Col: %11.4g and Row: %11.4g\n",
|
|
726
|
+
alpha_from_col, alpha_from_row);
|
|
727
|
+
}
|
|
728
|
+
if ((numerical_trouble || wrong_sign) && !reinvert) {
|
|
729
|
+
highsLogDev(this->options_->log_options, HighsLogType::kWarning,
|
|
730
|
+
" Numerical trouble or wrong sign and not reinverting\n");
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
HighsDebugStatus HEkk::debugUpdatedDual(const double updated_dual,
|
|
735
|
+
const double computed_dual) const {
|
|
736
|
+
const HighsOptions& options = *(this->options_);
|
|
737
|
+
if (options.highs_debug_level < kHighsDebugLevelCheap)
|
|
738
|
+
return HighsDebugStatus::kNotChecked;
|
|
739
|
+
HighsDebugStatus return_status = HighsDebugStatus::kOk;
|
|
740
|
+
std::string error_adjective;
|
|
741
|
+
HighsLogType report_level;
|
|
742
|
+
double updated_dual_absolute_error = abs(updated_dual - computed_dual);
|
|
743
|
+
double updated_dual_relative_error =
|
|
744
|
+
updated_dual_absolute_error / max(abs(computed_dual), 1.0);
|
|
745
|
+
bool sign_error = updated_dual * computed_dual <= 0;
|
|
746
|
+
bool at_least_small_error =
|
|
747
|
+
sign_error ||
|
|
748
|
+
updated_dual_absolute_error > updated_dual_small_absolute_error ||
|
|
749
|
+
updated_dual_relative_error > updated_dual_small_relative_error;
|
|
750
|
+
if (!at_least_small_error) return return_status;
|
|
751
|
+
|
|
752
|
+
if (updated_dual_relative_error > updated_dual_large_relative_error ||
|
|
753
|
+
updated_dual_absolute_error > updated_dual_large_absolute_error) {
|
|
754
|
+
error_adjective = "Large";
|
|
755
|
+
report_level = HighsLogType::kInfo;
|
|
756
|
+
return_status = HighsDebugStatus::kLargeError;
|
|
757
|
+
} else if (updated_dual_relative_error > updated_dual_small_relative_error ||
|
|
758
|
+
updated_dual_absolute_error > updated_dual_small_absolute_error) {
|
|
759
|
+
error_adjective = "Small";
|
|
760
|
+
report_level = HighsLogType::kDetailed;
|
|
761
|
+
return_status = HighsDebugStatus::kSmallError;
|
|
762
|
+
} else {
|
|
763
|
+
error_adjective = "OK";
|
|
764
|
+
report_level = HighsLogType::kVerbose;
|
|
765
|
+
return_status = HighsDebugStatus::kOk;
|
|
766
|
+
}
|
|
767
|
+
if (sign_error) {
|
|
768
|
+
report_level = HighsLogType::kInfo;
|
|
769
|
+
return_status = HighsDebugStatus::kLargeError;
|
|
770
|
+
}
|
|
771
|
+
highsLogDev(
|
|
772
|
+
options.log_options, report_level,
|
|
773
|
+
"UpdatedDual: %-9s absolute (%9.4g) or relative (%9.4g) error in "
|
|
774
|
+
"updated dual value",
|
|
775
|
+
error_adjective.c_str(), updated_dual_absolute_error,
|
|
776
|
+
updated_dual_relative_error);
|
|
777
|
+
if (sign_error) {
|
|
778
|
+
highsLogDev(options.log_options, report_level,
|
|
779
|
+
": Also sign error with (%9.4g, %9.4g)\n", updated_dual,
|
|
780
|
+
computed_dual);
|
|
781
|
+
} else {
|
|
782
|
+
highsLogDev(options.log_options, report_level, "\n");
|
|
783
|
+
}
|
|
784
|
+
return return_status;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
HighsDebugStatus HEkk::debugRetainedDataOk(const HighsLp& lp) const {
|
|
788
|
+
if (!this->status_.initialised_for_new_lp ||
|
|
789
|
+
this->options_->highs_debug_level < kHighsDebugLevelCostly)
|
|
790
|
+
return HighsDebugStatus::kNotChecked;
|
|
791
|
+
HighsDebugStatus return_status = HighsDebugStatus::kOk;
|
|
792
|
+
|
|
793
|
+
const HighsOptions& options = *(this->options_);
|
|
794
|
+
if (this->status_.has_basis) {
|
|
795
|
+
HighsDebugStatus call_status = this->debugBasisCorrect(&lp);
|
|
796
|
+
const bool basis_correct =
|
|
797
|
+
debugDebugToHighsStatus(call_status) != HighsStatus::kError;
|
|
798
|
+
if (!basis_correct) {
|
|
799
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
800
|
+
"Supposed to be a Simplex basis, but incorrect\n");
|
|
801
|
+
assert(basis_correct);
|
|
802
|
+
return_status = HighsDebugStatus::kLogicalError;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
if (this->status_.has_invert) {
|
|
807
|
+
HighsDebugStatus call_status =
|
|
808
|
+
this->debugNlaCheckInvert("HEkk::debugRetainedDataOk");
|
|
809
|
+
const bool invert_ok =
|
|
810
|
+
debugDebugToHighsStatus(call_status) != HighsStatus::kError;
|
|
811
|
+
if (!invert_ok) {
|
|
812
|
+
highsLogDev(
|
|
813
|
+
options.log_options, HighsLogType::kError,
|
|
814
|
+
"Supposed to be a simplex basis inverse, but too inaccurate\n");
|
|
815
|
+
assert(invert_ok);
|
|
816
|
+
return_status = HighsDebugStatus::kLogicalError;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
return return_status;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
HighsDebugStatus HEkk::debugBasisCorrect(const HighsLp* lp) const {
|
|
823
|
+
// Nontrivially expensive analysis of a Simplex basis, checking
|
|
824
|
+
// consistency, and then correctness of nonbasicMove
|
|
825
|
+
const HighsOptions& options = *(this->options_);
|
|
826
|
+
if (options.highs_debug_level < kHighsDebugLevelCheap)
|
|
827
|
+
return HighsDebugStatus::kNotChecked;
|
|
828
|
+
HighsDebugStatus return_status = HighsDebugStatus::kOk;
|
|
829
|
+
const bool consistent =
|
|
830
|
+
this->debugBasisConsistent() != HighsDebugStatus::kLogicalError;
|
|
831
|
+
if (!consistent) {
|
|
832
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
833
|
+
"Supposed to be a Simplex basis, but not consistent\n");
|
|
834
|
+
assert(consistent);
|
|
835
|
+
return_status = HighsDebugStatus::kLogicalError;
|
|
836
|
+
}
|
|
837
|
+
if (options.highs_debug_level < kHighsDebugLevelCostly) return return_status;
|
|
838
|
+
const bool correct_nonbasicMove =
|
|
839
|
+
this->debugNonbasicMove(lp) != HighsDebugStatus::kLogicalError;
|
|
840
|
+
if (!correct_nonbasicMove) {
|
|
841
|
+
highsLogDev(
|
|
842
|
+
options.log_options, HighsLogType::kError,
|
|
843
|
+
"Supposed to be a Simplex basis, but nonbasicMove is incorrect\n");
|
|
844
|
+
assert(correct_nonbasicMove);
|
|
845
|
+
return_status = HighsDebugStatus::kLogicalError;
|
|
846
|
+
}
|
|
847
|
+
return return_status;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
HighsDebugStatus HEkk::debugBasisConsistent() const {
|
|
851
|
+
// Cheap analysis of a Simplex basis, checking vector sizes, numbers
|
|
852
|
+
// of basic/nonbasic variables and non-repetition of basic variables
|
|
853
|
+
if (this->options_->highs_debug_level < kHighsDebugLevelCheap)
|
|
854
|
+
return HighsDebugStatus::kNotChecked;
|
|
855
|
+
HighsDebugStatus return_status = HighsDebugStatus::kOk;
|
|
856
|
+
const HighsOptions& options = *(this->options_);
|
|
857
|
+
const HighsLp& lp = this->lp_;
|
|
858
|
+
const SimplexBasis& basis = this->basis_;
|
|
859
|
+
// Check consistency of nonbasicFlag
|
|
860
|
+
if (this->debugNonbasicFlagConsistent() == HighsDebugStatus::kLogicalError) {
|
|
861
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
862
|
+
"nonbasicFlag inconsistent\n");
|
|
863
|
+
return_status = HighsDebugStatus::kLogicalError;
|
|
864
|
+
}
|
|
865
|
+
const bool right_size = (HighsInt)basis.basicIndex_.size() == lp.num_row_;
|
|
866
|
+
// Check consistency of basicIndex
|
|
867
|
+
if (!right_size) {
|
|
868
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
869
|
+
"basicIndex size error\n");
|
|
870
|
+
assert(right_size);
|
|
871
|
+
return_status = HighsDebugStatus::kLogicalError;
|
|
872
|
+
}
|
|
873
|
+
// Use localNonbasicFlag so that duplicate entries in basicIndex can
|
|
874
|
+
// be spotted
|
|
875
|
+
vector<int8_t> localNonbasicFlag = basis.nonbasicFlag_;
|
|
876
|
+
for (HighsInt iRow = 0; iRow < lp.num_row_; iRow++) {
|
|
877
|
+
HighsInt iCol = basis.basicIndex_[iRow];
|
|
878
|
+
HighsInt flag = localNonbasicFlag[iCol];
|
|
879
|
+
// Indicate that this column has been found in basicIndex
|
|
880
|
+
localNonbasicFlag[iCol] = -1;
|
|
881
|
+
if (flag) {
|
|
882
|
+
// Nonzero value for localNonbasicFlag entry means that column is either
|
|
883
|
+
if (flag == kNonbasicFlagTrue) {
|
|
884
|
+
// Nonbasic...
|
|
885
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
886
|
+
"Entry basicIndex_[%" HIGHSINT_FORMAT
|
|
887
|
+
"] = %" HIGHSINT_FORMAT " is not basic\n",
|
|
888
|
+
iRow, iCol);
|
|
889
|
+
} else {
|
|
890
|
+
// .. or is -1 since it has already been found in basicIndex
|
|
891
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
892
|
+
"Entry basicIndex_[%" HIGHSINT_FORMAT
|
|
893
|
+
"] = %" HIGHSINT_FORMAT " is already basic\n",
|
|
894
|
+
iRow, iCol);
|
|
895
|
+
assert(flag == -1);
|
|
896
|
+
}
|
|
897
|
+
assert(!flag);
|
|
898
|
+
return_status = HighsDebugStatus::kLogicalError;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
return return_status;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
HighsDebugStatus HEkk::debugNonbasicFlagConsistent() const {
|
|
905
|
+
if (this->options_->highs_debug_level < kHighsDebugLevelCheap)
|
|
906
|
+
return HighsDebugStatus::kNotChecked;
|
|
907
|
+
HighsDebugStatus return_status = HighsDebugStatus::kOk;
|
|
908
|
+
const HighsOptions& options = *(this->options_);
|
|
909
|
+
const HighsLp& lp = this->lp_;
|
|
910
|
+
const SimplexBasis& basis = this->basis_;
|
|
911
|
+
HighsInt numTot = lp.num_col_ + lp.num_row_;
|
|
912
|
+
const bool right_size = (HighsInt)basis.nonbasicFlag_.size() == numTot;
|
|
913
|
+
if (!right_size) {
|
|
914
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
915
|
+
"nonbasicFlag size error\n");
|
|
916
|
+
assert(right_size);
|
|
917
|
+
return_status = HighsDebugStatus::kLogicalError;
|
|
918
|
+
}
|
|
919
|
+
HighsInt num_basic_variables = 0;
|
|
920
|
+
for (HighsInt var = 0; var < numTot; var++) {
|
|
921
|
+
if (basis.nonbasicFlag_[var] == kNonbasicFlagFalse) {
|
|
922
|
+
num_basic_variables++;
|
|
923
|
+
} else {
|
|
924
|
+
assert(basis.nonbasicFlag_[var] == kNonbasicFlagTrue);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
bool right_num_basic_variables = num_basic_variables == lp.num_row_;
|
|
928
|
+
if (!right_num_basic_variables) {
|
|
929
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
930
|
+
"nonbasicFlag has %" HIGHSINT_FORMAT ", not %" HIGHSINT_FORMAT
|
|
931
|
+
" basic variables\n",
|
|
932
|
+
num_basic_variables, lp.num_row_);
|
|
933
|
+
assert(right_num_basic_variables);
|
|
934
|
+
return_status = HighsDebugStatus::kLogicalError;
|
|
935
|
+
}
|
|
936
|
+
return return_status;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
HighsDebugStatus HEkk::debugNonbasicMove(const HighsLp* pass_lp) const {
|
|
940
|
+
// Non-trivially expensive check of NonbasicMove
|
|
941
|
+
if (this->options_->highs_debug_level < kHighsDebugLevelCostly)
|
|
942
|
+
return HighsDebugStatus::kNotChecked;
|
|
943
|
+
HighsDebugStatus return_status = HighsDebugStatus::kOk;
|
|
944
|
+
const HighsOptions& options = *(this->options_);
|
|
945
|
+
const SimplexBasis& basis = this->basis_;
|
|
946
|
+
HighsInt num_free_variable_move_errors = 0;
|
|
947
|
+
HighsInt num_lower_bounded_variable_move_errors = 0;
|
|
948
|
+
HighsInt num_upper_bounded_variable_move_errors = 0;
|
|
949
|
+
HighsInt num_boxed_variable_move_errors = 0;
|
|
950
|
+
HighsInt num_fixed_variable_move_errors = 0;
|
|
951
|
+
HighsInt num_col;
|
|
952
|
+
HighsInt num_row;
|
|
953
|
+
const bool use_pass_lp = (pass_lp != nullptr);
|
|
954
|
+
if (use_pass_lp) {
|
|
955
|
+
num_col = pass_lp->num_col_;
|
|
956
|
+
num_row = pass_lp->num_row_;
|
|
957
|
+
} else {
|
|
958
|
+
assert(1 == 0);
|
|
959
|
+
num_col = this->lp_.num_col_;
|
|
960
|
+
num_row = this->lp_.num_row_;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
const HighsInt numTot = num_col + num_row;
|
|
964
|
+
bool right_size = (HighsInt)basis.nonbasicMove_.size() == numTot;
|
|
965
|
+
// Check consistency of nonbasicMove
|
|
966
|
+
if (!right_size) {
|
|
967
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
968
|
+
"nonbasicMove size error\n");
|
|
969
|
+
assert(right_size);
|
|
970
|
+
return_status = HighsDebugStatus::kLogicalError;
|
|
971
|
+
}
|
|
972
|
+
double lower;
|
|
973
|
+
double upper;
|
|
974
|
+
|
|
975
|
+
for (HighsInt iVar = 0; iVar < numTot; iVar++) {
|
|
976
|
+
if (!basis.nonbasicFlag_[iVar]) continue;
|
|
977
|
+
// Nonbasic variable
|
|
978
|
+
if (use_pass_lp) {
|
|
979
|
+
if (iVar < num_col) {
|
|
980
|
+
lower = pass_lp->col_lower_[iVar];
|
|
981
|
+
upper = pass_lp->col_upper_[iVar];
|
|
982
|
+
} else {
|
|
983
|
+
HighsInt iRow = iVar - num_col;
|
|
984
|
+
lower = -pass_lp->row_upper_[iRow];
|
|
985
|
+
upper = -pass_lp->row_lower_[iRow];
|
|
986
|
+
}
|
|
987
|
+
} else {
|
|
988
|
+
if (iVar < num_col) {
|
|
989
|
+
lower = this->lp_.col_lower_[iVar];
|
|
990
|
+
upper = this->lp_.col_upper_[iVar];
|
|
991
|
+
} else {
|
|
992
|
+
HighsInt iRow = iVar - num_col;
|
|
993
|
+
lower = -this->lp_.row_upper_[iRow];
|
|
994
|
+
upper = -this->lp_.row_lower_[iRow];
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
if (highs_isInfinity(upper)) {
|
|
999
|
+
if (highs_isInfinity(-lower)) {
|
|
1000
|
+
// Free
|
|
1001
|
+
if (basis.nonbasicMove_[iVar]) {
|
|
1002
|
+
num_free_variable_move_errors++;
|
|
1003
|
+
}
|
|
1004
|
+
} else {
|
|
1005
|
+
// Only lower bounded
|
|
1006
|
+
if (basis.nonbasicMove_[iVar] != kNonbasicMoveUp) {
|
|
1007
|
+
num_lower_bounded_variable_move_errors++;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
} else {
|
|
1011
|
+
if (highs_isInfinity(-lower)) {
|
|
1012
|
+
// Only upper bounded
|
|
1013
|
+
if (basis.nonbasicMove_[iVar] != kNonbasicMoveDn) {
|
|
1014
|
+
num_upper_bounded_variable_move_errors++;
|
|
1015
|
+
}
|
|
1016
|
+
} else {
|
|
1017
|
+
// Boxed or fixed
|
|
1018
|
+
if (lower != upper) {
|
|
1019
|
+
// Boxed
|
|
1020
|
+
if (!basis.nonbasicMove_[iVar]) {
|
|
1021
|
+
num_boxed_variable_move_errors++;
|
|
1022
|
+
}
|
|
1023
|
+
} else {
|
|
1024
|
+
// Fixed
|
|
1025
|
+
if (basis.nonbasicMove_[iVar]) {
|
|
1026
|
+
num_fixed_variable_move_errors++;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
HighsInt num_errors =
|
|
1033
|
+
num_free_variable_move_errors + num_lower_bounded_variable_move_errors +
|
|
1034
|
+
num_upper_bounded_variable_move_errors + num_boxed_variable_move_errors +
|
|
1035
|
+
num_fixed_variable_move_errors;
|
|
1036
|
+
|
|
1037
|
+
if (num_errors) {
|
|
1038
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1039
|
+
"There are %" HIGHSINT_FORMAT
|
|
1040
|
+
" nonbasicMove errors: %" HIGHSINT_FORMAT
|
|
1041
|
+
" free; %" HIGHSINT_FORMAT " lower; %" HIGHSINT_FORMAT
|
|
1042
|
+
" upper; %" HIGHSINT_FORMAT
|
|
1043
|
+
" "
|
|
1044
|
+
"boxed; %" HIGHSINT_FORMAT " fixed\n",
|
|
1045
|
+
num_errors, num_free_variable_move_errors,
|
|
1046
|
+
num_lower_bounded_variable_move_errors,
|
|
1047
|
+
num_upper_bounded_variable_move_errors,
|
|
1048
|
+
num_boxed_variable_move_errors, num_fixed_variable_move_errors);
|
|
1049
|
+
assert(num_errors == 0);
|
|
1050
|
+
return_status = HighsDebugStatus::kLogicalError;
|
|
1051
|
+
}
|
|
1052
|
+
return return_status;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
bool HEkk::debugNlaScalingOk(const HighsLp& lp) const {
|
|
1056
|
+
bool ok = true;
|
|
1057
|
+
assert(this->status_.has_nla);
|
|
1058
|
+
const HSimplexNla& simplex_nla = this->simplex_nla_;
|
|
1059
|
+
if (lp.scale_.has_scaling) {
|
|
1060
|
+
// The LP has scaling, so ensure that the simplex NLA has its scaling
|
|
1061
|
+
void* nla_scale = (void*)simplex_nla.scale_;
|
|
1062
|
+
void* lp_scale = (void*)(&lp.scale_);
|
|
1063
|
+
ok = nla_scale == lp_scale;
|
|
1064
|
+
} else {
|
|
1065
|
+
// The LP has no scaling, so ensure that the simplex NLA has no scaling
|
|
1066
|
+
ok = !simplex_nla.scale_;
|
|
1067
|
+
}
|
|
1068
|
+
assert(ok);
|
|
1069
|
+
return ok;
|
|
1070
|
+
}
|
|
1071
|
+
HighsDebugStatus HEkk::debugNlaCheckInvert(
|
|
1072
|
+
const std::string message, const HighsInt alt_debug_level) const {
|
|
1073
|
+
assert(this->status_.has_nla);
|
|
1074
|
+
return this->simplex_nla_.debugCheckInvert(message, alt_debug_level);
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
HighsDebugStatus HEkk::debugOkForSolve(const SimplexAlgorithm algorithm,
|
|
1078
|
+
const HighsInt phase) const {
|
|
1079
|
+
if (this->options_->highs_debug_level < kHighsDebugLevelCheap)
|
|
1080
|
+
return HighsDebugStatus::kNotChecked;
|
|
1081
|
+
const HighsDebugStatus return_status = HighsDebugStatus::kOk;
|
|
1082
|
+
const HighsLp& lp = this->lp_;
|
|
1083
|
+
const HighsSimplexStatus& status = this->status_;
|
|
1084
|
+
const SimplexBasis& basis = this->basis_;
|
|
1085
|
+
const HighsOptions& options = *this->options_;
|
|
1086
|
+
bool ok;
|
|
1087
|
+
// Minimal check - just look at flags. This means we trust them!
|
|
1088
|
+
ok = status.has_basis && status.has_ar_matrix && status.has_nla &&
|
|
1089
|
+
// status.has_dual_steepest_edge_weights &&
|
|
1090
|
+
status.has_invert;
|
|
1091
|
+
if (!ok) {
|
|
1092
|
+
if (!status.has_basis)
|
|
1093
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1094
|
+
"Not OK to solve since status.has_basis = "
|
|
1095
|
+
"%" HIGHSINT_FORMAT "\n",
|
|
1096
|
+
status.has_basis);
|
|
1097
|
+
if (!status.has_ar_matrix)
|
|
1098
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1099
|
+
"Not OK to solve since status.has_ar_matrix = "
|
|
1100
|
+
"%" HIGHSINT_FORMAT "\n",
|
|
1101
|
+
status.has_ar_matrix);
|
|
1102
|
+
if (!status.has_nla)
|
|
1103
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1104
|
+
"Not OK to solve since status.has_nla "
|
|
1105
|
+
"= %" HIGHSINT_FORMAT "\n",
|
|
1106
|
+
status.has_nla);
|
|
1107
|
+
if (!status.has_dual_steepest_edge_weights)
|
|
1108
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1109
|
+
"Not OK to solve since "
|
|
1110
|
+
"status.has_dual_steepest_edge_weights = %" HIGHSINT_FORMAT
|
|
1111
|
+
"\n",
|
|
1112
|
+
status.has_dual_steepest_edge_weights);
|
|
1113
|
+
if (!status.has_invert)
|
|
1114
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1115
|
+
"Not OK to solve since status.has_invert = "
|
|
1116
|
+
"%" HIGHSINT_FORMAT "\n",
|
|
1117
|
+
status.has_invert);
|
|
1118
|
+
}
|
|
1119
|
+
if (this->options_->highs_debug_level < kHighsDebugLevelCostly)
|
|
1120
|
+
return return_status;
|
|
1121
|
+
// Basis and data check
|
|
1122
|
+
if (this->debugBasisConsistent() == HighsDebugStatus::kLogicalError)
|
|
1123
|
+
return HighsDebugStatus::kLogicalError;
|
|
1124
|
+
// Check work cost, lower, upper and range
|
|
1125
|
+
if (!this->debugWorkArraysOk(algorithm, phase))
|
|
1126
|
+
return HighsDebugStatus::kLogicalError;
|
|
1127
|
+
const HighsInt numTot = lp.num_col_ + lp.num_row_;
|
|
1128
|
+
// Check nonbasic move against work cost, lower, upper and range
|
|
1129
|
+
for (HighsInt var = 0; var < numTot; ++var) {
|
|
1130
|
+
if (basis.nonbasicFlag_[var]) {
|
|
1131
|
+
// Nonbasic variable
|
|
1132
|
+
if (!this->debugOneNonbasicMoveVsWorkArraysOk(var))
|
|
1133
|
+
return HighsDebugStatus::kLogicalError;
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
return return_status;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
bool HEkk::debugWorkArraysOk(const SimplexAlgorithm algorithm,
|
|
1140
|
+
const HighsInt phase) const {
|
|
1141
|
+
const HighsLp& lp = this->lp_;
|
|
1142
|
+
const HighsSimplexInfo& info = this->info_;
|
|
1143
|
+
const HighsOptions& options = *(this->options_);
|
|
1144
|
+
bool ok = true;
|
|
1145
|
+
// Don't check dual simplex phase 1 bounds or perturbed bounds
|
|
1146
|
+
const bool dual_phase1 = algorithm == SimplexAlgorithm::kDual && phase == 1;
|
|
1147
|
+
const bool primal_phase1 =
|
|
1148
|
+
algorithm == SimplexAlgorithm::kPrimal && phase == 1;
|
|
1149
|
+
if (!(dual_phase1 || info.bounds_perturbed)) {
|
|
1150
|
+
for (HighsInt col = 0; col < lp.num_col_; ++col) {
|
|
1151
|
+
HighsInt var = col;
|
|
1152
|
+
if (!highs_isInfinity(-info.workLower_[var])) {
|
|
1153
|
+
double lp_lower = info.workLower_[var];
|
|
1154
|
+
ok = lp_lower == lp.col_lower_[col];
|
|
1155
|
+
if (!ok) {
|
|
1156
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1157
|
+
"For col %" HIGHSINT_FORMAT
|
|
1158
|
+
", info.workLower_ should be %g but is %g\n",
|
|
1159
|
+
col, lp.col_lower_[col], lp_lower);
|
|
1160
|
+
return ok;
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
if (!highs_isInfinity(info.workUpper_[var])) {
|
|
1164
|
+
double lp_upper = info.workUpper_[var];
|
|
1165
|
+
ok = lp_upper == lp.col_upper_[col];
|
|
1166
|
+
if (!ok) {
|
|
1167
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1168
|
+
"For col %" HIGHSINT_FORMAT
|
|
1169
|
+
", info.workUpper_ should be %g but is %g\n",
|
|
1170
|
+
col, lp.col_upper_[col], lp_upper);
|
|
1171
|
+
return ok;
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
for (HighsInt row = 0; row < lp.num_row_; ++row) {
|
|
1176
|
+
HighsInt var = lp.num_col_ + row;
|
|
1177
|
+
if (!highs_isInfinity(-info.workLower_[var])) {
|
|
1178
|
+
double lp_lower = info.workLower_[var];
|
|
1179
|
+
ok = lp_lower == -lp.row_upper_[row];
|
|
1180
|
+
if (!ok) {
|
|
1181
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1182
|
+
"For row %" HIGHSINT_FORMAT
|
|
1183
|
+
", info.workLower_ should be %g but is %g\n",
|
|
1184
|
+
row, -lp.row_upper_[row], lp_lower);
|
|
1185
|
+
return ok;
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
if (!highs_isInfinity(info.workUpper_[var])) {
|
|
1189
|
+
double lp_upper = info.workUpper_[var];
|
|
1190
|
+
ok = lp_upper == -lp.row_lower_[row];
|
|
1191
|
+
if (!ok) {
|
|
1192
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1193
|
+
"For row %" HIGHSINT_FORMAT
|
|
1194
|
+
", info.workUpper_ should be %g but is %g\n",
|
|
1195
|
+
row, -lp.row_lower_[row], lp_upper);
|
|
1196
|
+
return ok;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
const HighsInt numTot = lp.num_col_ + lp.num_row_;
|
|
1201
|
+
for (HighsInt var = 0; var < numTot; ++var) {
|
|
1202
|
+
ok =
|
|
1203
|
+
info.workRange_[var] == (info.workUpper_[var] - info.workLower_[var]);
|
|
1204
|
+
if (!ok) {
|
|
1205
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1206
|
+
"For variable %" HIGHSINT_FORMAT
|
|
1207
|
+
", info.workRange_ should be %g = %g - %g "
|
|
1208
|
+
"but is %g\n",
|
|
1209
|
+
var, info.workUpper_[var] - info.workLower_[var],
|
|
1210
|
+
info.workUpper_[var], info.workLower_[var],
|
|
1211
|
+
info.workRange_[var]);
|
|
1212
|
+
return ok;
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
// Don't check costs against the LP, when using primal simplex in
|
|
1217
|
+
// primal phase 1, if the LP is primal infeasible, or if the costs
|
|
1218
|
+
// have been changed
|
|
1219
|
+
const bool costs_changed = info_.costs_perturbed || info_.costs_shifted;
|
|
1220
|
+
if (!(primal_phase1 || this->model_status_ == HighsModelStatus::kInfeasible ||
|
|
1221
|
+
costs_changed)) {
|
|
1222
|
+
for (HighsInt col = 0; col < lp.num_col_; ++col) {
|
|
1223
|
+
HighsInt var = col;
|
|
1224
|
+
double work_cost = info.workCost_[var];
|
|
1225
|
+
double ok_cost = (HighsInt)lp.sense_ * lp.col_cost_[col];
|
|
1226
|
+
ok = work_cost == ok_cost;
|
|
1227
|
+
if (!ok) {
|
|
1228
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1229
|
+
"For col %" HIGHSINT_FORMAT
|
|
1230
|
+
", info.workCost_ should be %g but is %g\n",
|
|
1231
|
+
col, ok_cost, info.workCost_[var]);
|
|
1232
|
+
return ok;
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
for (HighsInt row = 0; row < lp.num_row_; ++row) {
|
|
1236
|
+
HighsInt var = lp.num_col_ + row;
|
|
1237
|
+
ok = info.workCost_[var] == 0.;
|
|
1238
|
+
if (!ok) {
|
|
1239
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1240
|
+
"For row %" HIGHSINT_FORMAT
|
|
1241
|
+
", info.workCost_ should be zero but is %g\n",
|
|
1242
|
+
row, info.workCost_[var]);
|
|
1243
|
+
return ok;
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
// ok must be true if we reach here
|
|
1248
|
+
assert(ok);
|
|
1249
|
+
return ok;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
bool HEkk::debugOneNonbasicMoveVsWorkArraysOk(const HighsInt var) const {
|
|
1253
|
+
const HighsLp& lp = this->lp_;
|
|
1254
|
+
const HighsSimplexInfo& info = this->info_;
|
|
1255
|
+
const SimplexBasis& basis = this->basis_;
|
|
1256
|
+
const HighsOptions& options = *(this->options_);
|
|
1257
|
+
assert(var >= 0);
|
|
1258
|
+
assert(var < lp.num_col_ + lp.num_row_);
|
|
1259
|
+
// Make sure we're not checking a basic variable
|
|
1260
|
+
if (!basis.nonbasicFlag_[var]) return true;
|
|
1261
|
+
bool ok;
|
|
1262
|
+
if (!highs_isInfinity(-info.workLower_[var])) {
|
|
1263
|
+
if (!highs_isInfinity(info.workUpper_[var])) {
|
|
1264
|
+
// Finite lower and upper bounds so nonbasic move depends on whether they
|
|
1265
|
+
// are equal
|
|
1266
|
+
if (info.workLower_[var] == info.workUpper_[var]) {
|
|
1267
|
+
// Fixed variable
|
|
1268
|
+
ok = basis.nonbasicMove_[var] == kNonbasicMoveZe;
|
|
1269
|
+
if (!ok) {
|
|
1270
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1271
|
+
"Fixed variable %" HIGHSINT_FORMAT
|
|
1272
|
+
" (lp.num_col_ = %" HIGHSINT_FORMAT
|
|
1273
|
+
") [%11g, %11g, "
|
|
1274
|
+
"%11g] so nonbasic "
|
|
1275
|
+
"move should be zero but is %" HIGHSINT_FORMAT "\n",
|
|
1276
|
+
var, lp.num_col_, info.workLower_[var],
|
|
1277
|
+
info.workValue_[var], info.workUpper_[var],
|
|
1278
|
+
basis.nonbasicMove_[var]);
|
|
1279
|
+
return ok;
|
|
1280
|
+
}
|
|
1281
|
+
ok = info.workValue_[var] == info.workLower_[var];
|
|
1282
|
+
if (!ok) {
|
|
1283
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1284
|
+
"Fixed variable %" HIGHSINT_FORMAT
|
|
1285
|
+
" (lp.num_col_ = %" HIGHSINT_FORMAT
|
|
1286
|
+
") so "
|
|
1287
|
+
"info.work value should be %g but "
|
|
1288
|
+
"is %g\n",
|
|
1289
|
+
var, lp.num_col_, info.workLower_[var],
|
|
1290
|
+
info.workValue_[var]);
|
|
1291
|
+
return ok;
|
|
1292
|
+
}
|
|
1293
|
+
} else {
|
|
1294
|
+
// Boxed variable
|
|
1295
|
+
ok = (basis.nonbasicMove_[var] == kNonbasicMoveUp) ||
|
|
1296
|
+
(basis.nonbasicMove_[var] == kNonbasicMoveDn);
|
|
1297
|
+
if (!ok) {
|
|
1298
|
+
highsLogDev(
|
|
1299
|
+
options.log_options, HighsLogType::kError,
|
|
1300
|
+
"Boxed variable %" HIGHSINT_FORMAT
|
|
1301
|
+
" (lp.num_col_ = %" HIGHSINT_FORMAT
|
|
1302
|
+
") [%11g, %11g, "
|
|
1303
|
+
"%11g] range %g so "
|
|
1304
|
+
"nonbasic move should be up/down but is %" HIGHSINT_FORMAT "\n",
|
|
1305
|
+
var, lp.num_col_, info.workLower_[var], info.workValue_[var],
|
|
1306
|
+
info.workUpper_[var], info.workUpper_[var] - info.workLower_[var],
|
|
1307
|
+
basis.nonbasicMove_[var]);
|
|
1308
|
+
return ok;
|
|
1309
|
+
}
|
|
1310
|
+
if (basis.nonbasicMove_[var] == kNonbasicMoveUp) {
|
|
1311
|
+
ok = info.workValue_[var] == info.workLower_[var];
|
|
1312
|
+
if (!ok) {
|
|
1313
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1314
|
+
"Boxed variable %" HIGHSINT_FORMAT
|
|
1315
|
+
" (lp.num_col_ = %" HIGHSINT_FORMAT
|
|
1316
|
+
") with "
|
|
1317
|
+
"kNonbasicMoveUp so work "
|
|
1318
|
+
"value should be %g but is %g\n",
|
|
1319
|
+
var, lp.num_col_, info.workLower_[var],
|
|
1320
|
+
info.workValue_[var]);
|
|
1321
|
+
return ok;
|
|
1322
|
+
}
|
|
1323
|
+
} else {
|
|
1324
|
+
ok = info.workValue_[var] == info.workUpper_[var];
|
|
1325
|
+
if (!ok) {
|
|
1326
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1327
|
+
"Boxed variable %" HIGHSINT_FORMAT
|
|
1328
|
+
" (lp.num_col_ = %" HIGHSINT_FORMAT
|
|
1329
|
+
") with "
|
|
1330
|
+
"kNonbasicMoveDn so work "
|
|
1331
|
+
"value should be %g but is %g\n",
|
|
1332
|
+
var, lp.num_col_, info.workUpper_[var],
|
|
1333
|
+
info.workValue_[var]);
|
|
1334
|
+
return ok;
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
} else {
|
|
1339
|
+
// Infinite upper bound
|
|
1340
|
+
ok = basis.nonbasicMove_[var] == kNonbasicMoveUp;
|
|
1341
|
+
if (!ok) {
|
|
1342
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1343
|
+
"Finite lower bound and infinite upper bound variable "
|
|
1344
|
+
"%" HIGHSINT_FORMAT
|
|
1345
|
+
" "
|
|
1346
|
+
"(lp.num_col_ = "
|
|
1347
|
+
"%" HIGHSINT_FORMAT
|
|
1348
|
+
") [%11g, %11g, %11g] so nonbasic move should be "
|
|
1349
|
+
"up=%2" HIGHSINT_FORMAT
|
|
1350
|
+
" but is "
|
|
1351
|
+
"%" HIGHSINT_FORMAT "\n",
|
|
1352
|
+
var, lp.num_col_, info.workLower_[var],
|
|
1353
|
+
info.workValue_[var], info.workUpper_[var], kNonbasicMoveUp,
|
|
1354
|
+
basis.nonbasicMove_[var]);
|
|
1355
|
+
return ok;
|
|
1356
|
+
}
|
|
1357
|
+
ok = info.workValue_[var] == info.workLower_[var];
|
|
1358
|
+
if (!ok) {
|
|
1359
|
+
highsLogDev(
|
|
1360
|
+
options.log_options, HighsLogType::kError,
|
|
1361
|
+
"Finite lower bound and infinite upper bound variable "
|
|
1362
|
+
"%" HIGHSINT_FORMAT
|
|
1363
|
+
" "
|
|
1364
|
+
"(lp.num_col_ = "
|
|
1365
|
+
"%" HIGHSINT_FORMAT ") so work value should be %g but is %g\n",
|
|
1366
|
+
var, lp.num_col_, info.workLower_[var], info.workValue_[var]);
|
|
1367
|
+
return ok;
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
} else {
|
|
1371
|
+
// Infinite lower bound
|
|
1372
|
+
if (!highs_isInfinity(info.workUpper_[var])) {
|
|
1373
|
+
ok = basis.nonbasicMove_[var] == kNonbasicMoveDn;
|
|
1374
|
+
if (!ok) {
|
|
1375
|
+
highsLogDev(
|
|
1376
|
+
options.log_options, HighsLogType::kError,
|
|
1377
|
+
"Finite upper bound and infinite lower bound variable "
|
|
1378
|
+
"%" HIGHSINT_FORMAT
|
|
1379
|
+
" "
|
|
1380
|
+
"(lp.num_col_ = "
|
|
1381
|
+
"%" HIGHSINT_FORMAT
|
|
1382
|
+
") [%11g, %11g, %11g] so nonbasic move should be down but is "
|
|
1383
|
+
"%" HIGHSINT_FORMAT "\n",
|
|
1384
|
+
var, lp.num_col_, info.workLower_[var], info.workValue_[var],
|
|
1385
|
+
info.workUpper_[var], basis.nonbasicMove_[var]);
|
|
1386
|
+
return ok;
|
|
1387
|
+
}
|
|
1388
|
+
ok = info.workValue_[var] == info.workUpper_[var];
|
|
1389
|
+
if (!ok) {
|
|
1390
|
+
highsLogDev(
|
|
1391
|
+
options.log_options, HighsLogType::kError,
|
|
1392
|
+
"Finite upper bound and infinite lower bound variable "
|
|
1393
|
+
"%" HIGHSINT_FORMAT
|
|
1394
|
+
" "
|
|
1395
|
+
"(lp.num_col_ = "
|
|
1396
|
+
"%" HIGHSINT_FORMAT ") so work value should be %g but is %g\n",
|
|
1397
|
+
var, lp.num_col_, info.workUpper_[var], info.workValue_[var]);
|
|
1398
|
+
return ok;
|
|
1399
|
+
}
|
|
1400
|
+
} else {
|
|
1401
|
+
// Infinite upper bound
|
|
1402
|
+
ok = basis.nonbasicMove_[var] == kNonbasicMoveZe;
|
|
1403
|
+
if (!ok) {
|
|
1404
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1405
|
+
"Free variable %" HIGHSINT_FORMAT
|
|
1406
|
+
" (lp.num_col_ = %" HIGHSINT_FORMAT
|
|
1407
|
+
") [%11g, %11g, %11g] "
|
|
1408
|
+
"so nonbasic "
|
|
1409
|
+
"move should be zero but is %" HIGHSINT_FORMAT "\n",
|
|
1410
|
+
var, lp.num_col_, info.workLower_[var],
|
|
1411
|
+
info.workValue_[var], info.workUpper_[var],
|
|
1412
|
+
basis.nonbasicMove_[var]);
|
|
1413
|
+
return ok;
|
|
1414
|
+
}
|
|
1415
|
+
ok = info.workValue_[var] == 0.0;
|
|
1416
|
+
if (!ok) {
|
|
1417
|
+
highsLogDev(options.log_options, HighsLogType::kError,
|
|
1418
|
+
"Free variable %" HIGHSINT_FORMAT
|
|
1419
|
+
" (lp.num_col_ = %" HIGHSINT_FORMAT
|
|
1420
|
+
") so work value should "
|
|
1421
|
+
"be zero but "
|
|
1422
|
+
"is %g\n",
|
|
1423
|
+
var, lp.num_col_, info.workValue_[var]);
|
|
1424
|
+
return ok;
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
// ok must be true if we reach here
|
|
1429
|
+
assert(ok);
|
|
1430
|
+
return ok;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
HighsDebugStatus HEkk::debugNonbasicFreeColumnSet(
|
|
1434
|
+
const HighsInt num_free_col, const HSet nonbasic_free_col_set) const {
|
|
1435
|
+
const HighsOptions& options = *(this->options_);
|
|
1436
|
+
if (options.highs_debug_level < kHighsDebugLevelCheap)
|
|
1437
|
+
return HighsDebugStatus::kNotChecked;
|
|
1438
|
+
const HighsLp& lp = this->lp_;
|
|
1439
|
+
const HighsSimplexInfo& info = this->info_;
|
|
1440
|
+
const SimplexBasis& basis = this->basis_;
|
|
1441
|
+
HighsInt num_tot = lp.num_col_ + lp.num_row_;
|
|
1442
|
+
|
|
1443
|
+
// Check the number of free columns
|
|
1444
|
+
HighsInt check_num_free_col = 0;
|
|
1445
|
+
for (HighsInt iVar = 0; iVar < num_tot; iVar++) {
|
|
1446
|
+
if (info.workLower_[iVar] <= -kHighsInf &&
|
|
1447
|
+
info.workUpper_[iVar] >= kHighsInf)
|
|
1448
|
+
check_num_free_col++;
|
|
1449
|
+
}
|
|
1450
|
+
if (check_num_free_col != num_free_col) {
|
|
1451
|
+
highsLogDev(options.log_options, HighsLogType::kInfo,
|
|
1452
|
+
"NonbasicFreeColumnData: Number of free columns should be "
|
|
1453
|
+
"%" HIGHSINT_FORMAT ", not %" HIGHSINT_FORMAT "\n",
|
|
1454
|
+
check_num_free_col, num_free_col);
|
|
1455
|
+
return HighsDebugStatus::kLogicalError;
|
|
1456
|
+
}
|
|
1457
|
+
if (!num_free_col) return HighsDebugStatus::kOk;
|
|
1458
|
+
// Debug HSet nonbasic_free_col
|
|
1459
|
+
bool nonbasic_free_col_ok = nonbasic_free_col_set.debug();
|
|
1460
|
+
if (!nonbasic_free_col_ok) {
|
|
1461
|
+
highsLogDev(options.log_options, HighsLogType::kInfo,
|
|
1462
|
+
"NonbasicFreeColumnData: HSet error\n");
|
|
1463
|
+
return HighsDebugStatus::kLogicalError;
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
// Check that we have the right number of nonbasic free columns
|
|
1467
|
+
const HighsInt& num_nonbasic_free_col = nonbasic_free_col_set.count();
|
|
1468
|
+
HighsInt check_num_nonbasic_free_col = 0;
|
|
1469
|
+
for (HighsInt iVar = 0; iVar < num_tot; iVar++) {
|
|
1470
|
+
bool nonbasic_free = basis.nonbasicFlag_[iVar] == kNonbasicFlagTrue &&
|
|
1471
|
+
info.workLower_[iVar] <= -kHighsInf &&
|
|
1472
|
+
info.workUpper_[iVar] >= kHighsInf;
|
|
1473
|
+
if (nonbasic_free) check_num_nonbasic_free_col++;
|
|
1474
|
+
}
|
|
1475
|
+
if (check_num_nonbasic_free_col != num_nonbasic_free_col) {
|
|
1476
|
+
highsLogDev(options.log_options, HighsLogType::kInfo,
|
|
1477
|
+
"NonbasicFreeColumnData: Set should have %" HIGHSINT_FORMAT
|
|
1478
|
+
" entries, not %" HIGHSINT_FORMAT "\n",
|
|
1479
|
+
check_num_nonbasic_free_col, num_nonbasic_free_col);
|
|
1480
|
+
return HighsDebugStatus::kLogicalError;
|
|
1481
|
+
}
|
|
1482
|
+
// Check that all in the set are nonbasic free columns
|
|
1483
|
+
const vector<HighsInt>& nonbasic_free_col_set_entry =
|
|
1484
|
+
nonbasic_free_col_set.entry();
|
|
1485
|
+
for (HighsInt ix = 0; ix < num_nonbasic_free_col; ix++) {
|
|
1486
|
+
HighsInt iVar = nonbasic_free_col_set_entry[ix];
|
|
1487
|
+
bool nonbasic_free = basis.nonbasicFlag_[iVar] == kNonbasicFlagTrue &&
|
|
1488
|
+
info.workLower_[iVar] <= -kHighsInf &&
|
|
1489
|
+
info.workUpper_[iVar] >= kHighsInf;
|
|
1490
|
+
if (!nonbasic_free) {
|
|
1491
|
+
highsLogDev(options.log_options, HighsLogType::kInfo,
|
|
1492
|
+
"NonbasicFreeColumnData: Variable %" HIGHSINT_FORMAT
|
|
1493
|
+
" in nonbasic free "
|
|
1494
|
+
"set has nonbasicFlag = %" HIGHSINT_FORMAT
|
|
1495
|
+
" and bounds [%g, %g]\n",
|
|
1496
|
+
iVar, basis.nonbasicFlag_[iVar], info.workLower_[iVar],
|
|
1497
|
+
info.workUpper_[iVar]);
|
|
1498
|
+
return HighsDebugStatus::kLogicalError;
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
return HighsDebugStatus::kOk;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
HighsDebugStatus HEkk::devDebugDualSteepestEdgeWeights(
|
|
1505
|
+
const std::string message) {
|
|
1506
|
+
// Possibly force the expensive check for development work
|
|
1507
|
+
const bool check_dual_edge_weights = false; // true;
|
|
1508
|
+
if (check_dual_edge_weights) {
|
|
1509
|
+
const bool check_all_dual_edge_weights = false;
|
|
1510
|
+
const HighsInt alt_debug_level = check_all_dual_edge_weights
|
|
1511
|
+
? (HighsInt)kHighsDebugLevelExpensive
|
|
1512
|
+
: (HighsInt)kHighsDebugLevelCostly;
|
|
1513
|
+
// printf("Performing level %1d check %s for dual steepest edge
|
|
1514
|
+
// weights\n", (int)alt_debug_level, message.c_str());
|
|
1515
|
+
return debugDualSteepestEdgeWeights(alt_debug_level);
|
|
1516
|
+
} else {
|
|
1517
|
+
return debugDualSteepestEdgeWeights();
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
HighsDebugStatus HEkk::debugDualSteepestEdgeWeights(
|
|
1522
|
+
const HighsInt alt_debug_level) {
|
|
1523
|
+
const HighsInt use_debug_level = alt_debug_level >= 0
|
|
1524
|
+
? alt_debug_level
|
|
1525
|
+
: this->options_->highs_debug_level;
|
|
1526
|
+
if (use_debug_level < kHighsDebugLevelCostly)
|
|
1527
|
+
return HighsDebugStatus::kNotChecked;
|
|
1528
|
+
const HighsLp& lp = this->lp_;
|
|
1529
|
+
const HighsInt num_row = lp.num_row_;
|
|
1530
|
+
double dual_steepest_edge_weight_norm = 0;
|
|
1531
|
+
double dual_steepest_edge_weight_error = 0;
|
|
1532
|
+
HighsInt num_check_weight;
|
|
1533
|
+
if (use_debug_level < kHighsDebugLevelExpensive) {
|
|
1534
|
+
for (HighsInt iRow = 0; iRow < num_row; iRow++) {
|
|
1535
|
+
dual_steepest_edge_weight_norm += std::fabs(dual_edge_weight_[iRow]);
|
|
1536
|
+
}
|
|
1537
|
+
// Just check a few weights
|
|
1538
|
+
num_check_weight =
|
|
1539
|
+
std::max((HighsInt)1, std::min((HighsInt)10, num_row / 10));
|
|
1540
|
+
HVector row_ep;
|
|
1541
|
+
row_ep.setup(num_row);
|
|
1542
|
+
for (HighsInt iCheck = 0; iCheck < num_check_weight; iCheck++) {
|
|
1543
|
+
HighsInt iRow = random_.integer(num_row);
|
|
1544
|
+
const double true_weight = computeDualSteepestEdgeWeight(iRow, row_ep);
|
|
1545
|
+
dual_steepest_edge_weight_error +=
|
|
1546
|
+
std::fabs(this->dual_edge_weight_[iRow] - true_weight);
|
|
1547
|
+
}
|
|
1548
|
+
} else {
|
|
1549
|
+
// Check all weights
|
|
1550
|
+
num_check_weight = num_row;
|
|
1551
|
+
std::vector<double> updated_dual_edge_weight = this->dual_edge_weight_;
|
|
1552
|
+
computeDualSteepestEdgeWeights();
|
|
1553
|
+
for (HighsInt iRow = 0; iRow < num_row; iRow++) {
|
|
1554
|
+
dual_steepest_edge_weight_norm +=
|
|
1555
|
+
std::fabs(this->dual_edge_weight_[iRow]);
|
|
1556
|
+
const double error = std::fabs(updated_dual_edge_weight[iRow] -
|
|
1557
|
+
this->dual_edge_weight_[iRow]);
|
|
1558
|
+
dual_steepest_edge_weight_error += error;
|
|
1559
|
+
}
|
|
1560
|
+
this->dual_edge_weight_ = updated_dual_edge_weight;
|
|
1561
|
+
}
|
|
1562
|
+
// Now assess the relative error
|
|
1563
|
+
assert(dual_steepest_edge_weight_norm > 0);
|
|
1564
|
+
double relative_dual_steepest_edge_weight_error =
|
|
1565
|
+
dual_steepest_edge_weight_error / dual_steepest_edge_weight_norm;
|
|
1566
|
+
const double large_relative_dual_steepest_edge_weight_error = 1e-3;
|
|
1567
|
+
if (relative_dual_steepest_edge_weight_error >
|
|
1568
|
+
10 * debug_max_relative_dual_steepest_edge_weight_error) {
|
|
1569
|
+
highsLogDev(options_->log_options, HighsLogType::kInfo,
|
|
1570
|
+
"Call %2d; Tick %8d: ", (int)debug_solve_call_num_,
|
|
1571
|
+
debug_initial_build_synthetic_tick_);
|
|
1572
|
+
highsLogDev(
|
|
1573
|
+
options_->log_options, HighsLogType::kInfo,
|
|
1574
|
+
"HEkk::debugDualSteepestEdgeWeights Iteration %5d: Checked %2d "
|
|
1575
|
+
"weights: "
|
|
1576
|
+
"error = %10.4g; norm = %10.4g; relative error = %10.4g\n",
|
|
1577
|
+
(int)iteration_count_, (int)num_check_weight,
|
|
1578
|
+
dual_steepest_edge_weight_error, dual_steepest_edge_weight_norm,
|
|
1579
|
+
relative_dual_steepest_edge_weight_error);
|
|
1580
|
+
fflush(stdout);
|
|
1581
|
+
debug_max_relative_dual_steepest_edge_weight_error =
|
|
1582
|
+
relative_dual_steepest_edge_weight_error;
|
|
1583
|
+
if (relative_dual_steepest_edge_weight_error >
|
|
1584
|
+
large_relative_dual_steepest_edge_weight_error)
|
|
1585
|
+
return HighsDebugStatus::kLargeError;
|
|
1586
|
+
}
|
|
1587
|
+
return HighsDebugStatus::kOk;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
HighsDebugStatus HEkk::debugRowMatrix() const {
|
|
1591
|
+
/*
|
|
1592
|
+
printf("Checking row-wise matrix\n");
|
|
1593
|
+
for (HighsInt row = 0; row < numRow; row++) {
|
|
1594
|
+
for (HighsInt el = ARstart[row]; el < AR_Nend[row]; el++) {
|
|
1595
|
+
HighsInt col = ARindex[el];
|
|
1596
|
+
if (!nonbasicFlag_[col]) {
|
|
1597
|
+
printf("Row-wise matrix error: col %" HIGHSINT_FORMAT ", (el = %"
|
|
1598
|
+
HIGHSINT_FORMAT " for row %" HIGHSINT_FORMAT ") is basic\n", col, el, row);
|
|
1599
|
+
return false;
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
for (HighsInt el = AR_Nend[row]; el < ARstart[row + 1]; el++) {
|
|
1603
|
+
HighsInt col = ARindex[el];
|
|
1604
|
+
if (nonbasicFlag_[col]) {
|
|
1605
|
+
printf(
|
|
1606
|
+
"Row-wise matrix error: col %" HIGHSINT_FORMAT ", (el = %"
|
|
1607
|
+
HIGHSINT_FORMAT " for row %" HIGHSINT_FORMAT ") is nonbasic\n", col, el, row);
|
|
1608
|
+
return false;
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
*/
|
|
1613
|
+
return HighsDebugStatus::kOk;
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
HighsDebugStatus HEkk::debugComputeDual(const bool initialise) const {
|
|
1617
|
+
static vector<double> previous_dual;
|
|
1618
|
+
const HighsSimplexInfo& info = this->info_;
|
|
1619
|
+
if (initialise) {
|
|
1620
|
+
previous_dual = info.workDual_;
|
|
1621
|
+
return HighsDebugStatus::kOk;
|
|
1622
|
+
}
|
|
1623
|
+
const HighsOptions& options = *(this->options_);
|
|
1624
|
+
// if (options.highs_debug_level < kHighsDebugLevelCheap) return
|
|
1625
|
+
// HighsDebugStatus::kNotChecked;
|
|
1626
|
+
const HighsLp& lp = this->lp_;
|
|
1627
|
+
const SimplexBasis& basis = this->basis_;
|
|
1628
|
+
|
|
1629
|
+
double norm_basic_costs = 0;
|
|
1630
|
+
for (HighsInt iRow = 0; iRow < lp_.num_row_; iRow++) {
|
|
1631
|
+
const double value = info.workCost_[basis.basicIndex_[iRow]] +
|
|
1632
|
+
info.workShift_[basis.basicIndex_[iRow]];
|
|
1633
|
+
norm_basic_costs = max(fabs(value), norm_basic_costs);
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
vector<double> new_dual = info.workDual_;
|
|
1637
|
+
vector<double> delta_dual;
|
|
1638
|
+
HighsInt num_tot = lp.num_col_ + lp.num_row_;
|
|
1639
|
+
delta_dual.assign(num_tot, 0);
|
|
1640
|
+
HighsInt num_dual_sign_change = 0;
|
|
1641
|
+
HighsInt num_delta_dual_values = 0;
|
|
1642
|
+
double norm_nonbasic_costs = 0;
|
|
1643
|
+
for (HighsInt iVar = 0; iVar < num_tot; iVar++) {
|
|
1644
|
+
if (!basis.nonbasicFlag_[iVar]) continue;
|
|
1645
|
+
double value = info.workCost_[iVar] + info.workShift_[iVar];
|
|
1646
|
+
norm_nonbasic_costs = max(fabs(value), norm_nonbasic_costs);
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
const double zero_delta_dual =
|
|
1650
|
+
max(0.5 * (norm_basic_costs + norm_nonbasic_costs) * 1e-16, 1e-16);
|
|
1651
|
+
for (HighsInt iVar = 0; iVar < num_tot; iVar++) {
|
|
1652
|
+
if (!basis.nonbasicFlag_[iVar]) {
|
|
1653
|
+
previous_dual[iVar] = 0;
|
|
1654
|
+
new_dual[iVar] = 0;
|
|
1655
|
+
continue;
|
|
1656
|
+
}
|
|
1657
|
+
double delta = new_dual[iVar] - previous_dual[iVar];
|
|
1658
|
+
if (fabs(delta) < zero_delta_dual) continue;
|
|
1659
|
+
delta_dual[iVar] = delta;
|
|
1660
|
+
const bool sign_change =
|
|
1661
|
+
fabs(previous_dual[iVar]) > options.dual_feasibility_tolerance &&
|
|
1662
|
+
fabs(new_dual[iVar]) > options.dual_feasibility_tolerance &&
|
|
1663
|
+
previous_dual[iVar] * new_dual[iVar] < 0;
|
|
1664
|
+
if (sign_change) num_dual_sign_change++;
|
|
1665
|
+
num_delta_dual_values++;
|
|
1666
|
+
}
|
|
1667
|
+
if (num_delta_dual_values) {
|
|
1668
|
+
printf(
|
|
1669
|
+
"\nHEkk::debugComputeDual Iteration %d: Number of dual sign changes = "
|
|
1670
|
+
"%d\n",
|
|
1671
|
+
(int)iteration_count_, (int)num_dual_sign_change);
|
|
1672
|
+
printf(" |cB| = %g; |cN| = %g; zero delta dual = %g\n", norm_basic_costs,
|
|
1673
|
+
norm_nonbasic_costs, zero_delta_dual);
|
|
1674
|
+
// analyseVectorValues(&options.log_options, "Previous duals", num_tot,
|
|
1675
|
+
// previous_dual); analyseVectorValues(&options.log_options, "New duals",
|
|
1676
|
+
// num_tot, new_dual);
|
|
1677
|
+
analyseVectorValues(&options.log_options, "Delta duals", num_tot,
|
|
1678
|
+
delta_dual);
|
|
1679
|
+
}
|
|
1680
|
+
return HighsDebugStatus::kOk;
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
HighsDebugStatus HEkk::debugSimplexDualInfeasible(const std::string message,
|
|
1684
|
+
const bool force_report) {
|
|
1685
|
+
const HighsSimplexInfo& info = this->info_;
|
|
1686
|
+
computeSimplexDualInfeasible();
|
|
1687
|
+
if (info.num_dual_infeasibilities || force_report)
|
|
1688
|
+
printf(
|
|
1689
|
+
"Iteration %6d: %s num / max / sum dual infeasibilities is %d / %g / "
|
|
1690
|
+
"%g\n",
|
|
1691
|
+
(int)iteration_count_, message.c_str(),
|
|
1692
|
+
(int)info.num_dual_infeasibilities, info.max_dual_infeasibility,
|
|
1693
|
+
info.sum_dual_infeasibilities);
|
|
1694
|
+
return HighsDebugStatus::kOk;
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
bool HEkk::debugNoShiftsOrPerturbations() const {
|
|
1698
|
+
switch (model_status_) {
|
|
1699
|
+
case HighsModelStatus::kOptimal: {
|
|
1700
|
+
if (this->info_.costs_shifted || this->info_.costs_perturbed ||
|
|
1701
|
+
this->info_.bounds_shifted || this->info_.bounds_perturbed) {
|
|
1702
|
+
return false;
|
|
1703
|
+
}
|
|
1704
|
+
break;
|
|
1705
|
+
}
|
|
1706
|
+
case HighsModelStatus::kInfeasible: {
|
|
1707
|
+
if (this->info_.bounds_shifted || this->info_.bounds_perturbed) {
|
|
1708
|
+
return false;
|
|
1709
|
+
}
|
|
1710
|
+
break;
|
|
1711
|
+
}
|
|
1712
|
+
case HighsModelStatus::kUnboundedOrInfeasible: {
|
|
1713
|
+
if (this->info_.costs_shifted || this->info_.costs_perturbed) {
|
|
1714
|
+
return false;
|
|
1715
|
+
}
|
|
1716
|
+
break;
|
|
1717
|
+
}
|
|
1718
|
+
default:
|
|
1719
|
+
return true;
|
|
1720
|
+
}
|
|
1721
|
+
return true;
|
|
1722
|
+
}
|