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,966 @@
|
|
|
1
|
+
#include "ipm/ipx/basis.h"
|
|
2
|
+
|
|
3
|
+
#include <algorithm>
|
|
4
|
+
#include <cmath>
|
|
5
|
+
#include <tuple>
|
|
6
|
+
#include "ipm/ipx/basiclu_kernel.h"
|
|
7
|
+
#include "ipm/ipx/basiclu_wrapper.h"
|
|
8
|
+
#include "ipm/ipx/forrest_tomlin.h"
|
|
9
|
+
#include "ipm/ipx/guess_basis.h"
|
|
10
|
+
#include "ipm/ipx/power_method.h"
|
|
11
|
+
#include "ipm/ipx/symbolic_invert.h"
|
|
12
|
+
#include "ipm/ipx/timer.h"
|
|
13
|
+
#include "ipm/ipx/utils.h"
|
|
14
|
+
|
|
15
|
+
namespace ipx {
|
|
16
|
+
|
|
17
|
+
Basis::Basis(const Control& control, const Model& model)
|
|
18
|
+
: control_(control), model_(model) {
|
|
19
|
+
const Int m = model_.rows();
|
|
20
|
+
const Int n = model_.cols();
|
|
21
|
+
basis_.resize(m);
|
|
22
|
+
map2basis_.resize(n+m);
|
|
23
|
+
if (control_.lu_kernel() <= 0) {
|
|
24
|
+
lu_.reset(new BasicLu(control_, m));
|
|
25
|
+
} else {
|
|
26
|
+
std::unique_ptr<LuFactorization> lu(new BasicLuKernel);
|
|
27
|
+
lu_.reset(new ForrestTomlin(control_, m, lu));
|
|
28
|
+
}
|
|
29
|
+
lu_->pivottol(control_.lu_pivottol());
|
|
30
|
+
SetToSlackBasis();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
void Basis::FixNonbasicVariable(Int j) {
|
|
34
|
+
if (StatusOf(j) == NONBASIC_FIXED)
|
|
35
|
+
return;
|
|
36
|
+
assert(StatusOf(j) == NONBASIC);
|
|
37
|
+
assert(map2basis_[j] == -1);
|
|
38
|
+
map2basis_[j] = -2;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
void Basis::FreeBasicVariable(Int j) {
|
|
42
|
+
const Int m = model_.rows();
|
|
43
|
+
if (StatusOf(j) == BASIC_FREE)
|
|
44
|
+
return;
|
|
45
|
+
assert(StatusOf(j) == BASIC);
|
|
46
|
+
assert(map2basis_[j] >= 0 && map2basis_[j] < m);
|
|
47
|
+
map2basis_[j] += m;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
void Basis::UnfixVariables() {
|
|
51
|
+
const Int m = model_.rows();
|
|
52
|
+
const Int n = model_.cols();
|
|
53
|
+
for (Int j = 0; j < n+m; j++)
|
|
54
|
+
if (map2basis_[j] == -2)
|
|
55
|
+
map2basis_[j] = -1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
void Basis::UnfreeVariables() {
|
|
59
|
+
const Int m = model_.rows();
|
|
60
|
+
const Int n = model_.cols();
|
|
61
|
+
for (Int j = 0; j < n+m; j++)
|
|
62
|
+
if (map2basis_[j] >= m)
|
|
63
|
+
map2basis_[j] -= m;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
void Basis::SetToSlackBasis() {
|
|
67
|
+
const Int m = model_.rows();
|
|
68
|
+
const Int n = model_.cols();
|
|
69
|
+
for (Int i = 0; i < m; i++)
|
|
70
|
+
basis_[i] = n+i;
|
|
71
|
+
for (Int j = 0; j < n; j++)
|
|
72
|
+
map2basis_[j] = -1;
|
|
73
|
+
for (Int i = 0; i < m; i++)
|
|
74
|
+
map2basis_[n+i] = i;
|
|
75
|
+
Int err = Factorize();
|
|
76
|
+
// factorization of slack basis cannot fail other than out of memory
|
|
77
|
+
assert(err == 0);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
Int Basis::Load(const int* basic_status) {
|
|
81
|
+
const Int m = model_.rows();
|
|
82
|
+
const Int n = model_.cols();
|
|
83
|
+
|
|
84
|
+
// Change member variables only when basis is valid.
|
|
85
|
+
std::vector<Int> basis, map2basis(n+m);
|
|
86
|
+
Int p = 0;
|
|
87
|
+
for (Int j = 0; j < n+m; j++) {
|
|
88
|
+
switch (basic_status[j]) {
|
|
89
|
+
case NONBASIC_FIXED:
|
|
90
|
+
map2basis[j] = -2;
|
|
91
|
+
break;
|
|
92
|
+
case NONBASIC:
|
|
93
|
+
map2basis[j] = -1;
|
|
94
|
+
break;
|
|
95
|
+
case BASIC:
|
|
96
|
+
basis.push_back(j);
|
|
97
|
+
map2basis[j] = p++;
|
|
98
|
+
break;
|
|
99
|
+
case BASIC_FREE:
|
|
100
|
+
basis.push_back(j);
|
|
101
|
+
map2basis[j] = p++ + m;
|
|
102
|
+
break;
|
|
103
|
+
default:
|
|
104
|
+
return IPX_ERROR_invalid_basis;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (p != m)
|
|
108
|
+
return IPX_ERROR_invalid_basis;
|
|
109
|
+
|
|
110
|
+
std::copy(basis.begin(), basis.end(), basis_.begin());
|
|
111
|
+
std::copy(map2basis.begin(), map2basis.end(), map2basis_.begin());
|
|
112
|
+
return Factorize();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
Int Basis::Factorize() {
|
|
116
|
+
const Int m = model_.rows();
|
|
117
|
+
const SparseMatrix& AI = model_.AI();
|
|
118
|
+
Timer timer;
|
|
119
|
+
|
|
120
|
+
// Build column pointers for passing to LU factorization.
|
|
121
|
+
std::vector<Int> begin(m), end(m);
|
|
122
|
+
Int basis_num_nz = 0;
|
|
123
|
+
for (Int i = 0; i < m; i++) {
|
|
124
|
+
assert(basis_[i] >= 0);
|
|
125
|
+
begin[i] = AI.begin(basis_[i]);
|
|
126
|
+
end[i] = AI.end(basis_[i]);
|
|
127
|
+
basis_num_nz += (end[i]-begin[i]);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
std::stringstream h_logging_stream;
|
|
131
|
+
h_logging_stream.str(std::string());
|
|
132
|
+
h_logging_stream <<
|
|
133
|
+
" Start factorization " << Format(num_factorizations_+1, 3) <<
|
|
134
|
+
": nonzeros in basis = " << Format(basis_num_nz, 9) <<
|
|
135
|
+
Format("", 14) << time(control_.Elapsed()) << "\n";
|
|
136
|
+
control_.hIntervalLog(h_logging_stream);
|
|
137
|
+
|
|
138
|
+
Int err = 0; // return code
|
|
139
|
+
while (true) {
|
|
140
|
+
Int flag = lu_->Factorize(begin.data(), end.data(), AI.rowidx(),
|
|
141
|
+
AI.values(), false);
|
|
142
|
+
num_factorizations_++;
|
|
143
|
+
fill_factors_.push_back(lu_->fill_factor());
|
|
144
|
+
if (flag & 2) {
|
|
145
|
+
AdaptToSingularFactorization();
|
|
146
|
+
err = IPX_ERROR_basis_singular;
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
if ((flag & 1) && TightenLuPivotTol()) {
|
|
150
|
+
// The factorization was numerically unstable and the pivot
|
|
151
|
+
// tolerance could be tightened. Repeat.
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
if (flag & 1) {
|
|
155
|
+
control_.Debug(3)
|
|
156
|
+
<< " LU factorization unstable with pivot tolerance "
|
|
157
|
+
<< lu_->pivottol() << '\n';
|
|
158
|
+
// ignore instability
|
|
159
|
+
}
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
time_factorize_ += timer.Elapsed();
|
|
163
|
+
factorization_is_fresh_ = true;
|
|
164
|
+
h_logging_stream.str(std::string());
|
|
165
|
+
h_logging_stream <<
|
|
166
|
+
" Finish factorization " << Format(num_factorizations_, 3) <<
|
|
167
|
+
": fill factor = " << Fixed(lu_->fill_factor(), 6, 2) <<
|
|
168
|
+
Format("", 23) << time(control_.Elapsed()) << "\n";
|
|
169
|
+
control_.hIntervalLog(h_logging_stream);
|
|
170
|
+
return err;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
bool Basis::FactorizationIsFresh() const {
|
|
174
|
+
return factorization_is_fresh_;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
void Basis::GetLuFactors(SparseMatrix *L, SparseMatrix *U, Int *rowperm,
|
|
178
|
+
Int *colperm) const {
|
|
179
|
+
assert(FactorizationIsFresh());
|
|
180
|
+
lu_->GetFactors(L, U, rowperm, colperm, nullptr);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
void Basis::SolveDense(const Vector& rhs, Vector& lhs, char trans) const {
|
|
184
|
+
lu_->SolveDense(rhs, lhs, trans);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
void Basis::SolveForUpdate(Int j, IndexedVector& lhs) {
|
|
188
|
+
const Int p = PositionOf(j);
|
|
189
|
+
Timer timer;
|
|
190
|
+
const Int dim = model_.rows();
|
|
191
|
+
assert(dim>0);
|
|
192
|
+
if (p < 0) { // ftran
|
|
193
|
+
const SparseMatrix& AI = model_.AI();
|
|
194
|
+
Int begin = AI.begin(j);
|
|
195
|
+
Int end = AI.end(j);
|
|
196
|
+
Int nz = end-begin;
|
|
197
|
+
const Int* bi = AI.rowidx() + begin;
|
|
198
|
+
const double* bx = AI.values() + begin;
|
|
199
|
+
lu_->FtranForUpdate(nz, bi, bx, lhs);
|
|
200
|
+
num_ftran_++;
|
|
201
|
+
const double density = (1.0 * lhs.nnz()) / dim;
|
|
202
|
+
sum_ftran_density_ += density;
|
|
203
|
+
if (lhs.sparse())
|
|
204
|
+
num_ftran_sparse_++;
|
|
205
|
+
time_ftran_ += timer.Elapsed();
|
|
206
|
+
}
|
|
207
|
+
else { // btran
|
|
208
|
+
lu_->BtranForUpdate(p, lhs);
|
|
209
|
+
num_btran_++;
|
|
210
|
+
const double density = (1.0 * lhs.nnz()) / dim;
|
|
211
|
+
sum_btran_density_ += density;
|
|
212
|
+
if (lhs.sparse())
|
|
213
|
+
num_btran_sparse_++;
|
|
214
|
+
time_btran_ += timer.Elapsed();
|
|
215
|
+
// updateValueDistribution(density, btran_density);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
void Basis::SolveForUpdate(Int j) {
|
|
220
|
+
const Int p = PositionOf(j);
|
|
221
|
+
Timer timer;
|
|
222
|
+
if (p < 0) {
|
|
223
|
+
const SparseMatrix& AI = model_.AI();
|
|
224
|
+
Int begin = AI.begin(j);
|
|
225
|
+
Int end = AI.end(j);
|
|
226
|
+
Int nz = end-begin;
|
|
227
|
+
const Int* bi = AI.rowidx() + begin;
|
|
228
|
+
const double* bx = AI.values() + begin;
|
|
229
|
+
lu_->FtranForUpdate(nz, bi, bx);
|
|
230
|
+
time_ftran_ += timer.Elapsed();
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
lu_->BtranForUpdate(p);
|
|
234
|
+
time_btran_ += timer.Elapsed();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
void Basis::TableauRow(Int jb, IndexedVector& btran, IndexedVector& row,
|
|
239
|
+
bool ignore_fixed) {
|
|
240
|
+
const Int m = model_.rows();
|
|
241
|
+
const Int n = model_.cols();
|
|
242
|
+
assert(IsBasic(jb));
|
|
243
|
+
SolveForUpdate(jb, btran);
|
|
244
|
+
|
|
245
|
+
// Estimate if tableau row is sparse.
|
|
246
|
+
bool is_sparse = btran.sparse();
|
|
247
|
+
if (is_sparse) {
|
|
248
|
+
const SparseMatrix& AIt = model_.AIt();
|
|
249
|
+
const Int* bi = btran.pattern();
|
|
250
|
+
Int nz = 0;
|
|
251
|
+
for (Int k = 0; k < btran.nnz(); k++) {
|
|
252
|
+
Int i = bi[k];
|
|
253
|
+
nz += AIt.end(i) - AIt.begin(i);
|
|
254
|
+
}
|
|
255
|
+
nz /= 2; // guess for overlap
|
|
256
|
+
if (nz > kHypersparseThreshold*n)
|
|
257
|
+
is_sparse = false;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (is_sparse) {
|
|
261
|
+
// sparse vector * sparse matrix: accesses A rowwise
|
|
262
|
+
const SparseMatrix& AIt = model_.AIt();
|
|
263
|
+
const Int* Ati = AIt.rowidx();
|
|
264
|
+
const double* Atx = AIt.values();
|
|
265
|
+
const Int* bi = btran.pattern();
|
|
266
|
+
row.set_to_zero();
|
|
267
|
+
Int* row_pattern = row.pattern();
|
|
268
|
+
Int nz = 0;
|
|
269
|
+
for (Int k = 0; k < btran.nnz(); k++) {
|
|
270
|
+
Int i = bi[k];
|
|
271
|
+
double temp = btran[i];
|
|
272
|
+
Int begin = AIt.begin(i);
|
|
273
|
+
Int end = AIt.end(i);
|
|
274
|
+
for (Int p = begin; p < end; p++) {
|
|
275
|
+
Int j = Ati[p];
|
|
276
|
+
if (map2basis_[j] == -1 || (map2basis_[j] == -2 && !ignore_fixed))
|
|
277
|
+
{
|
|
278
|
+
map2basis_[j] -= 2; // mark column
|
|
279
|
+
row_pattern[nz++] = j;
|
|
280
|
+
}
|
|
281
|
+
if (map2basis_[j] < -2) // marked column
|
|
282
|
+
row[j] += temp * Atx[p];
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
for (Int k = 0; k < nz; k++) // reset marked
|
|
286
|
+
map2basis_[row_pattern[k]] += 2;
|
|
287
|
+
row.set_nnz(nz);
|
|
288
|
+
} else {
|
|
289
|
+
// dense vector * sparse matrix: accesses A columnwise
|
|
290
|
+
const SparseMatrix& AI = model_.AI();
|
|
291
|
+
const Int* Ai = AI.rowidx();
|
|
292
|
+
const double* Ax = AI.values();
|
|
293
|
+
for (Int j = 0; j < n+m; j++) {
|
|
294
|
+
double result = 0.0;
|
|
295
|
+
if (map2basis_[j] == -1 || (map2basis_[j] == -2 && !ignore_fixed)) {
|
|
296
|
+
Int begin = AI.begin(j);
|
|
297
|
+
Int end = AI.end(j);
|
|
298
|
+
for (Int p = begin; p < end; p++)
|
|
299
|
+
result += Ax[p] * btran[Ai[p]];
|
|
300
|
+
}
|
|
301
|
+
row[j] = result;
|
|
302
|
+
}
|
|
303
|
+
row.InvalidatePattern();
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
Int Basis::ExchangeIfStable(Int jb, Int jn, double tableau_entry, int sys,
|
|
308
|
+
bool* exchanged) {
|
|
309
|
+
assert(IsBasic(jb));
|
|
310
|
+
assert(IsNonbasic(jn));
|
|
311
|
+
if (sys > 0) // forward system needs to be solved
|
|
312
|
+
SolveForUpdate(jn);
|
|
313
|
+
if (sys < 0) // transposed system needs to be solved
|
|
314
|
+
SolveForUpdate(jb);
|
|
315
|
+
|
|
316
|
+
// Update factorization.
|
|
317
|
+
*exchanged = false;
|
|
318
|
+
Timer timer;
|
|
319
|
+
Int err = lu_->Update(tableau_entry);
|
|
320
|
+
time_update_ += timer.Elapsed();
|
|
321
|
+
if (err != 0) {
|
|
322
|
+
if (FactorizationIsFresh() && !TightenLuPivotTol())
|
|
323
|
+
return IPX_ERROR_basis_too_ill_conditioned;
|
|
324
|
+
control_.Debug(3)
|
|
325
|
+
<< " stability check forced refactorization after "
|
|
326
|
+
<< lu_->updates()-1 << " updates\n";
|
|
327
|
+
return Factorize(); // refactorizes the old basis
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// Update basis.
|
|
331
|
+
Int ib = PositionOf(jb);
|
|
332
|
+
assert(basis_[ib] == jb);
|
|
333
|
+
basis_[ib] = jn;
|
|
334
|
+
map2basis_[jn] = ib; // status now BASIC
|
|
335
|
+
map2basis_[jb] = -1; // status now NONBASIC
|
|
336
|
+
num_updates_++;
|
|
337
|
+
factorization_is_fresh_ = false;
|
|
338
|
+
*exchanged = true;
|
|
339
|
+
|
|
340
|
+
if (lu_->NeedFreshFactorization())
|
|
341
|
+
return Factorize();
|
|
342
|
+
return 0;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
void Basis::ComputeBasicSolution(Vector& x, Vector& y, Vector& z) const {
|
|
346
|
+
const Int m = model_.rows();
|
|
347
|
+
const Int n = model_.cols();
|
|
348
|
+
const Vector& b = model_.b();
|
|
349
|
+
const Vector& c = model_.c();
|
|
350
|
+
const SparseMatrix& AI = model_.AI();
|
|
351
|
+
|
|
352
|
+
// Compute x[basic] so that Ax=b. Use y as workspace.
|
|
353
|
+
y = b;
|
|
354
|
+
for (Int j = 0; j < n+m; j++)
|
|
355
|
+
if (IsNonbasic(j))
|
|
356
|
+
ScatterColumn(AI, j, -x[j], y);
|
|
357
|
+
SolveDense(y, y, 'N');
|
|
358
|
+
for (Int p = 0; p < m; p++)
|
|
359
|
+
x[basis_[p]] = y[p];
|
|
360
|
+
|
|
361
|
+
// Compute y and z[nonbasic] so that AI'y+z=c.
|
|
362
|
+
for (Int p = 0; p < m; p++)
|
|
363
|
+
y[p] = c[basis_[p]] - z[basis_[p]];
|
|
364
|
+
SolveDense(y, y, 'T');
|
|
365
|
+
for (Int j = 0; j < n+m; j++) {
|
|
366
|
+
if (IsNonbasic(j))
|
|
367
|
+
z[j] = c[j] - DotColumn(AI, j, y);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
void Basis::ConstructBasisFromWeights(const double* colscale, Info* info) {
|
|
372
|
+
assert(colscale);
|
|
373
|
+
info->errflag = 0;
|
|
374
|
+
info->dependent_rows = 0;
|
|
375
|
+
info->dependent_cols = 0;
|
|
376
|
+
|
|
377
|
+
if (control_.crash_basis()) {
|
|
378
|
+
CrashBasis(colscale);
|
|
379
|
+
double sigma = MinSingularValue();
|
|
380
|
+
control_.Debug()
|
|
381
|
+
<< Textline("Minimum singular value of crash basis:") << sci2(sigma)
|
|
382
|
+
<< '\n';
|
|
383
|
+
Repair(info);
|
|
384
|
+
if (info->basis_repairs < 0) {
|
|
385
|
+
control_.hLog(" discarding crash basis\n");
|
|
386
|
+
SetToSlackBasis();
|
|
387
|
+
}
|
|
388
|
+
else if (info->basis_repairs > 0) {
|
|
389
|
+
sigma = MinSingularValue();
|
|
390
|
+
control_.Debug()
|
|
391
|
+
<< Textline("Minimum singular value of repaired crash basis:")
|
|
392
|
+
<< sci2(sigma) << '\n';
|
|
393
|
+
}
|
|
394
|
+
} else {
|
|
395
|
+
SetToSlackBasis();
|
|
396
|
+
}
|
|
397
|
+
PivotFreeVariablesIntoBasis(colscale, info);
|
|
398
|
+
if (info->errflag)
|
|
399
|
+
return;
|
|
400
|
+
PivotFixedVariablesOutOfBasis(colscale, info);
|
|
401
|
+
if (info->errflag)
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
double Basis::MinSingularValue() const {
|
|
406
|
+
const Int m = model_.rows();
|
|
407
|
+
Vector v(m);
|
|
408
|
+
|
|
409
|
+
// Computes maximum eigenvalue of inverse(B*B').
|
|
410
|
+
double lambda = PowerMethod(
|
|
411
|
+
[this](const Vector& x, Vector& fx) {
|
|
412
|
+
SolveDense(x, fx, 'N');
|
|
413
|
+
SolveDense(fx, fx, 'T'); }, v);
|
|
414
|
+
return std::sqrt(1.0/lambda);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
void Basis::SymbolicInvert(Int* rowcounts, Int* colcounts) const {
|
|
418
|
+
ipx::SymbolicInvert(model_, basis_, rowcounts, colcounts);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
double Basis::DensityInverse() const {
|
|
422
|
+
Int m = model_.rows();
|
|
423
|
+
std::vector<Int> rowcounts(m);
|
|
424
|
+
SymbolicInvert(rowcounts.data(), nullptr);
|
|
425
|
+
// Accumulating rowcounts would result in overflow for large LPs.
|
|
426
|
+
double density = 0.0;
|
|
427
|
+
for (Int i = 0; i < m; i++)
|
|
428
|
+
density += 1.0*rowcounts[i]/m;
|
|
429
|
+
return density/m;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
const Model& Basis::model() const {
|
|
433
|
+
return model_;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
Int Basis::factorizations() const {
|
|
437
|
+
return num_factorizations_;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
Int Basis::updates_total() const {
|
|
441
|
+
return num_updates_;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
double Basis::frac_ftran_sparse() const {
|
|
445
|
+
return 1.0 * num_ftran_sparse_ / num_ftran_;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
double Basis::frac_btran_sparse() const {
|
|
449
|
+
return 1.0 * num_btran_sparse_ / num_btran_;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
double Basis::time_factorize() const {
|
|
453
|
+
return time_factorize_;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
double Basis::time_ftran() const {
|
|
457
|
+
return time_ftran_;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
double Basis::time_btran() const {
|
|
461
|
+
return time_btran_;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
double Basis::time_update() const {
|
|
465
|
+
return time_update_;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
double Basis::mean_fill() const {
|
|
469
|
+
if (fill_factors_.empty())
|
|
470
|
+
return 0.0;
|
|
471
|
+
double mean = 1.0;
|
|
472
|
+
Int num_factors = fill_factors_.size();
|
|
473
|
+
for (double f : fill_factors_)
|
|
474
|
+
mean *= std::pow(f, 1.0/num_factors);
|
|
475
|
+
return mean;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
double Basis::max_fill() const {
|
|
479
|
+
if (fill_factors_.empty())
|
|
480
|
+
return 0.0;
|
|
481
|
+
return *std::max_element(fill_factors_.begin(), fill_factors_.end());
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
Int Basis::AdaptToSingularFactorization() {
|
|
485
|
+
const Int m = model_.rows();
|
|
486
|
+
const Int n = model_.cols();
|
|
487
|
+
std::vector<Int> rowperm(m), colperm(m), dependent_cols;
|
|
488
|
+
|
|
489
|
+
lu_->GetFactors(nullptr, nullptr, rowperm.data(), colperm.data(),
|
|
490
|
+
&dependent_cols);
|
|
491
|
+
for (Int k : dependent_cols) {
|
|
492
|
+
// Column p of the basis matrix was replaced by the i-th unit
|
|
493
|
+
// column. Insert the corresponding slack variable jn into
|
|
494
|
+
// position p of the basis.
|
|
495
|
+
Int p = colperm[k];
|
|
496
|
+
Int i = rowperm[k];
|
|
497
|
+
Int jb = basis_[p];
|
|
498
|
+
Int jn = n+i;
|
|
499
|
+
assert(map2basis_[jn] < 0);
|
|
500
|
+
basis_[p] = jn;
|
|
501
|
+
map2basis_[jn] = p; // now BASIC at position p
|
|
502
|
+
if (jb >= 0)
|
|
503
|
+
map2basis_[jb] = -1; // now NONBASIC
|
|
504
|
+
}
|
|
505
|
+
return dependent_cols.size();
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
bool Basis::TightenLuPivotTol() {
|
|
509
|
+
double tol = lu_->pivottol();
|
|
510
|
+
if (tol <= 0.05)
|
|
511
|
+
lu_->pivottol(0.1);
|
|
512
|
+
else if (tol <= 0.25)
|
|
513
|
+
lu_->pivottol(0.3);
|
|
514
|
+
else if (tol <= 0.5)
|
|
515
|
+
lu_->pivottol(0.9);
|
|
516
|
+
else
|
|
517
|
+
return false;
|
|
518
|
+
std::stringstream h_logging_stream;
|
|
519
|
+
h_logging_stream.str(std::string());
|
|
520
|
+
h_logging_stream << " LU pivot tolerance tightened to " << lu_->pivottol() << '\n';
|
|
521
|
+
control_.hLog(h_logging_stream);
|
|
522
|
+
return true;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
void Basis::CrashBasis(const double* colweights) {
|
|
526
|
+
const Int m = model_.rows();
|
|
527
|
+
|
|
528
|
+
// Make a guess for a basis. Then use LU factorization with a strict
|
|
529
|
+
// absolute pivot tolerance to remove dependent columns. This is not a
|
|
530
|
+
// rank revealing factorization, but it detects many dependencies in
|
|
531
|
+
// practice.
|
|
532
|
+
std::vector<Int> cols_guessed = GuessBasis(control_, model_, colweights);
|
|
533
|
+
assert((Int)cols_guessed.size() <= m);
|
|
534
|
+
assert((Int)cols_guessed.size() == m); // at the moment
|
|
535
|
+
|
|
536
|
+
// Initialize the Basis object and factorize the (partial) basis. If
|
|
537
|
+
// basis_[p] is negative, the p-th column of the basis matrix is zero,
|
|
538
|
+
// and a slack column will be inserted by CrashFacorize().
|
|
539
|
+
std::fill(basis_.begin(), basis_.end(), -1);
|
|
540
|
+
std::fill(map2basis_.begin(), map2basis_.end(), -1);
|
|
541
|
+
for (size_t k = 0; k < cols_guessed.size(); k++) {
|
|
542
|
+
basis_[k] = cols_guessed[k];
|
|
543
|
+
assert(map2basis_[basis_[k]] == -1); // must not have duplicates
|
|
544
|
+
map2basis_[basis_[k]] = k;
|
|
545
|
+
}
|
|
546
|
+
Int num_dropped = 0;
|
|
547
|
+
CrashFactorize(&num_dropped);
|
|
548
|
+
control_.Debug()
|
|
549
|
+
<< Textline("Number of columns dropped from guessed basis:")
|
|
550
|
+
<< num_dropped << '\n';
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
// Rook search for a large entry in inverse(B). If successful, returns [p,i,x]
|
|
554
|
+
// where x is the entry at position (p,i) of inverse(B). Notice that p
|
|
555
|
+
// corresponds to a column of B and i corresponds to a row of B. If overflow
|
|
556
|
+
// occurs, returns [-1,-1,INFINITY]. See [1] for a discussion of the algorithm.
|
|
557
|
+
//
|
|
558
|
+
// [1] N.J. Higham and S.D. Relton, "Estimating the Largest Elements of a
|
|
559
|
+
// Matrix", MIMS EPrint 2015.116, University of Manchester (2015).
|
|
560
|
+
//
|
|
561
|
+
static std::tuple<Int,Int,double> InverseSearch(const Basis& basis,
|
|
562
|
+
Vector& work) {
|
|
563
|
+
const Int m = work.size();
|
|
564
|
+
double inverse_max = 0.0;
|
|
565
|
+
|
|
566
|
+
for (Int i = 0; i < m; i++)
|
|
567
|
+
work[i] = 1.0/(i+1);
|
|
568
|
+
|
|
569
|
+
while (true) {
|
|
570
|
+
basis.SolveDense(work, work, 'N');
|
|
571
|
+
if (!AllFinite(work))
|
|
572
|
+
break;
|
|
573
|
+
Int pmax = FindMaxAbs(work);
|
|
574
|
+
work = 0.0;
|
|
575
|
+
work[pmax] = 1.0;
|
|
576
|
+
basis.SolveDense(work, work, 'T');
|
|
577
|
+
if (!AllFinite(work))
|
|
578
|
+
break;
|
|
579
|
+
Int imax = FindMaxAbs(work);
|
|
580
|
+
double inverse_entry = work[imax];
|
|
581
|
+
if (std::abs(inverse_entry) <= 2.0*inverse_max)
|
|
582
|
+
return std::make_tuple(pmax, imax, inverse_entry);
|
|
583
|
+
inverse_max = std::abs(inverse_entry);
|
|
584
|
+
work = 0.0;
|
|
585
|
+
work[imax] = 1.0;
|
|
586
|
+
}
|
|
587
|
+
return std::make_tuple(-1,-1,INFINITY); // failure
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
void Basis::Repair(Info* info) {
|
|
591
|
+
const Int m = model_.rows();
|
|
592
|
+
const Int n = model_.cols();
|
|
593
|
+
Vector work(m);
|
|
594
|
+
info->basis_repairs = 0;
|
|
595
|
+
|
|
596
|
+
while (true) {
|
|
597
|
+
std::tuple<Int,Int,double> entry = InverseSearch(*this, work);
|
|
598
|
+
Int pmax = std::get<0>(entry);
|
|
599
|
+
Int imax = std::get<1>(entry);
|
|
600
|
+
double pivot = std::get<2>(entry);
|
|
601
|
+
if (pmax < 0 || imax < 0 || !std::isfinite(pivot)) {
|
|
602
|
+
info->basis_repairs = -1;
|
|
603
|
+
break;
|
|
604
|
+
}
|
|
605
|
+
if (std::abs(pivot) < kBasisRepairThreshold)
|
|
606
|
+
break;
|
|
607
|
+
Int jb = basis_[pmax];
|
|
608
|
+
Int jn = n + imax;
|
|
609
|
+
if (!IsNonbasic(jn)) {
|
|
610
|
+
info->basis_repairs = -2;
|
|
611
|
+
break;
|
|
612
|
+
}
|
|
613
|
+
if (info->basis_repairs >= kMaxBasisRepair) {
|
|
614
|
+
info->basis_repairs = -3;
|
|
615
|
+
break;
|
|
616
|
+
}
|
|
617
|
+
SolveForUpdate(jb);
|
|
618
|
+
SolveForUpdate(jn);
|
|
619
|
+
CrashExchange(jb, jn, pivot, 0, nullptr);
|
|
620
|
+
info->basis_repairs++;
|
|
621
|
+
control_.Debug(3) << " basis repair: |pivot| = "
|
|
622
|
+
<< sci2(std::abs(pivot)) << '\n';
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
void Basis::CrashFactorize(Int* num_dropped) {
|
|
627
|
+
const Int m = model_.rows();
|
|
628
|
+
const SparseMatrix& AI = model_.AI();
|
|
629
|
+
Timer timer;
|
|
630
|
+
|
|
631
|
+
// Build column pointers for passing to LU factorization. A negative index
|
|
632
|
+
// in basis_ means an empty slot. This option is kept for use by the crash
|
|
633
|
+
// procedure, if an incomplete basis was constructed. The zero column in the
|
|
634
|
+
// basis matrix causes a singularity in the LU factorization, so that the
|
|
635
|
+
// empty slot will be replaced by a slack variable below.
|
|
636
|
+
std::vector<Int> begin(m), end(m);
|
|
637
|
+
for (Int i = 0; i < m; i++) {
|
|
638
|
+
if (basis_[i] >= 0) {
|
|
639
|
+
begin[i] = AI.begin(basis_[i]);
|
|
640
|
+
end[i] = AI.end(basis_[i]);
|
|
641
|
+
} else {
|
|
642
|
+
begin[i] = 0;
|
|
643
|
+
end[i] = 0;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
Int flag = lu_->Factorize(begin.data(), end.data(), AI.rowidx(),
|
|
647
|
+
AI.values(), true);
|
|
648
|
+
num_factorizations_++;
|
|
649
|
+
fill_factors_.push_back(lu_->fill_factor());
|
|
650
|
+
Int ndropped = 0;
|
|
651
|
+
if (flag & 2)
|
|
652
|
+
ndropped = AdaptToSingularFactorization();
|
|
653
|
+
if (num_dropped)
|
|
654
|
+
*num_dropped = ndropped;
|
|
655
|
+
|
|
656
|
+
time_factorize_ += timer.Elapsed();
|
|
657
|
+
factorization_is_fresh_ = true;
|
|
658
|
+
|
|
659
|
+
#ifndef NDEBUG
|
|
660
|
+
// All empty slots must have been replaced by slack variables.
|
|
661
|
+
for (Int i = 0; i < m; i++)
|
|
662
|
+
assert(basis_[i] >= 0);
|
|
663
|
+
#endif
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
void Basis::CrashExchange(Int jb, Int jn, double tableau_entry, int sys,
|
|
667
|
+
Int* num_dropped) {
|
|
668
|
+
assert(IsBasic(jb));
|
|
669
|
+
assert(IsNonbasic(jn));
|
|
670
|
+
if (sys > 0) // forward system needs to be solved
|
|
671
|
+
SolveForUpdate(jn);
|
|
672
|
+
if (sys < 0) // transposed system needs to be solved
|
|
673
|
+
SolveForUpdate(jb);
|
|
674
|
+
|
|
675
|
+
// Update basis.
|
|
676
|
+
Int ib = PositionOf(jb);
|
|
677
|
+
assert(basis_[ib] == jb);
|
|
678
|
+
basis_[ib] = jn;
|
|
679
|
+
map2basis_[jn] = ib; // status now BASIC
|
|
680
|
+
map2basis_[jb] = -1; // status now NONBASIC
|
|
681
|
+
num_updates_++;
|
|
682
|
+
factorization_is_fresh_ = false;
|
|
683
|
+
|
|
684
|
+
// Update factorization.
|
|
685
|
+
if (num_dropped)
|
|
686
|
+
*num_dropped = 0;
|
|
687
|
+
Timer timer;
|
|
688
|
+
Int err = lu_->Update(tableau_entry);
|
|
689
|
+
time_update_ += timer.Elapsed();
|
|
690
|
+
if (err != 0 || lu_->NeedFreshFactorization()) {
|
|
691
|
+
control_.Debug(3) << " refactorization required in CrashExchange()\n";
|
|
692
|
+
CrashFactorize(num_dropped);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
void Basis::PivotFreeVariablesIntoBasis(const double* colweights, Info* info) {
|
|
697
|
+
const Int m = model_.rows();
|
|
698
|
+
const Int n = model_.cols();
|
|
699
|
+
IndexedVector ftran(m);
|
|
700
|
+
const double dependency_tol = std::max(0.0, control_.dependency_tol());
|
|
701
|
+
info->errflag = 0;
|
|
702
|
+
info->dependent_cols = 0;
|
|
703
|
+
Int stability_pivots = 0;
|
|
704
|
+
|
|
705
|
+
// Maintain stack of free nonbasic variables.
|
|
706
|
+
std::vector<Int> remaining;
|
|
707
|
+
for (Int j = 0; j < n+m; j++) {
|
|
708
|
+
if (std::isinf(colweights[j]) && map2basis_[j] < 0)
|
|
709
|
+
remaining.push_back(j);
|
|
710
|
+
}
|
|
711
|
+
control_.Debug() << Textline("Number of free variables nonbasic:")
|
|
712
|
+
<< remaining.size() << '\n';
|
|
713
|
+
|
|
714
|
+
control_.ResetPrintInterval();
|
|
715
|
+
while (!remaining.empty()) {
|
|
716
|
+
Int jn = remaining.back();
|
|
717
|
+
assert(std::isinf(colweights[jn]));
|
|
718
|
+
assert(map2basis_[jn] < 0);
|
|
719
|
+
if ((info->errflag = control_.InterruptCheck()) != 0)
|
|
720
|
+
return;
|
|
721
|
+
|
|
722
|
+
SolveForUpdate(jn, ftran);
|
|
723
|
+
Int pmax = -1;
|
|
724
|
+
Int pmax_nonfree = -1;
|
|
725
|
+
double fmax = 0.0;
|
|
726
|
+
double fmax_nonfree = 0.0;
|
|
727
|
+
auto update_max = [&](Int p, double f) {
|
|
728
|
+
f = std::abs(f);
|
|
729
|
+
if (f > fmax) {
|
|
730
|
+
fmax = f;
|
|
731
|
+
pmax = p;
|
|
732
|
+
}
|
|
733
|
+
if (!std::isinf(colweights[basis_[p]])) {
|
|
734
|
+
if (f > fmax_nonfree) {
|
|
735
|
+
fmax_nonfree = f;
|
|
736
|
+
pmax_nonfree = p;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
for_each_nonzero(ftran, update_max);
|
|
741
|
+
|
|
742
|
+
if (fmax > 4.0 && fmax_nonfree < 1.0) {
|
|
743
|
+
Int jb = basis_[pmax];
|
|
744
|
+
assert(std::isinf(colweights[jb]));
|
|
745
|
+
bool exchanged;
|
|
746
|
+
info->errflag = ExchangeIfStable(jb, jn, ftran[pmax], -1,
|
|
747
|
+
&exchanged);
|
|
748
|
+
if (info->errflag)
|
|
749
|
+
return;
|
|
750
|
+
if (!exchanged) // factorization was unstable, try again
|
|
751
|
+
continue;
|
|
752
|
+
remaining.pop_back();
|
|
753
|
+
remaining.push_back(jb);
|
|
754
|
+
info->updates_start++;
|
|
755
|
+
stability_pivots++;
|
|
756
|
+
} else {
|
|
757
|
+
if (fmax_nonfree <= dependency_tol) {
|
|
758
|
+
// jn cannot be pivoted into the basis. If we do not have an
|
|
759
|
+
// unbounded primal ray yet, then test if column jn yields one.
|
|
760
|
+
// Compute the change in the primal objective that is caused by
|
|
761
|
+
// a unit increase of x[jn] with corresponding adjustment of
|
|
762
|
+
// free basic variables.
|
|
763
|
+
if (!info->cols_inconsistent) {
|
|
764
|
+
const Vector& c = model_.c();
|
|
765
|
+
double delta_obj = c[jn];
|
|
766
|
+
auto update_delta_obj = [&](Int p, double f) {
|
|
767
|
+
Int j = basis_[p];
|
|
768
|
+
if (std::isinf(colweights[j]))
|
|
769
|
+
delta_obj -= c[j] * f;
|
|
770
|
+
};
|
|
771
|
+
for_each_nonzero(ftran, update_delta_obj);
|
|
772
|
+
if (std::abs(delta_obj) > dependency_tol) {
|
|
773
|
+
control_.Debug()
|
|
774
|
+
<< Textline(
|
|
775
|
+
"Unbounded primal ray with objective change:")
|
|
776
|
+
<< sci2(delta_obj) << '\n';
|
|
777
|
+
info->cols_inconsistent = true;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
info->dependent_cols++;
|
|
781
|
+
remaining.pop_back();
|
|
782
|
+
} else {
|
|
783
|
+
Int jb = basis_[pmax_nonfree];
|
|
784
|
+
bool exchanged;
|
|
785
|
+
info->errflag = ExchangeIfStable(jb, jn, ftran[pmax_nonfree],
|
|
786
|
+
-1, &exchanged);
|
|
787
|
+
if (info->errflag)
|
|
788
|
+
return;
|
|
789
|
+
if (!exchanged) // factorization was unstable, try again
|
|
790
|
+
continue;
|
|
791
|
+
remaining.pop_back();
|
|
792
|
+
info->updates_start++;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
std::stringstream h_logging_stream;
|
|
796
|
+
h_logging_stream.str(std::string());
|
|
797
|
+
h_logging_stream << " " << remaining.size() << " free variables remaining\n";
|
|
798
|
+
control_.hIntervalLog(h_logging_stream);
|
|
799
|
+
}
|
|
800
|
+
control_.Debug()
|
|
801
|
+
<< Textline("Number of free variables swapped for stability:")
|
|
802
|
+
<< stability_pivots << '\n';
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
void Basis::PivotFixedVariablesOutOfBasis(const double* colweights, Info* info){
|
|
806
|
+
const Int m = model_.rows();
|
|
807
|
+
const Int n = model_.cols();
|
|
808
|
+
const SparseMatrix& AI = model_.AI();
|
|
809
|
+
const Vector& lb = model_.lb();
|
|
810
|
+
const Vector& ub = model_.ub();
|
|
811
|
+
IndexedVector btran(m), row(n+m);
|
|
812
|
+
const double dependency_tol = std::max(0.0, control_.dependency_tol());
|
|
813
|
+
info->errflag = 0;
|
|
814
|
+
info->dependent_rows = 0;
|
|
815
|
+
Int stability_pivots = 0;
|
|
816
|
+
|
|
817
|
+
// Build model right-hand side after subtracting fixed columns.
|
|
818
|
+
// Needed for dual unboundedness test.
|
|
819
|
+
Vector b_minus_fixed_columns(model_.b());
|
|
820
|
+
for (Int j = 0; j < n+m; j++) {
|
|
821
|
+
if (lb[j] == ub[j] && lb[j] != 0.0)
|
|
822
|
+
ScatterColumn(AI, j, -lb[j], b_minus_fixed_columns);
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
// Maintain stack of fixed basic variables.
|
|
826
|
+
std::vector<Int> remaining;
|
|
827
|
+
for (Int j = 0; j < n; j++) {
|
|
828
|
+
// Structural variables with zero weight must not be in the crash basis.
|
|
829
|
+
if (colweights[j] == 0.0)
|
|
830
|
+
assert(map2basis_[j] < 0);
|
|
831
|
+
}
|
|
832
|
+
for (Int j = n; j < n+m; j++) {
|
|
833
|
+
if (colweights[j] == 0.0 && map2basis_[j] >= 0)
|
|
834
|
+
remaining.push_back(j);
|
|
835
|
+
}
|
|
836
|
+
control_.Debug() << Textline("Number of fixed variables basic:")
|
|
837
|
+
<< remaining.size() << '\n';
|
|
838
|
+
|
|
839
|
+
control_.ResetPrintInterval();
|
|
840
|
+
while (!remaining.empty()) {
|
|
841
|
+
Int jb = remaining.back();
|
|
842
|
+
assert(colweights[jb] == 0.0);
|
|
843
|
+
assert(map2basis_[jb] >= 0);
|
|
844
|
+
if ((info->errflag = control_.InterruptCheck()) != 0)
|
|
845
|
+
return;
|
|
846
|
+
|
|
847
|
+
TableauRow(jb, btran, row);
|
|
848
|
+
Int jmax = -1;
|
|
849
|
+
Int jmax_nonfixed = -1;
|
|
850
|
+
double rmax = 0.0;
|
|
851
|
+
double rmax_nonfixed = 0.0;
|
|
852
|
+
auto update_max = [&](Int j, double r) {
|
|
853
|
+
// Ignore structural variables with zero weight.
|
|
854
|
+
if (j >= n || colweights[j] != 0.0) {
|
|
855
|
+
r = std::abs(r);
|
|
856
|
+
if (r > rmax) {
|
|
857
|
+
rmax = r;
|
|
858
|
+
jmax = j;
|
|
859
|
+
}
|
|
860
|
+
if (colweights[j] != 0.0) {
|
|
861
|
+
if (r > rmax_nonfixed) {
|
|
862
|
+
rmax_nonfixed = r;
|
|
863
|
+
jmax_nonfixed = j;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
for_each_nonzero(row, update_max);
|
|
869
|
+
|
|
870
|
+
if (rmax > 4.0 && rmax_nonfixed < 1.0) {
|
|
871
|
+
assert(colweights[jmax] == 0.0);
|
|
872
|
+
bool exchanged;
|
|
873
|
+
info->errflag = ExchangeIfStable(jb, jmax, row[jmax], 1,
|
|
874
|
+
&exchanged);
|
|
875
|
+
if (info->errflag)
|
|
876
|
+
return;
|
|
877
|
+
if (!exchanged) // factorization was unstable, try again
|
|
878
|
+
continue;
|
|
879
|
+
remaining.pop_back();
|
|
880
|
+
remaining.push_back(jmax);
|
|
881
|
+
info->updates_start++;
|
|
882
|
+
stability_pivots++;
|
|
883
|
+
} else {
|
|
884
|
+
if (rmax_nonfixed <= dependency_tol) {
|
|
885
|
+
// jb cannot be pivoted out of the basis. If we do not have an
|
|
886
|
+
// unbounded dual ray yet, then test if row jb-n yields one.
|
|
887
|
+
// Compute the change in the dual objective that is caused by a
|
|
888
|
+
// unit increase of y[jb-n] with corresponding adjustment of the
|
|
889
|
+
// remaining y[i].
|
|
890
|
+
if (!info->rows_inconsistent) {
|
|
891
|
+
// Fix for #280 replaces this line by next
|
|
892
|
+
// double delta_obj = Dot(btran, model_.b());
|
|
893
|
+
double delta_obj = Dot(btran, b_minus_fixed_columns);
|
|
894
|
+
if (std::abs(delta_obj) > dependency_tol) {
|
|
895
|
+
control_.Debug()
|
|
896
|
+
<< Textline(
|
|
897
|
+
"Unbounded dual ray with objective change:")
|
|
898
|
+
<< sci2(delta_obj) << '\n';
|
|
899
|
+
info->rows_inconsistent = true;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
info->dependent_rows++;
|
|
903
|
+
remaining.pop_back();
|
|
904
|
+
} else {
|
|
905
|
+
// jb can be exchanged by a non-fixed variable.
|
|
906
|
+
// Among all numerically stable pivots, choose the one that
|
|
907
|
+
// maximizes volume of the basis matrix.
|
|
908
|
+
Int jmax_scaled = -1;
|
|
909
|
+
double rmax_scaled = 0.0;
|
|
910
|
+
auto update_max = [&](Int j, double r) {
|
|
911
|
+
r = std::abs(r);
|
|
912
|
+
double rscaled = r * colweights[j];
|
|
913
|
+
if (r >= 0.1*rmax_nonfixed && rscaled > rmax_scaled) {
|
|
914
|
+
rmax_scaled = rscaled;
|
|
915
|
+
jmax_scaled = j;
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
for_each_nonzero(row, update_max);
|
|
919
|
+
assert(jmax_scaled >= 0);
|
|
920
|
+
bool exchanged;
|
|
921
|
+
double pivot = row[jmax_scaled];
|
|
922
|
+
info->errflag = ExchangeIfStable(jb, jmax_scaled, pivot, 1,
|
|
923
|
+
&exchanged);
|
|
924
|
+
if (info->errflag)
|
|
925
|
+
return;
|
|
926
|
+
if (!exchanged) // factorization was unstable, try again
|
|
927
|
+
continue;
|
|
928
|
+
remaining.pop_back();
|
|
929
|
+
info->updates_start++;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
std::stringstream h_logging_stream;
|
|
933
|
+
h_logging_stream.str(std::string());
|
|
934
|
+
h_logging_stream << Format(remaining.size(), 9) <<
|
|
935
|
+
" fixed variables remaining" << Format("", 38) <<
|
|
936
|
+
time(control_.Elapsed()) << "\n";
|
|
937
|
+
control_.hIntervalLog(h_logging_stream);
|
|
938
|
+
}
|
|
939
|
+
control_.Debug()
|
|
940
|
+
<< Textline("Number of fixed variables swapped for stability:")
|
|
941
|
+
<< stability_pivots << '\n';
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
Vector CopyBasic(const Vector& x, const Basis& basis) {
|
|
945
|
+
const Int m = basis.model().rows();
|
|
946
|
+
Vector xbasic(m);
|
|
947
|
+
for (Int p = 0; p < m; p++)
|
|
948
|
+
xbasic[p] = x[basis[p]];
|
|
949
|
+
return xbasic;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
void Basis::reportBasisData() const {
|
|
953
|
+
printf("\nBasis data\n");
|
|
954
|
+
printf(" Num factorizations = %d\n", (int)this->factorizations());
|
|
955
|
+
printf(" Num updates = %d\n", (int)updates_total());
|
|
956
|
+
if (this->num_ftran_)
|
|
957
|
+
printf(" Average density of %7d FTRANs is %6.4f; sparse proportion = %6.4f\n",
|
|
958
|
+
(int)this->num_ftran_, this->sum_ftran_density_ / this->num_ftran_, frac_ftran_sparse());
|
|
959
|
+
if (this->num_btran_)
|
|
960
|
+
printf(" Average density of %7d BTRANs is %6.4f; sparse proportion = %6.4f\n",
|
|
961
|
+
(int)this->num_btran_, this->sum_btran_density_ / this->num_btran_, frac_btran_sparse());
|
|
962
|
+
printf(" Mean fill-in %11.4g\n", mean_fill());
|
|
963
|
+
printf(" Max fill-in %11.4g\n", max_fill());
|
|
964
|
+
|
|
965
|
+
}
|
|
966
|
+
} // namespace ipx
|