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,1921 @@
|
|
|
1
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
2
|
+
/* */
|
|
3
|
+
/* This file is part of the HiGHS linear optimization suite */
|
|
4
|
+
/* */
|
|
5
|
+
/* Available as open-source under the MIT License */
|
|
6
|
+
/* */
|
|
7
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
8
|
+
/**@file HighsSymmetry.cpp
|
|
9
|
+
* @brief Facilities for symmetry detection
|
|
10
|
+
* @author Leona Gottwald
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
#include "presolve/HighsSymmetry.h"
|
|
14
|
+
|
|
15
|
+
#include <algorithm>
|
|
16
|
+
#include <numeric>
|
|
17
|
+
|
|
18
|
+
#include "../extern/pdqsort/pdqsort.h"
|
|
19
|
+
#include "mip/HighsCliqueTable.h"
|
|
20
|
+
#include "mip/HighsDomain.h"
|
|
21
|
+
#include "parallel/HighsParallel.h"
|
|
22
|
+
#include "util/HighsDisjointSets.h"
|
|
23
|
+
|
|
24
|
+
void HighsSymmetryDetection::removeFixPoints() {
|
|
25
|
+
Gend.resize(numVertices);
|
|
26
|
+
for (HighsInt i = 0; i < numVertices; ++i) {
|
|
27
|
+
Gend[i] =
|
|
28
|
+
std::partition(Gedge.begin() + Gstart[i], Gedge.begin() + Gstart[i + 1],
|
|
29
|
+
[&](const std::pair<HighsInt, HighsUInt>& edge) {
|
|
30
|
+
return cellSize(vertexToCell[edge.first]) > 1;
|
|
31
|
+
}) -
|
|
32
|
+
Gedge.begin();
|
|
33
|
+
assert(Gend[i] >= Gstart[i] && Gend[i] <= Gstart[i + 1]);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
HighsInt unitCellIndex = numVertices;
|
|
37
|
+
currentPartition.erase(
|
|
38
|
+
std::remove_if(currentPartition.begin(), currentPartition.end(),
|
|
39
|
+
[&](HighsInt vertex) {
|
|
40
|
+
if (cellSize(vertexToCell[vertex]) == 1) {
|
|
41
|
+
--unitCellIndex;
|
|
42
|
+
vertexToCell[vertex] = unitCellIndex;
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
return false;
|
|
46
|
+
}),
|
|
47
|
+
currentPartition.end());
|
|
48
|
+
|
|
49
|
+
for (HighsInt i = 0; i < numVertices; ++i) {
|
|
50
|
+
if (Gend[i] == Gstart[i + 1]) continue;
|
|
51
|
+
|
|
52
|
+
for (HighsInt j = Gend[i]; j < Gstart[i + 1]; ++j)
|
|
53
|
+
Gedge[j].first = vertexToCell[Gedge[j].first];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if ((HighsInt)currentPartition.size() < numVertices) {
|
|
57
|
+
numVertices = currentPartition.size();
|
|
58
|
+
if (numVertices == 0) {
|
|
59
|
+
numActiveCols = 0;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
currentPartitionLinks.resize(numVertices);
|
|
63
|
+
cellInRefinementQueue.assign(numVertices, false);
|
|
64
|
+
assert(refinementQueue.empty());
|
|
65
|
+
refinementQueue.clear();
|
|
66
|
+
HighsInt cellStart = 0;
|
|
67
|
+
HighsInt cellNumber = 0;
|
|
68
|
+
for (HighsInt i = 0; i < numVertices; ++i) {
|
|
69
|
+
HighsInt vertex = currentPartition[i];
|
|
70
|
+
// if the cell number is different to the current cell number this is the
|
|
71
|
+
// start of a new cell
|
|
72
|
+
if (cellNumber != vertexToCell[vertex]) {
|
|
73
|
+
// remember the number of this cell to identify its end
|
|
74
|
+
cellNumber = vertexToCell[vertex];
|
|
75
|
+
// set the link of the cell start to point to its end
|
|
76
|
+
currentPartitionLinks[cellStart] = i;
|
|
77
|
+
// remember start of this cell
|
|
78
|
+
cellStart = i;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// correct the vertexToCell array to store the start index of the
|
|
82
|
+
// cell, not its number
|
|
83
|
+
updateCellMembership(i, cellStart, false);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// set the column partition link of the last started cell to point past the
|
|
87
|
+
// end
|
|
88
|
+
assert((int)currentPartitionLinks.size() > 0);
|
|
89
|
+
currentPartitionLinks[cellStart] = numVertices;
|
|
90
|
+
|
|
91
|
+
numActiveCols =
|
|
92
|
+
std::partition_point(currentPartition.begin(), currentPartition.end(),
|
|
93
|
+
[&](HighsInt v) { return v < numCol; }) -
|
|
94
|
+
currentPartition.begin();
|
|
95
|
+
} else
|
|
96
|
+
numActiveCols = numCol;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
void HighsSymmetries::clear() {
|
|
100
|
+
permutationColumns.clear();
|
|
101
|
+
permutations.clear();
|
|
102
|
+
orbitPartition.clear();
|
|
103
|
+
orbitSize.clear();
|
|
104
|
+
columnPosition.clear();
|
|
105
|
+
linkCompressionStack.clear();
|
|
106
|
+
columnToOrbitope.clear();
|
|
107
|
+
orbitopes.clear();
|
|
108
|
+
numPerms = 0;
|
|
109
|
+
numGenerators = 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
void HighsSymmetries::mergeOrbits(HighsInt v1, HighsInt v2) {
|
|
113
|
+
if (v1 == v2) return;
|
|
114
|
+
|
|
115
|
+
HighsInt orbit1 = getOrbit(v1);
|
|
116
|
+
HighsInt orbit2 = getOrbit(v2);
|
|
117
|
+
|
|
118
|
+
if (orbit1 == orbit2) return;
|
|
119
|
+
|
|
120
|
+
if (orbitSize[orbit2] < orbitSize[orbit1]) {
|
|
121
|
+
orbitPartition[orbit2] = orbit1;
|
|
122
|
+
orbitSize[orbit1] += orbitSize[orbit2];
|
|
123
|
+
} else {
|
|
124
|
+
orbitPartition[orbit1] = orbit2;
|
|
125
|
+
orbitSize[orbit2] += orbitSize[orbit1];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
HighsInt HighsSymmetries::getOrbit(HighsInt col) {
|
|
132
|
+
HighsInt i = columnPosition[col];
|
|
133
|
+
if (i == -1) return -1;
|
|
134
|
+
HighsInt orbit = orbitPartition[i];
|
|
135
|
+
if (orbit != orbitPartition[orbit]) {
|
|
136
|
+
do {
|
|
137
|
+
linkCompressionStack.push_back(i);
|
|
138
|
+
i = orbit;
|
|
139
|
+
orbit = orbitPartition[orbit];
|
|
140
|
+
} while (orbit != orbitPartition[orbit]);
|
|
141
|
+
|
|
142
|
+
do {
|
|
143
|
+
i = linkCompressionStack.back();
|
|
144
|
+
linkCompressionStack.pop_back();
|
|
145
|
+
orbitPartition[i] = orbit;
|
|
146
|
+
} while (!linkCompressionStack.empty());
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return orbit;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
HighsInt HighsSymmetries::propagateOrbitopes(HighsDomain& domain) const {
|
|
153
|
+
if (columnToOrbitope.size() == 0 || domain.getBranchDepth() == 0) return 0;
|
|
154
|
+
|
|
155
|
+
std::set<HighsInt> propagationOrbitopes;
|
|
156
|
+
const auto& domchgstack = domain.getDomainChangeStack();
|
|
157
|
+
for (HighsInt pos : domain.getBranchingPositions()) {
|
|
158
|
+
const HighsInt* orbitope = columnToOrbitope.find(domchgstack[pos].column);
|
|
159
|
+
if (orbitope) propagationOrbitopes.insert(*orbitope);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
HighsInt numFixed = 0;
|
|
163
|
+
for (HighsInt i : propagationOrbitopes) {
|
|
164
|
+
numFixed += orbitopes[i].orbitalFixing(domain);
|
|
165
|
+
if (domain.infeasible()) break;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// if (numFixed)
|
|
169
|
+
// printf("orbital fixing for full orbitope found %d fixings\n", numFixed);
|
|
170
|
+
|
|
171
|
+
return numFixed;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
std::shared_ptr<const StabilizerOrbits>
|
|
175
|
+
HighsSymmetries::computeStabilizerOrbits(const HighsDomain& localdom) {
|
|
176
|
+
const auto& domchgStack = localdom.getDomainChangeStack();
|
|
177
|
+
const auto& branchingPos = localdom.getBranchingPositions();
|
|
178
|
+
|
|
179
|
+
StabilizerOrbits stabilizerOrbits;
|
|
180
|
+
stabilizerOrbits.stabilizedCols.reserve(permutationColumns.size());
|
|
181
|
+
for (HighsInt i : branchingPos) {
|
|
182
|
+
HighsInt col = domchgStack[i].column;
|
|
183
|
+
if (columnPosition[col] == -1) continue;
|
|
184
|
+
|
|
185
|
+
assert(localdom.variableType(col) != HighsVarType::kContinuous);
|
|
186
|
+
|
|
187
|
+
// if we branch a variable upwards it is either binary and branched to one
|
|
188
|
+
// and needs to be stabilized or it is a general integer and needs to be
|
|
189
|
+
// stabilized regardless of branching direction.
|
|
190
|
+
// if we branch downwards we only need to stabilize on this
|
|
191
|
+
// branching column if it is a general integer
|
|
192
|
+
if (domchgStack[i].boundtype == HighsBoundType::kLower ||
|
|
193
|
+
!localdom.isGlobalBinary(col))
|
|
194
|
+
stabilizerOrbits.stabilizedCols.push_back(columnPosition[col]);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
HighsInt permLength = permutationColumns.size();
|
|
198
|
+
orbitPartition.resize(permLength);
|
|
199
|
+
std::iota(orbitPartition.begin(), orbitPartition.end(), 0);
|
|
200
|
+
orbitSize.assign(permLength, 1);
|
|
201
|
+
|
|
202
|
+
for (HighsInt i = 0; i < numPerms; ++i) {
|
|
203
|
+
const HighsInt* perm = permutations.data() + i * permutationColumns.size();
|
|
204
|
+
|
|
205
|
+
bool permRespectsBranchings = true;
|
|
206
|
+
for (HighsInt i : stabilizerOrbits.stabilizedCols) {
|
|
207
|
+
if (permutationColumns[i] != perm[i]) {
|
|
208
|
+
permRespectsBranchings = false;
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (!permRespectsBranchings) continue;
|
|
214
|
+
|
|
215
|
+
for (HighsInt j = 0; j < permLength; ++j) {
|
|
216
|
+
mergeOrbits(permutationColumns[j], perm[j]);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
stabilizerOrbits.stabilizedCols.clear();
|
|
221
|
+
|
|
222
|
+
stabilizerOrbits.orbitCols.reserve(permLength);
|
|
223
|
+
for (HighsInt i = 0; i < permLength; ++i) {
|
|
224
|
+
if (localdom.variableType(permutationColumns[i]) ==
|
|
225
|
+
HighsVarType::kContinuous)
|
|
226
|
+
continue;
|
|
227
|
+
HighsInt orbit = getOrbit(permutationColumns[i]);
|
|
228
|
+
if (orbitSize[orbit] == 1)
|
|
229
|
+
stabilizerOrbits.stabilizedCols.push_back(permutationColumns[i]);
|
|
230
|
+
else if (localdom.isGlobalBinary(permutationColumns[i]))
|
|
231
|
+
stabilizerOrbits.orbitCols.push_back(permutationColumns[i]);
|
|
232
|
+
}
|
|
233
|
+
stabilizerOrbits.symmetries = this;
|
|
234
|
+
pdqsort(stabilizerOrbits.stabilizedCols.begin(),
|
|
235
|
+
stabilizerOrbits.stabilizedCols.end());
|
|
236
|
+
if (!stabilizerOrbits.orbitCols.empty()) {
|
|
237
|
+
pdqsort(stabilizerOrbits.orbitCols.begin(),
|
|
238
|
+
stabilizerOrbits.orbitCols.end(),
|
|
239
|
+
[&](HighsInt col1, HighsInt col2) {
|
|
240
|
+
return getOrbit(col1) < getOrbit(col2);
|
|
241
|
+
});
|
|
242
|
+
HighsInt numOrbitCols = stabilizerOrbits.orbitCols.size();
|
|
243
|
+
stabilizerOrbits.orbitStarts.reserve(numOrbitCols + 1);
|
|
244
|
+
stabilizerOrbits.orbitStarts.push_back(0);
|
|
245
|
+
|
|
246
|
+
for (HighsInt i = 1; i < numOrbitCols; ++i) {
|
|
247
|
+
if (getOrbit(stabilizerOrbits.orbitCols[i]) !=
|
|
248
|
+
getOrbit(stabilizerOrbits.orbitCols[i - 1]))
|
|
249
|
+
stabilizerOrbits.orbitStarts.push_back(i);
|
|
250
|
+
}
|
|
251
|
+
stabilizerOrbits.orbitStarts.push_back(numOrbitCols);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return std::make_shared<const StabilizerOrbits>(std::move(stabilizerOrbits));
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
HighsInt StabilizerOrbits::orbitalFixing(HighsDomain& domain) const {
|
|
258
|
+
HighsInt numFixed = symmetries->propagateOrbitopes(domain);
|
|
259
|
+
if (domain.infeasible() || orbitCols.empty()) return numFixed;
|
|
260
|
+
|
|
261
|
+
HighsInt numOrbits = orbitStarts.size() - 1;
|
|
262
|
+
for (HighsInt i = 0; i < numOrbits; ++i) {
|
|
263
|
+
HighsInt fixcol = -1;
|
|
264
|
+
for (HighsInt j = orbitStarts[i]; j < orbitStarts[i + 1]; ++j) {
|
|
265
|
+
if (domain.isFixed(orbitCols[j])) {
|
|
266
|
+
fixcol = orbitCols[j];
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (fixcol != -1) {
|
|
272
|
+
HighsInt oldNumFixed = numFixed;
|
|
273
|
+
auto oldSize = domain.getDomainChangeStack().size();
|
|
274
|
+
if (domain.col_lower_[fixcol] == 1.0) {
|
|
275
|
+
for (HighsInt j = orbitStarts[i]; j < orbitStarts[i + 1]; ++j) {
|
|
276
|
+
if (domain.col_lower_[orbitCols[j]] == 1.0) continue;
|
|
277
|
+
++numFixed;
|
|
278
|
+
domain.changeBound(HighsBoundType::kLower, orbitCols[j], 1.0,
|
|
279
|
+
HighsDomain::Reason::unspecified());
|
|
280
|
+
if (domain.infeasible()) return numFixed;
|
|
281
|
+
}
|
|
282
|
+
} else {
|
|
283
|
+
for (HighsInt j = orbitStarts[i]; j < orbitStarts[i + 1]; ++j) {
|
|
284
|
+
if (domain.col_upper_[orbitCols[j]] == 0.0) continue;
|
|
285
|
+
++numFixed;
|
|
286
|
+
domain.changeBound(HighsBoundType::kUpper, orbitCols[j], 0.0,
|
|
287
|
+
HighsDomain::Reason::unspecified());
|
|
288
|
+
if (domain.infeasible()) return numFixed;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
HighsInt newFixed = numFixed - oldNumFixed;
|
|
293
|
+
|
|
294
|
+
if (newFixed != 0) {
|
|
295
|
+
domain.propagate();
|
|
296
|
+
if (domain.infeasible()) return numFixed;
|
|
297
|
+
if ((HighsInt)(domain.getDomainChangeStack().size() - oldSize) >
|
|
298
|
+
newFixed)
|
|
299
|
+
i = -1;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return numFixed;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
bool StabilizerOrbits::isStabilized(HighsInt col) const {
|
|
308
|
+
return symmetries->columnPosition[col] == -1 ||
|
|
309
|
+
std::binary_search(stabilizedCols.begin(), stabilizedCols.end(), col);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
void HighsOrbitopeMatrix::determineOrbitopeType(HighsCliqueTable& cliquetable) {
|
|
313
|
+
for (HighsInt j = 0; j < rowLength; ++j) {
|
|
314
|
+
for (HighsInt i = 0; i < numRows; ++i) {
|
|
315
|
+
columnToRow.insert(entry(i, j), i);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
rowIsSetPacking.assign(numRows, -1);
|
|
320
|
+
numSetPackingRows = 0;
|
|
321
|
+
|
|
322
|
+
for (HighsInt j = 1; j < rowLength; ++j) {
|
|
323
|
+
HighsInt* colj1 = &entry(0, j);
|
|
324
|
+
|
|
325
|
+
for (HighsInt j0 = 0; j0 < j; ++j0) {
|
|
326
|
+
HighsInt* colj0 = &entry(0, j0);
|
|
327
|
+
|
|
328
|
+
for (HighsInt i = 0; i < numRows; ++i) {
|
|
329
|
+
if (rowIsSetPacking[i] != -1) continue;
|
|
330
|
+
|
|
331
|
+
HighsInt xj0 = colj0[i];
|
|
332
|
+
HighsInt xj1 = colj1[i];
|
|
333
|
+
|
|
334
|
+
auto commonClique = cliquetable.findCommonClique({xj0, 1}, {xj1, 1});
|
|
335
|
+
|
|
336
|
+
if (commonClique.first == nullptr) {
|
|
337
|
+
rowIsSetPacking[i] = false;
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
HighsInt overlap = 0;
|
|
342
|
+
|
|
343
|
+
for (HighsInt k = 0; k < commonClique.second; ++k) {
|
|
344
|
+
if (commonClique.first[k].val == 0) continue;
|
|
345
|
+
|
|
346
|
+
HighsInt* cliqueColRow = columnToRow.find(commonClique.first[k].col);
|
|
347
|
+
if (cliqueColRow && *cliqueColRow == i) ++overlap;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
if (overlap == rowLength) {
|
|
351
|
+
rowIsSetPacking[i] = true;
|
|
352
|
+
++numSetPackingRows;
|
|
353
|
+
if (numSetPackingRows == numRows) break;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (numSetPackingRows == numRows) break;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (numSetPackingRows == numRows) break;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// now for the rows that do not have a set packing structure check
|
|
364
|
+
// if we have such structure when all columns in the row are negated
|
|
365
|
+
|
|
366
|
+
for (HighsInt i = 0; i < numRows; ++i) {
|
|
367
|
+
if (!rowIsSetPacking[i]) rowIsSetPacking[i] = -1;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
for (HighsInt j = 1; j < rowLength; ++j) {
|
|
371
|
+
HighsInt* colj1 = &entry(0, j);
|
|
372
|
+
|
|
373
|
+
for (HighsInt j0 = 0; j0 < j; ++j0) {
|
|
374
|
+
HighsInt* colj0 = &entry(0, j0);
|
|
375
|
+
|
|
376
|
+
for (HighsInt i = 0; i < numRows; ++i) {
|
|
377
|
+
if (rowIsSetPacking[i] != -1) continue;
|
|
378
|
+
|
|
379
|
+
HighsInt xj0 = colj0[i];
|
|
380
|
+
HighsInt xj1 = colj1[i];
|
|
381
|
+
|
|
382
|
+
// now look for cliques with value 0
|
|
383
|
+
auto commonClique = cliquetable.findCommonClique({xj0, 0}, {xj1, 0});
|
|
384
|
+
|
|
385
|
+
if (commonClique.first == nullptr) {
|
|
386
|
+
rowIsSetPacking[i] = false;
|
|
387
|
+
continue;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
HighsInt overlap = 0;
|
|
391
|
+
|
|
392
|
+
for (HighsInt k = 0; k < commonClique.second; ++k) {
|
|
393
|
+
// skip clique variables with values of 1
|
|
394
|
+
if (commonClique.first[k].val == 1) continue;
|
|
395
|
+
|
|
396
|
+
HighsInt* cliqueColRow = columnToRow.find(commonClique.first[k].col);
|
|
397
|
+
if (cliqueColRow && *cliqueColRow == i) ++overlap;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
if (overlap == rowLength) {
|
|
401
|
+
// mark with value 2, for negated set packing row with at most one
|
|
402
|
+
// zero
|
|
403
|
+
rowIsSetPacking[i] = 2;
|
|
404
|
+
++numSetPackingRows;
|
|
405
|
+
if (numSetPackingRows == numRows) break;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
if (numSetPackingRows == numRows) break;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
if (numSetPackingRows == numRows) break;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
HighsInt HighsOrbitopeMatrix::getBranchingColumn(
|
|
417
|
+
const std::vector<double>& colLower, const std::vector<double>& colUpper,
|
|
418
|
+
HighsInt col) const {
|
|
419
|
+
const HighsInt* i = columnToRow.find(col);
|
|
420
|
+
if (i && rowIsSetPacking[*i]) {
|
|
421
|
+
for (HighsInt j = 0; j < rowLength; ++j) {
|
|
422
|
+
HighsInt branchCol = entry(*i, j);
|
|
423
|
+
if (branchCol == col) break;
|
|
424
|
+
if (colLower[branchCol] != colUpper[branchCol]) return branchCol;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
return col;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
HighsInt HighsOrbitopeMatrix::orbitalFixingForPackingOrbitope(
|
|
432
|
+
const std::vector<HighsInt>& rows, HighsDomain& domain) const {
|
|
433
|
+
HighsInt numDynamicRows = rows.size();
|
|
434
|
+
|
|
435
|
+
// printf("propagate packing orbitope\n");
|
|
436
|
+
|
|
437
|
+
std::vector<HighsInt> firstOneInRow(numDynamicRows, -1);
|
|
438
|
+
|
|
439
|
+
for (HighsInt j = 0; j < rowLength; ++j) {
|
|
440
|
+
for (HighsInt i = 0; i < numDynamicRows; ++i) {
|
|
441
|
+
if (firstOneInRow[i] != -1) continue;
|
|
442
|
+
HighsInt r = rows[i];
|
|
443
|
+
HighsInt colrj = entry(r, j);
|
|
444
|
+
if (rowIsSetPacking[r] == 1) {
|
|
445
|
+
if (domain.col_lower_[colrj] > 0.5) firstOneInRow[i] = j;
|
|
446
|
+
} else {
|
|
447
|
+
assert(rowIsSetPacking[r] == 2);
|
|
448
|
+
if (domain.col_upper_[colrj] < 0.5) firstOneInRow[i] = j;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
// we start looping over the rows and keep the index j at the column that
|
|
454
|
+
// is the right most possible location for a 1 entry.
|
|
455
|
+
// For the first row this position is 0.
|
|
456
|
+
|
|
457
|
+
HighsInt j = 0;
|
|
458
|
+
HighsInt numFixed = 0;
|
|
459
|
+
for (HighsInt i = 0; i < numDynamicRows; ++i) {
|
|
460
|
+
// at this position we know that the last possible position
|
|
461
|
+
// of a 1-entry in this row is j. If we have a 1 behind j
|
|
462
|
+
// the face of the orbitope intersecting the set of initial fixings is empty
|
|
463
|
+
if (firstOneInRow[i] > j) {
|
|
464
|
+
domain.markInfeasible();
|
|
465
|
+
// printf("packing orbitope propagation found infeasibility\n");
|
|
466
|
+
return numFixed;
|
|
467
|
+
}
|
|
468
|
+
HighsInt col_ij = entry(rows[i], j);
|
|
469
|
+
|
|
470
|
+
bool negate_i = rowIsSetPacking[rows[i]] == 2;
|
|
471
|
+
|
|
472
|
+
bool notZeroFixed = negate_i ? domain.col_lower_[col_ij] < 0.5
|
|
473
|
+
: domain.col_upper_[col_ij] > 0.5;
|
|
474
|
+
|
|
475
|
+
// as long as the entry is fixed to zero
|
|
476
|
+
// the frontier stays at the same column
|
|
477
|
+
// if we encounter an entry that is not fixed to zero
|
|
478
|
+
// we need to proceed with the next column and found a frontier step
|
|
479
|
+
if (notZeroFixed) {
|
|
480
|
+
// found a frontier step. Now we first check for the current column
|
|
481
|
+
// if it can be fixed to 1.
|
|
482
|
+
// For this we check if we find an infeasibility in the case where this
|
|
483
|
+
// column was fixed to zero in which case the frontier would have stayed
|
|
484
|
+
// at j for the following rows.
|
|
485
|
+
HighsInt j0 = j;
|
|
486
|
+
for (HighsInt k = i + 1; k < numDynamicRows; ++k) {
|
|
487
|
+
if (firstOneInRow[k] > j0) {
|
|
488
|
+
if (negate_i)
|
|
489
|
+
domain.changeBound(HighsBoundType::kUpper, col_ij, 0.0,
|
|
490
|
+
HighsDomain::Reason::unspecified());
|
|
491
|
+
else
|
|
492
|
+
domain.changeBound(HighsBoundType::kLower, col_ij, 1.0,
|
|
493
|
+
HighsDomain::Reason::unspecified());
|
|
494
|
+
|
|
495
|
+
++numFixed;
|
|
496
|
+
if (domain.infeasible()) {
|
|
497
|
+
// printf("packing orbitope propagation found infeasibility\n");
|
|
498
|
+
return numFixed;
|
|
499
|
+
}
|
|
500
|
+
break;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
bool negate_k = rowIsSetPacking[rows[k]] == 2;
|
|
504
|
+
bool notZeroFixed = negate_k
|
|
505
|
+
? domain.col_lower_[entry(rows[k], j0)] < 0.5
|
|
506
|
+
: domain.col_upper_[entry(rows[k], j0)] > 0.5;
|
|
507
|
+
|
|
508
|
+
if (notZeroFixed) {
|
|
509
|
+
++j0;
|
|
510
|
+
if (j0 == rowLength) break;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
++j;
|
|
515
|
+
if (j == rowLength) break;
|
|
516
|
+
|
|
517
|
+
for (HighsInt k = 0; k <= i; ++k) {
|
|
518
|
+
// we should have checked this row at the frontier position
|
|
519
|
+
assert(firstOneInRow[k] < j);
|
|
520
|
+
|
|
521
|
+
HighsInt col_kj = entry(rows[k], j);
|
|
522
|
+
bool negate_k = rowIsSetPacking[rows[k]] == 2;
|
|
523
|
+
|
|
524
|
+
if (negate_k) {
|
|
525
|
+
if (domain.col_lower_[col_kj] > 0.5) continue;
|
|
526
|
+
|
|
527
|
+
domain.changeBound(HighsBoundType::kLower, col_kj, 1.0,
|
|
528
|
+
HighsDomain::Reason::unspecified());
|
|
529
|
+
} else {
|
|
530
|
+
if (domain.col_upper_[col_kj] < 0.5) continue;
|
|
531
|
+
|
|
532
|
+
domain.changeBound(HighsBoundType::kUpper, col_kj, 0.0,
|
|
533
|
+
HighsDomain::Reason::unspecified());
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
++numFixed;
|
|
537
|
+
if (domain.infeasible()) {
|
|
538
|
+
// this can happen due to deductions from earlier fixings
|
|
539
|
+
// otherwise it would have been caught by the infeasibility
|
|
540
|
+
// check within the next loop that goes over i
|
|
541
|
+
// printf("packing orbitope propagation found infeasibility\n");
|
|
542
|
+
return numFixed;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// check if there are more columns that can be completely fixed to zero
|
|
549
|
+
while (++j < rowLength) {
|
|
550
|
+
for (HighsInt k = 0; k < numDynamicRows; ++k) {
|
|
551
|
+
// we should have checked this row at the frontier position
|
|
552
|
+
assert(firstOneInRow[k] < j);
|
|
553
|
+
|
|
554
|
+
HighsInt col_kj = entry(rows[k], j);
|
|
555
|
+
bool negate_k = rowIsSetPacking[rows[k]] == 2;
|
|
556
|
+
|
|
557
|
+
if (negate_k) {
|
|
558
|
+
if (domain.col_lower_[col_kj] > 0.5) continue;
|
|
559
|
+
|
|
560
|
+
domain.changeBound(HighsBoundType::kLower, col_kj, 1.0,
|
|
561
|
+
HighsDomain::Reason::unspecified());
|
|
562
|
+
} else {
|
|
563
|
+
if (domain.col_upper_[col_kj] < 0.5) continue;
|
|
564
|
+
|
|
565
|
+
domain.changeBound(HighsBoundType::kUpper, col_kj, 0.0,
|
|
566
|
+
HighsDomain::Reason::unspecified());
|
|
567
|
+
}
|
|
568
|
+
// printf("new fixed\n");
|
|
569
|
+
++numFixed;
|
|
570
|
+
if (domain.infeasible()) {
|
|
571
|
+
// this can happen due to deductions from earlier fixings
|
|
572
|
+
// otherwise it would have been caught by the infeasibility
|
|
573
|
+
// check within the next loop that goes over i
|
|
574
|
+
// printf("packing orbitope propagation found infeasibility\n");
|
|
575
|
+
return numFixed;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
if (!domain.infeasible() && numFixed) domain.propagate();
|
|
581
|
+
|
|
582
|
+
// if (numFixed)
|
|
583
|
+
// printf("orbital fixing for packing case fixed %d columns\n", numFixed);
|
|
584
|
+
|
|
585
|
+
return numFixed;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
HighsInt HighsOrbitopeMatrix::orbitalFixingForFullOrbitope(
|
|
589
|
+
const std::vector<HighsInt>& rows, HighsDomain& domain) const {
|
|
590
|
+
HighsInt numDynamicRows = rows.size();
|
|
591
|
+
std::vector<int8_t> Mminimal(numDynamicRows * rowLength, -1);
|
|
592
|
+
|
|
593
|
+
for (HighsInt j = 0; j < rowLength; ++j) {
|
|
594
|
+
for (HighsInt i = 0; i < numDynamicRows; ++i) {
|
|
595
|
+
HighsInt r = rows[i];
|
|
596
|
+
HighsInt colij = matrix[r + j * numRows];
|
|
597
|
+
if (domain.col_lower_[colij] == 1.0)
|
|
598
|
+
Mminimal[i + j * numDynamicRows] = 1;
|
|
599
|
+
else if (domain.col_upper_[colij] == 0.0)
|
|
600
|
+
Mminimal[i + j * numDynamicRows] = 0;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
std::vector<int8_t> Mmaximal = Mminimal;
|
|
605
|
+
|
|
606
|
+
int8_t* MminimaljLast = Mminimal.data() + numDynamicRows * (rowLength - 1);
|
|
607
|
+
int8_t* MmaximaljFirst = Mmaximal.data();
|
|
608
|
+
for (HighsInt k = 0; k < numDynamicRows; ++k) {
|
|
609
|
+
if (MminimaljLast[k] == -1) MminimaljLast[k] = 0;
|
|
610
|
+
if (MmaximaljFirst[k] == -1) MmaximaljFirst[k] = 1;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
auto i_fixed = [&](const int8_t* colj0, const int8_t* colj1) {
|
|
614
|
+
for (HighsInt i = 0; i < numDynamicRows; ++i) {
|
|
615
|
+
if (colj0[i] != -1 && colj1[i] != -1 && colj0[i] != colj1[i]) return i;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
return numDynamicRows;
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
auto i_discr = [&](const int8_t* colj0, const int8_t* colj1, HighsInt i_f) {
|
|
622
|
+
for (HighsInt i = i_f; i >= 0; --i) {
|
|
623
|
+
if (colj0[i] != 0 && colj1[i] != 1) return i;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
return HighsInt{-1};
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
for (HighsInt j = rowLength - 2; j >= 0; --j) {
|
|
630
|
+
int8_t* colj0 = Mminimal.data() + j * numDynamicRows;
|
|
631
|
+
int8_t* colj1 = colj0 + numDynamicRows;
|
|
632
|
+
HighsInt i_f = i_fixed(colj0, colj1);
|
|
633
|
+
|
|
634
|
+
if (i_f == numDynamicRows) {
|
|
635
|
+
for (HighsInt k = 0; k < numDynamicRows; ++k) {
|
|
636
|
+
int8_t isFree = (colj0[k] == -1);
|
|
637
|
+
colj0[k] += (isFree & colj1[k]) + isFree;
|
|
638
|
+
}
|
|
639
|
+
} else {
|
|
640
|
+
HighsInt i_d = i_discr(colj0, colj1, i_f);
|
|
641
|
+
if (i_d == -1) {
|
|
642
|
+
domain.markInfeasible();
|
|
643
|
+
return 0;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
for (HighsInt k = 0; k < i_d; ++k) {
|
|
647
|
+
int8_t isFree = (colj0[k] == -1);
|
|
648
|
+
colj0[k] += (isFree & colj1[k]) + isFree;
|
|
649
|
+
}
|
|
650
|
+
colj0[i_d] = 1;
|
|
651
|
+
for (HighsInt k = i_d + 1; k < numDynamicRows; ++k)
|
|
652
|
+
colj0[k] += (colj0[k] == -1);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
for (HighsInt j = 1; j < rowLength; ++j) {
|
|
657
|
+
int8_t* colj0 = Mmaximal.data() + j * numDynamicRows;
|
|
658
|
+
int8_t* colj1 = colj0 - numDynamicRows;
|
|
659
|
+
HighsInt i_f = i_fixed(colj1, colj0);
|
|
660
|
+
|
|
661
|
+
if (i_f == numDynamicRows) {
|
|
662
|
+
for (HighsInt k = 0; k < numDynamicRows; ++k) {
|
|
663
|
+
int8_t isFree = (colj0[k] == -1);
|
|
664
|
+
colj0[k] += (isFree & colj1[k]) + isFree;
|
|
665
|
+
}
|
|
666
|
+
} else {
|
|
667
|
+
HighsInt i_d = i_discr(colj1, colj0, i_f);
|
|
668
|
+
if (i_d == -1) {
|
|
669
|
+
domain.markInfeasible();
|
|
670
|
+
return 0;
|
|
671
|
+
}
|
|
672
|
+
for (HighsInt k = 0; k < i_d; ++k) {
|
|
673
|
+
int8_t isFree = (colj0[k] == -1);
|
|
674
|
+
colj0[k] += (isFree & colj1[k]) + isFree;
|
|
675
|
+
}
|
|
676
|
+
colj0[i_d] = 0;
|
|
677
|
+
for (HighsInt k = i_d + 1; k < numDynamicRows; ++k)
|
|
678
|
+
colj0[k] += 2 * (colj0[k] == -1);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
HighsInt numFixed = 0;
|
|
683
|
+
|
|
684
|
+
for (HighsInt j = 0; j < rowLength; ++j) {
|
|
685
|
+
const int8_t* colMaximal = Mmaximal.data() + j * numDynamicRows;
|
|
686
|
+
const int8_t* colMinimal = Mminimal.data() + j * numDynamicRows;
|
|
687
|
+
|
|
688
|
+
for (HighsInt i = 0; i < numDynamicRows; ++i) {
|
|
689
|
+
if (colMinimal[i] != colMaximal[i]) {
|
|
690
|
+
assert(colMinimal[i] < colMaximal[i]);
|
|
691
|
+
break;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
HighsInt r = rows[i];
|
|
695
|
+
HighsInt colrj = matrix[r + j * numRows];
|
|
696
|
+
if (domain.isFixed(colrj)) continue;
|
|
697
|
+
|
|
698
|
+
++numFixed;
|
|
699
|
+
if (colMinimal[i] == 1)
|
|
700
|
+
domain.changeBound(HighsBoundType::kLower, colrj, 1.0,
|
|
701
|
+
HighsDomain::Reason::unspecified());
|
|
702
|
+
else
|
|
703
|
+
domain.changeBound(HighsBoundType::kUpper, colrj, 0.0,
|
|
704
|
+
HighsDomain::Reason::unspecified());
|
|
705
|
+
if (domain.infeasible()) break;
|
|
706
|
+
}
|
|
707
|
+
if (domain.infeasible()) break;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
if (!domain.infeasible()) domain.propagate();
|
|
711
|
+
|
|
712
|
+
return numFixed;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
HighsInt HighsOrbitopeMatrix::orbitalFixing(HighsDomain& domain) const {
|
|
716
|
+
std::vector<HighsInt> rows;
|
|
717
|
+
std::vector<uint8_t> rowUsed(numRows);
|
|
718
|
+
|
|
719
|
+
rows.reserve(numRows);
|
|
720
|
+
|
|
721
|
+
const auto& branchpos = domain.getBranchingPositions();
|
|
722
|
+
const auto& domchgstack = domain.getDomainChangeStack();
|
|
723
|
+
|
|
724
|
+
bool isPacking = true;
|
|
725
|
+
for (HighsInt pos : branchpos) {
|
|
726
|
+
const HighsInt* i = columnToRow.find(domchgstack[pos].column);
|
|
727
|
+
if (i && !rowUsed[*i]) {
|
|
728
|
+
rowUsed[*i] = true;
|
|
729
|
+
isPacking = isPacking && rowIsSetPacking[*i] != 0;
|
|
730
|
+
rows.push_back(*i);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
if (rows.empty()) return 0;
|
|
735
|
+
|
|
736
|
+
if (isPacking) return orbitalFixingForPackingOrbitope(rows, domain);
|
|
737
|
+
|
|
738
|
+
return orbitalFixingForFullOrbitope(rows, domain);
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
void HighsSymmetryDetection::initializeGroundSet() {
|
|
742
|
+
vertexGroundSet = currentPartition;
|
|
743
|
+
pdqsort(vertexGroundSet.begin(), vertexGroundSet.end());
|
|
744
|
+
vertexPosition.resize(vertexToCell.size(), -1);
|
|
745
|
+
for (HighsInt i = 0; i < numVertices; ++i)
|
|
746
|
+
vertexPosition[vertexGroundSet[i]] = i;
|
|
747
|
+
|
|
748
|
+
orbitPartition.resize(numVertices);
|
|
749
|
+
std::iota(orbitPartition.begin(), orbitPartition.end(), 0);
|
|
750
|
+
orbitSize.assign(numVertices, 1);
|
|
751
|
+
|
|
752
|
+
automorphisms.resize(numVertices * 64);
|
|
753
|
+
numAutomorphisms = 0;
|
|
754
|
+
currNodeCertificate.reserve(numVertices);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
bool HighsSymmetryDetection::mergeOrbits(HighsInt v1, HighsInt v2) {
|
|
758
|
+
if (v1 == v2) return false;
|
|
759
|
+
|
|
760
|
+
HighsInt orbit1 = getOrbit(v1);
|
|
761
|
+
HighsInt orbit2 = getOrbit(v2);
|
|
762
|
+
|
|
763
|
+
if (orbit1 == orbit2) return false;
|
|
764
|
+
|
|
765
|
+
if (orbit1 < orbit2) {
|
|
766
|
+
orbitPartition[orbit2] = orbit1;
|
|
767
|
+
orbitSize[orbit1] += orbitSize[orbit2];
|
|
768
|
+
} else {
|
|
769
|
+
orbitPartition[orbit1] = orbit2;
|
|
770
|
+
orbitSize[orbit2] += orbitSize[orbit1];
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
return true;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
HighsInt HighsSymmetryDetection::getOrbit(HighsInt vertex) {
|
|
777
|
+
HighsInt i = vertexPosition[vertex];
|
|
778
|
+
HighsInt orbit = orbitPartition[i];
|
|
779
|
+
if (orbit != orbitPartition[orbit]) {
|
|
780
|
+
do {
|
|
781
|
+
linkCompressionStack.push_back(i);
|
|
782
|
+
i = orbit;
|
|
783
|
+
orbit = orbitPartition[orbit];
|
|
784
|
+
} while (orbit != orbitPartition[orbit]);
|
|
785
|
+
|
|
786
|
+
do {
|
|
787
|
+
i = linkCompressionStack.back();
|
|
788
|
+
linkCompressionStack.pop_back();
|
|
789
|
+
orbitPartition[i] = orbit;
|
|
790
|
+
} while (!linkCompressionStack.empty());
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
return orbit;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
void HighsSymmetryDetection::initializeHashValues() {
|
|
797
|
+
for (HighsInt i = 0; i != numVertices; ++i) {
|
|
798
|
+
HighsInt cell = vertexToCell[i];
|
|
799
|
+
for (HighsInt j = Gstart[i]; j != Gend[i]; ++j) {
|
|
800
|
+
HighsHashHelpers::sparse_combine32(vertexHash[Gedge[j].first], cell,
|
|
801
|
+
Gedge[j].second);
|
|
802
|
+
}
|
|
803
|
+
markCellForRefinement(cell);
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
bool HighsSymmetryDetection::updateCellMembership(HighsInt i, HighsInt cell,
|
|
808
|
+
bool markForRefinement) {
|
|
809
|
+
HighsInt vertex = currentPartition[i];
|
|
810
|
+
if (vertexToCell[vertex] != cell) {
|
|
811
|
+
// set new cell id
|
|
812
|
+
vertexToCell[vertex] = cell;
|
|
813
|
+
if (i != cell) currentPartitionLinks[i] = cell;
|
|
814
|
+
|
|
815
|
+
// update hashes of affected rows
|
|
816
|
+
if (markForRefinement) {
|
|
817
|
+
for (HighsInt j = Gstart[vertex]; j != Gend[vertex]; ++j) {
|
|
818
|
+
HighsInt edgeDestinationCell = vertexToCell[Gedge[j].first];
|
|
819
|
+
if (cellSize(edgeDestinationCell) == 1) continue;
|
|
820
|
+
HighsHashHelpers::sparse_combine32(vertexHash[Gedge[j].first], cell,
|
|
821
|
+
Gedge[j].second);
|
|
822
|
+
markCellForRefinement(edgeDestinationCell);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
return true;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
return false;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
bool HighsSymmetryDetection::splitCell(HighsInt cell, HighsInt splitPoint) {
|
|
833
|
+
u32 hSplit = getVertexHash(currentPartition[splitPoint]);
|
|
834
|
+
u32 hCell = getVertexHash(currentPartition[cell]);
|
|
835
|
+
|
|
836
|
+
u32 certificateVal =
|
|
837
|
+
(HighsHashHelpers::pair_hash<0>(hSplit, hCell) +
|
|
838
|
+
HighsHashHelpers::pair_hash<1>(
|
|
839
|
+
cell, currentPartitionLinks[cell] - splitPoint) +
|
|
840
|
+
HighsHashHelpers::pair_hash<2>(splitPoint, splitPoint - cell)) >>
|
|
841
|
+
32;
|
|
842
|
+
|
|
843
|
+
// employ prefix pruning scheme as in bliss
|
|
844
|
+
if (!firstLeaveCertificate.empty()) {
|
|
845
|
+
firstLeavePrefixLen +=
|
|
846
|
+
(firstLeavePrefixLen == (HighsInt)currNodeCertificate.size()) *
|
|
847
|
+
(certificateVal == firstLeaveCertificate[currNodeCertificate.size()]);
|
|
848
|
+
bestLeavePrefixLen +=
|
|
849
|
+
(bestLeavePrefixLen == (HighsInt)currNodeCertificate.size()) *
|
|
850
|
+
(certificateVal == bestLeaveCertificate[currNodeCertificate.size()]);
|
|
851
|
+
|
|
852
|
+
// if the node certificate is not a prefix of the first leave's certificate
|
|
853
|
+
// and it comes lexicographically after the certificate value of the
|
|
854
|
+
// lexicographically smallest leave certificate we prune the node
|
|
855
|
+
if (firstLeavePrefixLen <= (HighsInt)currNodeCertificate.size() &&
|
|
856
|
+
bestLeavePrefixLen <= (HighsInt)currNodeCertificate.size()) {
|
|
857
|
+
u32 diffVal = bestLeavePrefixLen == (HighsInt)currNodeCertificate.size()
|
|
858
|
+
? certificateVal
|
|
859
|
+
: currNodeCertificate[bestLeavePrefixLen];
|
|
860
|
+
if (diffVal > bestLeaveCertificate[bestLeavePrefixLen]) return false;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
currentPartitionLinks[splitPoint] = currentPartitionLinks[cell];
|
|
865
|
+
currentPartitionLinks[cell] = splitPoint;
|
|
866
|
+
cellCreationStack.push_back(splitPoint);
|
|
867
|
+
currNodeCertificate.push_back(certificateVal);
|
|
868
|
+
|
|
869
|
+
return true;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
void HighsSymmetryDetection::markCellForRefinement(HighsInt cell) {
|
|
873
|
+
if (cellSize(cell) == 1 || cellInRefinementQueue[cell]) return;
|
|
874
|
+
|
|
875
|
+
cellInRefinementQueue[cell] = true;
|
|
876
|
+
refinementQueue.push_back(cell);
|
|
877
|
+
std::push_heap(refinementQueue.begin(), refinementQueue.end(),
|
|
878
|
+
std::greater<HighsInt>());
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
HighsSymmetryDetection::u32 HighsSymmetryDetection::getVertexHash(HighsInt v) {
|
|
882
|
+
const u32* h = vertexHash.find(v);
|
|
883
|
+
if (h) return *h;
|
|
884
|
+
return 0;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
bool HighsSymmetryDetection::partitionRefinement() {
|
|
888
|
+
while (!refinementQueue.empty()) {
|
|
889
|
+
std::pop_heap(refinementQueue.begin(), refinementQueue.end(),
|
|
890
|
+
std::greater<HighsInt>());
|
|
891
|
+
|
|
892
|
+
HighsInt cellStart = refinementQueue.back();
|
|
893
|
+
HighsInt firstCellStart = cellStart;
|
|
894
|
+
refinementQueue.pop_back();
|
|
895
|
+
cellInRefinementQueue[cellStart] = false;
|
|
896
|
+
|
|
897
|
+
if (cellSize(cellStart) == 1) continue;
|
|
898
|
+
HighsInt cellEnd = currentPartitionLinks[cellStart];
|
|
899
|
+
assert(cellEnd >= cellStart);
|
|
900
|
+
|
|
901
|
+
// first check which vertices do have updated hash values and put them to
|
|
902
|
+
// the end of the partition
|
|
903
|
+
HighsInt refineStart =
|
|
904
|
+
std::partition(
|
|
905
|
+
currentPartition.begin() + cellStart,
|
|
906
|
+
currentPartition.begin() + cellEnd,
|
|
907
|
+
[&](HighsInt v) { return vertexHash.find(v) == nullptr; }) -
|
|
908
|
+
currentPartition.begin();
|
|
909
|
+
|
|
910
|
+
// if there are none there is nothing to refine
|
|
911
|
+
if (refineStart == cellEnd) continue;
|
|
912
|
+
|
|
913
|
+
// sort the vertices that have updated hash values by their hash values
|
|
914
|
+
pdqsort(currentPartition.begin() + refineStart,
|
|
915
|
+
currentPartition.begin() + cellEnd, [&](HighsInt v1, HighsInt v2) {
|
|
916
|
+
return vertexHash[v1] < vertexHash[v2];
|
|
917
|
+
});
|
|
918
|
+
|
|
919
|
+
// if not all vertices have updated hash values directly create the first
|
|
920
|
+
// new cell at the start of the range that we want to refine
|
|
921
|
+
if (refineStart != cellStart) {
|
|
922
|
+
assert(refineStart != cellStart);
|
|
923
|
+
assert(refineStart != cellEnd);
|
|
924
|
+
if (!splitCell(cellStart, refineStart)) {
|
|
925
|
+
// node can be pruned, make sure hash values are cleared and queue is
|
|
926
|
+
// empty
|
|
927
|
+
for (HighsInt c : refinementQueue) cellInRefinementQueue[c] = false;
|
|
928
|
+
refinementQueue.clear();
|
|
929
|
+
vertexHash.clear();
|
|
930
|
+
return false;
|
|
931
|
+
}
|
|
932
|
+
cellStart = refineStart;
|
|
933
|
+
updateCellMembership(cellStart, cellStart);
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
// now update the remaining vertices
|
|
937
|
+
bool prune = false;
|
|
938
|
+
HighsInt i;
|
|
939
|
+
assert(vertexHash.find(currentPartition[cellStart]) != nullptr);
|
|
940
|
+
// store value of first hash
|
|
941
|
+
u64 lastHash = vertexHash[currentPartition[cellStart]];
|
|
942
|
+
for (i = cellStart + 1; i < cellEnd; ++i) {
|
|
943
|
+
HighsInt vertex = currentPartition[i];
|
|
944
|
+
// get this vertex hash value
|
|
945
|
+
u64 hash = vertexHash[vertex];
|
|
946
|
+
|
|
947
|
+
if (hash != lastHash) {
|
|
948
|
+
// hash values do not match -> start of new cell
|
|
949
|
+
if (!splitCell(cellStart, i)) {
|
|
950
|
+
// refinement process yielded bad prefix of certificate
|
|
951
|
+
// -> node can be pruned
|
|
952
|
+
prune = true;
|
|
953
|
+
break;
|
|
954
|
+
}
|
|
955
|
+
cellStart = i;
|
|
956
|
+
// remember hash value of this new cell under lastHash
|
|
957
|
+
lastHash = hash;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
// update membership of vertex to new cell
|
|
961
|
+
updateCellMembership(i, cellStart);
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
if (prune) {
|
|
965
|
+
// node can be pruned, make sure hash values are cleared and queue is
|
|
966
|
+
// empty
|
|
967
|
+
for (HighsInt c : refinementQueue) cellInRefinementQueue[c] = false;
|
|
968
|
+
refinementQueue.clear();
|
|
969
|
+
vertexHash.clear();
|
|
970
|
+
currentPartitionLinks[firstCellStart] = cellEnd;
|
|
971
|
+
|
|
972
|
+
// undo possibly incomplete changes done to the cells
|
|
973
|
+
for (--i; i >= refineStart; --i)
|
|
974
|
+
updateCellMembership(i, firstCellStart, false);
|
|
975
|
+
|
|
976
|
+
return false;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
assert(currentPartitionLinks[cellStart] == cellEnd);
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
vertexHash.clear();
|
|
983
|
+
|
|
984
|
+
return true;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
HighsInt HighsSymmetryDetection::selectTargetCell() const {
|
|
988
|
+
HighsInt i = 0;
|
|
989
|
+
if (nodeStack.size() > 1) i = nodeStack[nodeStack.size() - 2].targetCell;
|
|
990
|
+
|
|
991
|
+
while (i < numVertices) {
|
|
992
|
+
if (cellSize(i) > 1) return i;
|
|
993
|
+
|
|
994
|
+
++i;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
return -1;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
bool HighsSymmetryDetection::checkStoredAutomorphism(HighsInt vertex) const {
|
|
1001
|
+
HighsInt numCheck = std::min(numAutomorphisms, (HighsInt)64);
|
|
1002
|
+
|
|
1003
|
+
for (HighsInt i = 0; i < numCheck; ++i) {
|
|
1004
|
+
const HighsInt* automorphism = automorphisms.data() + i * numVertices;
|
|
1005
|
+
bool automorphismUseful = true;
|
|
1006
|
+
for (HighsInt j = nodeStack.size() - 2; j >= firstPathDepth; --j) {
|
|
1007
|
+
HighsInt fixPos = vertexPosition[nodeStack[j].lastDistiguished];
|
|
1008
|
+
|
|
1009
|
+
if (automorphism[fixPos] != vertexGroundSet[fixPos]) {
|
|
1010
|
+
automorphismUseful = false;
|
|
1011
|
+
break;
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
if (!automorphismUseful) continue;
|
|
1016
|
+
|
|
1017
|
+
if (automorphism[vertexPosition[vertex]] < vertex) return false;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
return true;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
bool HighsSymmetryDetection::determineNextToDistinguish() {
|
|
1024
|
+
Node& currNode = nodeStack.back();
|
|
1025
|
+
distinguishCands.clear();
|
|
1026
|
+
std::vector<HighsInt>::iterator cellStart;
|
|
1027
|
+
std::vector<HighsInt>::iterator cellEnd;
|
|
1028
|
+
cellStart = currentPartition.begin() + currNode.targetCell;
|
|
1029
|
+
cellEnd =
|
|
1030
|
+
currentPartition.begin() + currentPartitionLinks[currNode.targetCell];
|
|
1031
|
+
|
|
1032
|
+
if (currNode.lastDistiguished == -1) {
|
|
1033
|
+
auto nextDistinguishPos = std::min_element(cellStart, cellEnd);
|
|
1034
|
+
distinguishCands.push_back(&*nextDistinguishPos);
|
|
1035
|
+
} else if ((HighsInt)nodeStack.size() > firstPathDepth) {
|
|
1036
|
+
for (auto i = cellStart; i != cellEnd; ++i) {
|
|
1037
|
+
if (*i > currNode.lastDistiguished && checkStoredAutomorphism(*i))
|
|
1038
|
+
distinguishCands.push_back(&*i);
|
|
1039
|
+
}
|
|
1040
|
+
if (distinguishCands.empty()) return false;
|
|
1041
|
+
auto nextDistinguishPos =
|
|
1042
|
+
std::min_element(distinguishCands.begin(), distinguishCands.end(),
|
|
1043
|
+
[](HighsInt* a, HighsInt* b) { return *a < *b; });
|
|
1044
|
+
std::swap(*distinguishCands.begin(), *nextDistinguishPos);
|
|
1045
|
+
distinguishCands.resize(1);
|
|
1046
|
+
} else {
|
|
1047
|
+
for (auto i = cellStart; i != cellEnd; ++i) {
|
|
1048
|
+
if (*i > currNode.lastDistiguished && vertexGroundSet[getOrbit(*i)] == *i)
|
|
1049
|
+
distinguishCands.push_back(&*i);
|
|
1050
|
+
}
|
|
1051
|
+
if (distinguishCands.empty()) return false;
|
|
1052
|
+
auto nextDistinguishPos =
|
|
1053
|
+
std::min_element(distinguishCands.begin(), distinguishCands.end(),
|
|
1054
|
+
[](HighsInt* a, HighsInt* b) { return *a < *b; });
|
|
1055
|
+
std::swap(*distinguishCands.begin(), *nextDistinguishPos);
|
|
1056
|
+
distinguishCands.resize(1);
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
return true;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
bool HighsSymmetryDetection::distinguishVertex(HighsInt targetCell) {
|
|
1063
|
+
assert(distinguishCands.size() == 1u);
|
|
1064
|
+
HighsInt targetCellEnd = currentPartitionLinks[targetCell];
|
|
1065
|
+
HighsInt newCell = targetCellEnd - 1;
|
|
1066
|
+
std::swap(*distinguishCands[0], currentPartition[newCell]);
|
|
1067
|
+
nodeStack.back().lastDistiguished = currentPartition[newCell];
|
|
1068
|
+
|
|
1069
|
+
if (!splitCell(targetCell, newCell)) return false;
|
|
1070
|
+
|
|
1071
|
+
updateCellMembership(newCell, newCell);
|
|
1072
|
+
|
|
1073
|
+
return true;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
void HighsSymmetryDetection::backtrack(HighsInt backtrackStackNewEnd,
|
|
1077
|
+
HighsInt backtrackStackEnd) {
|
|
1078
|
+
// we assume that we always backtrack from a leaf node, i.e. a discrete
|
|
1079
|
+
// partition therefore we do not need to remember the values of the hash
|
|
1080
|
+
// contributions as it is the indentity for each position and all new cells
|
|
1081
|
+
// are on the cell creation stack.
|
|
1082
|
+
for (HighsInt stackPos = backtrackStackEnd - 1;
|
|
1083
|
+
stackPos >= backtrackStackNewEnd; --stackPos) {
|
|
1084
|
+
HighsInt cell = cellCreationStack[stackPos];
|
|
1085
|
+
// look up the cell start of the preceding cell with link compression
|
|
1086
|
+
HighsInt newStart = getCellStart(cell - 1);
|
|
1087
|
+
// remember the current end
|
|
1088
|
+
HighsInt currEnd = currentPartitionLinks[cell];
|
|
1089
|
+
// change the link to point to the start of the preceding cell
|
|
1090
|
+
currentPartitionLinks[cell] = newStart;
|
|
1091
|
+
// change the link of the start pointer of the preceding cell to point to
|
|
1092
|
+
// the end of this cell
|
|
1093
|
+
currentPartitionLinks[newStart] = currEnd;
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
void HighsSymmetryDetection::cleanupBacktrack(HighsInt cellCreationStackPos) {
|
|
1098
|
+
// the links have been updated. Even though they might still not be fully
|
|
1099
|
+
// compressed the cell starts will all point to the correct cell end and the
|
|
1100
|
+
// lookup with path compression will give the correct start
|
|
1101
|
+
for (HighsInt stackPos = cellCreationStack.size() - 1;
|
|
1102
|
+
stackPos >= cellCreationStackPos; --stackPos) {
|
|
1103
|
+
HighsInt cell = cellCreationStack[stackPos];
|
|
1104
|
+
|
|
1105
|
+
HighsInt cellStart = getCellStart(cell);
|
|
1106
|
+
HighsInt cellEnd = currentPartitionLinks[cellStart];
|
|
1107
|
+
|
|
1108
|
+
for (HighsInt v = cell;
|
|
1109
|
+
v < cellEnd && vertexToCell[currentPartition[v]] == cell; ++v)
|
|
1110
|
+
updateCellMembership(v, cellStart, false);
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
cellCreationStack.resize(cellCreationStackPos);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
HighsInt HighsSymmetryDetection::getCellStart(HighsInt pos) {
|
|
1117
|
+
HighsInt startPos = currentPartitionLinks[pos];
|
|
1118
|
+
if (startPos > pos) return pos;
|
|
1119
|
+
if (currentPartitionLinks[startPos] < startPos) {
|
|
1120
|
+
do {
|
|
1121
|
+
linkCompressionStack.push_back(pos);
|
|
1122
|
+
pos = startPos;
|
|
1123
|
+
startPos = currentPartitionLinks[startPos];
|
|
1124
|
+
} while (currentPartitionLinks[startPos] < startPos);
|
|
1125
|
+
|
|
1126
|
+
do {
|
|
1127
|
+
currentPartitionLinks[linkCompressionStack.back()] = startPos;
|
|
1128
|
+
linkCompressionStack.pop_back();
|
|
1129
|
+
} while (!linkCompressionStack.empty());
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
return startPos;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
void HighsSymmetryDetection::createNode() {
|
|
1136
|
+
nodeStack.emplace_back();
|
|
1137
|
+
nodeStack.back().stackStart = cellCreationStack.size();
|
|
1138
|
+
nodeStack.back().certificateEnd = currNodeCertificate.size();
|
|
1139
|
+
nodeStack.back().targetCell = -1;
|
|
1140
|
+
nodeStack.back().lastDistiguished = -1;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
struct MatrixColumn {
|
|
1144
|
+
uint32_t cost;
|
|
1145
|
+
uint32_t lb;
|
|
1146
|
+
uint32_t ub;
|
|
1147
|
+
uint32_t integral;
|
|
1148
|
+
uint32_t len;
|
|
1149
|
+
|
|
1150
|
+
bool operator==(const MatrixColumn& other) const {
|
|
1151
|
+
return std::memcmp(this, &other, sizeof(MatrixColumn)) == 0;
|
|
1152
|
+
}
|
|
1153
|
+
};
|
|
1154
|
+
|
|
1155
|
+
struct MatrixRow {
|
|
1156
|
+
uint32_t lb;
|
|
1157
|
+
uint32_t ub;
|
|
1158
|
+
uint32_t len;
|
|
1159
|
+
|
|
1160
|
+
bool operator==(const MatrixRow& other) const {
|
|
1161
|
+
return std::memcmp(this, &other, sizeof(MatrixRow)) == 0;
|
|
1162
|
+
}
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1165
|
+
void HighsSymmetryDetection::loadModelAsGraph(const HighsLp& model,
|
|
1166
|
+
double epsilon) {
|
|
1167
|
+
this->model = &model;
|
|
1168
|
+
numCol = model.num_col_;
|
|
1169
|
+
numRow = model.num_row_;
|
|
1170
|
+
numVertices = numRow + numCol;
|
|
1171
|
+
|
|
1172
|
+
cellInRefinementQueue.resize(numVertices);
|
|
1173
|
+
vertexToCell.resize(numVertices);
|
|
1174
|
+
refinementQueue.reserve(numVertices);
|
|
1175
|
+
currNodeCertificate.reserve(numVertices);
|
|
1176
|
+
|
|
1177
|
+
HighsHashTable<MatrixColumn, HighsInt> columnSet;
|
|
1178
|
+
HighsHashTable<MatrixRow, HighsInt> rowSet;
|
|
1179
|
+
HighsMatrixColoring coloring(epsilon);
|
|
1180
|
+
edgeBuffer.resize(numVertices);
|
|
1181
|
+
// set up row and column based incidence matrix
|
|
1182
|
+
HighsInt numNz = model.a_matrix_.index_.size();
|
|
1183
|
+
Gedge.resize(2 * numNz);
|
|
1184
|
+
std::transform(model.a_matrix_.index_.begin(), model.a_matrix_.index_.end(),
|
|
1185
|
+
Gedge.begin(), [&](HighsInt rowIndex) {
|
|
1186
|
+
return std::make_pair(rowIndex + numCol, HighsUInt{0});
|
|
1187
|
+
});
|
|
1188
|
+
|
|
1189
|
+
Gstart.resize(numVertices + 1);
|
|
1190
|
+
std::copy(model.a_matrix_.start_.begin(), model.a_matrix_.start_.end(),
|
|
1191
|
+
Gstart.begin());
|
|
1192
|
+
|
|
1193
|
+
// set up the column colors and count row sizes
|
|
1194
|
+
std::vector<HighsInt> rowSizes(numRow);
|
|
1195
|
+
for (HighsInt i = 0; i < numCol; ++i) {
|
|
1196
|
+
for (HighsInt j = Gstart[i]; j < Gstart[i + 1]; ++j) {
|
|
1197
|
+
Gedge[j].second = coloring.color(model.a_matrix_.value_[j]);
|
|
1198
|
+
rowSizes[model.a_matrix_.index_[j]] += 1;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
// next set up the row starts using the computed row sizes
|
|
1203
|
+
HighsInt offset = numNz;
|
|
1204
|
+
for (HighsInt i = 0; i < numRow; ++i) {
|
|
1205
|
+
Gstart[numCol + i] = offset;
|
|
1206
|
+
offset += rowSizes[i];
|
|
1207
|
+
}
|
|
1208
|
+
Gstart[numCol + numRow] = offset;
|
|
1209
|
+
|
|
1210
|
+
Gend.assign(Gstart.begin() + 1, Gstart.end());
|
|
1211
|
+
|
|
1212
|
+
// finally add the nonzeros to the row major matrix
|
|
1213
|
+
for (HighsInt i = 0; i < numCol; ++i) {
|
|
1214
|
+
for (HighsInt j = Gstart[i]; j < Gstart[i + 1]; ++j) {
|
|
1215
|
+
HighsInt row = model.a_matrix_.index_[j];
|
|
1216
|
+
HighsInt ARpos = Gstart[numCol + row + 1] - rowSizes[row];
|
|
1217
|
+
rowSizes[row] -= 1;
|
|
1218
|
+
Gedge[ARpos].first = i;
|
|
1219
|
+
Gedge[ARpos].second = Gedge[j].second;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
// loop over the columns and assign them a number that is distinct based on
|
|
1224
|
+
// their upper/lower bounds, cost, and integrality status. Use the columnSet
|
|
1225
|
+
// hash table to look up whether a column with similar properties exists and
|
|
1226
|
+
// use the previous number in that case. The number is stored in the
|
|
1227
|
+
// colToCell array which is subsequently used to sort an initial column
|
|
1228
|
+
// permutation.
|
|
1229
|
+
HighsInt indexOffset = numCol + 1;
|
|
1230
|
+
for (HighsInt i = 0; i < numCol; ++i) {
|
|
1231
|
+
MatrixColumn matrixCol;
|
|
1232
|
+
|
|
1233
|
+
matrixCol.cost = coloring.color(model.col_cost_[i]);
|
|
1234
|
+
matrixCol.lb = coloring.color(model.col_lower_[i]);
|
|
1235
|
+
matrixCol.ub = coloring.color(model.col_upper_[i]);
|
|
1236
|
+
matrixCol.integral = (u32)model.integrality_[i];
|
|
1237
|
+
matrixCol.len = Gstart[i + 1] - Gstart[i];
|
|
1238
|
+
|
|
1239
|
+
HighsInt* columnCell = &columnSet[matrixCol];
|
|
1240
|
+
|
|
1241
|
+
if (*columnCell == 0) {
|
|
1242
|
+
*columnCell = columnSet.size();
|
|
1243
|
+
if (model.col_lower_[i] != 0.0 || model.col_upper_[i] != 1.0 ||
|
|
1244
|
+
model.integrality_[i] == HighsVarType::kContinuous)
|
|
1245
|
+
*columnCell += indexOffset;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
vertexToCell[i] = *columnCell;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
indexOffset = 2 * numCol + 1;
|
|
1252
|
+
for (HighsInt i = 0; i < numRow; ++i) {
|
|
1253
|
+
MatrixRow matrixRow;
|
|
1254
|
+
|
|
1255
|
+
matrixRow.lb = coloring.color(model.row_lower_[i]);
|
|
1256
|
+
matrixRow.ub = coloring.color(model.row_upper_[i]);
|
|
1257
|
+
matrixRow.len = Gstart[numCol + i + 1] - Gstart[numCol + i];
|
|
1258
|
+
|
|
1259
|
+
HighsInt* rowCell = &rowSet[matrixRow];
|
|
1260
|
+
|
|
1261
|
+
if (*rowCell == 0) *rowCell = rowSet.size();
|
|
1262
|
+
|
|
1263
|
+
vertexToCell[numCol + i] = indexOffset + *rowCell;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
// set up the initial partition array, sort by the colToCell value
|
|
1267
|
+
// assigned above
|
|
1268
|
+
currentPartition.resize(numVertices);
|
|
1269
|
+
std::iota(currentPartition.begin(), currentPartition.end(), 0);
|
|
1270
|
+
pdqsort(currentPartition.begin(), currentPartition.end(),
|
|
1271
|
+
[&](HighsInt v1, HighsInt v2) {
|
|
1272
|
+
return vertexToCell[v1] < vertexToCell[v2];
|
|
1273
|
+
});
|
|
1274
|
+
|
|
1275
|
+
// now set up partition links and correct the colToCell array to the
|
|
1276
|
+
// correct cell index
|
|
1277
|
+
currentPartitionLinks.resize(numVertices);
|
|
1278
|
+
HighsInt cellStart = 0;
|
|
1279
|
+
HighsInt cellNumber = 0;
|
|
1280
|
+
for (HighsInt i = 0; i < numVertices; ++i) {
|
|
1281
|
+
HighsInt vertex = currentPartition[i];
|
|
1282
|
+
// if the cell number is different to the current cell number this is the
|
|
1283
|
+
// start of a new cell
|
|
1284
|
+
if (cellNumber != vertexToCell[vertex]) {
|
|
1285
|
+
// remember the number of this cell to identify its end
|
|
1286
|
+
cellNumber = vertexToCell[vertex];
|
|
1287
|
+
// set the link of the cell start to point to its end
|
|
1288
|
+
currentPartitionLinks[cellStart] = i;
|
|
1289
|
+
// remember start of this cell
|
|
1290
|
+
cellStart = i;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
// correct the colToCell array to not store the start index of the
|
|
1294
|
+
// cell, not its number
|
|
1295
|
+
vertexToCell[vertex] = cellStart;
|
|
1296
|
+
// set the link of the column to the cellStart
|
|
1297
|
+
currentPartitionLinks[i] = cellStart;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
// set the column partition link of the last started cell to point past the
|
|
1301
|
+
// end
|
|
1302
|
+
currentPartitionLinks[cellStart] = numVertices;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
HighsHashTable<std::tuple<HighsInt, HighsInt, HighsUInt>>
|
|
1306
|
+
HighsSymmetryDetection::dumpCurrentGraph() {
|
|
1307
|
+
HighsHashTable<std::tuple<HighsInt, HighsInt, HighsUInt>> graphTriplets;
|
|
1308
|
+
|
|
1309
|
+
for (HighsInt i = 0; i < numCol; ++i) {
|
|
1310
|
+
HighsInt colCell = vertexToCell[i];
|
|
1311
|
+
for (HighsInt j = Gstart[i]; j != Gend[i]; ++j)
|
|
1312
|
+
graphTriplets.insert(vertexToCell[Gedge[j].first], colCell,
|
|
1313
|
+
Gedge[j].second);
|
|
1314
|
+
for (HighsInt j = Gend[i]; j != Gstart[i + 1]; ++j)
|
|
1315
|
+
graphTriplets.insert(Gedge[j].first, colCell, Gedge[j].second);
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
return graphTriplets;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
void HighsSymmetryDetection::switchToNextNode(HighsInt backtrackDepth) {
|
|
1322
|
+
HighsInt stackEnd = cellCreationStack.size();
|
|
1323
|
+
// we need to backtrack the datastructures
|
|
1324
|
+
nodeStack.resize(backtrackDepth);
|
|
1325
|
+
if (backtrackDepth == 0) return;
|
|
1326
|
+
do {
|
|
1327
|
+
Node& currNode = nodeStack.back();
|
|
1328
|
+
backtrack(currNode.stackStart, stackEnd);
|
|
1329
|
+
stackEnd = currNode.stackStart;
|
|
1330
|
+
firstPathDepth = std::min((HighsInt)nodeStack.size(), firstPathDepth);
|
|
1331
|
+
bestPathDepth = std::min((HighsInt)nodeStack.size(), bestPathDepth);
|
|
1332
|
+
firstLeavePrefixLen =
|
|
1333
|
+
std::min(currNode.certificateEnd, firstLeavePrefixLen);
|
|
1334
|
+
bestLeavePrefixLen = std::min(currNode.certificateEnd, bestLeavePrefixLen);
|
|
1335
|
+
currNodeCertificate.resize(currNode.certificateEnd);
|
|
1336
|
+
if (!determineNextToDistinguish()) {
|
|
1337
|
+
nodeStack.pop_back();
|
|
1338
|
+
continue;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
// call cleanup backtrack with the final stackEnd
|
|
1342
|
+
// so that all hashes are up to date and the link arrays do not contain
|
|
1343
|
+
// chains anymore
|
|
1344
|
+
cleanupBacktrack(stackEnd);
|
|
1345
|
+
HighsInt targetCell = currNode.targetCell;
|
|
1346
|
+
|
|
1347
|
+
if (!distinguishVertex(targetCell)) {
|
|
1348
|
+
// if distinguishing the next vertex fails, it means that its certificate
|
|
1349
|
+
// value is lexicographically larger than that of the best leave
|
|
1350
|
+
nodeStack.pop_back();
|
|
1351
|
+
continue;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
if (!partitionRefinement()) {
|
|
1355
|
+
stackEnd = cellCreationStack.size();
|
|
1356
|
+
continue;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
createNode();
|
|
1360
|
+
break;
|
|
1361
|
+
} while (!nodeStack.empty());
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
bool HighsSymmetryDetection::compareCurrentGraph(
|
|
1365
|
+
const HighsHashTable<std::tuple<HighsInt, HighsInt, HighsUInt>>& otherGraph,
|
|
1366
|
+
HighsInt& wrongCell) const {
|
|
1367
|
+
for (HighsInt i = 0; i < numCol; ++i) {
|
|
1368
|
+
HighsInt colCell = vertexToCell[i];
|
|
1369
|
+
|
|
1370
|
+
for (HighsInt j = Gstart[i]; j != Gend[i]; ++j)
|
|
1371
|
+
if (!otherGraph.find(std::make_tuple(vertexToCell[Gedge[j].first],
|
|
1372
|
+
colCell, Gedge[j].second))) {
|
|
1373
|
+
// return which cell does not match in its neighbourhood as this should
|
|
1374
|
+
// have been detected with the hashing it can very rarely happen due to
|
|
1375
|
+
// a hash collision. In such a case we want to backtrack to the last
|
|
1376
|
+
// time where we targeted this particular cell. Otherwise we could spent
|
|
1377
|
+
// a long time searching for a matching leave value until every
|
|
1378
|
+
// combination is exhausted and for each leave in this subtree the graph
|
|
1379
|
+
// comparison will fail on this edge.
|
|
1380
|
+
wrongCell = colCell;
|
|
1381
|
+
return false;
|
|
1382
|
+
}
|
|
1383
|
+
for (HighsInt j = Gend[i]; j != Gstart[i + 1]; ++j)
|
|
1384
|
+
if (!otherGraph.find(
|
|
1385
|
+
std::make_tuple(Gedge[j].first, colCell, Gedge[j].second))) {
|
|
1386
|
+
wrongCell = colCell;
|
|
1387
|
+
return false;
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
return true;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
bool HighsSymmetryDetection::isFromBinaryColumn(HighsInt pos) const {
|
|
1395
|
+
if (pos >= numActiveCols) return false;
|
|
1396
|
+
|
|
1397
|
+
HighsInt col = currentPartition[pos];
|
|
1398
|
+
|
|
1399
|
+
if (model->col_lower_[col] != 0.0 || model->col_upper_[col] != 1.0 ||
|
|
1400
|
+
model->integrality_[col] == HighsVarType::kContinuous)
|
|
1401
|
+
return false;
|
|
1402
|
+
|
|
1403
|
+
return true;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
HighsSymmetryDetection::ComponentData
|
|
1407
|
+
HighsSymmetryDetection::computeComponentData(
|
|
1408
|
+
const HighsSymmetries& symmetries) {
|
|
1409
|
+
ComponentData componentData;
|
|
1410
|
+
|
|
1411
|
+
componentData.components.reset(numActiveCols);
|
|
1412
|
+
componentData.firstUnfixed.assign(symmetries.numPerms, -1);
|
|
1413
|
+
componentData.numUnfixed.assign(symmetries.numPerms, 0);
|
|
1414
|
+
for (HighsInt i = 0; i < symmetries.numPerms; ++i) {
|
|
1415
|
+
const HighsInt* perm = symmetries.permutations.data() + i * numActiveCols;
|
|
1416
|
+
|
|
1417
|
+
for (HighsInt j = 0; j < numActiveCols; ++j) {
|
|
1418
|
+
if (perm[j] != vertexGroundSet[j]) {
|
|
1419
|
+
HighsInt pos = vertexPosition[perm[j]];
|
|
1420
|
+
componentData.numUnfixed[i] += 1;
|
|
1421
|
+
if (componentData.firstUnfixed[i] != -1)
|
|
1422
|
+
componentData.components.merge(componentData.firstUnfixed[i], pos);
|
|
1423
|
+
else
|
|
1424
|
+
componentData.firstUnfixed[i] = pos;
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
componentData.componentSets.assign(vertexGroundSet.begin(),
|
|
1430
|
+
vertexGroundSet.begin() + numActiveCols);
|
|
1431
|
+
pdqsort(componentData.componentSets.begin(),
|
|
1432
|
+
componentData.componentSets.end(), [&](HighsInt u, HighsInt v) {
|
|
1433
|
+
HighsInt uComp = componentData.components.getSet(vertexPosition[u]);
|
|
1434
|
+
HighsInt vComp = componentData.components.getSet(vertexPosition[v]);
|
|
1435
|
+
return std::make_pair(
|
|
1436
|
+
componentData.components.getSetSize(uComp) == 1, uComp) <
|
|
1437
|
+
std::make_pair(
|
|
1438
|
+
componentData.components.getSetSize(vComp) == 1, vComp);
|
|
1439
|
+
});
|
|
1440
|
+
|
|
1441
|
+
HighsInt currentComponentStart = -1;
|
|
1442
|
+
HighsInt currentComponent = -1;
|
|
1443
|
+
HighsHashTable<HighsInt> currComponentOrbits;
|
|
1444
|
+
for (HighsInt i = 0; i < numActiveCols; ++i) {
|
|
1445
|
+
HighsInt comp = componentData.components.getSet(
|
|
1446
|
+
vertexPosition[componentData.componentSets[i]]);
|
|
1447
|
+
if (componentData.components.getSetSize(comp) == 1) break;
|
|
1448
|
+
if (comp != currentComponent) {
|
|
1449
|
+
currentComponent = comp;
|
|
1450
|
+
currentComponentStart = i;
|
|
1451
|
+
componentData.componentStarts.push_back(currentComponentStart);
|
|
1452
|
+
componentData.componentNumber.push_back(currentComponent);
|
|
1453
|
+
componentData.componentNumOrbits.emplace_back();
|
|
1454
|
+
currComponentOrbits.clear();
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
if (currComponentOrbits.insert(getOrbit(componentData.componentSets[i]))) {
|
|
1458
|
+
++componentData.componentNumOrbits.back();
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
componentData.permComponents.reserve(symmetries.numPerms);
|
|
1463
|
+
|
|
1464
|
+
for (HighsInt i = 0; i < symmetries.numPerms; ++i) {
|
|
1465
|
+
if (componentData.firstUnfixed[i] == -1) continue;
|
|
1466
|
+
componentData.permComponents.push_back(i);
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
pdqsort(componentData.permComponents.begin(),
|
|
1470
|
+
componentData.permComponents.end(), [&](HighsInt i, HighsInt j) {
|
|
1471
|
+
HighsInt seti =
|
|
1472
|
+
componentData.components.getSet(componentData.firstUnfixed[i]);
|
|
1473
|
+
HighsInt setj =
|
|
1474
|
+
componentData.components.getSet(componentData.firstUnfixed[j]);
|
|
1475
|
+
return std::make_pair(seti, componentData.numUnfixed[i]) <
|
|
1476
|
+
std::make_pair(setj, componentData.numUnfixed[j]);
|
|
1477
|
+
});
|
|
1478
|
+
|
|
1479
|
+
currentComponentStart = -1;
|
|
1480
|
+
currentComponent = -1;
|
|
1481
|
+
|
|
1482
|
+
HighsInt numUsedPerms = componentData.permComponents.size();
|
|
1483
|
+
|
|
1484
|
+
for (HighsInt i = 0; i < numUsedPerms; ++i) {
|
|
1485
|
+
HighsInt p = componentData.permComponents[i];
|
|
1486
|
+
HighsInt comp =
|
|
1487
|
+
componentData.components.getSet(componentData.firstUnfixed[p]);
|
|
1488
|
+
if (comp != currentComponent) {
|
|
1489
|
+
currentComponent = comp;
|
|
1490
|
+
currentComponentStart = i;
|
|
1491
|
+
componentData.permComponentStarts.push_back(currentComponentStart);
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
assert(componentData.permComponentStarts.size() ==
|
|
1496
|
+
componentData.componentStarts.size());
|
|
1497
|
+
componentData.permComponentStarts.push_back(numUsedPerms);
|
|
1498
|
+
|
|
1499
|
+
// HighsInt numComponents = componentData.componentStarts.size();
|
|
1500
|
+
// printf("found %d components\n", numComponents);
|
|
1501
|
+
componentData.componentStarts.push_back(numActiveCols);
|
|
1502
|
+
|
|
1503
|
+
return componentData;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
bool HighsSymmetryDetection::isFullOrbitope(const ComponentData& componentData,
|
|
1507
|
+
HighsInt component,
|
|
1508
|
+
HighsSymmetries& symmetries) {
|
|
1509
|
+
HighsInt componentSize = componentData.componentStarts[component + 1] -
|
|
1510
|
+
componentData.componentStarts[component];
|
|
1511
|
+
if (componentSize == 1) return false;
|
|
1512
|
+
|
|
1513
|
+
// check that component acts only on binary variables
|
|
1514
|
+
for (HighsInt i = componentData.componentStarts[component];
|
|
1515
|
+
i < componentData.componentStarts[component + 1]; ++i) {
|
|
1516
|
+
HighsInt col = componentData.componentSets[i];
|
|
1517
|
+
if (model->integrality_[col] == HighsVarType::kContinuous ||
|
|
1518
|
+
model->col_lower_[col] != 0.0 || model->col_upper_[col] != 1.0)
|
|
1519
|
+
return false;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
// check that the number of unfixed variables in the first permutation is even
|
|
1523
|
+
HighsInt p0 =
|
|
1524
|
+
componentData
|
|
1525
|
+
.permComponents[componentData.permComponentStarts[component]];
|
|
1526
|
+
if (componentData.numUnfixed[p0] & 1) return false;
|
|
1527
|
+
|
|
1528
|
+
// check that the other permutations in the component have the same number of
|
|
1529
|
+
// unfixed variables as the first one
|
|
1530
|
+
for (HighsInt k = componentData.permComponentStarts[component] + 1;
|
|
1531
|
+
k < componentData.permComponentStarts[component + 1]; ++k) {
|
|
1532
|
+
HighsInt p = componentData.permComponents[k];
|
|
1533
|
+
if (componentData.numUnfixed[p] != componentData.numUnfixed[p0]) {
|
|
1534
|
+
// printf("number of unfixed cols in perm %d: %d\n", p,
|
|
1535
|
+
// componentData.numUnfixed[p]);
|
|
1536
|
+
// printf("wrong number of unfixed columns in permutation\n");
|
|
1537
|
+
return false;
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
// all unfixed variables in the permutation must be part of a two cycle
|
|
1542
|
+
// and each two cycle defines one row of the orbitope. Hence the number
|
|
1543
|
+
// of unfixed variables in each permutation must be even and the number of
|
|
1544
|
+
// rows is the number of unfixed variables divided by two
|
|
1545
|
+
HighsInt orbitopeNumRows = componentData.numUnfixed[p0] >> 1;
|
|
1546
|
+
|
|
1547
|
+
// if this component is a full orbitope the component size must be
|
|
1548
|
+
// divisible by the number of orbits and the result is the size of each
|
|
1549
|
+
// orbit
|
|
1550
|
+
HighsInt orbitopeOrbitSize = componentSize / orbitopeNumRows;
|
|
1551
|
+
if (orbitopeOrbitSize * orbitopeNumRows != componentSize) {
|
|
1552
|
+
// printf("wrong number of orbits (%d orbits for component of size %d)\n",
|
|
1553
|
+
// orbitopeNumRows, componentSize);
|
|
1554
|
+
return false;
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
// the number of permutations must be n-1 where n is the size of the
|
|
1558
|
+
// orbits in the orbitope
|
|
1559
|
+
HighsInt componentNumPerms =
|
|
1560
|
+
componentData.permComponentStarts[component + 1] -
|
|
1561
|
+
componentData.permComponentStarts[component];
|
|
1562
|
+
if (componentNumPerms != (orbitopeOrbitSize - 1)) {
|
|
1563
|
+
// printf("wrong number of perms\n");
|
|
1564
|
+
return false;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
// set up the first two columns of the orbitope matrix based on the first
|
|
1568
|
+
// permutation.
|
|
1569
|
+
HighsOrbitopeMatrix orbitopeMatrix;
|
|
1570
|
+
orbitopeMatrix.matrix.resize(componentSize, -1);
|
|
1571
|
+
orbitopeMatrix.numRows = orbitopeNumRows;
|
|
1572
|
+
orbitopeMatrix.rowLength = orbitopeOrbitSize;
|
|
1573
|
+
assert(componentSize == orbitopeMatrix.numRows * orbitopeMatrix.rowLength);
|
|
1574
|
+
|
|
1575
|
+
const HighsInt* perm = symmetries.permutations.data() + p0 * numActiveCols;
|
|
1576
|
+
HighsHashTable<HighsInt> colSet;
|
|
1577
|
+
HighsInt m = 0;
|
|
1578
|
+
for (HighsInt j = 0; j < numActiveCols; ++j) {
|
|
1579
|
+
HighsInt jImagePos = vertexPosition[perm[j]];
|
|
1580
|
+
if (jImagePos <= j) continue;
|
|
1581
|
+
if (m == orbitopeNumRows) return false;
|
|
1582
|
+
|
|
1583
|
+
// permutation should consist of two cycles
|
|
1584
|
+
if (perm[jImagePos] != vertexGroundSet[j]) return false;
|
|
1585
|
+
|
|
1586
|
+
orbitopeMatrix.matrix[m] = vertexGroundSet[j];
|
|
1587
|
+
orbitopeMatrix.matrix[orbitopeMatrix.numRows + m] = perm[j];
|
|
1588
|
+
|
|
1589
|
+
// Remember set of variables of the orbtiope matrix. Each variable should
|
|
1590
|
+
// occur only once, otherwise the permutation do not work out. Since we
|
|
1591
|
+
|
|
1592
|
+
if (!colSet.insert(vertexGroundSet[j])) return false;
|
|
1593
|
+
if (!colSet.insert(perm[j])) return false;
|
|
1594
|
+
++m;
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
// printf("set up first two columns of possible orbitope with permutation
|
|
1598
|
+
// %d\n",
|
|
1599
|
+
// p0);
|
|
1600
|
+
|
|
1601
|
+
HighsInt numColsAdded = 2;
|
|
1602
|
+
bool triedLeftExtension = false;
|
|
1603
|
+
|
|
1604
|
+
while (numColsAdded < orbitopeMatrix.rowLength) {
|
|
1605
|
+
if (colSet.size() != numColsAdded * orbitopeMatrix.numRows) return false;
|
|
1606
|
+
|
|
1607
|
+
HighsInt* thisCol = &orbitopeMatrix(0, numColsAdded);
|
|
1608
|
+
HighsInt* prevCol = &orbitopeMatrix(0, numColsAdded - 1);
|
|
1609
|
+
|
|
1610
|
+
bool foundCand = false;
|
|
1611
|
+
|
|
1612
|
+
while (true) {
|
|
1613
|
+
HighsInt movePos = vertexPosition[prevCol[0]];
|
|
1614
|
+
perm = nullptr;
|
|
1615
|
+
|
|
1616
|
+
for (HighsInt k = componentData.permComponentStarts[component] + 1;
|
|
1617
|
+
k < componentData.permComponentStarts[component + 1]; ++k) {
|
|
1618
|
+
HighsInt p = componentData.permComponents[k];
|
|
1619
|
+
perm = symmetries.permutations.data() + p * numActiveCols;
|
|
1620
|
+
|
|
1621
|
+
if (perm[movePos] != vertexGroundSet[movePos] &&
|
|
1622
|
+
!colSet.find(perm[movePos])) {
|
|
1623
|
+
foundCand = true;
|
|
1624
|
+
break;
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
if (!foundCand && !triedLeftExtension) {
|
|
1629
|
+
// if we fail to find a permutation extending the last column directly
|
|
1630
|
+
// after we set up the first two columns we might try to extend column
|
|
1631
|
+
// zero instead of the previous one
|
|
1632
|
+
prevCol = &orbitopeMatrix(0, 0);
|
|
1633
|
+
triedLeftExtension = true;
|
|
1634
|
+
continue;
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
break;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
if (!foundCand) {
|
|
1641
|
+
// printf("did not find next permutation moving col %d\n", prevCol[0]);
|
|
1642
|
+
return false;
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
for (HighsInt j = 0; j < orbitopeMatrix.numRows; ++j) {
|
|
1646
|
+
HighsInt nextVertex = perm[vertexPosition[prevCol[j]]];
|
|
1647
|
+
|
|
1648
|
+
thisCol[j] = nextVertex;
|
|
1649
|
+
|
|
1650
|
+
// check if this is a two cycle
|
|
1651
|
+
if (perm[vertexPosition[nextVertex]] != prevCol[j]) return false;
|
|
1652
|
+
|
|
1653
|
+
if (!colSet.insert(thisCol[j])) {
|
|
1654
|
+
// printf("col already exists\n");
|
|
1655
|
+
return false;
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
++numColsAdded;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
if (colSet.size() != componentSize) {
|
|
1663
|
+
// printf("not all columns of component are mapped\n");
|
|
1664
|
+
return false;
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
for (HighsInt col : orbitopeMatrix.matrix)
|
|
1668
|
+
symmetries.columnToOrbitope.insert(col, symmetries.orbitopes.size());
|
|
1669
|
+
|
|
1670
|
+
symmetries.orbitopes.emplace_back(std::move(orbitopeMatrix));
|
|
1671
|
+
|
|
1672
|
+
// printf("component %d is full orbitope: size %d and %d orbits\n", component,
|
|
1673
|
+
// componentSize, componentData.componentNumOrbits[component]);
|
|
1674
|
+
return true;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
bool HighsSymmetryDetection::initializeDetection() {
|
|
1678
|
+
initializeHashValues();
|
|
1679
|
+
partitionRefinement();
|
|
1680
|
+
removeFixPoints();
|
|
1681
|
+
if (numActiveCols == 0) return false;
|
|
1682
|
+
return true;
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
void HighsSymmetryDetection::run(HighsSymmetries& symmetries) {
|
|
1686
|
+
assert(numActiveCols != 0);
|
|
1687
|
+
initializeGroundSet();
|
|
1688
|
+
currNodeCertificate.clear();
|
|
1689
|
+
cellCreationStack.clear();
|
|
1690
|
+
createNode();
|
|
1691
|
+
HighsInt maxPerms = 64000000 / numActiveCols;
|
|
1692
|
+
HighsSplitDeque* workerDeque = HighsTaskExecutor::getThisWorkerDeque();
|
|
1693
|
+
while (!nodeStack.empty()) {
|
|
1694
|
+
HighsInt targetCell = selectTargetCell();
|
|
1695
|
+
if (targetCell == -1) {
|
|
1696
|
+
if (firstLeavePartition.empty()) {
|
|
1697
|
+
firstLeavePartition = currentPartition;
|
|
1698
|
+
firstLeaveCertificate = currNodeCertificate;
|
|
1699
|
+
bestLeaveCertificate = currNodeCertificate;
|
|
1700
|
+
firstLeaveGraph = dumpCurrentGraph();
|
|
1701
|
+
firstPathDepth = nodeStack.size();
|
|
1702
|
+
bestPathDepth = nodeStack.size();
|
|
1703
|
+
firstLeavePrefixLen = currNodeCertificate.size();
|
|
1704
|
+
bestLeavePrefixLen = currNodeCertificate.size();
|
|
1705
|
+
|
|
1706
|
+
HighsInt backtrackDepth = firstPathDepth - 1;
|
|
1707
|
+
while (backtrackDepth > 0 &&
|
|
1708
|
+
!isFromBinaryColumn(nodeStack[backtrackDepth - 1].targetCell))
|
|
1709
|
+
--backtrackDepth;
|
|
1710
|
+
switchToNextNode(backtrackDepth);
|
|
1711
|
+
} else {
|
|
1712
|
+
HighsInt wrongCell = -1;
|
|
1713
|
+
HighsInt backtrackDepth = nodeStack.size() - 1;
|
|
1714
|
+
assert(currNodeCertificate.size() == firstLeaveCertificate.size());
|
|
1715
|
+
if (firstLeavePrefixLen == (HighsInt)currNodeCertificate.size() ||
|
|
1716
|
+
bestLeavePrefixLen == (HighsInt)currNodeCertificate.size()) {
|
|
1717
|
+
if (firstLeavePrefixLen == (HighsInt)currNodeCertificate.size() &&
|
|
1718
|
+
compareCurrentGraph(firstLeaveGraph, wrongCell)) {
|
|
1719
|
+
HighsInt k = (numAutomorphisms++) & 63;
|
|
1720
|
+
HighsInt* permutation = automorphisms.data() + k * numVertices;
|
|
1721
|
+
for (HighsInt i = 0; i < numVertices; ++i) {
|
|
1722
|
+
HighsInt firstLeaveCol = firstLeavePartition[i];
|
|
1723
|
+
permutation[vertexPosition[currentPartition[i]]] = firstLeaveCol;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
bool report = false;
|
|
1727
|
+
for (HighsInt i = 0; i < numVertices; ++i) {
|
|
1728
|
+
if (mergeOrbits(permutation[i], vertexGroundSet[i]) &&
|
|
1729
|
+
i < numActiveCols) {
|
|
1730
|
+
assert(permutation[i] < numCol);
|
|
1731
|
+
report = true;
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
if (report) {
|
|
1736
|
+
symmetries.permutations.insert(symmetries.permutations.end(),
|
|
1737
|
+
permutation,
|
|
1738
|
+
permutation + numActiveCols);
|
|
1739
|
+
++symmetries.numPerms;
|
|
1740
|
+
if (symmetries.numPerms == maxPerms) break;
|
|
1741
|
+
}
|
|
1742
|
+
backtrackDepth = std::min(backtrackDepth, firstPathDepth);
|
|
1743
|
+
} else if (!bestLeavePartition.empty() &&
|
|
1744
|
+
bestLeavePrefixLen ==
|
|
1745
|
+
(HighsInt)currNodeCertificate.size() &&
|
|
1746
|
+
compareCurrentGraph(bestLeaveGraph, wrongCell)) {
|
|
1747
|
+
HighsInt k = (numAutomorphisms++) & 63;
|
|
1748
|
+
HighsInt* permutation = automorphisms.data() + k * numVertices;
|
|
1749
|
+
for (HighsInt i = 0; i < numVertices; ++i) {
|
|
1750
|
+
HighsInt bestLeaveCol = bestLeavePartition[i];
|
|
1751
|
+
permutation[vertexPosition[currentPartition[i]]] = bestLeaveCol;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
bool report = false;
|
|
1755
|
+
for (HighsInt i = 0; i < numVertices; ++i) {
|
|
1756
|
+
if (mergeOrbits(permutation[i], vertexGroundSet[i]) &&
|
|
1757
|
+
i < numActiveCols) {
|
|
1758
|
+
assert(permutation[i] < numCol);
|
|
1759
|
+
report = true;
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
if (report) {
|
|
1764
|
+
symmetries.permutations.insert(symmetries.permutations.end(),
|
|
1765
|
+
permutation,
|
|
1766
|
+
permutation + numActiveCols);
|
|
1767
|
+
++symmetries.numPerms;
|
|
1768
|
+
if (symmetries.numPerms == maxPerms) break;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
backtrackDepth = std::min(backtrackDepth, bestPathDepth);
|
|
1772
|
+
} else if (bestLeavePrefixLen <
|
|
1773
|
+
(HighsInt)currNodeCertificate.size() &&
|
|
1774
|
+
currNodeCertificate[bestLeavePrefixLen] >
|
|
1775
|
+
bestLeaveCertificate[bestLeavePrefixLen]) {
|
|
1776
|
+
// certificate value is lexicographically above the smallest one
|
|
1777
|
+
// seen so far, so we might be able to backtrack to a higher level
|
|
1778
|
+
HighsInt possibleBacktrackDepth = firstPathDepth - 1;
|
|
1779
|
+
while (nodeStack[possibleBacktrackDepth].certificateEnd <=
|
|
1780
|
+
bestLeavePrefixLen)
|
|
1781
|
+
++possibleBacktrackDepth;
|
|
1782
|
+
|
|
1783
|
+
backtrackDepth = std::min(possibleBacktrackDepth, backtrackDepth);
|
|
1784
|
+
} else {
|
|
1785
|
+
// This case can be caused by a hash collision which was now
|
|
1786
|
+
// detected in the graph comparison call. The graph comparison call
|
|
1787
|
+
// will return the cell where the vertex neighbourhood caused a
|
|
1788
|
+
// mismatch on the edges. This would have been detected by
|
|
1789
|
+
// an exact partition refinement when we targeted that cell the last
|
|
1790
|
+
// time, so that is where we can backtrack to.
|
|
1791
|
+
HighsInt possibleBacktrackDepth;
|
|
1792
|
+
for (possibleBacktrackDepth = backtrackDepth;
|
|
1793
|
+
possibleBacktrackDepth >= 0; --possibleBacktrackDepth) {
|
|
1794
|
+
if (nodeStack[possibleBacktrackDepth].targetCell == wrongCell) {
|
|
1795
|
+
backtrackDepth = possibleBacktrackDepth;
|
|
1796
|
+
break;
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
} else {
|
|
1801
|
+
// leave must have a lexicographically smaller certificate value
|
|
1802
|
+
// than the current best leave, because its prefix length is smaller
|
|
1803
|
+
// than the best leaves and it would have been already pruned if
|
|
1804
|
+
// it's certificate value was larger unless it is equal to the first
|
|
1805
|
+
// leaf nodes certificate value which is caught by the first case
|
|
1806
|
+
// of the if condition. Hence, having a lexicographically smaller
|
|
1807
|
+
// certificate value than the best leave is the only way to get
|
|
1808
|
+
// here.
|
|
1809
|
+
assert(bestLeaveCertificate[bestLeavePrefixLen] >
|
|
1810
|
+
currNodeCertificate[bestLeavePrefixLen] &&
|
|
1811
|
+
std::memcmp(bestLeaveCertificate.data(),
|
|
1812
|
+
currNodeCertificate.data(),
|
|
1813
|
+
bestLeavePrefixLen * sizeof(u32)) == 0);
|
|
1814
|
+
bestLeaveCertificate = currNodeCertificate;
|
|
1815
|
+
bestLeaveGraph = dumpCurrentGraph();
|
|
1816
|
+
bestLeavePartition = currentPartition;
|
|
1817
|
+
bestPathDepth = nodeStack.size();
|
|
1818
|
+
bestLeavePrefixLen = currNodeCertificate.size();
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
switchToNextNode(backtrackDepth);
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
workerDeque->checkInterrupt();
|
|
1825
|
+
} else {
|
|
1826
|
+
Node& currNode = nodeStack.back();
|
|
1827
|
+
currNode.targetCell = targetCell;
|
|
1828
|
+
bool success = determineNextToDistinguish();
|
|
1829
|
+
assert(success);
|
|
1830
|
+
if (!distinguishVertex(targetCell)) {
|
|
1831
|
+
switchToNextNode(nodeStack.size() - 1);
|
|
1832
|
+
continue;
|
|
1833
|
+
}
|
|
1834
|
+
if (!partitionRefinement()) {
|
|
1835
|
+
switchToNextNode(nodeStack.size());
|
|
1836
|
+
continue;
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
createNode();
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
symmetries.numGenerators = symmetries.numPerms;
|
|
1844
|
+
if (symmetries.numPerms > 0) {
|
|
1845
|
+
vertexPosition.resize(numCol);
|
|
1846
|
+
|
|
1847
|
+
ComponentData componentData = computeComponentData(symmetries);
|
|
1848
|
+
HighsInt numComponents = componentData.numComponents();
|
|
1849
|
+
|
|
1850
|
+
for (HighsInt i = 0; i < numComponents; ++i) {
|
|
1851
|
+
if (componentData.componentSize(i) == 1) continue;
|
|
1852
|
+
|
|
1853
|
+
isFullOrbitope(componentData, i, symmetries);
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
HighsHashTable<HighsInt> deletedPerms;
|
|
1857
|
+
for (HighsInt p = 0; p < symmetries.numPerms; ++p) {
|
|
1858
|
+
HighsInt* perm = symmetries.permutations.data() + p * numActiveCols;
|
|
1859
|
+
for (HighsInt i = 0; i < numActiveCols; ++i) {
|
|
1860
|
+
if (perm[i] != vertexGroundSet[i] &&
|
|
1861
|
+
symmetries.columnToOrbitope.find(perm[i])) {
|
|
1862
|
+
deletedPerms.insert(p);
|
|
1863
|
+
break;
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
// check which columns have non-trivial orbits
|
|
1869
|
+
HighsInt numFixed = 0;
|
|
1870
|
+
for (HighsInt i = 0; i < numActiveCols; ++i) {
|
|
1871
|
+
if (orbitSize[getOrbit(vertexGroundSet[i])] == 1 ||
|
|
1872
|
+
symmetries.columnToOrbitope.find(vertexGroundSet[i])) {
|
|
1873
|
+
vertexPosition[vertexGroundSet[i]] = -1;
|
|
1874
|
+
vertexGroundSet[i] = -1;
|
|
1875
|
+
numFixed += 1;
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
if (numFixed != 0) {
|
|
1880
|
+
// now compress symmetries and the groundset to only contain the unfixed
|
|
1881
|
+
// columns and columns not handled by full orbitopes
|
|
1882
|
+
HighsInt p = 0;
|
|
1883
|
+
HighsInt* perms = symmetries.permutations.data();
|
|
1884
|
+
HighsInt* permEnd =
|
|
1885
|
+
symmetries.permutations.data() + symmetries.numPerms * numActiveCols;
|
|
1886
|
+
HighsInt* permOutput = symmetries.permutations.data();
|
|
1887
|
+
while (perms != permEnd) {
|
|
1888
|
+
if (!deletedPerms.find(p)) {
|
|
1889
|
+
for (HighsInt i = 0; i < numActiveCols; ++i) {
|
|
1890
|
+
if (vertexGroundSet[i] == -1) continue;
|
|
1891
|
+
|
|
1892
|
+
*permOutput = perms[i];
|
|
1893
|
+
++permOutput;
|
|
1894
|
+
}
|
|
1895
|
+
} else {
|
|
1896
|
+
--symmetries.numPerms;
|
|
1897
|
+
}
|
|
1898
|
+
perms += numActiveCols;
|
|
1899
|
+
++p;
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
HighsInt outPos = 0;
|
|
1903
|
+
for (HighsInt i = 0; i < numActiveCols; ++i) {
|
|
1904
|
+
if (vertexGroundSet[i] == -1) continue;
|
|
1905
|
+
|
|
1906
|
+
vertexGroundSet[outPos] = vertexGroundSet[i];
|
|
1907
|
+
vertexPosition[vertexGroundSet[outPos]] = outPos;
|
|
1908
|
+
outPos += 1;
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
numActiveCols -= numFixed;
|
|
1912
|
+
assert(permOutput == symmetries.permutations.data() +
|
|
1913
|
+
symmetries.numPerms * numActiveCols);
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
vertexGroundSet.resize(numActiveCols);
|
|
1917
|
+
symmetries.permutationColumns = std::move(vertexGroundSet);
|
|
1918
|
+
symmetries.columnPosition = std::move(vertexPosition);
|
|
1919
|
+
symmetries.permutations.resize(symmetries.numPerms * numActiveCols);
|
|
1920
|
+
}
|
|
1921
|
+
}
|