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,1367 @@
|
|
|
1
|
+
#include "Analyse.h"
|
|
2
|
+
|
|
3
|
+
#include <algorithm>
|
|
4
|
+
#include <fstream>
|
|
5
|
+
#include <iostream>
|
|
6
|
+
#include <limits>
|
|
7
|
+
#include <random>
|
|
8
|
+
#include <stack>
|
|
9
|
+
|
|
10
|
+
#include "DataCollector.h"
|
|
11
|
+
#include "FactorHiGHSSettings.h"
|
|
12
|
+
#include "ReturnValues.h"
|
|
13
|
+
#include "amd/amd.h"
|
|
14
|
+
#include "ipm/hipo/auxiliary/Auxiliary.h"
|
|
15
|
+
#include "ipm/hipo/auxiliary/Log.h"
|
|
16
|
+
#include "metis/metis.h"
|
|
17
|
+
#include "rcm/rcm.h"
|
|
18
|
+
|
|
19
|
+
namespace hipo {
|
|
20
|
+
|
|
21
|
+
const Int64 int32_limit = std::numeric_limits<int32_t>::max();
|
|
22
|
+
const Int64 int64_limit = std::numeric_limits<int64_t>::max();
|
|
23
|
+
|
|
24
|
+
Analyse::Analyse(const std::vector<Int>& rows, const std::vector<Int>& ptr,
|
|
25
|
+
const std::vector<Int>& signs, Int nb, const Log* log,
|
|
26
|
+
DataCollector& data, const std::vector<Int>& perm)
|
|
27
|
+
: log_{log}, data_{data} {
|
|
28
|
+
// Input the symmetric matrix to be analysed in CSC format.
|
|
29
|
+
// rows contains the row indices.
|
|
30
|
+
// ptr contains the starting points of each column.
|
|
31
|
+
// Only the lower triangular part is used.
|
|
32
|
+
// signs contains the sign that each pivot should have.
|
|
33
|
+
|
|
34
|
+
n_ = ptr.size() - 1;
|
|
35
|
+
nz_ = rows.size();
|
|
36
|
+
signs_ = signs;
|
|
37
|
+
nb_ = nb;
|
|
38
|
+
|
|
39
|
+
// Create upper triangular part
|
|
40
|
+
rows_upper_.resize(nz_);
|
|
41
|
+
ptr_upper_.resize(n_ + 1);
|
|
42
|
+
transpose(ptr, rows, ptr_upper_, rows_upper_);
|
|
43
|
+
|
|
44
|
+
// Permute the matrix with identical permutation, to extract upper triangular
|
|
45
|
+
// part, if the input is not lower triangular.
|
|
46
|
+
std::vector<Int> id_perm(n_);
|
|
47
|
+
for (Int i = 0; i < n_; ++i) id_perm[i] = i;
|
|
48
|
+
permute(id_perm);
|
|
49
|
+
|
|
50
|
+
// actual number of nonzeros of only upper triangular part
|
|
51
|
+
nz_ = ptr_upper_.back();
|
|
52
|
+
|
|
53
|
+
// number of nonzeros potentially changed after Permute.
|
|
54
|
+
rows_upper_.resize(nz_);
|
|
55
|
+
|
|
56
|
+
// double transpose to sort columns
|
|
57
|
+
ptr_lower_.resize(n_ + 1);
|
|
58
|
+
rows_lower_.resize(nz_);
|
|
59
|
+
transpose(ptr_upper_, rows_upper_, ptr_lower_, rows_lower_);
|
|
60
|
+
transpose(ptr_lower_, rows_lower_, ptr_upper_, rows_upper_);
|
|
61
|
+
|
|
62
|
+
perm_ = perm;
|
|
63
|
+
iperm_.resize(n_);
|
|
64
|
+
inversePerm(perm_, iperm_);
|
|
65
|
+
|
|
66
|
+
ready_ = true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
void Analyse::permute(const std::vector<Int>& iperm) {
|
|
70
|
+
// Symmetric permutation of the upper triangular matrix based on inverse
|
|
71
|
+
// permutation iperm.
|
|
72
|
+
// The resulting matrix is upper triangular, regardless of the input matrix.
|
|
73
|
+
|
|
74
|
+
std::vector<Int> work(n_, 0);
|
|
75
|
+
|
|
76
|
+
// go through the columns to count the nonzeros
|
|
77
|
+
for (Int j = 0; j < n_; ++j) {
|
|
78
|
+
// get new index of column
|
|
79
|
+
const Int col = iperm[j];
|
|
80
|
+
|
|
81
|
+
// go through elements of column
|
|
82
|
+
for (Int el = ptr_upper_[j]; el < ptr_upper_[j + 1]; ++el) {
|
|
83
|
+
const Int i = rows_upper_[el];
|
|
84
|
+
|
|
85
|
+
// ignore potential entries in lower triangular part
|
|
86
|
+
if (i > j) continue;
|
|
87
|
+
|
|
88
|
+
// get new index of row
|
|
89
|
+
const Int row = iperm[i];
|
|
90
|
+
|
|
91
|
+
// since only upper triangular part is used, col is larger than row
|
|
92
|
+
Int actual_col = std::max(row, col);
|
|
93
|
+
++work[actual_col];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
std::vector<Int> new_ptr(n_ + 1);
|
|
98
|
+
|
|
99
|
+
// get column pointers by summing the count of nonzeros in each column.
|
|
100
|
+
// copy column pointers into work
|
|
101
|
+
counts2Ptr(new_ptr, work);
|
|
102
|
+
|
|
103
|
+
std::vector<Int> new_rows(new_ptr.back());
|
|
104
|
+
|
|
105
|
+
// go through the columns to assign row indices
|
|
106
|
+
for (Int j = 0; j < n_; ++j) {
|
|
107
|
+
// get new index of column
|
|
108
|
+
const Int col = iperm[j];
|
|
109
|
+
|
|
110
|
+
// go through elements of column
|
|
111
|
+
for (Int el = ptr_upper_[j]; el < ptr_upper_[j + 1]; ++el) {
|
|
112
|
+
const Int i = rows_upper_[el];
|
|
113
|
+
|
|
114
|
+
// ignore potential entries in lower triangular part
|
|
115
|
+
if (i > j) continue;
|
|
116
|
+
|
|
117
|
+
// get new index of row
|
|
118
|
+
const Int row = iperm[i];
|
|
119
|
+
|
|
120
|
+
// since only upper triangular part is used, column is larger than row
|
|
121
|
+
const Int actual_col = std::max(row, col);
|
|
122
|
+
const Int actual_row = std::min(row, col);
|
|
123
|
+
|
|
124
|
+
Int pos = work[actual_col]++;
|
|
125
|
+
new_rows[pos] = actual_row;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
ptr_upper_ = std::move(new_ptr);
|
|
130
|
+
rows_upper_ = std::move(new_rows);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
void Analyse::eTree() {
|
|
134
|
+
// Find elimination tree.
|
|
135
|
+
// It works only for upper triangular matrices.
|
|
136
|
+
// The tree is stored in the vector parent:
|
|
137
|
+
// parent[i] = j
|
|
138
|
+
// means that j is the parent of i in the tree.
|
|
139
|
+
// For the root(s) of the tree, parent[root] = -1.
|
|
140
|
+
|
|
141
|
+
parent_.resize(n_);
|
|
142
|
+
std::vector<Int> ancestor(n_);
|
|
143
|
+
Int next{};
|
|
144
|
+
|
|
145
|
+
for (Int j = 0; j < n_; ++j) {
|
|
146
|
+
// initialise parent and ancestor, which are still unknown
|
|
147
|
+
parent_[j] = -1;
|
|
148
|
+
ancestor[j] = -1;
|
|
149
|
+
|
|
150
|
+
for (Int el = ptr_upper_[j]; el < ptr_upper_[j + 1]; ++el) {
|
|
151
|
+
for (Int i = rows_upper_[el]; i != -1 && i < j; i = next) {
|
|
152
|
+
// next is used to move up the tree
|
|
153
|
+
next = ancestor[i];
|
|
154
|
+
|
|
155
|
+
// ancestor keeps track of the known part of the tree, to avoid
|
|
156
|
+
// repeating (aka path compression): from j there is a known path to i
|
|
157
|
+
ancestor[i] = j;
|
|
158
|
+
|
|
159
|
+
if (next == -1) parent_[i] = j;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
void Analyse::postorder() {
|
|
166
|
+
// Find a postordering of the elimination tree using depth first search
|
|
167
|
+
|
|
168
|
+
postorder_.resize(n_);
|
|
169
|
+
|
|
170
|
+
// create linked list of children
|
|
171
|
+
std::vector<Int> head, next;
|
|
172
|
+
childrenLinkedList(parent_, head, next);
|
|
173
|
+
|
|
174
|
+
// Execute depth first search only for root node(s)
|
|
175
|
+
Int start{};
|
|
176
|
+
for (Int node = 0; node < n_; ++node) {
|
|
177
|
+
if (parent_[node] == -1) {
|
|
178
|
+
dfsPostorder(node, start, head, next, postorder_);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Permute elimination tree based on postorder
|
|
183
|
+
std::vector<Int> ipost(n_);
|
|
184
|
+
inversePerm(postorder_, ipost);
|
|
185
|
+
std::vector<Int> new_parent(n_);
|
|
186
|
+
for (Int i = 0; i < n_; ++i) {
|
|
187
|
+
if (parent_[i] != -1) {
|
|
188
|
+
new_parent[ipost[i]] = ipost[parent_[i]];
|
|
189
|
+
} else {
|
|
190
|
+
new_parent[ipost[i]] = -1;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
parent_ = std::move(new_parent);
|
|
194
|
+
|
|
195
|
+
// Permute matrix based on postorder
|
|
196
|
+
permute(ipost);
|
|
197
|
+
|
|
198
|
+
// double transpose to sort columns and compute lower part
|
|
199
|
+
transpose(ptr_upper_, rows_upper_, ptr_lower_, rows_lower_);
|
|
200
|
+
transpose(ptr_lower_, rows_lower_, ptr_upper_, rows_upper_);
|
|
201
|
+
|
|
202
|
+
// Update perm and iperm
|
|
203
|
+
permuteVector(perm_, postorder_);
|
|
204
|
+
inversePerm(perm_, iperm_);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
void Analyse::colCount() {
|
|
208
|
+
// Columns count using skeleton matrix.
|
|
209
|
+
// Taken from Tim Davis "Direct Methods for Sparse Linear Systems".
|
|
210
|
+
|
|
211
|
+
std::vector<Int> first(n_, -1);
|
|
212
|
+
std::vector<Int> ancestor(n_, -1);
|
|
213
|
+
std::vector<Int> max_first(n_, -1);
|
|
214
|
+
std::vector<Int> prev_leaf(n_, -1);
|
|
215
|
+
|
|
216
|
+
col_count_.resize(n_);
|
|
217
|
+
|
|
218
|
+
// find first descendant
|
|
219
|
+
for (Int k = 0; k < n_; ++k) {
|
|
220
|
+
Int j = k;
|
|
221
|
+
col_count_[j] = (first[j] == -1) ? 1 : 0;
|
|
222
|
+
while (j != -1 && first[j] == -1) {
|
|
223
|
+
first[j] = k;
|
|
224
|
+
j = parent_[j];
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// each node belongs to a separate set
|
|
229
|
+
for (Int j = 0; j < n_; j++) ancestor[j] = j;
|
|
230
|
+
|
|
231
|
+
for (Int k = 0; k < n_; ++k) {
|
|
232
|
+
const Int j = k;
|
|
233
|
+
|
|
234
|
+
// if not a root, decrement
|
|
235
|
+
if (parent_[j] != -1) col_count_[parent_[j]]--;
|
|
236
|
+
|
|
237
|
+
// process edges of matrix
|
|
238
|
+
for (Int el = ptr_lower_[j]; el < ptr_lower_[j + 1]; ++el) {
|
|
239
|
+
processEdge(j, rows_lower_[el], first, max_first, col_count_, prev_leaf,
|
|
240
|
+
ancestor);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (parent_[j] != -1) ancestor[j] = parent_[j];
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// sum contributions from each child
|
|
247
|
+
for (Int j = 0; j < n_; ++j) {
|
|
248
|
+
if (parent_[j] != -1) {
|
|
249
|
+
col_count_[parent_[j]] += col_count_[j];
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// compute nonzeros of L
|
|
254
|
+
dense_ops_norelax_ = 0.0;
|
|
255
|
+
nz_factor_ = 0;
|
|
256
|
+
for (Int j = 0; j < n_; ++j) {
|
|
257
|
+
nz_factor_ += col_count_[j];
|
|
258
|
+
dense_ops_norelax_ += (double)(col_count_[j] - 1) * (col_count_[j] - 1);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
void Analyse::fundamentalSupernodes() {
|
|
263
|
+
// Find fundamental supernodes.
|
|
264
|
+
|
|
265
|
+
// isSN[i] is true if node i is the start of a fundamental supernode
|
|
266
|
+
std::vector<bool> is_sn(n_, false);
|
|
267
|
+
|
|
268
|
+
std::vector<Int> prev_nonz(n_, -1);
|
|
269
|
+
|
|
270
|
+
// compute sizes of subtrees
|
|
271
|
+
std::vector<Int> subtree_sizes(n_);
|
|
272
|
+
subtreeSize(parent_, subtree_sizes);
|
|
273
|
+
|
|
274
|
+
for (Int j = 0; j < n_; ++j) {
|
|
275
|
+
for (Int el = ptr_lower_[j]; el < ptr_lower_[j + 1]; ++el) {
|
|
276
|
+
const Int i = rows_lower_[el];
|
|
277
|
+
const Int k = prev_nonz[i];
|
|
278
|
+
|
|
279
|
+
// mark as fundamental sn, nodes which are leaf of subtrees
|
|
280
|
+
if (k < j - subtree_sizes[j] + 1) {
|
|
281
|
+
is_sn[j] = true;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// mark as fundamental sn, nodes which have more than one child
|
|
285
|
+
if (parent_[i] != -1 &&
|
|
286
|
+
subtree_sizes[i] + 1 != subtree_sizes[parent_[i]]) {
|
|
287
|
+
is_sn[parent_[i]] = true;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
prev_nonz[i] = j;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// create information about fundamental supernodes
|
|
295
|
+
sn_belong_.resize(n_);
|
|
296
|
+
Int sn_number = -1;
|
|
297
|
+
for (Int i = 0; i < n_; ++i) {
|
|
298
|
+
// if isSN[i] is true, then node i is the start of a new supernode
|
|
299
|
+
if (is_sn[i]) ++sn_number;
|
|
300
|
+
|
|
301
|
+
// mark node i as belonging to the current supernode
|
|
302
|
+
sn_belong_[i] = sn_number;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// number of supernodes found
|
|
306
|
+
sn_count_ = sn_belong_.back() + 1;
|
|
307
|
+
|
|
308
|
+
// sn_start_ contains pointers to the starting node of each supernode
|
|
309
|
+
sn_start_.resize(sn_count_ + 1);
|
|
310
|
+
Int next = 0;
|
|
311
|
+
for (Int i = 0; i < n_; ++i) {
|
|
312
|
+
if (is_sn[i]) {
|
|
313
|
+
sn_start_[next] = i;
|
|
314
|
+
++next;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
sn_start_[next] = n_;
|
|
318
|
+
|
|
319
|
+
// build supernodal elimination tree
|
|
320
|
+
sn_parent_.resize(sn_count_);
|
|
321
|
+
for (Int i = 0; i < sn_count_ - 1; ++i) {
|
|
322
|
+
Int j = parent_[sn_start_[i + 1] - 1];
|
|
323
|
+
if (j != -1) {
|
|
324
|
+
sn_parent_[i] = sn_belong_[j];
|
|
325
|
+
} else {
|
|
326
|
+
sn_parent_[i] = -1;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
sn_parent_.back() = -1;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
void Analyse::relaxSupernodes() {
|
|
333
|
+
// Choose which strategy to use for supernode amalgamation.
|
|
334
|
+
// Relaxing supernodes is fast to run, so just run again the one that is
|
|
335
|
+
// chosen to set the correct information.
|
|
336
|
+
|
|
337
|
+
double flops_1{};
|
|
338
|
+
double spops_1{};
|
|
339
|
+
relaxSnMaxNz(flops_1, spops_1);
|
|
340
|
+
double ops_1 = flops_1 + kSpopsWeightSn * spops_1;
|
|
341
|
+
|
|
342
|
+
double flops_2{};
|
|
343
|
+
double spops_2{};
|
|
344
|
+
relaxSnNetOps(flops_2, spops_2);
|
|
345
|
+
double ops_2 = flops_2 + kSpopsWeightSn * spops_2;
|
|
346
|
+
|
|
347
|
+
bool total_ops_reduced = ops_2 < ops_1;
|
|
348
|
+
bool spops_reduced_enough = spops_2 < spops_1 * 0.6;
|
|
349
|
+
|
|
350
|
+
if (total_ops_reduced && spops_reduced_enough) {
|
|
351
|
+
relaxSnNetOps(flops_2, spops_2);
|
|
352
|
+
} else {
|
|
353
|
+
relaxSnMaxNz(flops_1, spops_1);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
void Analyse::relaxSnNetOps(double& flops, double& spops) {
|
|
358
|
+
// =================================================
|
|
359
|
+
// Build information about supernodes
|
|
360
|
+
// =================================================
|
|
361
|
+
std::vector<Int> sn_size(sn_count_);
|
|
362
|
+
std::vector<Int> clique_size(sn_count_);
|
|
363
|
+
fake_nz_.assign(sn_count_, 0);
|
|
364
|
+
for (Int i = 0; i < sn_count_; ++i) {
|
|
365
|
+
sn_size[i] = sn_start_[i + 1] - sn_start_[i];
|
|
366
|
+
clique_size[i] = col_count_[sn_start_[i]] - sn_size[i];
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// build linked lists of children
|
|
370
|
+
std::vector<Int> first_child, next_child;
|
|
371
|
+
childrenLinkedList(sn_parent_, first_child, next_child);
|
|
372
|
+
|
|
373
|
+
// =================================================
|
|
374
|
+
// Merge supernodes
|
|
375
|
+
// =================================================
|
|
376
|
+
merged_into_.assign(sn_count_, -1);
|
|
377
|
+
merged_sn_ = 0;
|
|
378
|
+
|
|
379
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
380
|
+
// sort children by increasing size
|
|
381
|
+
std::vector<Int> children;
|
|
382
|
+
Int child = first_child[sn];
|
|
383
|
+
while (child != -1) {
|
|
384
|
+
children.push_back(child);
|
|
385
|
+
child = next_child[child];
|
|
386
|
+
}
|
|
387
|
+
std::sort(children.begin(), children.end(),
|
|
388
|
+
[&](Int a, Int b) { return sn_size[a] < sn_size[b]; });
|
|
389
|
+
|
|
390
|
+
for (Int child : children) {
|
|
391
|
+
// how many zero rows would become nonzero
|
|
392
|
+
const Int rows_filled =
|
|
393
|
+
sn_size[sn] + clique_size[sn] - clique_size[child];
|
|
394
|
+
|
|
395
|
+
// how many zero entries would become nonzero
|
|
396
|
+
const Int64 nz_added = (Int64)rows_filled * sn_size[child];
|
|
397
|
+
|
|
398
|
+
// how many artificial nonzeros would the merged supernode have
|
|
399
|
+
const Int64 total_art_nz = nz_added + fake_nz_[sn] + fake_nz_[child];
|
|
400
|
+
|
|
401
|
+
const double flops_added =
|
|
402
|
+
rows_filled * rows_filled * sn_size[child] +
|
|
403
|
+
2 * rows_filled *
|
|
404
|
+
(sn_size[child] * (sn_size[child] + clique_size[child]) -
|
|
405
|
+
sn_size[child] * (sn_size[child] + 1) / 2);
|
|
406
|
+
|
|
407
|
+
const double spops_removed =
|
|
408
|
+
clique_size[child] * (clique_size[child] + 1) / 2;
|
|
409
|
+
|
|
410
|
+
const double net_ops = flops_added - kSpopsWeightSn * spops_removed;
|
|
411
|
+
|
|
412
|
+
if (net_ops < 0) {
|
|
413
|
+
// merge child with parent
|
|
414
|
+
sn_size[sn] += sn_size[child];
|
|
415
|
+
fake_nz_[sn] = total_art_nz;
|
|
416
|
+
++merged_sn_;
|
|
417
|
+
merged_into_[child] = sn;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
flops = 0.0;
|
|
423
|
+
spops = 0.0;
|
|
424
|
+
for (Int i = 0; i < sn_count_; ++i) {
|
|
425
|
+
if (merged_into_[i] == -1) {
|
|
426
|
+
spops += snSpops(clique_size[i]);
|
|
427
|
+
flops += snFlops(sn_size[i], clique_size[i]);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
double Analyse::doRelaxSnMaxNz(double& flops, double& spops,
|
|
433
|
+
Int64 max_artificial_nz) {
|
|
434
|
+
// =================================================
|
|
435
|
+
// Build information about supernodes
|
|
436
|
+
// =================================================
|
|
437
|
+
std::vector<Int> sn_size(sn_count_);
|
|
438
|
+
std::vector<Int> clique_size(sn_count_);
|
|
439
|
+
fake_nz_.assign(sn_count_, 0);
|
|
440
|
+
for (Int i = 0; i < sn_count_; ++i) {
|
|
441
|
+
sn_size[i] = sn_start_[i + 1] - sn_start_[i];
|
|
442
|
+
clique_size[i] = col_count_[sn_start_[i]] - sn_size[i];
|
|
443
|
+
fake_nz_[i] = 0;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// build linked lists of children
|
|
447
|
+
std::vector<Int> first_child, next_child;
|
|
448
|
+
childrenLinkedList(sn_parent_, first_child, next_child);
|
|
449
|
+
|
|
450
|
+
// =================================================
|
|
451
|
+
// Merge supernodes
|
|
452
|
+
// =================================================
|
|
453
|
+
merged_into_.assign(sn_count_, -1);
|
|
454
|
+
merged_sn_ = 0;
|
|
455
|
+
|
|
456
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
457
|
+
// keep iterating through the children of the supernode, until there's no
|
|
458
|
+
// more child to merge with
|
|
459
|
+
|
|
460
|
+
while (true) {
|
|
461
|
+
Int child = first_child[sn];
|
|
462
|
+
|
|
463
|
+
// info for first criterion
|
|
464
|
+
Int64 nz_fakenz = int64_limit;
|
|
465
|
+
Int size_fakenz = 0;
|
|
466
|
+
Int child_fakenz = -1;
|
|
467
|
+
|
|
468
|
+
while (child != -1) {
|
|
469
|
+
// how many zero rows would become nonzero
|
|
470
|
+
const Int rows_filled =
|
|
471
|
+
sn_size[sn] + clique_size[sn] - clique_size[child];
|
|
472
|
+
|
|
473
|
+
// how many zero entries would become nonzero
|
|
474
|
+
const Int64 nz_added = (Int64)rows_filled * sn_size[child];
|
|
475
|
+
|
|
476
|
+
// how many artificial nonzeros would the merged supernode have
|
|
477
|
+
const Int64 total_art_nz = nz_added + fake_nz_[sn] + fake_nz_[child];
|
|
478
|
+
|
|
479
|
+
// Save child with smallest number of artificial zeros created.
|
|
480
|
+
// Ties are broken based on size of child.
|
|
481
|
+
if (total_art_nz < nz_fakenz ||
|
|
482
|
+
(total_art_nz == nz_fakenz && size_fakenz < sn_size[child])) {
|
|
483
|
+
nz_fakenz = total_art_nz;
|
|
484
|
+
size_fakenz = sn_size[child];
|
|
485
|
+
child_fakenz = child;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
child = next_child[child];
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
if (nz_fakenz <= max_artificial_nz) {
|
|
492
|
+
// merging creates fewer nonzeros than the maximum allowed
|
|
493
|
+
|
|
494
|
+
// update information of parent
|
|
495
|
+
sn_size[sn] += size_fakenz;
|
|
496
|
+
fake_nz_[sn] = nz_fakenz;
|
|
497
|
+
|
|
498
|
+
// count number of merged supernodes
|
|
499
|
+
++merged_sn_;
|
|
500
|
+
|
|
501
|
+
// save information about merging of supernodes
|
|
502
|
+
merged_into_[child_fakenz] = sn;
|
|
503
|
+
|
|
504
|
+
// remove child from linked list of children
|
|
505
|
+
child = first_child[sn];
|
|
506
|
+
if (child == child_fakenz) {
|
|
507
|
+
// child_smallest is the first child
|
|
508
|
+
first_child[sn] = next_child[child_fakenz];
|
|
509
|
+
} else {
|
|
510
|
+
while (next_child[child] != child_fakenz) {
|
|
511
|
+
child = next_child[child];
|
|
512
|
+
}
|
|
513
|
+
// now child is the previous child of child_smallest
|
|
514
|
+
next_child[child] = next_child[child_fakenz];
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
} else {
|
|
518
|
+
// no more children can be merged with parent
|
|
519
|
+
break;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
flops = 0.0;
|
|
525
|
+
spops = 0.0;
|
|
526
|
+
for (Int i = 0; i < sn_count_; ++i) {
|
|
527
|
+
if (merged_into_[i] == -1) {
|
|
528
|
+
spops += snSpops(clique_size[i]);
|
|
529
|
+
flops += snFlops(sn_size[i], clique_size[i]);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
// compute total number of artificial nonzeros and artificial ops for this
|
|
534
|
+
// value of max_artificial_nz
|
|
535
|
+
double temp_art_nz{};
|
|
536
|
+
double temp_art_ops{};
|
|
537
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
538
|
+
if (merged_into_[sn] == -1) {
|
|
539
|
+
temp_art_nz += fake_nz_[sn];
|
|
540
|
+
temp_art_ops += snFlops(sn_size[sn], clique_size[sn]);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
temp_art_ops -= dense_ops_norelax_;
|
|
544
|
+
|
|
545
|
+
// if enough fake nz or ops have been added, stop.
|
|
546
|
+
const double ratio_fake = temp_art_ops / (temp_art_ops + dense_ops_norelax_);
|
|
547
|
+
|
|
548
|
+
return ratio_fake;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
void Analyse::relaxSnMaxNz(double& flops, double& spops) {
|
|
552
|
+
// Child which produces smallest number of fake nonzeros is merged if
|
|
553
|
+
// resulting sn has fewer than max_artificial_nz fake nonzeros.
|
|
554
|
+
// Multiple values of max_artificial_nz are tried, chosen with bisection
|
|
555
|
+
// method, until the percentage of artificial nonzeros is in the range [1,2]%.
|
|
556
|
+
|
|
557
|
+
Int64 max_artificial_nz = kStartThreshRelax;
|
|
558
|
+
Int64 largest_below = -1;
|
|
559
|
+
Int64 smallest_above = -1;
|
|
560
|
+
|
|
561
|
+
double best_dist_ratio = kHighsInf;
|
|
562
|
+
Int64 best_max_art_nz = -1;
|
|
563
|
+
|
|
564
|
+
for (Int iter = 0; iter < kMaxIterRelax; ++iter) {
|
|
565
|
+
// relax the supernodes and obtain the ratio of how many new ops have been
|
|
566
|
+
// added with the current value of max_artificial_nz
|
|
567
|
+
const double ratio_fake = doRelaxSnMaxNz(flops, spops, max_artificial_nz);
|
|
568
|
+
|
|
569
|
+
// store the best ratio, in case a good ratio is never found
|
|
570
|
+
double dist_ratio_fake = std::min(std::abs(ratio_fake - kLowerRatioRelax),
|
|
571
|
+
std::abs(ratio_fake - kUpperRatioRelax));
|
|
572
|
+
if (dist_ratio_fake < best_dist_ratio) {
|
|
573
|
+
best_dist_ratio = dist_ratio_fake;
|
|
574
|
+
best_max_art_nz = max_artificial_nz;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
// try to find ratio in interval [0.01,0.02] using bisection
|
|
578
|
+
if (ratio_fake < kLowerRatioRelax) {
|
|
579
|
+
// ratio too small
|
|
580
|
+
largest_below = max_artificial_nz;
|
|
581
|
+
if (smallest_above == -1) {
|
|
582
|
+
max_artificial_nz *= 2;
|
|
583
|
+
} else {
|
|
584
|
+
max_artificial_nz = (largest_below + smallest_above) / 2;
|
|
585
|
+
}
|
|
586
|
+
} else if (ratio_fake > kUpperRatioRelax) {
|
|
587
|
+
// ratio too large
|
|
588
|
+
smallest_above = max_artificial_nz;
|
|
589
|
+
if (largest_below == -1) {
|
|
590
|
+
max_artificial_nz /= 2;
|
|
591
|
+
} else {
|
|
592
|
+
max_artificial_nz = (largest_below + smallest_above) / 2;
|
|
593
|
+
}
|
|
594
|
+
} else {
|
|
595
|
+
// good ratio
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
// If reach here, no good ratio was found within kMaxIterRelax
|
|
601
|
+
// To avoid having a catastrophically bad ratio in pathological problems,
|
|
602
|
+
// choose the best ratio found
|
|
603
|
+
|
|
604
|
+
doRelaxSnMaxNz(flops, spops, best_max_art_nz);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
void Analyse::afterRelaxSn() {
|
|
608
|
+
// number of new supernodes
|
|
609
|
+
const Int new_snCount = sn_count_ - merged_sn_;
|
|
610
|
+
|
|
611
|
+
// keep track of number of row indices needed for each supernode
|
|
612
|
+
sn_indices_.assign(new_snCount, 0);
|
|
613
|
+
|
|
614
|
+
// =================================================
|
|
615
|
+
// Create supernodal permutation
|
|
616
|
+
// =================================================
|
|
617
|
+
|
|
618
|
+
// permutation of supernodes needed after merging
|
|
619
|
+
std::vector<Int> sn_perm(sn_count_);
|
|
620
|
+
|
|
621
|
+
// number of new sn that includes the old sn
|
|
622
|
+
std::vector<Int> new_id(sn_count_);
|
|
623
|
+
|
|
624
|
+
// new sn pointer vector
|
|
625
|
+
std::vector<Int> new_snStart(new_snCount + 1);
|
|
626
|
+
|
|
627
|
+
// keep track of the children merged into a given supernode
|
|
628
|
+
std::vector<std::vector<Int>> received_from(sn_count_, std::vector<Int>());
|
|
629
|
+
|
|
630
|
+
// index to write into sn_perm
|
|
631
|
+
Int start_perm{};
|
|
632
|
+
|
|
633
|
+
// index to write into new_snStart
|
|
634
|
+
Int snStart_ind{};
|
|
635
|
+
|
|
636
|
+
// next available number for new sn numbering
|
|
637
|
+
Int next_id{};
|
|
638
|
+
|
|
639
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
640
|
+
if (merged_into_[sn] > -1) {
|
|
641
|
+
// Current sn was merged into its parent.
|
|
642
|
+
// Save information about which supernode sn was merged into
|
|
643
|
+
received_from[merged_into_[sn]].push_back(sn);
|
|
644
|
+
} else {
|
|
645
|
+
// Current sn was not merged into its parent.
|
|
646
|
+
// It is one of the new sn.
|
|
647
|
+
|
|
648
|
+
// Add merged supernodes to the permutation, recursively.
|
|
649
|
+
|
|
650
|
+
++snStart_ind;
|
|
651
|
+
|
|
652
|
+
std::stack<Int> toadd;
|
|
653
|
+
toadd.push(sn);
|
|
654
|
+
|
|
655
|
+
while (!toadd.empty()) {
|
|
656
|
+
const Int current = toadd.top();
|
|
657
|
+
|
|
658
|
+
if (!received_from[current].empty()) {
|
|
659
|
+
for (Int i : received_from[current]) toadd.push(i);
|
|
660
|
+
received_from[current].clear();
|
|
661
|
+
} else {
|
|
662
|
+
toadd.pop();
|
|
663
|
+
sn_perm[start_perm++] = current;
|
|
664
|
+
new_id[current] = next_id;
|
|
665
|
+
|
|
666
|
+
// count number of nodes in each new supernode
|
|
667
|
+
new_snStart[snStart_ind] +=
|
|
668
|
+
sn_start_[current + 1] - sn_start_[current];
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
// keep track of total number of artificial nonzeros
|
|
673
|
+
artificial_nz_ += fake_nz_[sn];
|
|
674
|
+
|
|
675
|
+
// Compute number of indices for new sn.
|
|
676
|
+
// This is equal to the number of columns in the new sn plus the clique
|
|
677
|
+
// size of the original supernode where the children where merged.
|
|
678
|
+
sn_indices_[next_id] = new_snStart[snStart_ind] +
|
|
679
|
+
col_count_[sn_start_[sn]] - sn_start_[sn + 1] +
|
|
680
|
+
sn_start_[sn];
|
|
681
|
+
|
|
682
|
+
++next_id;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
// new_snStart contain the number of cols in each new sn.
|
|
687
|
+
// sum them to obtain the sn pointers.
|
|
688
|
+
for (Int i = 0; i < new_snCount; ++i) {
|
|
689
|
+
new_snStart[i + 1] += new_snStart[i];
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
// include artificial nonzeros in the nonzeros of the factor
|
|
693
|
+
nz_factor_ += artificial_nz_;
|
|
694
|
+
|
|
695
|
+
// compute number of flops needed for the factorisation
|
|
696
|
+
dense_ops_ = 0.0;
|
|
697
|
+
for (Int sn = 0; sn < new_snCount; ++sn) {
|
|
698
|
+
const double colcount_sn = (double)sn_indices_[sn];
|
|
699
|
+
for (Int i = 0; i < new_snStart[sn + 1] - new_snStart[sn]; ++i) {
|
|
700
|
+
dense_ops_ += (colcount_sn - i - 1) * (colcount_sn - i - 1);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
// =================================================
|
|
705
|
+
// Create nodal permutation
|
|
706
|
+
// =================================================
|
|
707
|
+
// Given the supernodal permutation, find the nodal permutation needed after
|
|
708
|
+
// sn merging.
|
|
709
|
+
|
|
710
|
+
// permutation to apply to the existing one
|
|
711
|
+
std::vector<Int> new_perm(n_);
|
|
712
|
+
|
|
713
|
+
// index to write into new_perm
|
|
714
|
+
Int start{};
|
|
715
|
+
|
|
716
|
+
for (Int i = 0; i < sn_count_; ++i) {
|
|
717
|
+
const Int sn = sn_perm[i];
|
|
718
|
+
for (Int j = sn_start_[sn]; j < sn_start_[sn + 1]; ++j) {
|
|
719
|
+
new_perm[start++] = j;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// obtain inverse permutation
|
|
724
|
+
std::vector<Int> new_iperm(n_);
|
|
725
|
+
inversePerm(new_perm, new_iperm);
|
|
726
|
+
|
|
727
|
+
// =================================================
|
|
728
|
+
// Create new sn elimination tree
|
|
729
|
+
// =================================================
|
|
730
|
+
std::vector<Int> new_snParent(new_snCount, -1);
|
|
731
|
+
for (Int i = 0; i < sn_count_; ++i) {
|
|
732
|
+
if (sn_parent_[i] == -1) continue;
|
|
733
|
+
|
|
734
|
+
const Int ii = new_id[i];
|
|
735
|
+
const Int pp = new_id[sn_parent_[i]];
|
|
736
|
+
|
|
737
|
+
if (ii == pp) continue;
|
|
738
|
+
|
|
739
|
+
new_snParent[ii] = pp;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
// =================================================
|
|
743
|
+
// Save new information
|
|
744
|
+
// =================================================
|
|
745
|
+
|
|
746
|
+
// build new snBelong, i.e., the sn to which each column belongs
|
|
747
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
748
|
+
for (Int i = sn_start_[sn]; i < sn_start_[sn + 1]; ++i) {
|
|
749
|
+
sn_belong_[i] = new_id[sn];
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
permuteVector(sn_belong_, new_perm);
|
|
753
|
+
|
|
754
|
+
permuteVector(col_count_, new_perm);
|
|
755
|
+
|
|
756
|
+
// Overwrite previous data
|
|
757
|
+
sn_parent_ = std::move(new_snParent);
|
|
758
|
+
sn_start_ = std::move(new_snStart);
|
|
759
|
+
sn_count_ = new_snCount;
|
|
760
|
+
|
|
761
|
+
// Permute matrix based on new permutation
|
|
762
|
+
permute(new_iperm);
|
|
763
|
+
|
|
764
|
+
// double transpose to sort columns and compute lower part
|
|
765
|
+
transpose(ptr_upper_, rows_upper_, ptr_lower_, rows_lower_);
|
|
766
|
+
transpose(ptr_lower_, rows_lower_, ptr_upper_, rows_upper_);
|
|
767
|
+
|
|
768
|
+
// Update perm and iperm
|
|
769
|
+
permuteVector(perm_, new_perm);
|
|
770
|
+
inversePerm(perm_, iperm_);
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
void Analyse::snPattern() {
|
|
774
|
+
// number of total indices needed
|
|
775
|
+
Int64 indices{};
|
|
776
|
+
|
|
777
|
+
for (Int64 i : sn_indices_) indices += i;
|
|
778
|
+
|
|
779
|
+
// allocate space for sn pattern
|
|
780
|
+
rows_sn_.resize(indices);
|
|
781
|
+
ptr_sn_.resize(sn_count_ + 1);
|
|
782
|
+
|
|
783
|
+
// keep track of visited supernodes
|
|
784
|
+
std::vector<Int> mark(sn_count_, -1);
|
|
785
|
+
|
|
786
|
+
// compute column pointers of L
|
|
787
|
+
std::vector<Int64> work(sn_indices_.size());
|
|
788
|
+
for (Int i = 0; i < static_cast<Int>(sn_indices_.size()); ++i)
|
|
789
|
+
work[i] = sn_indices_[i];
|
|
790
|
+
counts2Ptr(ptr_sn_, work);
|
|
791
|
+
|
|
792
|
+
// consider each row
|
|
793
|
+
for (Int i = 0; i < n_; ++i) {
|
|
794
|
+
// for all entries in the row of lower triangle
|
|
795
|
+
for (Int el = ptr_upper_[i]; el < ptr_upper_[i + 1]; ++el) {
|
|
796
|
+
// there is nonzero (i,j)
|
|
797
|
+
const Int j = rows_upper_[el];
|
|
798
|
+
|
|
799
|
+
// supernode to which column j belongs to
|
|
800
|
+
Int snj = sn_belong_[j];
|
|
801
|
+
|
|
802
|
+
// while supernodes are not yet considered
|
|
803
|
+
while (snj != -1 && mark[snj] != i) {
|
|
804
|
+
// we may end up too far
|
|
805
|
+
if (sn_start_[snj] > i) break;
|
|
806
|
+
|
|
807
|
+
// supernode snj is now considered for row i
|
|
808
|
+
mark[snj] = i;
|
|
809
|
+
|
|
810
|
+
// there is a nonzero entry in supernode snj at row i
|
|
811
|
+
rows_sn_[work[snj]++] = i;
|
|
812
|
+
|
|
813
|
+
// go up the elimination tree
|
|
814
|
+
snj = sn_parent_[snj];
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
void Analyse::relativeIndCols() {
|
|
821
|
+
// Find the relative indices of the original column wrt the frontal matrix of
|
|
822
|
+
// the corresponding supernode
|
|
823
|
+
|
|
824
|
+
relind_cols_.resize(nz_);
|
|
825
|
+
|
|
826
|
+
// go through the supernodes
|
|
827
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
828
|
+
const Int64 ptL_start = ptr_sn_[sn];
|
|
829
|
+
const Int64 ptL_end = ptr_sn_[sn + 1];
|
|
830
|
+
|
|
831
|
+
// go through the columns of the supernode
|
|
832
|
+
for (Int col = sn_start_[sn]; col < sn_start_[sn + 1]; ++col) {
|
|
833
|
+
// go through original column and supernodal column
|
|
834
|
+
Int ptA = ptr_lower_[col];
|
|
835
|
+
Int64 ptL = ptL_start;
|
|
836
|
+
|
|
837
|
+
// offset wrt ptrLower[col]
|
|
838
|
+
Int index{};
|
|
839
|
+
|
|
840
|
+
// size of the column of the original matrix
|
|
841
|
+
Int col_size = ptr_lower_[col + 1] - ptr_lower_[col];
|
|
842
|
+
|
|
843
|
+
while (ptL < ptL_end) {
|
|
844
|
+
// if found all the relative indices that are needed, stop
|
|
845
|
+
if (index == col_size) {
|
|
846
|
+
break;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
// check if indices coincide
|
|
850
|
+
if (rows_sn_[ptL] == rows_lower_[ptA]) {
|
|
851
|
+
// yes: save relative index and move pointers forward
|
|
852
|
+
// NB: difference fits into Int
|
|
853
|
+
relind_cols_[ptr_lower_[col] + index] = ptL - ptL_start;
|
|
854
|
+
++index;
|
|
855
|
+
++ptL;
|
|
856
|
+
++ptA;
|
|
857
|
+
} else {
|
|
858
|
+
// no: move pointer of L forward
|
|
859
|
+
++ptL;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
void Analyse::relativeIndClique() {
|
|
867
|
+
// Find the relative indices of the child clique wrt the frontal matrix of the
|
|
868
|
+
// parent supernode
|
|
869
|
+
|
|
870
|
+
relind_clique_.resize(sn_count_);
|
|
871
|
+
consecutive_sums_.resize(sn_count_);
|
|
872
|
+
|
|
873
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
874
|
+
// if there is no parent, skip supernode
|
|
875
|
+
if (sn_parent_[sn] == -1) continue;
|
|
876
|
+
|
|
877
|
+
// number of nodes in the supernode
|
|
878
|
+
const Int sn_size = sn_start_[sn + 1] - sn_start_[sn];
|
|
879
|
+
|
|
880
|
+
// column of the first node in the supernode
|
|
881
|
+
const Int j = sn_start_[sn];
|
|
882
|
+
|
|
883
|
+
// size of the first column of the supernode
|
|
884
|
+
const Int sn_column_size = ptr_sn_[sn + 1] - ptr_sn_[sn];
|
|
885
|
+
|
|
886
|
+
// size of the clique of the supernode
|
|
887
|
+
const Int sn_clique_size = sn_column_size - sn_size;
|
|
888
|
+
|
|
889
|
+
// count number of assembly operations during factorise
|
|
890
|
+
sparse_ops_ += snSpops(sn_clique_size);
|
|
891
|
+
|
|
892
|
+
relind_clique_[sn].resize(sn_clique_size);
|
|
893
|
+
|
|
894
|
+
// iterate through the clique of sn
|
|
895
|
+
Int64 ptr_current = ptr_sn_[sn] + sn_size;
|
|
896
|
+
|
|
897
|
+
// iterate through the full column of parent sn
|
|
898
|
+
Int64 ptr_parent = ptr_sn_[sn_parent_[sn]];
|
|
899
|
+
|
|
900
|
+
// keep track of start and end of parent sn column
|
|
901
|
+
const Int64 ptr_parent_start = ptr_parent;
|
|
902
|
+
const Int64 ptr_parent_end = ptr_sn_[sn_parent_[sn] + 1];
|
|
903
|
+
|
|
904
|
+
// where to write into relind
|
|
905
|
+
Int index{};
|
|
906
|
+
|
|
907
|
+
// iterate though the column of the parent sn
|
|
908
|
+
while (ptr_parent < ptr_parent_end) {
|
|
909
|
+
// if found all the relative indices that are needed, stop
|
|
910
|
+
if (index == sn_clique_size) {
|
|
911
|
+
break;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
// check if indices coincide
|
|
915
|
+
if (rows_sn_[ptr_current] == rows_sn_[ptr_parent]) {
|
|
916
|
+
// yes: save relative index and move pointers forward
|
|
917
|
+
// NB: difference fits into Int
|
|
918
|
+
relind_clique_[sn][index] = ptr_parent - ptr_parent_start;
|
|
919
|
+
++index;
|
|
920
|
+
++ptr_parent;
|
|
921
|
+
++ptr_current;
|
|
922
|
+
} else {
|
|
923
|
+
// no: move pointer of parent forward
|
|
924
|
+
++ptr_parent;
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
// Difference between consecutive relative indices.
|
|
929
|
+
// Useful to detect chains of consecutive indices.
|
|
930
|
+
consecutive_sums_[sn].resize(sn_clique_size);
|
|
931
|
+
for (Int i = 0; i < sn_clique_size - 1; ++i) {
|
|
932
|
+
consecutive_sums_[sn][i] =
|
|
933
|
+
relind_clique_[sn][i + 1] - relind_clique_[sn][i];
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
// Number of consecutive sums that can be done in one blas call.
|
|
937
|
+
consecutive_sums_[sn].back() = 1;
|
|
938
|
+
for (Int i = sn_clique_size - 2; i >= 0; --i) {
|
|
939
|
+
if (consecutive_sums_[sn][i] > 1) {
|
|
940
|
+
consecutive_sums_[sn][i] = 1;
|
|
941
|
+
} else if (consecutive_sums_[sn][i] == 1) {
|
|
942
|
+
consecutive_sums_[sn][i] = consecutive_sums_[sn][i + 1] + 1;
|
|
943
|
+
} else {
|
|
944
|
+
if (log_) log_->printDevInfo("Error in consecutiveSums\n");
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
void Analyse::computeStorage(Int fr, Int sz, Int64& fr_entries,
|
|
951
|
+
Int64& cl_entries) const {
|
|
952
|
+
// compute storage required by frontal and clique, based on the format used
|
|
953
|
+
|
|
954
|
+
const Int cl = fr - sz;
|
|
955
|
+
|
|
956
|
+
Int n_blocks = (sz - 1) / nb_ + 1;
|
|
957
|
+
std::vector<Int64> temp;
|
|
958
|
+
fr_entries = getDiagStart(fr, sz, nb_, n_blocks, temp);
|
|
959
|
+
|
|
960
|
+
// clique is stored as a collection of rectangles
|
|
961
|
+
n_blocks = (cl - 1) / nb_ + 1;
|
|
962
|
+
Int64 schur_size{};
|
|
963
|
+
for (Int j = 0; j < n_blocks; ++j) {
|
|
964
|
+
const Int jb = std::min(nb_, cl - j * nb_);
|
|
965
|
+
schur_size += (Int64)(cl - j * nb_) * jb;
|
|
966
|
+
}
|
|
967
|
+
cl_entries = schur_size;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
void Analyse::computeCriticalPath() {
|
|
971
|
+
// Compute the critical path within the supernodal elimination tree, and the
|
|
972
|
+
// number of operations along the path. This is the number of operations that
|
|
973
|
+
// need to be done sequentially while doing tree parallelism.
|
|
974
|
+
|
|
975
|
+
std::vector<double> critical_ops(sn_count_);
|
|
976
|
+
|
|
977
|
+
// linked lists of children
|
|
978
|
+
std::vector<Int> head, next;
|
|
979
|
+
childrenLinkedList(sn_parent_, head, next);
|
|
980
|
+
|
|
981
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
982
|
+
// supernode size
|
|
983
|
+
const Int sz = sn_start_[sn + 1] - sn_start_[sn];
|
|
984
|
+
|
|
985
|
+
// frontal size
|
|
986
|
+
const Int fr = ptr_sn_[sn + 1] - ptr_sn_[sn];
|
|
987
|
+
|
|
988
|
+
critical_ops[sn] = snFlops(sz, fr - sz);
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
992
|
+
// leaf nodes
|
|
993
|
+
if (head[sn] == -1) continue;
|
|
994
|
+
|
|
995
|
+
double max_ops{};
|
|
996
|
+
Int child = head[sn];
|
|
997
|
+
while (child != -1) {
|
|
998
|
+
// critical_ops of this supernode is max over children of
|
|
999
|
+
// (ops_of_this_sn + critical_ops_of_child)
|
|
1000
|
+
max_ops = std::max(max_ops, critical_ops[sn] + critical_ops[child]);
|
|
1001
|
+
child = next[child];
|
|
1002
|
+
}
|
|
1003
|
+
critical_ops[sn] = max_ops;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
1007
|
+
critical_ops_ = std::max(critical_ops_, critical_ops[sn]);
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
void Analyse::reorderChildren() {
|
|
1012
|
+
std::vector<Int64> clique_entries(sn_count_);
|
|
1013
|
+
std::vector<Int64> frontal_entries(sn_count_);
|
|
1014
|
+
std::vector<double> storage(sn_count_);
|
|
1015
|
+
std::vector<double> storage_factors(sn_count_);
|
|
1016
|
+
|
|
1017
|
+
// initialise data of supernodes
|
|
1018
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
1019
|
+
// supernode size
|
|
1020
|
+
const Int sz = sn_start_[sn + 1] - sn_start_[sn];
|
|
1021
|
+
|
|
1022
|
+
// frontal size
|
|
1023
|
+
const Int fr = col_count_[sn_start_[sn]];
|
|
1024
|
+
|
|
1025
|
+
// compute storage based on format used
|
|
1026
|
+
computeStorage(fr, sz, frontal_entries[sn], clique_entries[sn]);
|
|
1027
|
+
|
|
1028
|
+
// compute number of entries in factors within the subtree
|
|
1029
|
+
storage_factors[sn] += frontal_entries[sn];
|
|
1030
|
+
if (sn_parent_[sn] != -1)
|
|
1031
|
+
storage_factors[sn_parent_[sn]] += storage_factors[sn];
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
// linked lists of children
|
|
1035
|
+
std::vector<Int> head, next;
|
|
1036
|
+
childrenLinkedList(sn_parent_, head, next);
|
|
1037
|
+
|
|
1038
|
+
// go through the supernodes
|
|
1039
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
1040
|
+
// leaf node
|
|
1041
|
+
if (head[sn] == -1) {
|
|
1042
|
+
storage[sn] = frontal_entries[sn] + clique_entries[sn];
|
|
1043
|
+
continue;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
// save children and values to sort
|
|
1047
|
+
std::vector<std::pair<Int, double>> children{};
|
|
1048
|
+
Int child = head[sn];
|
|
1049
|
+
while (child != -1) {
|
|
1050
|
+
double value =
|
|
1051
|
+
storage[child] - clique_entries[child] - storage_factors[child];
|
|
1052
|
+
children.push_back({child, value});
|
|
1053
|
+
child = next[child];
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
// sort children in decreasing order of the values
|
|
1057
|
+
std::sort(children.begin(), children.end(),
|
|
1058
|
+
[&](std::pair<Int, double>& a, std::pair<Int, double>& b) {
|
|
1059
|
+
return a.second > b.second;
|
|
1060
|
+
});
|
|
1061
|
+
|
|
1062
|
+
// modify linked lists with new order of children
|
|
1063
|
+
head[sn] = children.front().first;
|
|
1064
|
+
for (Int i = 0; i < static_cast<Int>(children.size()) - 1; ++i) {
|
|
1065
|
+
next[children[i].first] = children[i + 1].first;
|
|
1066
|
+
}
|
|
1067
|
+
next[children.back().first] = -1;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
// =================================================
|
|
1071
|
+
// Create supernodal permutation
|
|
1072
|
+
// =================================================
|
|
1073
|
+
// build supernodal permutation with dfs
|
|
1074
|
+
std::vector<Int> sn_perm(sn_count_);
|
|
1075
|
+
Int start{};
|
|
1076
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
1077
|
+
if (sn_parent_[sn] == -1) dfsPostorder(sn, start, head, next, sn_perm);
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
// =================================================
|
|
1081
|
+
// Create nodal permutation
|
|
1082
|
+
// =================================================
|
|
1083
|
+
// Given the supernodal permutation, find the nodal permutation
|
|
1084
|
+
|
|
1085
|
+
// permutation to apply to the existing one
|
|
1086
|
+
std::vector<Int> new_perm(n_);
|
|
1087
|
+
|
|
1088
|
+
// index to write into new_perm
|
|
1089
|
+
start = 0;
|
|
1090
|
+
|
|
1091
|
+
for (Int i = 0; i < sn_count_; ++i) {
|
|
1092
|
+
const Int sn = sn_perm[i];
|
|
1093
|
+
for (Int j = sn_start_[sn]; j < sn_start_[sn + 1]; ++j) {
|
|
1094
|
+
new_perm[start++] = j;
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
// obtain inverse permutation
|
|
1099
|
+
std::vector<Int> new_iperm(n_);
|
|
1100
|
+
inversePerm(new_perm, new_iperm);
|
|
1101
|
+
|
|
1102
|
+
// =================================================
|
|
1103
|
+
// Create new sn elimination tree
|
|
1104
|
+
// =================================================
|
|
1105
|
+
std::vector<Int> isn_perm(sn_count_);
|
|
1106
|
+
inversePerm(sn_perm, isn_perm);
|
|
1107
|
+
std::vector<Int> new_sn_parent(sn_count_);
|
|
1108
|
+
for (Int i = 0; i < sn_count_; ++i) {
|
|
1109
|
+
if (sn_parent_[i] != -1) {
|
|
1110
|
+
new_sn_parent[isn_perm[i]] = isn_perm[sn_parent_[i]];
|
|
1111
|
+
} else {
|
|
1112
|
+
new_sn_parent[isn_perm[i]] = -1;
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
// =================================================
|
|
1117
|
+
// Create new snBelong
|
|
1118
|
+
// =================================================
|
|
1119
|
+
|
|
1120
|
+
// build new snBelong, i.e., the sn to which each colum belongs
|
|
1121
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
1122
|
+
for (Int i = sn_start_[sn]; i < sn_start_[sn + 1]; ++i) {
|
|
1123
|
+
sn_belong_[i] = isn_perm[sn];
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
permuteVector(sn_belong_, new_perm);
|
|
1127
|
+
|
|
1128
|
+
// permute other vectors that may be needed
|
|
1129
|
+
permuteVector(col_count_, new_perm);
|
|
1130
|
+
permuteVector(sn_indices_, sn_perm);
|
|
1131
|
+
|
|
1132
|
+
// =================================================
|
|
1133
|
+
// Create new snStart
|
|
1134
|
+
// =================================================
|
|
1135
|
+
std::vector<Int> cols_per_sn(sn_count_);
|
|
1136
|
+
|
|
1137
|
+
// compute size of each supernode
|
|
1138
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
1139
|
+
cols_per_sn[sn] = sn_start_[sn + 1] - sn_start_[sn];
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
// permute according to new order of supernodes
|
|
1143
|
+
permuteVector(cols_per_sn, sn_perm);
|
|
1144
|
+
|
|
1145
|
+
// sum number of columns to obtain pointers
|
|
1146
|
+
for (Int i = 0; i < sn_count_ - 1; ++i) {
|
|
1147
|
+
cols_per_sn[i + 1] += cols_per_sn[i];
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
for (Int i = 0; i < sn_count_; ++i) {
|
|
1151
|
+
sn_start_[i + 1] = cols_per_sn[i];
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
// =================================================
|
|
1155
|
+
// Save new data
|
|
1156
|
+
// =================================================
|
|
1157
|
+
|
|
1158
|
+
// Overwrite previous data
|
|
1159
|
+
sn_parent_ = std::move(new_sn_parent);
|
|
1160
|
+
|
|
1161
|
+
// Permute matrix based on new permutation
|
|
1162
|
+
permute(new_iperm);
|
|
1163
|
+
|
|
1164
|
+
// double transpose to sort columns and compute lower part
|
|
1165
|
+
transpose(ptr_upper_, rows_upper_, ptr_lower_, rows_lower_);
|
|
1166
|
+
transpose(ptr_lower_, rows_lower_, ptr_upper_, rows_upper_);
|
|
1167
|
+
|
|
1168
|
+
// Update perm and iperm
|
|
1169
|
+
permuteVector(perm_, new_perm);
|
|
1170
|
+
inversePerm(perm_, iperm_);
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
void Analyse::computeBlockStart() {
|
|
1174
|
+
clique_block_start_.resize(sn_count_);
|
|
1175
|
+
// compute starting position of each block of columns in the clique, for
|
|
1176
|
+
// each supernode
|
|
1177
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
1178
|
+
const Int sn_size = sn_start_[sn + 1] - sn_start_[sn];
|
|
1179
|
+
const Int ldf = ptr_sn_[sn + 1] - ptr_sn_[sn];
|
|
1180
|
+
const Int ldc = ldf - sn_size;
|
|
1181
|
+
const Int n_blocks = (ldc - 1) / nb_ + 1;
|
|
1182
|
+
|
|
1183
|
+
Int64 schur_size =
|
|
1184
|
+
getDiagStart(ldc, ldc, nb_, n_blocks, clique_block_start_[sn]);
|
|
1185
|
+
clique_block_start_[sn].push_back(schur_size);
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
Int Analyse::checkOverflow() const {
|
|
1190
|
+
// In order to use 32-bit BLAS, any data accessed by BLAS must be addressable
|
|
1191
|
+
// using 32-bit integer offset. If BLAS is given a pointer double* A, the
|
|
1192
|
+
// distance between the first and last entry of A used by BLAS needs to be
|
|
1193
|
+
// smaller than int32_limit. Since the matrices are stored in blocked data
|
|
1194
|
+
// structures, and BLAS only uses contiguous data from a given block of
|
|
1195
|
+
// columns, we need to impose that:
|
|
1196
|
+
// front_size * min(block_size, sn_size) <= int32_limit
|
|
1197
|
+
|
|
1198
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
1199
|
+
const Int sn_size = sn_start_[sn + 1] - sn_start_[sn];
|
|
1200
|
+
const Int front_size = ptr_sn_[sn + 1] - ptr_sn_[sn];
|
|
1201
|
+
|
|
1202
|
+
if ((Int64)front_size * std::min(sn_size, nb_) > int32_limit) return 1;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
return 0;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
void Analyse::computeStackSize() {
|
|
1209
|
+
// Compute the minimum size of the stack to process the elimination tree
|
|
1210
|
+
// serially.
|
|
1211
|
+
|
|
1212
|
+
std::vector<Int64> clique_entries(sn_count_);
|
|
1213
|
+
std::vector<Int64> stack_subtrees(sn_count_);
|
|
1214
|
+
Int64 total_frontal{};
|
|
1215
|
+
|
|
1216
|
+
// initialise data of supernodes
|
|
1217
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
1218
|
+
// supernode size
|
|
1219
|
+
const Int sz = sn_start_[sn + 1] - sn_start_[sn];
|
|
1220
|
+
|
|
1221
|
+
// frontal size
|
|
1222
|
+
const Int fr = ptr_sn_[sn + 1] - ptr_sn_[sn];
|
|
1223
|
+
|
|
1224
|
+
Int64 frontal_entries{};
|
|
1225
|
+
|
|
1226
|
+
// compute storage based on format used
|
|
1227
|
+
computeStorage(fr, sz, frontal_entries, clique_entries[sn]);
|
|
1228
|
+
|
|
1229
|
+
total_frontal += frontal_entries;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
// linked lists of children
|
|
1233
|
+
std::vector<Int> head, next;
|
|
1234
|
+
childrenLinkedList(sn_parent_, head, next);
|
|
1235
|
+
|
|
1236
|
+
// go through the supernodes
|
|
1237
|
+
for (Int sn = 0; sn < sn_count_; ++sn) {
|
|
1238
|
+
// leaf node
|
|
1239
|
+
if (head[sn] == -1) {
|
|
1240
|
+
stack_subtrees[sn] = clique_entries[sn];
|
|
1241
|
+
continue;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
// Compute storage
|
|
1245
|
+
// storage is found as max(storage_1,storage_2), where
|
|
1246
|
+
// storage_1 = max_j stack_size[j] + \sum_{k up to j-1} clique_entries[k]
|
|
1247
|
+
// storage_2 = clique_total_entries (including node itself)
|
|
1248
|
+
|
|
1249
|
+
Int64 clique_partial_entries{};
|
|
1250
|
+
Int64 storage_1{};
|
|
1251
|
+
|
|
1252
|
+
Int child = head[sn];
|
|
1253
|
+
while (child != -1) {
|
|
1254
|
+
Int64 current = stack_subtrees[child] + clique_partial_entries;
|
|
1255
|
+
|
|
1256
|
+
clique_partial_entries += clique_entries[child];
|
|
1257
|
+
storage_1 = std::max(storage_1, current);
|
|
1258
|
+
|
|
1259
|
+
child = next[child];
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
Int64 storage_2 = clique_partial_entries + clique_entries[sn];
|
|
1263
|
+
|
|
1264
|
+
stack_subtrees[sn] = std::max(storage_1, storage_2);
|
|
1265
|
+
max_stack_size_ = std::max(max_stack_size_, stack_subtrees[sn]);
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
// minimum storage in serial is equal to the space needed to store the
|
|
1269
|
+
// factorisation and the maximum size of the stack. Times 8 to obtain the
|
|
1270
|
+
// number of bytes.
|
|
1271
|
+
serial_storage_ = (total_frontal + max_stack_size_) * 8;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
Int Analyse::run(Symbolic& S) {
|
|
1275
|
+
// Perform analyse phase and store the result into the symbolic object S.
|
|
1276
|
+
// After Run returns, the Analyse object is not valid.
|
|
1277
|
+
|
|
1278
|
+
if (!ready_) return kRetGeneric;
|
|
1279
|
+
|
|
1280
|
+
HIPO_CLOCK_CREATE;
|
|
1281
|
+
|
|
1282
|
+
HIPO_CLOCK_START(2);
|
|
1283
|
+
permute(iperm_);
|
|
1284
|
+
eTree();
|
|
1285
|
+
postorder();
|
|
1286
|
+
HIPO_CLOCK_STOP(2, data_, kTimeAnalyseTree);
|
|
1287
|
+
|
|
1288
|
+
HIPO_CLOCK_START(2);
|
|
1289
|
+
colCount();
|
|
1290
|
+
HIPO_CLOCK_STOP(2, data_, kTimeAnalyseCount);
|
|
1291
|
+
|
|
1292
|
+
HIPO_CLOCK_START(2);
|
|
1293
|
+
fundamentalSupernodes();
|
|
1294
|
+
relaxSupernodes();
|
|
1295
|
+
afterRelaxSn();
|
|
1296
|
+
HIPO_CLOCK_STOP(2, data_, kTimeAnalyseSn);
|
|
1297
|
+
|
|
1298
|
+
HIPO_CLOCK_START(2);
|
|
1299
|
+
reorderChildren();
|
|
1300
|
+
HIPO_CLOCK_STOP(2, data_, kTimeAnalyseReorder);
|
|
1301
|
+
|
|
1302
|
+
HIPO_CLOCK_START(2);
|
|
1303
|
+
snPattern();
|
|
1304
|
+
HIPO_CLOCK_STOP(2, data_, kTimeAnalysePattern);
|
|
1305
|
+
|
|
1306
|
+
HIPO_CLOCK_START(2);
|
|
1307
|
+
relativeIndCols();
|
|
1308
|
+
relativeIndClique();
|
|
1309
|
+
HIPO_CLOCK_STOP(2, data_, kTimeAnalyseRelInd);
|
|
1310
|
+
|
|
1311
|
+
computeBlockStart();
|
|
1312
|
+
computeCriticalPath();
|
|
1313
|
+
computeStackSize();
|
|
1314
|
+
|
|
1315
|
+
// move relevant stuff into S
|
|
1316
|
+
S.n_ = n_;
|
|
1317
|
+
S.sn_ = sn_count_;
|
|
1318
|
+
S.nz_ = nz_factor_;
|
|
1319
|
+
S.fillin_ = (double)nz_factor_ / nz_;
|
|
1320
|
+
S.artificial_nz_ = artificial_nz_;
|
|
1321
|
+
S.artificial_ops_ = dense_ops_ - dense_ops_norelax_;
|
|
1322
|
+
S.spops_ = sparse_ops_;
|
|
1323
|
+
S.critops_ = critical_ops_;
|
|
1324
|
+
S.largest_front_ = *std::max_element(sn_indices_.begin(), sn_indices_.end());
|
|
1325
|
+
S.serial_storage_ = serial_storage_;
|
|
1326
|
+
S.flops_ = dense_ops_;
|
|
1327
|
+
S.block_size_ = nb_;
|
|
1328
|
+
S.max_stack_size_ = max_stack_size_;
|
|
1329
|
+
S.tree_depth_ = maxDepthTree(sn_parent_);
|
|
1330
|
+
|
|
1331
|
+
// compute largest supernode
|
|
1332
|
+
std::vector<Int> sn_size(sn_start_.begin() + 1, sn_start_.end());
|
|
1333
|
+
for (Int i = sn_count_ - 1; i > 0; --i) sn_size[i] -= sn_size[i - 1];
|
|
1334
|
+
S.largest_sn_ = *std::max_element(sn_size.begin(), sn_size.end());
|
|
1335
|
+
|
|
1336
|
+
// build statistics about supernodes size
|
|
1337
|
+
for (Int i : sn_size) {
|
|
1338
|
+
if (i == 1) S.sn_size_1_++;
|
|
1339
|
+
if (i <= 10) S.sn_size_10_++;
|
|
1340
|
+
if (i <= 100) S.sn_size_100_++;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
if (checkOverflow()) {
|
|
1344
|
+
if (log_) log_->printe("Integer overflow in analyse phase\n");
|
|
1345
|
+
return kRetIntOverflow;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
// permute signs of pivots
|
|
1349
|
+
S.pivot_sign_ = std::move(signs_);
|
|
1350
|
+
permuteVector(S.pivot_sign_, perm_);
|
|
1351
|
+
|
|
1352
|
+
S.iperm_ = std::move(iperm_);
|
|
1353
|
+
S.rows_ = std::move(rows_sn_);
|
|
1354
|
+
S.ptr_ = std::move(ptr_sn_);
|
|
1355
|
+
S.sn_parent_ = std::move(sn_parent_);
|
|
1356
|
+
S.sn_start_ = std::move(sn_start_);
|
|
1357
|
+
S.relind_cols_ = std::move(relind_cols_);
|
|
1358
|
+
S.relind_clique_ = std::move(relind_clique_);
|
|
1359
|
+
S.consecutive_sums_ = std::move(consecutive_sums_);
|
|
1360
|
+
S.clique_block_start_ = std::move(clique_block_start_);
|
|
1361
|
+
|
|
1362
|
+
HIPO_CLOCK_STOP(1, data_, kTimeAnalyse);
|
|
1363
|
+
|
|
1364
|
+
return kRetOk;
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
} // namespace hipo
|