lpsolver 0.1.0 → 0.2.0
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 +70 -26
- data/ext/lpsolver/Makefile +273 -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 +28 -4
- data/lib/lpsolver/native.so +0 -0
- data/lib/lpsolver/native_model.rb +261 -0
- data/lib/lpsolver/solution.rb +72 -7
- data/lib/lpsolver/version.rb +1 -1
- data/lpsolver.gemspec +4 -1
- metadata +1176 -4
|
@@ -0,0 +1,1498 @@
|
|
|
1
|
+
|
|
2
|
+
#include "pdlp/cupdlp/cupdlp_solver.h"
|
|
3
|
+
|
|
4
|
+
#include "pdlp/cupdlp/cupdlp_defs.h"
|
|
5
|
+
#include "pdlp/cupdlp/cupdlp_linalg.h"
|
|
6
|
+
#include "pdlp/cupdlp/cupdlp_proj.h"
|
|
7
|
+
#include "pdlp/cupdlp/cupdlp_restart.h"
|
|
8
|
+
#include "pdlp/cupdlp/cupdlp_step.h"
|
|
9
|
+
#include "pdlp/cupdlp/cupdlp_utils.h"
|
|
10
|
+
#include "pdlp/cupdlp/glbopts.h"
|
|
11
|
+
|
|
12
|
+
void PDHG_Compute_Primal_Feasibility(CUPDLPwork *work, cupdlp_float *primalResidual,
|
|
13
|
+
const cupdlp_float *ax, const cupdlp_float *x,
|
|
14
|
+
cupdlp_float *dPrimalFeasibility,
|
|
15
|
+
cupdlp_float *dPrimalObj) {
|
|
16
|
+
CUPDLPproblem *problem = work->problem;
|
|
17
|
+
CUPDLPdata *lp = problem->data;
|
|
18
|
+
CUPDLPscaling *scaling = work->scaling;
|
|
19
|
+
|
|
20
|
+
// primal variable violation
|
|
21
|
+
|
|
22
|
+
// todo, add this
|
|
23
|
+
// *dPrimalObj = Dotprod_Neumaier(problem->cost, x, lp->nCols);
|
|
24
|
+
cupdlp_dot(work, lp->nCols, x, problem->cost, dPrimalObj);
|
|
25
|
+
*dPrimalObj = *dPrimalObj * problem->sense_origin + problem->offset;
|
|
26
|
+
|
|
27
|
+
#if !defined(CUPDLP_CPU) && USE_KERNELS
|
|
28
|
+
primalResidual = work->buffer2;
|
|
29
|
+
|
|
30
|
+
cupdlp_primal_feasibility_kernel_cuda(primalResidual, ax, problem->rhs,
|
|
31
|
+
work->rowScale, scaling->ifScaled,
|
|
32
|
+
problem->nEqs, lp->nRows);
|
|
33
|
+
|
|
34
|
+
cupdlp_twoNorm(work, lp->nRows, primalResidual, dPrimalFeasibility);
|
|
35
|
+
|
|
36
|
+
#else
|
|
37
|
+
|
|
38
|
+
// cupdlp_copy(primalResidual, ax, cupdlp_float, lp->nRows);
|
|
39
|
+
CUPDLP_COPY_VEC(primalResidual, ax, cupdlp_float, lp->nRows);
|
|
40
|
+
|
|
41
|
+
// AddToVector(primalResidual, -1.0, problem->rhs, lp->nRows);
|
|
42
|
+
cupdlp_float alpha = -1.0;
|
|
43
|
+
cupdlp_axpy(work, lp->nRows, &alpha, problem->rhs, primalResidual);
|
|
44
|
+
|
|
45
|
+
// double dPrimalFeas = 0.0; // Redundant
|
|
46
|
+
|
|
47
|
+
// todo, check
|
|
48
|
+
// cupdlp_projNegative(primalResidual + problem->nEqs, primalResidual +
|
|
49
|
+
// problem->nEqs, lp->nRows - problem->nEqs);
|
|
50
|
+
//
|
|
51
|
+
|
|
52
|
+
cupdlp_projNeg(primalResidual + problem->nEqs, lp->nRows - problem->nEqs);
|
|
53
|
+
|
|
54
|
+
if (scaling->ifScaled) {
|
|
55
|
+
// cupdlp_edot(primalResidual, scaling->rowScale, lp->nRows);
|
|
56
|
+
// cupdlp_edot(primalResidual, scaling->rowScale_gpu, lp->nRows);
|
|
57
|
+
|
|
58
|
+
// cupdlp_copy_vec(work->buffer3, scaling->rowScale, cupdlp_float,
|
|
59
|
+
// lp->nRows); cupdlp_edot(primalResidual, work->buffer3, lp->nRows);
|
|
60
|
+
|
|
61
|
+
cupdlp_edot(primalResidual, work->rowScale, lp->nRows);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
cupdlp_twoNorm(work, lp->nRows, primalResidual, dPrimalFeasibility);
|
|
65
|
+
|
|
66
|
+
#endif
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
void PDHG_Compute_Dual_Feasibility(CUPDLPwork *work, cupdlp_float *dualResidual,
|
|
70
|
+
const cupdlp_float *aty, const cupdlp_float *x,
|
|
71
|
+
const cupdlp_float *y, cupdlp_float *dDualFeasibility,
|
|
72
|
+
cupdlp_float *dDualObj, cupdlp_float *dComplementarity,
|
|
73
|
+
cupdlp_float *dSlackPos, cupdlp_float *dSlackNeg) {
|
|
74
|
+
CUPDLPproblem *problem = work->problem;
|
|
75
|
+
CUPDLPdata *lp = problem->data;
|
|
76
|
+
CUPDLPresobj *resobj = work->resobj;
|
|
77
|
+
CUPDLPscaling *scaling = work->scaling;
|
|
78
|
+
// todo, compute Neumaier
|
|
79
|
+
// *dDualObj = Dotprod_Neumaier(problem->rhs, y, lp->nRows);
|
|
80
|
+
cupdlp_dot(work, lp->nRows, y, problem->rhs, dDualObj);
|
|
81
|
+
|
|
82
|
+
#if !defined(CUPDLP_CPU) && USE_KERNELS
|
|
83
|
+
dualResidual = work->buffer2;
|
|
84
|
+
|
|
85
|
+
cupdlp_float alpha;
|
|
86
|
+
cupdlp_dual_feasibility_kernel_1_cuda(dualResidual, aty,
|
|
87
|
+
problem->cost, lp->nCols);
|
|
88
|
+
|
|
89
|
+
cupdlp_dual_feasibility_kernel_2_cuda(dSlackPos, dualResidual,
|
|
90
|
+
problem->hasLower, lp->nCols);
|
|
91
|
+
|
|
92
|
+
cupdlp_float temp = 0.0;
|
|
93
|
+
cupdlp_dot(work, lp->nCols, dSlackPos, resobj->dLowerFiltered, &temp);
|
|
94
|
+
*dDualObj += temp;
|
|
95
|
+
|
|
96
|
+
cupdlp_dual_feasibility_kernel_3_cuda(dSlackNeg, dualResidual,
|
|
97
|
+
problem->hasUpper, lp->nCols);
|
|
98
|
+
|
|
99
|
+
cupdlp_dot(work, lp->nCols, dSlackNeg, resobj->dUpperFiltered, &temp);
|
|
100
|
+
*dDualObj -= temp;
|
|
101
|
+
|
|
102
|
+
*dDualObj = *dDualObj * problem->sense_origin + problem->offset;
|
|
103
|
+
|
|
104
|
+
alpha = -1.0;
|
|
105
|
+
cupdlp_axpy(work, lp->nCols, &alpha, dSlackPos, dualResidual);
|
|
106
|
+
alpha = 1.0;
|
|
107
|
+
cupdlp_axpy(work, lp->nCols, &alpha, dSlackNeg, dualResidual);
|
|
108
|
+
|
|
109
|
+
if (scaling->ifScaled) {
|
|
110
|
+
cupdlp_edot(dualResidual, work->colScale, lp->nCols);
|
|
111
|
+
}
|
|
112
|
+
cupdlp_twoNorm(work, lp->nCols, dualResidual, dDualFeasibility);
|
|
113
|
+
|
|
114
|
+
#else
|
|
115
|
+
// *dComplementarity = 0.0;
|
|
116
|
+
|
|
117
|
+
// @note:
|
|
118
|
+
// original dual residual in pdlp:
|
|
119
|
+
// they compute:
|
|
120
|
+
// violation + reduced cost
|
|
121
|
+
// |max(-y, 0)| + |(I-\Pi)(c-Α'\nu)|
|
|
122
|
+
// compute c - A'y
|
|
123
|
+
|
|
124
|
+
CUPDLP_COPY_VEC(dualResidual, aty, cupdlp_float, lp->nCols);
|
|
125
|
+
cupdlp_float alpha = -1.0;
|
|
126
|
+
cupdlp_scaleVector(work, alpha, dualResidual, lp->nCols);
|
|
127
|
+
|
|
128
|
+
alpha = 1.0;
|
|
129
|
+
cupdlp_axpy(work, lp->nCols, &alpha, problem->cost, dualResidual);
|
|
130
|
+
|
|
131
|
+
// julia version
|
|
132
|
+
// function compute_reduced_costs_from_primal_gradient_kernel!(
|
|
133
|
+
// primal_gradient::CuDeviceVector{Float64},
|
|
134
|
+
// isfinite_variable_lower_bound::CuDeviceVector{Bool},
|
|
135
|
+
// isfinite_variable_upper_bound::CuDeviceVector{Bool},
|
|
136
|
+
// num_variables::Int64,
|
|
137
|
+
// reduced_costs::CuDeviceVector{Float64},
|
|
138
|
+
// reduced_costs_violation::CuDeviceVector{Float64},
|
|
139
|
+
// )
|
|
140
|
+
// tx = threadIdx().x + (blockDim().x * (blockIdx().x - 0x1))
|
|
141
|
+
// if tx <= num_variables
|
|
142
|
+
// @inbounds begin
|
|
143
|
+
// reduced_costs[tx] = max(primal_gradient[tx], 0.0) *
|
|
144
|
+
// isfinite_variable_lower_bound[tx] +
|
|
145
|
+
// min(primal_gradient[tx], 0.0) *
|
|
146
|
+
// isfinite_variable_upper_bound[tx]
|
|
147
|
+
//
|
|
148
|
+
// reduced_costs_violation[tx] = primal_gradient[tx] -
|
|
149
|
+
// reduced_costs[tx]
|
|
150
|
+
// end
|
|
151
|
+
// end
|
|
152
|
+
// return
|
|
153
|
+
// end
|
|
154
|
+
|
|
155
|
+
CUPDLP_COPY_VEC(dSlackPos, dualResidual, cupdlp_float, lp->nCols);
|
|
156
|
+
|
|
157
|
+
cupdlp_projPos(dSlackPos, lp->nCols);
|
|
158
|
+
|
|
159
|
+
cupdlp_edot(dSlackPos, problem->hasLower, lp->nCols);
|
|
160
|
+
|
|
161
|
+
cupdlp_float temp = 0.0;
|
|
162
|
+
// cupdlp_dot(work, lp->nCols, x, dSlackPos, &temp);
|
|
163
|
+
// *dComplementarity += temp;
|
|
164
|
+
// cupdlp_dot(work, lp->nCols, dSlackPos, resobj->dLowerFiltered, &temp);
|
|
165
|
+
// *dComplementarity -= temp;
|
|
166
|
+
cupdlp_dot(work, lp->nCols, dSlackPos, resobj->dLowerFiltered, &temp);
|
|
167
|
+
*dDualObj += temp;
|
|
168
|
+
|
|
169
|
+
CUPDLP_COPY_VEC(dSlackNeg, dualResidual, cupdlp_float, lp->nCols);
|
|
170
|
+
|
|
171
|
+
cupdlp_projNeg(dSlackNeg, lp->nCols);
|
|
172
|
+
|
|
173
|
+
cupdlp_scaleVector(work, -1.0, dSlackNeg, lp->nCols);
|
|
174
|
+
|
|
175
|
+
cupdlp_edot(dSlackNeg, problem->hasUpper, lp->nCols);
|
|
176
|
+
|
|
177
|
+
// cupdlp_dot(work, lp->nCols, x, dSlackNeg, &temp);
|
|
178
|
+
// *dComplementarity -= temp;
|
|
179
|
+
// cupdlp_dot(work, lp->nCols, dSlackNeg, resobj->dUpperFiltered, &temp);
|
|
180
|
+
// *dComplementarity += temp;
|
|
181
|
+
cupdlp_dot(work, lp->nCols, dSlackNeg, resobj->dUpperFiltered, &temp);
|
|
182
|
+
*dDualObj -= temp;
|
|
183
|
+
|
|
184
|
+
*dDualObj = *dDualObj * problem->sense_origin + problem->offset;
|
|
185
|
+
|
|
186
|
+
alpha = -1.0;
|
|
187
|
+
cupdlp_axpy(work, lp->nCols, &alpha, dSlackPos, dualResidual);
|
|
188
|
+
alpha = 1.0;
|
|
189
|
+
cupdlp_axpy(work, lp->nCols, &alpha, dSlackNeg, dualResidual);
|
|
190
|
+
|
|
191
|
+
if (scaling->ifScaled) {
|
|
192
|
+
// cupdlp_edot(dualResidual, scaling->colScale, lp->nCols);
|
|
193
|
+
// cupdlp_edot(dualResidual, scaling->colScale_gpu, lp->nCols);
|
|
194
|
+
|
|
195
|
+
// cupdlp_copy_vec(work->buffer3, scaling->colScale, cupdlp_float,
|
|
196
|
+
// lp->nCols); cupdlp_edot(dualResidual, work->buffer3, lp->nCols);
|
|
197
|
+
|
|
198
|
+
cupdlp_edot(dualResidual, work->colScale, lp->nCols);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
cupdlp_twoNorm(work, lp->nCols, dualResidual, dDualFeasibility);
|
|
202
|
+
|
|
203
|
+
#endif
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
void PDHG_Compute_Primal_Infeasibility(CUPDLPwork *work, const cupdlp_float *y,
|
|
207
|
+
const cupdlp_float *dSlackPos,
|
|
208
|
+
const cupdlp_float *dSlackNeg,
|
|
209
|
+
const cupdlp_float *aty,
|
|
210
|
+
const cupdlp_float dualObj,
|
|
211
|
+
cupdlp_float *dPrimalInfeasObj,
|
|
212
|
+
cupdlp_float *dPrimalInfeasRes) {
|
|
213
|
+
CUPDLPproblem *problem = work->problem;
|
|
214
|
+
CUPDLPresobj *resobj = work->resobj;
|
|
215
|
+
CUPDLPscaling *scaling = work->scaling;
|
|
216
|
+
|
|
217
|
+
cupdlp_float alpha;
|
|
218
|
+
|
|
219
|
+
cupdlp_float yNrmSq = 1.0;
|
|
220
|
+
cupdlp_float slackPosNrmSq = 1.0;
|
|
221
|
+
cupdlp_float slackNegSq = 1.0;
|
|
222
|
+
cupdlp_float dScale = 1.0;
|
|
223
|
+
|
|
224
|
+
// cupdlp_float dConstrResSq = 0.0;
|
|
225
|
+
// y and lambda must be feasible, no need to check bound
|
|
226
|
+
// cupdlp_float dBoundLbResSq = 0.0;
|
|
227
|
+
// cupdlp_float dBoundUbResSq = 0.0;
|
|
228
|
+
|
|
229
|
+
#if !defined(CUPDLP_CPU) && USE_KERNELS
|
|
230
|
+
cupdlp_twoNormSquared(work, problem->data->nRows, y, &yNrmSq);
|
|
231
|
+
cupdlp_twoNormSquared(work, problem->data->nCols, dSlackPos, &slackPosNrmSq);
|
|
232
|
+
cupdlp_twoNormSquared(work, problem->data->nCols, dSlackNeg, &slackNegSq);
|
|
233
|
+
dScale = sqrt(yNrmSq + slackPosNrmSq + slackNegSq);
|
|
234
|
+
// dScale /= sqrt(problem->data->nRows + 2 * problem->data->nCols);
|
|
235
|
+
if (dScale < 1e-8) {
|
|
236
|
+
dScale = 1.0;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// dual obj
|
|
240
|
+
*dPrimalInfeasObj =
|
|
241
|
+
(dualObj - problem->offset) / problem->sense_origin / dScale;
|
|
242
|
+
|
|
243
|
+
// dual constraints [ATy1 + GTy2 + lambda]
|
|
244
|
+
|
|
245
|
+
cupdlp_primal_infeasibility_kernel_cuda(work->buffer2, aty, dSlackPos,
|
|
246
|
+
dSlackNeg, work->colScale, 1.0 / dScale,
|
|
247
|
+
scaling->ifScaled, problem->data->nCols);
|
|
248
|
+
|
|
249
|
+
// cupdlp_twoNormSquared(work, problem->data->nCols, resobj->dualInfeasConstr,
|
|
250
|
+
// &dConstrResSq);
|
|
251
|
+
cupdlp_twoNorm(work, problem->data->nCols, work->buffer2,
|
|
252
|
+
dPrimalInfeasRes);
|
|
253
|
+
|
|
254
|
+
// dual bound
|
|
255
|
+
// always satisfied, no need to check
|
|
256
|
+
|
|
257
|
+
#else
|
|
258
|
+
|
|
259
|
+
// y, ldb ray
|
|
260
|
+
CUPDLP_COPY_VEC(resobj->dualInfeasRay, y, cupdlp_float, problem->data->nRows);
|
|
261
|
+
CUPDLP_COPY_VEC(resobj->dualInfeasLbRay, dSlackPos, cupdlp_float,
|
|
262
|
+
problem->data->nCols);
|
|
263
|
+
CUPDLP_COPY_VEC(resobj->dualInfeasUbRay, dSlackNeg, cupdlp_float,
|
|
264
|
+
problem->data->nCols);
|
|
265
|
+
cupdlp_twoNormSquared(work, problem->data->nRows, resobj->dualInfeasRay,
|
|
266
|
+
&yNrmSq);
|
|
267
|
+
cupdlp_twoNormSquared(work, problem->data->nCols, resobj->dualInfeasLbRay,
|
|
268
|
+
&slackPosNrmSq);
|
|
269
|
+
cupdlp_twoNormSquared(work, problem->data->nCols, resobj->dualInfeasUbRay,
|
|
270
|
+
&slackNegSq);
|
|
271
|
+
dScale = sqrt(yNrmSq + slackPosNrmSq + slackNegSq);
|
|
272
|
+
// dScale /= sqrt(problem->data->nRows + 2 * problem->data->nCols);
|
|
273
|
+
if (dScale < 1e-8) {
|
|
274
|
+
dScale = 1.0;
|
|
275
|
+
}
|
|
276
|
+
cupdlp_scaleVector(work, 1 / dScale, resobj->dualInfeasRay,
|
|
277
|
+
problem->data->nRows);
|
|
278
|
+
cupdlp_scaleVector(work, 1 / dScale, resobj->dualInfeasLbRay,
|
|
279
|
+
problem->data->nCols);
|
|
280
|
+
cupdlp_scaleVector(work, 1 / dScale, resobj->dualInfeasUbRay,
|
|
281
|
+
problem->data->nCols);
|
|
282
|
+
|
|
283
|
+
// dual obj
|
|
284
|
+
*dPrimalInfeasObj =
|
|
285
|
+
(dualObj - problem->offset) / problem->sense_origin / dScale;
|
|
286
|
+
|
|
287
|
+
// dual constraints [ATy1 + GTy2 + lambda]
|
|
288
|
+
CUPDLP_COPY_VEC(resobj->dualInfeasConstr, aty, cupdlp_float,
|
|
289
|
+
problem->data->nCols);
|
|
290
|
+
cupdlp_scaleVector(work, 1.0 / dScale, resobj->dualInfeasConstr,
|
|
291
|
+
problem->data->nCols);
|
|
292
|
+
alpha = 1.0;
|
|
293
|
+
cupdlp_axpy(work, problem->data->nCols, &alpha, resobj->dualInfeasLbRay,
|
|
294
|
+
resobj->dualInfeasConstr);
|
|
295
|
+
alpha = -1.0;
|
|
296
|
+
cupdlp_axpy(work, problem->data->nCols, &alpha, resobj->dualInfeasUbRay,
|
|
297
|
+
resobj->dualInfeasConstr);
|
|
298
|
+
if (scaling->ifScaled) {
|
|
299
|
+
cupdlp_edot(resobj->dualInfeasConstr, work->colScale, problem->data->nCols);
|
|
300
|
+
}
|
|
301
|
+
// cupdlp_twoNormSquared(work, problem->data->nCols, resobj->dualInfeasConstr,
|
|
302
|
+
// &dConstrResSq);
|
|
303
|
+
cupdlp_twoNorm(work, problem->data->nCols, resobj->dualInfeasConstr,
|
|
304
|
+
dPrimalInfeasRes);
|
|
305
|
+
|
|
306
|
+
// dual bound
|
|
307
|
+
// always satisfied, no need to check
|
|
308
|
+
|
|
309
|
+
#endif
|
|
310
|
+
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
void PDHG_Compute_Dual_Infeasibility(CUPDLPwork *work, const cupdlp_float *x,
|
|
314
|
+
const cupdlp_float *ax,
|
|
315
|
+
const cupdlp_float primalObj,
|
|
316
|
+
cupdlp_float *dDualInfeasObj,
|
|
317
|
+
cupdlp_float *dDualInfeasRes) {
|
|
318
|
+
CUPDLPproblem *problem = work->problem;
|
|
319
|
+
CUPDLPresobj *resobj = work->resobj;
|
|
320
|
+
CUPDLPscaling *scaling = work->scaling;
|
|
321
|
+
cupdlp_float pScale = 1.0;
|
|
322
|
+
cupdlp_float pConstrResSq = 0.0;
|
|
323
|
+
cupdlp_float pBoundLbResSq = 0.0;
|
|
324
|
+
cupdlp_float pBoundUbResSq = 0.0;
|
|
325
|
+
|
|
326
|
+
#if !defined(CUPDLP_CPU) && USE_KERNELS
|
|
327
|
+
// x ray
|
|
328
|
+
cupdlp_twoNorm(work, problem->data->nCols, x, &pScale);
|
|
329
|
+
// pScale /= sqrt(problem->data->nCols);
|
|
330
|
+
if (pScale < 1e-8) {
|
|
331
|
+
pScale = 1.0;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// primal obj
|
|
335
|
+
*dDualInfeasObj =
|
|
336
|
+
(primalObj - problem->offset) / problem->sense_origin / pScale;
|
|
337
|
+
|
|
338
|
+
// primal constraints [Ax, min(Gx, 0)]
|
|
339
|
+
cupdlp_dual_infeasibility_kernel_constr_cuda(work->buffer2, ax,
|
|
340
|
+
work->rowScale, 1.0 / pScale,
|
|
341
|
+
scaling->ifScaled,
|
|
342
|
+
problem->nEqs,
|
|
343
|
+
problem->data->nRows);
|
|
344
|
+
cupdlp_twoNormSquared(work, problem->data->nRows, work->buffer2,
|
|
345
|
+
&pConstrResSq);
|
|
346
|
+
|
|
347
|
+
// primal bound
|
|
348
|
+
// lb
|
|
349
|
+
cupdlp_dual_infeasibility_kernel_lb_cuda(work->buffer2, x,
|
|
350
|
+
problem->hasLower,
|
|
351
|
+
work->colScale,
|
|
352
|
+
1.0 / pScale, scaling->ifScaled,
|
|
353
|
+
problem->data->nCols);
|
|
354
|
+
cupdlp_twoNormSquared(work, problem->data->nCols, work->buffer2,
|
|
355
|
+
&pBoundLbResSq);
|
|
356
|
+
// ub
|
|
357
|
+
cupdlp_dual_infeasibility_kernel_ub_cuda(work->buffer2, x,
|
|
358
|
+
problem->hasUpper,
|
|
359
|
+
work->colScale,
|
|
360
|
+
1.0 / pScale, scaling->ifScaled,
|
|
361
|
+
problem->data->nCols);
|
|
362
|
+
cupdlp_twoNormSquared(work, problem->data->nCols, work->buffer2,
|
|
363
|
+
&pBoundUbResSq);
|
|
364
|
+
|
|
365
|
+
// sum up
|
|
366
|
+
*dDualInfeasRes = sqrt(pConstrResSq + pBoundLbResSq + pBoundUbResSq);
|
|
367
|
+
|
|
368
|
+
#else
|
|
369
|
+
|
|
370
|
+
// x ray
|
|
371
|
+
CUPDLP_COPY_VEC(resobj->primalInfeasRay, x, cupdlp_float,
|
|
372
|
+
problem->data->nCols);
|
|
373
|
+
cupdlp_twoNorm(work, problem->data->nCols, resobj->primalInfeasRay, &pScale);
|
|
374
|
+
// pScale /= sqrt(problem->data->nCols);
|
|
375
|
+
if (pScale < 1e-8) {
|
|
376
|
+
pScale = 1.0;
|
|
377
|
+
}
|
|
378
|
+
cupdlp_scaleVector(work, 1.0 / pScale, resobj->primalInfeasRay,
|
|
379
|
+
problem->data->nCols);
|
|
380
|
+
|
|
381
|
+
// primal obj
|
|
382
|
+
*dDualInfeasObj =
|
|
383
|
+
(primalObj - problem->offset) / problem->sense_origin / pScale;
|
|
384
|
+
|
|
385
|
+
// primal constraints [Ax, min(Gx, 0)]
|
|
386
|
+
CUPDLP_COPY_VEC(resobj->primalInfeasConstr, ax, cupdlp_float,
|
|
387
|
+
problem->data->nRows);
|
|
388
|
+
cupdlp_scaleVector(work, 1.0 / pScale, resobj->primalInfeasConstr,
|
|
389
|
+
problem->data->nRows);
|
|
390
|
+
cupdlp_projNeg(resobj->primalInfeasConstr + problem->nEqs,
|
|
391
|
+
problem->data->nRows - problem->nEqs);
|
|
392
|
+
if (scaling->ifScaled) {
|
|
393
|
+
cupdlp_edot(resobj->primalInfeasConstr, work->rowScale,
|
|
394
|
+
problem->data->nRows);
|
|
395
|
+
}
|
|
396
|
+
cupdlp_twoNormSquared(work, problem->data->nRows, resobj->primalInfeasConstr,
|
|
397
|
+
&pConstrResSq);
|
|
398
|
+
|
|
399
|
+
// primal bound
|
|
400
|
+
// lb
|
|
401
|
+
CUPDLP_COPY_VEC(resobj->primalInfeasBound, resobj->primalInfeasRay,
|
|
402
|
+
cupdlp_float, problem->data->nCols);
|
|
403
|
+
cupdlp_projNeg(resobj->primalInfeasBound, problem->data->nCols);
|
|
404
|
+
cupdlp_edot(resobj->primalInfeasBound, problem->hasLower,
|
|
405
|
+
problem->data->nCols);
|
|
406
|
+
if (scaling->ifScaled) {
|
|
407
|
+
cupdlp_ediv(resobj->primalInfeasBound, work->colScale,
|
|
408
|
+
problem->data->nCols);
|
|
409
|
+
}
|
|
410
|
+
cupdlp_twoNormSquared(work, problem->data->nCols, resobj->primalInfeasBound,
|
|
411
|
+
&pBoundLbResSq);
|
|
412
|
+
// ub
|
|
413
|
+
CUPDLP_COPY_VEC(resobj->primalInfeasBound, resobj->primalInfeasRay,
|
|
414
|
+
cupdlp_float, problem->data->nCols);
|
|
415
|
+
cupdlp_projPos(resobj->primalInfeasBound, problem->data->nCols);
|
|
416
|
+
cupdlp_edot(resobj->primalInfeasBound, problem->hasUpper,
|
|
417
|
+
problem->data->nCols);
|
|
418
|
+
if (scaling->ifScaled) {
|
|
419
|
+
cupdlp_ediv(resobj->primalInfeasBound, work->colScale,
|
|
420
|
+
problem->data->nCols);
|
|
421
|
+
}
|
|
422
|
+
cupdlp_twoNormSquared(work, problem->data->nCols, resobj->primalInfeasBound,
|
|
423
|
+
&pBoundUbResSq);
|
|
424
|
+
|
|
425
|
+
// sum up
|
|
426
|
+
*dDualInfeasRes = sqrt(pConstrResSq + pBoundLbResSq + pBoundUbResSq);
|
|
427
|
+
|
|
428
|
+
#endif
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// must be called after PDHG_Compute_Residuals(CUPDLPwork *work)
|
|
432
|
+
// because it needs resobj->dSlackPos and resobj->dSlackNeg
|
|
433
|
+
void PDHG_Compute_Infeas_Residuals(CUPDLPwork *work) {
|
|
434
|
+
#if problem_USE_TIMERS
|
|
435
|
+
++problem->nComputeResidualsCalls;
|
|
436
|
+
double dStartTime = getTimeStamp();
|
|
437
|
+
#endif
|
|
438
|
+
CUPDLPiterates *iterates = work->iterates;
|
|
439
|
+
CUPDLPresobj *resobj = work->resobj;
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
cupdlp_int iter = work->timers->nIter;
|
|
443
|
+
CUPDLPvec *x = iterates->x[iter % 2];
|
|
444
|
+
CUPDLPvec *y = iterates->y[iter % 2];
|
|
445
|
+
CUPDLPvec *ax = iterates->ax[iter % 2];
|
|
446
|
+
CUPDLPvec *aty = iterates->aty[iter % 2];
|
|
447
|
+
|
|
448
|
+
// current solution
|
|
449
|
+
PDHG_Compute_Primal_Infeasibility(work, y->data, resobj->dSlackPos,
|
|
450
|
+
resobj->dSlackNeg, aty->data,
|
|
451
|
+
resobj->dDualObj, &resobj->dPrimalInfeasObj,
|
|
452
|
+
&resobj->dPrimalInfeasRes);
|
|
453
|
+
PDHG_Compute_Dual_Infeasibility(work, x->data, ax->data,
|
|
454
|
+
resobj->dPrimalObj, &resobj->dDualInfeasObj,
|
|
455
|
+
&resobj->dDualInfeasRes);
|
|
456
|
+
|
|
457
|
+
// average solution
|
|
458
|
+
PDHG_Compute_Primal_Infeasibility(
|
|
459
|
+
work, iterates->yAverage->data, resobj->dSlackPosAverage,
|
|
460
|
+
resobj->dSlackNegAverage, iterates->atyAverage->data,
|
|
461
|
+
resobj->dDualObjAverage, &resobj->dPrimalInfeasObjAverage,
|
|
462
|
+
&resobj->dPrimalInfeasResAverage);
|
|
463
|
+
PDHG_Compute_Dual_Infeasibility(
|
|
464
|
+
work, iterates->xAverage->data, iterates->axAverage->data,
|
|
465
|
+
resobj->dPrimalObjAverage, &resobj->dDualInfeasObjAverage,
|
|
466
|
+
&resobj->dDualInfeasResAverage);
|
|
467
|
+
|
|
468
|
+
#if problem_USE_TIMERS
|
|
469
|
+
problem->dComputeResidualsTime += getTimeStamp() - dStartTime;
|
|
470
|
+
#endif
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
void PDHG_Compute_Residuals(CUPDLPwork *work) {
|
|
474
|
+
#if problem_USE_TIMERS
|
|
475
|
+
++problem->nComputeResidualsCalls;
|
|
476
|
+
double dStartTime = getTimeStamp();
|
|
477
|
+
#endif
|
|
478
|
+
CUPDLPproblem *problem = work->problem;
|
|
479
|
+
CUPDLPdata *lp = problem->data;
|
|
480
|
+
CUPDLPresobj *resobj = work->resobj;
|
|
481
|
+
CUPDLPiterates *iterates = work->iterates;
|
|
482
|
+
CUPDLPscaling *scaling = work->scaling;
|
|
483
|
+
CUPDLPsettings *settings = work->settings;
|
|
484
|
+
|
|
485
|
+
cupdlp_int iter = work->timers->nIter;
|
|
486
|
+
CUPDLPvec *x = iterates->x[iter % 2];
|
|
487
|
+
CUPDLPvec *y = iterates->y[iter % 2];
|
|
488
|
+
CUPDLPvec *ax = iterates->ax[iter % 2];
|
|
489
|
+
CUPDLPvec *aty = iterates->aty[iter % 2];
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
PDHG_Compute_Primal_Feasibility(work, resobj->primalResidual,
|
|
493
|
+
ax->data, x->data,
|
|
494
|
+
&resobj->dPrimalFeas, &resobj->dPrimalObj);
|
|
495
|
+
PDHG_Compute_Dual_Feasibility(
|
|
496
|
+
work, resobj->dualResidual, aty->data, x->data,
|
|
497
|
+
y->data, &resobj->dDualFeas, &resobj->dDualObj,
|
|
498
|
+
&resobj->dComplementarity, resobj->dSlackPos, resobj->dSlackNeg);
|
|
499
|
+
|
|
500
|
+
PDHG_Compute_Primal_Feasibility(
|
|
501
|
+
work, resobj->primalResidualAverage, iterates->axAverage->data,
|
|
502
|
+
iterates->xAverage->data, &resobj->dPrimalFeasAverage,
|
|
503
|
+
&resobj->dPrimalObjAverage);
|
|
504
|
+
PDHG_Compute_Dual_Feasibility(
|
|
505
|
+
work, resobj->dualResidualAverage, iterates->atyAverage->data,
|
|
506
|
+
iterates->xAverage->data, iterates->yAverage->data,
|
|
507
|
+
&resobj->dDualFeasAverage, &resobj->dDualObjAverage,
|
|
508
|
+
&resobj->dComplementarityAverage, resobj->dSlackPosAverage,
|
|
509
|
+
resobj->dSlackNegAverage);
|
|
510
|
+
|
|
511
|
+
// resobj->dPrimalObj /= (scaling->dObjScale * scaling->dObjScale);
|
|
512
|
+
// resobj->dDualObj /= (scaling->dObjScale * scaling->dObjScale);
|
|
513
|
+
resobj->dDualityGap = resobj->dPrimalObj - resobj->dDualObj;
|
|
514
|
+
resobj->dRelObjGap =
|
|
515
|
+
fabs(resobj->dPrimalObj - resobj->dDualObj) /
|
|
516
|
+
(1.0 + fabs(resobj->dPrimalObj) + fabs(resobj->dDualObj));
|
|
517
|
+
|
|
518
|
+
// resobj->dPrimalObjAverage /= scaling->dObjScale * scaling->dObjScale;
|
|
519
|
+
// resobj->dDualObjAverage /= scaling->dObjScale * scaling->dObjScale;
|
|
520
|
+
resobj->dDualityGapAverage =
|
|
521
|
+
resobj->dPrimalObjAverage - resobj->dDualObjAverage;
|
|
522
|
+
resobj->dRelObjGapAverage =
|
|
523
|
+
fabs(resobj->dPrimalObjAverage - resobj->dDualObjAverage) /
|
|
524
|
+
(1.0 + fabs(resobj->dPrimalObjAverage) + fabs(resobj->dDualObjAverage));
|
|
525
|
+
|
|
526
|
+
#if problem_USE_TIMERS
|
|
527
|
+
problem->dComputeResidualsTime += getTimeStamp() - dStartTime;
|
|
528
|
+
#endif
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
void PDHG_Init_Variables(const cupdlp_int* has_variables, CUPDLPwork *work) {
|
|
532
|
+
CUPDLPproblem *problem = work->problem;
|
|
533
|
+
CUPDLPdata *lp = problem->data;
|
|
534
|
+
CUPDLPstepsize *stepsize = work->stepsize;
|
|
535
|
+
CUPDLPiterates *iterates = work->iterates;
|
|
536
|
+
|
|
537
|
+
cupdlp_int iter = work->timers->nIter;
|
|
538
|
+
CUPDLPvec *x = iterates->x[iter % 2];
|
|
539
|
+
CUPDLPvec *y = iterates->y[iter % 2];
|
|
540
|
+
CUPDLPvec *ax = iterates->ax[iter % 2];
|
|
541
|
+
CUPDLPvec *aty = iterates->aty[iter % 2];
|
|
542
|
+
|
|
543
|
+
if (!*has_variables)
|
|
544
|
+
CUPDLP_ZERO_VEC(x->data, cupdlp_float, lp->nCols);
|
|
545
|
+
|
|
546
|
+
// XXX: PDLP Does not project x0, so we uncomment for 1-1 comparison
|
|
547
|
+
|
|
548
|
+
PDHG_Project_Bounds(work, x->data);
|
|
549
|
+
double x_norm;
|
|
550
|
+
cupdlp_twoNorm(work, lp->nCols, x->data, &x_norm);
|
|
551
|
+
if (work->settings->nLogLevel>0)
|
|
552
|
+
cupdlp_printf("||x0||_2 = %e\n", x_norm);
|
|
553
|
+
|
|
554
|
+
// cupdlp_zero(iterates->y, cupdlp_float, lp->nRows);
|
|
555
|
+
if (!*has_variables)
|
|
556
|
+
CUPDLP_ZERO_VEC(y->data, cupdlp_float, lp->nRows);
|
|
557
|
+
|
|
558
|
+
// Ax(work, iterates->ax, iterates->x);
|
|
559
|
+
// ATyCPU(work, iterates->aty, iterates->y);
|
|
560
|
+
Ax(work, ax, x);
|
|
561
|
+
ATy(work, aty, y);
|
|
562
|
+
|
|
563
|
+
#if PDLP_DEBUG_LOG
|
|
564
|
+
double ax_norm;
|
|
565
|
+
cupdlp_twoNorm(work, lp->nRows, ax->data, &ax_norm);
|
|
566
|
+
if (work->settings->nLogLevel>0)
|
|
567
|
+
cupdlp_printf("||Ax0||_2 = %e\n", ax_norm);
|
|
568
|
+
work->debug_pdlp_data_.ax_norm = ax_norm;
|
|
569
|
+
double aty_norm;
|
|
570
|
+
cupdlp_twoNorm(work, lp->nCols, aty->data, &aty_norm);
|
|
571
|
+
work->debug_pdlp_data_.aty_norm = aty_norm;
|
|
572
|
+
#endif
|
|
573
|
+
|
|
574
|
+
// cupdlp_zero(iterates->xSum, cupdlp_float, lp->nCols);
|
|
575
|
+
// cupdlp_zero(iterates->ySum, cupdlp_float, lp->nRows);
|
|
576
|
+
// cupdlp_zero(iterates->xAverage, cupdlp_float, lp->nCols);
|
|
577
|
+
// cupdlp_zero(iterates->yAverage, cupdlp_float, lp->nRows);
|
|
578
|
+
CUPDLP_ZERO_VEC(iterates->xSum, cupdlp_float, lp->nCols);
|
|
579
|
+
CUPDLP_ZERO_VEC(iterates->ySum, cupdlp_float, lp->nRows);
|
|
580
|
+
CUPDLP_ZERO_VEC(iterates->xAverage->data, cupdlp_float, lp->nCols);
|
|
581
|
+
CUPDLP_ZERO_VEC(iterates->yAverage->data, cupdlp_float, lp->nRows);
|
|
582
|
+
|
|
583
|
+
PDHG_Project_Bounds(work, iterates->xSum);
|
|
584
|
+
PDHG_Project_Bounds(work, iterates->xAverage->data);
|
|
585
|
+
|
|
586
|
+
stepsize->dSumPrimalStep = 0.0;
|
|
587
|
+
stepsize->dSumDualStep = 0.0;
|
|
588
|
+
|
|
589
|
+
CUPDLP_ZERO_VEC(iterates->xLastRestart, cupdlp_float, lp->nCols);
|
|
590
|
+
CUPDLP_ZERO_VEC(iterates->yLastRestart, cupdlp_float, lp->nRows);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/* TODO: this function seems considering
|
|
594
|
+
* l1 <= Ax <= u1
|
|
595
|
+
* l2 <= x <= u2
|
|
596
|
+
* needs rewritten for current formulation
|
|
597
|
+
*/
|
|
598
|
+
void PDHG_Check_Data(CUPDLPwork *work) {
|
|
599
|
+
CUPDLPproblem *problem = work->problem;
|
|
600
|
+
CUPDLPdata *lp = problem->data;
|
|
601
|
+
CUPDLPstepsize *stepsize = work->stepsize;
|
|
602
|
+
CUPDLPiterates *iterates = work->iterates;
|
|
603
|
+
cupdlp_int nFreeCol = 0;
|
|
604
|
+
cupdlp_int nFixedCol = 0;
|
|
605
|
+
cupdlp_int nUpperCol = 0;
|
|
606
|
+
cupdlp_int nLowerCol = 0;
|
|
607
|
+
cupdlp_int nRangedCol = 0;
|
|
608
|
+
cupdlp_int nFreeRow = 0;
|
|
609
|
+
cupdlp_int nFixedRow = 0;
|
|
610
|
+
cupdlp_int nUpperRow = 0;
|
|
611
|
+
cupdlp_int nLowerRow = 0;
|
|
612
|
+
cupdlp_int nRangedRow = 0;
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
cupdlp_int iter = work->timers->nIter;
|
|
616
|
+
CUPDLPvec *x = iterates->x[iter % 2];
|
|
617
|
+
CUPDLPvec *y = iterates->y[iter % 2];
|
|
618
|
+
|
|
619
|
+
for (cupdlp_int iSeq = 0; iSeq < lp->nCols; ++iSeq) {
|
|
620
|
+
cupdlp_bool hasLower = problem->lower[iSeq] > -INFINITY;
|
|
621
|
+
cupdlp_bool hasUpper = problem->upper[iSeq] < +INFINITY;
|
|
622
|
+
|
|
623
|
+
if (!hasLower && !hasUpper) {
|
|
624
|
+
++nFreeCol;
|
|
625
|
+
if (work->settings->nLogLevel>0)
|
|
626
|
+
cupdlp_printf("Warning: variable %d is free.", iSeq);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
if (hasLower && hasUpper) {
|
|
630
|
+
if (problem->lower[iSeq] == problem->upper[iSeq]) {
|
|
631
|
+
++nFixedCol;
|
|
632
|
+
// cupdlp_printf( "Warning: variable %d is fixed.", iSeq);
|
|
633
|
+
} else
|
|
634
|
+
++nRangedCol;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
if (hasLower) {
|
|
638
|
+
// XXX: uncommented for PDLP comparison
|
|
639
|
+
// CUPDLP_ASSERT(x[iSeq] >= problem->lower[iSeq]);
|
|
640
|
+
nLowerCol += !hasUpper;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
if (hasUpper) {
|
|
644
|
+
// XXX: uncommented for PDLP comparison
|
|
645
|
+
// CUPDLP_ASSERT(x[iSeq] <= problem->upper[iSeq]);
|
|
646
|
+
nUpperCol += !hasLower;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
for (cupdlp_int iSeq = lp->nCols; iSeq < lp->nCols; ++iSeq) {
|
|
651
|
+
cupdlp_bool hasLower = problem->lower[iSeq] > -INFINITY;
|
|
652
|
+
cupdlp_bool hasUpper = problem->upper[iSeq] < +INFINITY;
|
|
653
|
+
|
|
654
|
+
if (!hasLower && !hasUpper) {
|
|
655
|
+
++nFreeRow;
|
|
656
|
+
if (work->settings->nLogLevel>0)
|
|
657
|
+
cupdlp_printf("Warning: row %d is free.", iSeq - lp->nCols);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
if (hasLower && hasUpper) {
|
|
661
|
+
if (problem->lower[iSeq] == problem->upper[iSeq])
|
|
662
|
+
++nFixedRow;
|
|
663
|
+
else
|
|
664
|
+
++nRangedRow;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
if (hasLower) {
|
|
668
|
+
// CUPDLP_ASSERT(x[iSeq] >= problem->lower[iSeq]);
|
|
669
|
+
nLowerRow += !hasUpper;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
if (hasUpper) {
|
|
673
|
+
// CUPDLP_ASSERT(x[iSeq] <= problem->upper[iSeq]);
|
|
674
|
+
nUpperRow += !hasLower;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
for (cupdlp_int iRow = 0; iRow < lp->nRows; ++iRow) {
|
|
679
|
+
CUPDLP_ASSERT(y->data[iRow] < +INFINITY);
|
|
680
|
+
CUPDLP_ASSERT(y->data[iRow] > -INFINITY);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
for (cupdlp_int iRow = 0; iRow < lp->nRows; ++iRow) {
|
|
684
|
+
if (problem->data->csr_matrix->rowMatBeg[iRow + 1] -
|
|
685
|
+
problem->data->csr_matrix->rowMatBeg[iRow] ==
|
|
686
|
+
1) {
|
|
687
|
+
if (work->settings->nLogLevel>0)
|
|
688
|
+
cupdlp_printf("Warning: row %d is a singleton row.", iRow);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
CUPDLP_ASSERT(nRangedRow == 0);
|
|
693
|
+
if (work->settings->nLogLevel>0) {
|
|
694
|
+
cupdlp_printf("nFreeCol : %d\n", nFreeCol);
|
|
695
|
+
cupdlp_printf("nFixedCol : %d\n", nFixedCol);
|
|
696
|
+
cupdlp_printf("nRangedCol: %d\n", nRangedCol);
|
|
697
|
+
cupdlp_printf("nLowerCol : %d\n", nLowerCol);
|
|
698
|
+
cupdlp_printf("nUpperCol : %d\n", nUpperCol);
|
|
699
|
+
cupdlp_printf("nFreeRow : %d\n", nFreeRow);
|
|
700
|
+
cupdlp_printf("nFixedRow : %d\n", nFixedRow);
|
|
701
|
+
cupdlp_printf("nRangedRow: %d\n", nRangedRow);
|
|
702
|
+
cupdlp_printf("nLowerRow : %d\n", nLowerRow);
|
|
703
|
+
cupdlp_printf("nUpperRow : %d\n", nUpperRow);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// We need to test problems ranged row-bounds more carefully.
|
|
707
|
+
CUPDLP_ASSERT(nRangedRow == 0);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
termination_code PDHG_Check_Primal_Infeasibility(
|
|
711
|
+
CUPDLPwork *pdhg, cupdlp_float dPrimalInfeasObj,
|
|
712
|
+
cupdlp_float dPrimalInfeasRes) {
|
|
713
|
+
CUPDLPresobj *resobj = pdhg->resobj;
|
|
714
|
+
|
|
715
|
+
termination_code primalCode = FEASIBLE;
|
|
716
|
+
|
|
717
|
+
if (dPrimalInfeasObj > 0.0) {
|
|
718
|
+
if (dPrimalInfeasRes < resobj->dFeasTol * dPrimalInfeasObj)
|
|
719
|
+
primalCode = INFEASIBLE;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
return primalCode;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
termination_code PDHG_Check_Dual_Infeasibility(CUPDLPwork *pdhg,
|
|
726
|
+
cupdlp_float dDualInfeasObj,
|
|
727
|
+
cupdlp_float dDualInfeasRes) {
|
|
728
|
+
CUPDLPresobj *resobj = pdhg->resobj;
|
|
729
|
+
|
|
730
|
+
termination_code dualCode = FEASIBLE;
|
|
731
|
+
|
|
732
|
+
if (dDualInfeasObj < 0.0) {
|
|
733
|
+
if (dDualInfeasRes < -resobj->dFeasTol * dDualInfeasObj)
|
|
734
|
+
dualCode = INFEASIBLE;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
return dualCode;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
termination_code PDHG_Check_Infeasibility(CUPDLPwork *pdhg, int bool_print) {
|
|
741
|
+
CUPDLPresobj *resobj = pdhg->resobj;
|
|
742
|
+
termination_code t_code = FEASIBLE;
|
|
743
|
+
|
|
744
|
+
// current solution
|
|
745
|
+
|
|
746
|
+
// primal infeasibility
|
|
747
|
+
if (PDHG_Check_Primal_Infeasibility(pdhg, resobj->dPrimalInfeasObj,
|
|
748
|
+
resobj->dPrimalInfeasRes) == INFEASIBLE) {
|
|
749
|
+
resobj->primalCode = INFEASIBLE;
|
|
750
|
+
resobj->termInfeasIterate = LAST_ITERATE;
|
|
751
|
+
t_code = INFEASIBLE_OR_UNBOUNDED;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
// dual infeasibility
|
|
755
|
+
if (PDHG_Check_Dual_Infeasibility(pdhg, resobj->dDualInfeasObj,
|
|
756
|
+
resobj->dDualInfeasRes) == INFEASIBLE) {
|
|
757
|
+
resobj->dualCode = INFEASIBLE;
|
|
758
|
+
resobj->termInfeasIterate = LAST_ITERATE;
|
|
759
|
+
t_code = INFEASIBLE_OR_UNBOUNDED;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
// average solution
|
|
763
|
+
// primal infeasibility
|
|
764
|
+
if (PDHG_Check_Primal_Infeasibility(pdhg, resobj->dPrimalInfeasObjAverage,
|
|
765
|
+
resobj->dPrimalInfeasResAverage) ==
|
|
766
|
+
INFEASIBLE) {
|
|
767
|
+
resobj->primalCode = INFEASIBLE;
|
|
768
|
+
resobj->termInfeasIterate = AVERAGE_ITERATE;
|
|
769
|
+
t_code = INFEASIBLE_OR_UNBOUNDED;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
// dual infeasibility
|
|
773
|
+
if (PDHG_Check_Dual_Infeasibility(pdhg, resobj->dDualInfeasObjAverage,
|
|
774
|
+
resobj->dDualInfeasResAverage) ==
|
|
775
|
+
INFEASIBLE) {
|
|
776
|
+
resobj->dualCode = INFEASIBLE;
|
|
777
|
+
resobj->termInfeasIterate = AVERAGE_ITERATE;
|
|
778
|
+
t_code = INFEASIBLE_OR_UNBOUNDED;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
if (bool_print) {
|
|
782
|
+
printf("Last iter:\n");
|
|
783
|
+
printf(" Primal obj = %+.4e, res = %+.4e\n", resobj->dPrimalInfeasObj,
|
|
784
|
+
resobj->dPrimalInfeasRes);
|
|
785
|
+
printf(" Dual obj = %+.4e, res = %+.4e\n", resobj->dDualInfeasObj,
|
|
786
|
+
resobj->dDualInfeasRes);
|
|
787
|
+
printf("Average iter:\n");
|
|
788
|
+
printf(" Primal obj = %+.4e, res = %+.4e\n",
|
|
789
|
+
resobj->dPrimalInfeasObjAverage, resobj->dPrimalInfeasResAverage);
|
|
790
|
+
printf(" Dual obj = %+.4e, res = %+.4e\n", resobj->dDualInfeasObjAverage,
|
|
791
|
+
resobj->dDualInfeasResAverage);
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
return t_code;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
cupdlp_bool PDHG_Check_Termination(CUPDLPwork *pdhg, int bool_print) {
|
|
798
|
+
CUPDLPproblem *problem = pdhg->problem;
|
|
799
|
+
CUPDLPsettings *settings = pdhg->settings;
|
|
800
|
+
CUPDLPresobj *resobj = pdhg->resobj;
|
|
801
|
+
CUPDLPscaling *scaling = pdhg->scaling;
|
|
802
|
+
#if PDHG_DISPLAY_TERMINATION_CHECK
|
|
803
|
+
// todo, check, is it correct
|
|
804
|
+
if (bool_print) {
|
|
805
|
+
cupdlp_printf(
|
|
806
|
+
"Termination check: %e|%e %e|%e %e|%e\n", resobj->dPrimalFeas,
|
|
807
|
+
settings->dPrimalTol * (1.0 + scaling->dNormRhs), resobj->dDualFeas,
|
|
808
|
+
settings->dDualTol * (1.0 + scaling->dNormCost), resobj->dRelObjGap,
|
|
809
|
+
settings->dGapTol);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
#endif
|
|
813
|
+
int bool_pass =
|
|
814
|
+
(resobj->dPrimalFeas < settings->dPrimalTol * (1.0 + scaling->dNormRhs)) &&
|
|
815
|
+
(resobj->dDualFeas < settings->dDualTol * (1.0 + scaling->dNormCost));
|
|
816
|
+
bool_pass = bool_pass && (resobj->dRelObjGap < settings->dGapTol);
|
|
817
|
+
return bool_pass;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
cupdlp_bool PDHG_Check_Termination_Average(CUPDLPwork *pdhg, int bool_print) {
|
|
821
|
+
CUPDLPproblem *problem = pdhg->problem;
|
|
822
|
+
CUPDLPsettings *settings = pdhg->settings;
|
|
823
|
+
CUPDLPresobj *resobj = pdhg->resobj;
|
|
824
|
+
CUPDLPscaling *scaling = pdhg->scaling;
|
|
825
|
+
#if PDHG_DISPLAY_TERMINATION_CHECK
|
|
826
|
+
if (bool_print) {
|
|
827
|
+
cupdlp_printf("Termination check: %e|%e %e|%e %e|%e\n",
|
|
828
|
+
resobj->dPrimalFeasAverage,
|
|
829
|
+
settings->dPrimalTol * (1.0 + scaling->dNormRhs),
|
|
830
|
+
resobj->dDualFeasAverage,
|
|
831
|
+
settings->dDualTol * (1.0 + scaling->dNormCost),
|
|
832
|
+
resobj->dRelObjGapAverage, settings->dGapTol);
|
|
833
|
+
}
|
|
834
|
+
#endif
|
|
835
|
+
int bool_pass = ((resobj->dPrimalFeasAverage <
|
|
836
|
+
settings->dPrimalTol * (1.0 + scaling->dNormRhs)) &&
|
|
837
|
+
(resobj->dDualFeasAverage <
|
|
838
|
+
settings->dDualTol * (1.0 + scaling->dNormCost)) &&
|
|
839
|
+
(resobj->dRelObjGapAverage < settings->dGapTol));
|
|
840
|
+
return bool_pass;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
void PDHG_Print_Header(CUPDLPwork *pdhg) {
|
|
844
|
+
// cupdlp_printf("%9s %15s %15s %8s %8s %10s %8s %7s\n", "Iter",
|
|
845
|
+
// "Primal.Obj", "Dual.Obj", "Gap", "Compl", "Primal.Inf",
|
|
846
|
+
// "Dual.Inf", "Time");
|
|
847
|
+
cupdlp_printf("%9s %15s %15s %8s %10s %8s %7s\n", "Iter", "Primal.Obj",
|
|
848
|
+
"Dual.Obj", "Gap", "Primal.Inf", "Dual.Inf", "Time");
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
void PDHG_Print_Iter(CUPDLPwork *pdhg) {
|
|
852
|
+
/* Format time as xxx.yy for < 1000s and as integer afterwards. */
|
|
853
|
+
CUPDLPresobj *resobj = pdhg->resobj;
|
|
854
|
+
CUPDLPtimers *timers = pdhg->timers;
|
|
855
|
+
char timeString[8];
|
|
856
|
+
if (timers->dSolvingTime < 100.0)
|
|
857
|
+
cupdlp_snprintf(timeString, 8, "%6.2fs", timers->dSolvingTime);
|
|
858
|
+
else
|
|
859
|
+
cupdlp_snprintf(timeString, 8, "%6ds", (cupdlp_int)timers->dSolvingTime);
|
|
860
|
+
|
|
861
|
+
CUPDLPscaling *scaling = pdhg->scaling;
|
|
862
|
+
const double gap_log_value = resobj->dRelObjGap;
|
|
863
|
+
const double primal_feas_log_value = resobj->dPrimalFeas / (1.0 + scaling->dNormRhs);
|
|
864
|
+
const double dual_feas_log_value = resobj->dDualFeas / (1.0 + scaling->dNormCost);
|
|
865
|
+
cupdlp_printf("%9d %+15.8e %+15.8e %+8.2e %10.2e %8.2e %7s [L]\n",
|
|
866
|
+
timers->nIter, resobj->dPrimalObj, resobj->dDualObj,
|
|
867
|
+
// resobj->dDualityGap, resobj->dPrimalFeas, resobj->dDualFeas,
|
|
868
|
+
gap_log_value, primal_feas_log_value, dual_feas_log_value,
|
|
869
|
+
timeString);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
void PDHG_Print_Iter_Average(CUPDLPwork *pdhg) {
|
|
873
|
+
/* Format time as xxx.yy for < 1000s and as integer afterwards. */
|
|
874
|
+
CUPDLPresobj *resobj = pdhg->resobj;
|
|
875
|
+
CUPDLPtimers *timers = pdhg->timers;
|
|
876
|
+
char timeString[8];
|
|
877
|
+
if (timers->dSolvingTime < 100.0)
|
|
878
|
+
cupdlp_snprintf(timeString, 8, "%6.2fs", timers->dSolvingTime);
|
|
879
|
+
else
|
|
880
|
+
cupdlp_snprintf(timeString, 8, "%6ds", (cupdlp_int)timers->dSolvingTime);
|
|
881
|
+
|
|
882
|
+
CUPDLPscaling *scaling = pdhg->scaling;
|
|
883
|
+
const double gap_log_value = resobj->dRelObjGapAverage;
|
|
884
|
+
const double primal_feas_log_value = resobj->dPrimalFeasAverage / (1.0 + scaling->dNormRhs);
|
|
885
|
+
const double dual_feas_log_value = resobj->dDualFeasAverage / (1.0 + scaling->dNormCost);
|
|
886
|
+
cupdlp_printf("%9d %+15.8e %+15.8e %+8.2e %10.2e %8.2e %7s [A]\n",
|
|
887
|
+
timers->nIter, resobj->dPrimalObjAverage,
|
|
888
|
+
resobj->dDualObjAverage,
|
|
889
|
+
// resobj->dDualityGapAverage, resobj->dPrimalFeasAverage, resobj->dDualFeasAverage,
|
|
890
|
+
gap_log_value, primal_feas_log_value, dual_feas_log_value,
|
|
891
|
+
timeString);
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
void PDHG_Compute_SolvingTime(CUPDLPwork *pdhg) {
|
|
895
|
+
CUPDLPtimers *timers = pdhg->timers;
|
|
896
|
+
timers->dSolvingTime = getTimeStamp() - timers->dSolvingBeg;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
cupdlp_retcode PDHG_Solve(const cupdlp_int* has_variables, CUPDLPwork *pdhg) {
|
|
900
|
+
cupdlp_retcode retcode = RETCODE_OK;
|
|
901
|
+
|
|
902
|
+
CUPDLPproblem *problem = pdhg->problem;
|
|
903
|
+
CUPDLPstepsize *stepsize = pdhg->stepsize;
|
|
904
|
+
CUPDLPsettings *settings = pdhg->settings;
|
|
905
|
+
CUPDLPresobj *resobj = pdhg->resobj;
|
|
906
|
+
CUPDLPiterates *iterates = pdhg->iterates;
|
|
907
|
+
CUPDLPtimers *timers = pdhg->timers;
|
|
908
|
+
CUPDLPscaling *scaling = pdhg->scaling;
|
|
909
|
+
|
|
910
|
+
timers->nIter = 0;
|
|
911
|
+
timers->dSolvingBeg = getTimeStamp();
|
|
912
|
+
|
|
913
|
+
#if PDLP_DEBUG_LOG
|
|
914
|
+
pdhg->debug_pdlp_log_file_ = fopen("cuPDLP.log", "w");
|
|
915
|
+
assert(pdhg->debug_pdlp_log_file_);
|
|
916
|
+
debugPdlpDataInitialise(&pdhg->debug_pdlp_data_);
|
|
917
|
+
#endif
|
|
918
|
+
// PDHG_Init_Data does nothing!
|
|
919
|
+
PDHG_Init_Data(pdhg);
|
|
920
|
+
|
|
921
|
+
CUPDLP_CALL(PDHG_Init_Step_Sizes(pdhg));
|
|
922
|
+
|
|
923
|
+
PDHG_Init_Variables(has_variables, pdhg);
|
|
924
|
+
|
|
925
|
+
// todo: translate check_data into cuda or do it on cpu
|
|
926
|
+
// PDHG_Check_Data(pdhg);
|
|
927
|
+
|
|
928
|
+
// PDHG_Print_Header(pdhg);
|
|
929
|
+
|
|
930
|
+
// Repeat the iteration logging header periodically if logging style
|
|
931
|
+
// is minimal (pdhg->settings->nLogLevel=1), initialising
|
|
932
|
+
// iter_log_since_header so that an initial header is printed
|
|
933
|
+
const int iter_log_between_header = 50;
|
|
934
|
+
int iter_log_since_header = iter_log_between_header;
|
|
935
|
+
#if PDLP_DEBUG_LOG
|
|
936
|
+
debugPdlpIterHeaderLog(pdhg->debug_pdlp_log_file_);
|
|
937
|
+
#endif
|
|
938
|
+
// Main loop!
|
|
939
|
+
for (timers->nIter = 0; timers->nIter < settings->nIterLim; ++timers->nIter) {
|
|
940
|
+
#if PDLP_DEBUG_LOG
|
|
941
|
+
debugPdlpIterLog(pdhg->debug_pdlp_log_file_,
|
|
942
|
+
timers->nIter,
|
|
943
|
+
&pdhg->debug_pdlp_data_,
|
|
944
|
+
pdhg->stepsize->dBeta,
|
|
945
|
+
pdhg->stepsize->dPrimalStep,
|
|
946
|
+
pdhg->stepsize->dDualStep);
|
|
947
|
+
#endif
|
|
948
|
+
PDHG_Compute_SolvingTime(pdhg);
|
|
949
|
+
|
|
950
|
+
#if CUPDLP_DUMP_ITERATES_STATS && CUPDLP_DEBUG
|
|
951
|
+
PDHG_Dump_Stats(pdhg);
|
|
952
|
+
#endif
|
|
953
|
+
int bool_checking = (timers->nIter < 10) ||
|
|
954
|
+
(timers->nIter == (settings->nIterLim - 1)) ||
|
|
955
|
+
(timers->dSolvingTime > settings->dTimeLim);
|
|
956
|
+
int bool_print = 0;
|
|
957
|
+
#if CUPDLP_DEBUG
|
|
958
|
+
bool_checking = (bool_checking || !(timers->nIter % CUPDLP_DEBUG_INTERVAL));
|
|
959
|
+
bool_print = bool_checking;
|
|
960
|
+
#else
|
|
961
|
+
bool_checking =
|
|
962
|
+
(bool_checking || !(timers->nIter % CUPDLP_RELEASE_INTERVAL));
|
|
963
|
+
bool_print =
|
|
964
|
+
(bool_checking && !(timers->nIter % (CUPDLP_RELEASE_INTERVAL *
|
|
965
|
+
settings->nLogInterval))) ||
|
|
966
|
+
(timers->nIter == (settings->nIterLim - 1)) ||
|
|
967
|
+
(timers->dSolvingTime > settings->dTimeLim);
|
|
968
|
+
// Ensure that bool_print is false if the logging level has been
|
|
969
|
+
// set to 0 via the HiGHS option
|
|
970
|
+
bool_print = pdhg->settings->nLogLevel>0 && bool_print;
|
|
971
|
+
#endif
|
|
972
|
+
// Full printing is false only if the logging level has been set
|
|
973
|
+
// to 0 or 1 via the HiGHS option
|
|
974
|
+
int full_print = pdhg->settings->nLogLevel >= 2;
|
|
975
|
+
if (bool_checking) {
|
|
976
|
+
PDHG_Compute_Average_Iterate(pdhg);
|
|
977
|
+
PDHG_Compute_Residuals(pdhg);
|
|
978
|
+
PDHG_Compute_Infeas_Residuals(pdhg);
|
|
979
|
+
|
|
980
|
+
if (bool_print) {
|
|
981
|
+
// With reduced printing, the header is only needed for the
|
|
982
|
+
// first iteration since only average iteration printing is
|
|
983
|
+
// carried out
|
|
984
|
+
if (full_print ||
|
|
985
|
+
iter_log_since_header == iter_log_between_header) {
|
|
986
|
+
PDHG_Print_Header(pdhg);
|
|
987
|
+
iter_log_since_header = 0;
|
|
988
|
+
}
|
|
989
|
+
int print_iter = timers->nIter == 0 || full_print;
|
|
990
|
+
int print_iter_average = timers->nIter > 0 || full_print;
|
|
991
|
+
if (print_iter) PDHG_Print_Iter(pdhg);
|
|
992
|
+
if (print_iter_average) PDHG_Print_Iter_Average(pdhg);
|
|
993
|
+
iter_log_since_header++;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
#if PDLP_DEBUG_LOG
|
|
997
|
+
debugPdlpFeasOptLog(pdhg->debug_pdlp_log_file_,
|
|
998
|
+
pdhg->timers->nIter,
|
|
999
|
+
pdhg->resobj->dPrimalObj,
|
|
1000
|
+
pdhg->resobj->dDualObj,
|
|
1001
|
+
pdhg->resobj->dRelObjGap,
|
|
1002
|
+
pdhg->resobj->dPrimalFeas / (1.0 + pdhg->scaling->dNormRhs),
|
|
1003
|
+
pdhg->resobj->dDualFeas / (1.0 + pdhg->scaling->dNormCost), "[L]");
|
|
1004
|
+
debugPdlpFeasOptLog(pdhg->debug_pdlp_log_file_,
|
|
1005
|
+
pdhg->timers->nIter,
|
|
1006
|
+
pdhg->resobj->dPrimalObjAverage,
|
|
1007
|
+
pdhg->resobj->dDualObjAverage,
|
|
1008
|
+
pdhg->resobj->dRelObjGapAverage,
|
|
1009
|
+
pdhg->resobj->dPrimalFeasAverage / (1.0 + pdhg->scaling->dNormRhs),
|
|
1010
|
+
pdhg->resobj->dDualFeasAverage / (1.0 + pdhg->scaling->dNormCost), "[A]");
|
|
1011
|
+
debugPdlpIterHeaderLog(pdhg->debug_pdlp_log_file_);
|
|
1012
|
+
#endif
|
|
1013
|
+
// Termination check printing is only done when printing is full
|
|
1014
|
+
int termination_print = bool_print && full_print;
|
|
1015
|
+
if (PDHG_Check_Termination(pdhg, termination_print)) {
|
|
1016
|
+
// cupdlp_printf("Optimal current solution.\n");
|
|
1017
|
+
resobj->termIterate = LAST_ITERATE;
|
|
1018
|
+
resobj->termCode = OPTIMAL;
|
|
1019
|
+
break;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
if (PDHG_Check_Termination_Average(pdhg, termination_print)) {
|
|
1023
|
+
// cupdlp_printf("Optimal average solution.\n");
|
|
1024
|
+
|
|
1025
|
+
cupdlp_int iter = pdhg->timers->nIter;
|
|
1026
|
+
CUPDLPvec *x = iterates->x[iter % 2];
|
|
1027
|
+
CUPDLPvec *y = iterates->y[iter % 2];
|
|
1028
|
+
CUPDLPvec *ax = iterates->ax[iter % 2];
|
|
1029
|
+
CUPDLPvec *aty = iterates->aty[iter % 2];
|
|
1030
|
+
|
|
1031
|
+
CUPDLP_COPY_VEC(x->data, iterates->xAverage->data, cupdlp_float, problem->nCols);
|
|
1032
|
+
CUPDLP_COPY_VEC(y->data, iterates->yAverage->data, cupdlp_float, problem->nRows);
|
|
1033
|
+
CUPDLP_COPY_VEC(ax->data, iterates->axAverage->data, cupdlp_float, problem->nRows);
|
|
1034
|
+
CUPDLP_COPY_VEC(aty->data, iterates->atyAverage->data, cupdlp_float, problem->nCols);
|
|
1035
|
+
CUPDLP_COPY_VEC(resobj->dSlackPos, resobj->dSlackPosAverage, cupdlp_float, problem->nCols);
|
|
1036
|
+
CUPDLP_COPY_VEC(resobj->dSlackNeg, resobj->dSlackNegAverage, cupdlp_float, problem->nCols);
|
|
1037
|
+
|
|
1038
|
+
resobj->termIterate = AVERAGE_ITERATE;
|
|
1039
|
+
resobj->termCode = OPTIMAL;
|
|
1040
|
+
break;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
if (PDHG_Check_Infeasibility(pdhg, 0) == INFEASIBLE_OR_UNBOUNDED) {
|
|
1044
|
+
// cupdlp_printf("Infeasible or unbounded.\n");
|
|
1045
|
+
// if (resobj->primalCode == INFEASIBLE && resobj->dualCode == FEASIBLE)
|
|
1046
|
+
// {
|
|
1047
|
+
// resobj->dualCode = UNBOUNDED;
|
|
1048
|
+
// } else if (resobj->primalCode == FEASIBLE &&
|
|
1049
|
+
// resobj->dualCode == INFEASIBLE) {
|
|
1050
|
+
// resobj->primalCode = UNBOUNDED;
|
|
1051
|
+
// }
|
|
1052
|
+
// resobj->termCode = resobj->primalCode;
|
|
1053
|
+
resobj->termCode = INFEASIBLE_OR_UNBOUNDED;
|
|
1054
|
+
break;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
if (timers->dSolvingTime > settings->dTimeLim) {
|
|
1058
|
+
// cupdlp_printf("Time limit reached.\n");
|
|
1059
|
+
resobj->termCode = TIMELIMIT_OR_ITERLIMIT;
|
|
1060
|
+
break;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
if (timers->nIter >= (settings->nIterLim - 1)) {
|
|
1064
|
+
// cupdlp_printf("Iteration limit reached.\n");
|
|
1065
|
+
resobj->termCode = TIMELIMIT_OR_ITERLIMIT;
|
|
1066
|
+
break;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
PDHG_Restart_Iterate(pdhg);
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
CUPDLPvec *ax = iterates->ax[timers->nIter % 2];
|
|
1073
|
+
CUPDLPvec *aty = iterates->aty[timers->nIter % 2];
|
|
1074
|
+
|
|
1075
|
+
#if PDLP_DEBUG_LOG
|
|
1076
|
+
double debug_pdlp_data_ax_norm = 0.0;
|
|
1077
|
+
cupdlp_twoNorm(pdhg, problem->nRows, ax->data,
|
|
1078
|
+
&debug_pdlp_data_ax_norm);
|
|
1079
|
+
pdhg->debug_pdlp_data_.ax_norm = debug_pdlp_data_ax_norm;
|
|
1080
|
+
double debug_pdlp_data_aty_norm = 0.0;
|
|
1081
|
+
cupdlp_twoNorm(pdhg, problem->nCols, aty->data, &debug_pdlp_data_aty_norm);
|
|
1082
|
+
pdhg->debug_pdlp_data_.aty_norm = debug_pdlp_data_aty_norm;
|
|
1083
|
+
#endif
|
|
1084
|
+
// CUPDLP_CALL(PDHG_Update_Iterate(pdhg));
|
|
1085
|
+
if (PDHG_Update_Iterate(pdhg) == RETCODE_FAILED) {
|
|
1086
|
+
// cupdlp_printf("Time limit reached.\n");
|
|
1087
|
+
resobj->termCode = TIMELIMIT_OR_ITERLIMIT;
|
|
1088
|
+
break;
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
// print at last
|
|
1093
|
+
if (pdhg->settings->nLogLevel>0 && timers->nIter > 0) {
|
|
1094
|
+
int full_print = pdhg->settings->nLogLevel >= 2;
|
|
1095
|
+
if (full_print) PDHG_Print_Header(pdhg);
|
|
1096
|
+
int print_iter = resobj->termIterate == LAST_ITERATE || full_print;
|
|
1097
|
+
int print_iter_average = resobj->termIterate == AVERAGE_ITERATE || full_print;
|
|
1098
|
+
if (print_iter) PDHG_Print_Iter(pdhg);
|
|
1099
|
+
if (print_iter_average) PDHG_Print_Iter_Average(pdhg);
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
if (pdhg->settings->nLogLevel>0) {
|
|
1103
|
+
cupdlp_printf("\n");
|
|
1104
|
+
cupdlp_printf("%-27s ", "Solving information:");
|
|
1105
|
+
|
|
1106
|
+
switch (resobj->termCode) {
|
|
1107
|
+
case OPTIMAL:
|
|
1108
|
+
if (resobj->termIterate == LAST_ITERATE) {
|
|
1109
|
+
cupdlp_printf("Optimal current solution.\n");
|
|
1110
|
+
} else if (resobj->termIterate == AVERAGE_ITERATE) {
|
|
1111
|
+
cupdlp_printf("Optimal average solution.\n");
|
|
1112
|
+
}
|
|
1113
|
+
break;
|
|
1114
|
+
case TIMELIMIT_OR_ITERLIMIT:
|
|
1115
|
+
if (timers->dSolvingTime > settings->dTimeLim) {
|
|
1116
|
+
cupdlp_printf("Time limit reached.\n");
|
|
1117
|
+
} else if (timers->nIter >= (settings->nIterLim - 1)) {
|
|
1118
|
+
cupdlp_printf("Iteration limit reached.\n");
|
|
1119
|
+
}
|
|
1120
|
+
break;
|
|
1121
|
+
case INFEASIBLE_OR_UNBOUNDED:
|
|
1122
|
+
if (resobj->primalCode == INFEASIBLE && resobj->dualCode == FEASIBLE) {
|
|
1123
|
+
cupdlp_printf("Infeasible or unbounded: primal infeasible.");
|
|
1124
|
+
} else if (resobj->primalCode == FEASIBLE &&
|
|
1125
|
+
resobj->dualCode == INFEASIBLE) {
|
|
1126
|
+
cupdlp_printf("Infeasible or unbounded: dual infeasible.");
|
|
1127
|
+
} else {
|
|
1128
|
+
cupdlp_printf(
|
|
1129
|
+
"Infeasible or unbounded: both primal and dual infeasible.");
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
if (resobj->termInfeasIterate == LAST_ITERATE) {
|
|
1133
|
+
cupdlp_printf(" [L]\n");
|
|
1134
|
+
} else if (resobj->termInfeasIterate == AVERAGE_ITERATE) {
|
|
1135
|
+
cupdlp_printf(" [A]\n");
|
|
1136
|
+
}
|
|
1137
|
+
break;
|
|
1138
|
+
default:
|
|
1139
|
+
cupdlp_printf("Unexpected.\n");
|
|
1140
|
+
break;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
if (resobj->termCode == OPTIMAL && resobj->termIterate == AVERAGE_ITERATE) {
|
|
1144
|
+
cupdlp_printf("%27s %+15.8e\n",
|
|
1145
|
+
"Primal objective:", resobj->dPrimalObjAverage);
|
|
1146
|
+
cupdlp_printf("%27s %+15.8e\n", "Dual objective:", resobj->dDualObjAverage);
|
|
1147
|
+
cupdlp_printf("%27s %8.2e / %8.2e\n",
|
|
1148
|
+
"Primal infeas (abs/rel):", resobj->dPrimalFeasAverage,
|
|
1149
|
+
resobj->dPrimalFeasAverage / (1.0 + scaling->dNormRhs));
|
|
1150
|
+
cupdlp_printf("%27s %8.2e / %8.2e\n",
|
|
1151
|
+
"Dual infeas (abs/rel):", resobj->dDualFeasAverage,
|
|
1152
|
+
resobj->dDualFeasAverage / (1.0 + scaling->dNormCost));
|
|
1153
|
+
cupdlp_printf("%27s %8.2e / %8.2e\n",
|
|
1154
|
+
"Duality gap (abs/rel):", fabs(resobj->dDualityGapAverage),
|
|
1155
|
+
resobj->dRelObjGapAverage);
|
|
1156
|
+
} else {
|
|
1157
|
+
cupdlp_printf("%27s %+15.8e\n", "Primal objective:", resobj->dPrimalObj);
|
|
1158
|
+
cupdlp_printf("%27s %+15.8e\n", "Dual objective:", resobj->dDualObj);
|
|
1159
|
+
cupdlp_printf("%27s %8.2e / %8.2e\n",
|
|
1160
|
+
"Primal infeas (abs/rel):", resobj->dPrimalFeas,
|
|
1161
|
+
resobj->dPrimalFeas / (1.0 + scaling->dNormRhs));
|
|
1162
|
+
cupdlp_printf("%27s %8.2e / %8.2e\n",
|
|
1163
|
+
"Dual infeas (abs/rel):", resobj->dDualFeas,
|
|
1164
|
+
resobj->dDualFeas / (1.0 + scaling->dNormCost));
|
|
1165
|
+
cupdlp_printf("%27s %8.2e / %8.2e\n",
|
|
1166
|
+
"Duality gap (abs/rel):", fabs(resobj->dDualityGap),
|
|
1167
|
+
resobj->dRelObjGap);
|
|
1168
|
+
}
|
|
1169
|
+
cupdlp_printf("%27s %d\n", "Number of iterations:", timers->nIter);
|
|
1170
|
+
cupdlp_printf("\n");
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
#if PDHG_USE_TIMERS
|
|
1174
|
+
if (pdhg->settings->nLogLevel>1) {
|
|
1175
|
+
cupdlp_printf("Timing information:\n");
|
|
1176
|
+
// cupdlp_printf("%21s %e in %d iterations\n", "Total solver time",
|
|
1177
|
+
// timers->dSolvingTime, timers->nIter);
|
|
1178
|
+
cupdlp_printf(
|
|
1179
|
+
"%21s %e in %d iterations\n", "Total solver time",
|
|
1180
|
+
timers->dSolvingTime + timers->dScalingTime + timers->dPresolveTime,
|
|
1181
|
+
timers->nIter);
|
|
1182
|
+
cupdlp_printf("%21s %e in %d iterations\n", "Solve time",
|
|
1183
|
+
timers->dSolvingTime, timers->nIter);
|
|
1184
|
+
cupdlp_printf("%21s %e \n", "Iters per sec",
|
|
1185
|
+
timers->nIter / timers->dSolvingTime);
|
|
1186
|
+
cupdlp_printf("%21s %e\n", "Scaling time", timers->dScalingTime);
|
|
1187
|
+
cupdlp_printf("%21s %e\n", "Presolve time", timers->dPresolveTime);
|
|
1188
|
+
cupdlp_printf("%21s %e in %d calls\n", "Ax", timers->dAxTime,
|
|
1189
|
+
timers->nAxCalls);
|
|
1190
|
+
cupdlp_printf("%21s %e in %d calls\n", "Aty", timers->dAtyTime,
|
|
1191
|
+
timers->nAtyCalls);
|
|
1192
|
+
cupdlp_printf("%21s %e in %d calls\n", "ComputeResiduals",
|
|
1193
|
+
timers->dComputeResidualsTime, timers->nComputeResidualsCalls);
|
|
1194
|
+
cupdlp_printf("%21s %e in %d calls\n", "UpdateIterates",
|
|
1195
|
+
timers->dUpdateIterateTime, timers->nUpdateIterateCalls);
|
|
1196
|
+
}
|
|
1197
|
+
#endif
|
|
1198
|
+
|
|
1199
|
+
#ifndef CUPDLP_CPU
|
|
1200
|
+
if (pdhg->settings->nLogLevel>1) {
|
|
1201
|
+
cupdlp_printf("\n");
|
|
1202
|
+
cupdlp_printf("GPU Timing information:\n");
|
|
1203
|
+
cupdlp_printf("%21s %e\n", "CudaPrepare", timers->CudaPrepareTime);
|
|
1204
|
+
cupdlp_printf("%21s %e\n", "Alloc&CopyMatToDevice",
|
|
1205
|
+
timers->AllocMem_CopyMatToDeviceTime);
|
|
1206
|
+
cupdlp_printf("%21s %e\n", "CopyVecToDevice", timers->CopyVecToDeviceTime);
|
|
1207
|
+
cupdlp_printf("%21s %e\n", "DeviceMatVecProd", timers->DeviceMatVecProdTime);
|
|
1208
|
+
cupdlp_printf("%21s %e\n\n", "CopyVecToHost", timers->CopyVecToHostTime);
|
|
1209
|
+
}
|
|
1210
|
+
#endif
|
|
1211
|
+
|
|
1212
|
+
exit_cleanup:
|
|
1213
|
+
//fclose(pdhg->debug_pdlp_log_file_);
|
|
1214
|
+
return retcode;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
cupdlp_retcode PDHG_PreSolve(CUPDLPwork *pdhg, cupdlp_int nCols_origin,
|
|
1218
|
+
cupdlp_int *constraint_new_idx,
|
|
1219
|
+
cupdlp_int *constraint_type,
|
|
1220
|
+
cupdlp_float *col_value, cupdlp_float *col_dual,
|
|
1221
|
+
cupdlp_float *row_value, cupdlp_float *row_dual,
|
|
1222
|
+
cupdlp_int *value_valid, cupdlp_int *dual_valid) {
|
|
1223
|
+
cupdlp_retcode retcode = RETCODE_OK;
|
|
1224
|
+
if (!*value_valid || !*dual_valid) {
|
|
1225
|
+
// Nothing to presolve
|
|
1226
|
+
return retcode;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
CUPDLPproblem *problem = pdhg->problem;
|
|
1230
|
+
CUPDLPiterates *iterates = pdhg->iterates;
|
|
1231
|
+
CUPDLPscaling *scaling = pdhg->scaling;
|
|
1232
|
+
CUPDLPresobj *resobj = pdhg->resobj;
|
|
1233
|
+
cupdlp_float sense = problem->sense_origin;
|
|
1234
|
+
|
|
1235
|
+
CUPDLPvec *x = iterates->x[0];
|
|
1236
|
+
CUPDLPvec *y = iterates->y[0];
|
|
1237
|
+
|
|
1238
|
+
assert(constraint_new_idx);
|
|
1239
|
+
assert(constraint_type);
|
|
1240
|
+
|
|
1241
|
+
// Have to build cuPDLP-C solution in CPU row and column buffers, so
|
|
1242
|
+
// that only copy operations are required to put the cuPDLP-C
|
|
1243
|
+
// solution into GPU buffers
|
|
1244
|
+
cupdlp_float *col_buffer = NULL;
|
|
1245
|
+
cupdlp_float *row_buffer = NULL;
|
|
1246
|
+
CUPDLP_INIT_DOUBLE(col_buffer, problem->nCols);
|
|
1247
|
+
CUPDLP_INIT_DOUBLE(row_buffer, problem->nRows);
|
|
1248
|
+
|
|
1249
|
+
|
|
1250
|
+
CUPDLP_ZERO_VEC(x->data, cupdlp_float, problem->nCols);
|
|
1251
|
+
CUPDLP_ZERO_VEC(y->data, cupdlp_float, problem->nRows);
|
|
1252
|
+
|
|
1253
|
+
|
|
1254
|
+
int iCol = 0;
|
|
1255
|
+
for (; iCol < nCols_origin; iCol++)
|
|
1256
|
+
col_buffer[iCol] = col_value[iCol];
|
|
1257
|
+
|
|
1258
|
+
for (int iRow = 0; iRow < problem->nRows; iRow++) {
|
|
1259
|
+
const double mu = constraint_type[iRow] == 1 ? -1 : 1;
|
|
1260
|
+
row_buffer[constraint_new_idx[iRow]] = sense * mu * row_dual[iRow];
|
|
1261
|
+
if (constraint_type[iRow] == 3)
|
|
1262
|
+
col_buffer[iCol++] = row_value[iRow];
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
// Copy into GPU buffers
|
|
1266
|
+
CUPDLP_COPY_VEC(x->data, col_buffer, cupdlp_float, problem->nCols);
|
|
1267
|
+
CUPDLP_COPY_VEC(y->data, row_buffer, cupdlp_float, problem->nRows);
|
|
1268
|
+
|
|
1269
|
+
// Scale
|
|
1270
|
+
if (scaling->ifScaled) {
|
|
1271
|
+
cupdlp_edot(x->data, pdhg->colScale, problem->nCols);
|
|
1272
|
+
cupdlp_edot(y->data, pdhg->rowScale, problem->nRows);
|
|
1273
|
+
}
|
|
1274
|
+
exit_cleanup:
|
|
1275
|
+
// free buffer
|
|
1276
|
+
CUPDLP_FREE(col_buffer);
|
|
1277
|
+
CUPDLP_FREE(row_buffer);
|
|
1278
|
+
return retcode;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
cupdlp_retcode PDHG_PostSolve(CUPDLPwork *pdhg, cupdlp_int nCols_origin,
|
|
1282
|
+
cupdlp_int *constraint_new_idx,
|
|
1283
|
+
cupdlp_int *constraint_type,
|
|
1284
|
+
cupdlp_float *col_value, cupdlp_float *col_dual,
|
|
1285
|
+
cupdlp_float *row_value, cupdlp_float *row_dual,
|
|
1286
|
+
cupdlp_int *value_valid, cupdlp_int *dual_valid) {
|
|
1287
|
+
cupdlp_retcode retcode = RETCODE_OK;
|
|
1288
|
+
|
|
1289
|
+
CUPDLPproblem *problem = pdhg->problem;
|
|
1290
|
+
CUPDLPiterates *iterates = pdhg->iterates;
|
|
1291
|
+
CUPDLPscaling *scaling = pdhg->scaling;
|
|
1292
|
+
CUPDLPresobj *resobj = pdhg->resobj;
|
|
1293
|
+
cupdlp_float sense = problem->sense_origin;
|
|
1294
|
+
|
|
1295
|
+
// flag
|
|
1296
|
+
cupdlp_int col_value_flag = 0;
|
|
1297
|
+
cupdlp_int col_dual_flag = 0;
|
|
1298
|
+
cupdlp_int row_value_flag = 0;
|
|
1299
|
+
cupdlp_int row_dual_flag = 0;
|
|
1300
|
+
|
|
1301
|
+
// allocate buffer
|
|
1302
|
+
cupdlp_float *col_buffer = NULL;
|
|
1303
|
+
cupdlp_float *row_buffer = NULL;
|
|
1304
|
+
cupdlp_float *col_buffer2 = NULL;
|
|
1305
|
+
// no need for row_buffer2
|
|
1306
|
+
// cupdlp_float *row_buffer2 = NULL;
|
|
1307
|
+
CUPDLP_INIT_DOUBLE(col_buffer, problem->nCols);
|
|
1308
|
+
CUPDLP_INIT_DOUBLE(row_buffer, problem->nRows);
|
|
1309
|
+
CUPDLP_INIT_DOUBLE(col_buffer2, problem->nCols);
|
|
1310
|
+
// CUPDLP_INIT_DOUBLE(row_buffer2, problem->nRows);
|
|
1311
|
+
|
|
1312
|
+
|
|
1313
|
+
cupdlp_int iter = pdhg->timers->nIter;
|
|
1314
|
+
CUPDLPvec *x = iterates->x[iter % 2];
|
|
1315
|
+
CUPDLPvec *y = iterates->y[iter % 2];
|
|
1316
|
+
CUPDLPvec *ax = iterates->ax[iter % 2];
|
|
1317
|
+
CUPDLPvec *aty = iterates->aty[iter % 2];
|
|
1318
|
+
|
|
1319
|
+
/*
|
|
1320
|
+
for (int iCol = 0; iCol < problem->nCols; iCol++)
|
|
1321
|
+
printf("PDHG_PostSolve: Col %d primal value = %9.3g\n", iCol, x->data[iCol]);
|
|
1322
|
+
for (int iRow = 0; iRow < problem->nRows; iRow++)
|
|
1323
|
+
printf("PDHG_PostSolve: Row %d dual value = %9.3g\n", iRow, y->data[iRow]);
|
|
1324
|
+
*/
|
|
1325
|
+
|
|
1326
|
+
// unscale
|
|
1327
|
+
if (scaling->ifScaled) {
|
|
1328
|
+
cupdlp_ediv(x->data, pdhg->colScale, problem->nCols);
|
|
1329
|
+
cupdlp_ediv(y->data, pdhg->rowScale, problem->nRows);
|
|
1330
|
+
cupdlp_edot(resobj->dSlackPos, pdhg->colScale, problem->nCols);
|
|
1331
|
+
cupdlp_edot(resobj->dSlackNeg, pdhg->colScale, problem->nCols);
|
|
1332
|
+
cupdlp_edot(ax->data, pdhg->rowScale, problem->nRows);
|
|
1333
|
+
cupdlp_edot(aty->data, pdhg->colScale, problem->nCols);
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
// col value: extract x from (x, z)
|
|
1337
|
+
if (col_value) {
|
|
1338
|
+
CUPDLP_COPY_VEC(col_value, x->data, cupdlp_float, nCols_origin);
|
|
1339
|
+
|
|
1340
|
+
col_value_flag = 1;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
// row value
|
|
1344
|
+
if (row_value) {
|
|
1345
|
+
if (constraint_new_idx) {
|
|
1346
|
+
CUPDLP_COPY_VEC(row_buffer, ax->data, cupdlp_float,
|
|
1347
|
+
problem->nRows);
|
|
1348
|
+
|
|
1349
|
+
// un-permute row value
|
|
1350
|
+
for (int i = 0; i < problem->nRows; i++) {
|
|
1351
|
+
row_value[i] = row_buffer[constraint_new_idx[i]];
|
|
1352
|
+
}
|
|
1353
|
+
} else {
|
|
1354
|
+
CUPDLP_COPY_VEC(row_value, ax->data, cupdlp_float,
|
|
1355
|
+
problem->nRows);
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
if (constraint_type) {
|
|
1359
|
+
CUPDLP_COPY_VEC(col_buffer, x->data, cupdlp_float,
|
|
1360
|
+
problem->nCols);
|
|
1361
|
+
|
|
1362
|
+
// EQ = 0, LEQ = 1, GEQ = 2, BOUND = 3
|
|
1363
|
+
for (int i = 0, j = 0; i < problem->nRows; i++) {
|
|
1364
|
+
if (constraint_type[i] == 1) { // LEQ: multiply -1
|
|
1365
|
+
row_value[i] = -row_value[i];
|
|
1366
|
+
} else if (constraint_type[i] == 3) { // BOUND: get Ax from Ax - z
|
|
1367
|
+
row_value[i] = row_value[i] + col_buffer[nCols_origin + j];
|
|
1368
|
+
j++;
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
row_value_flag = 1;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
// col duals of l <= x <= u
|
|
1377
|
+
if (col_dual) {
|
|
1378
|
+
CUPDLP_COPY_VEC(col_buffer, resobj->dSlackPos, cupdlp_float, nCols_origin);
|
|
1379
|
+
CUPDLP_COPY_VEC(col_buffer2, resobj->dSlackNeg, cupdlp_float, nCols_origin);
|
|
1380
|
+
|
|
1381
|
+
for (int i = 0; i < nCols_origin; i++) {
|
|
1382
|
+
col_dual[i] = col_buffer[i] - col_buffer2[i];
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
ScaleVector(sense, col_dual, nCols_origin);
|
|
1386
|
+
|
|
1387
|
+
col_dual_flag = 1;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
// row dual: recover y
|
|
1391
|
+
if (row_dual) {
|
|
1392
|
+
if (constraint_new_idx) {
|
|
1393
|
+
CUPDLP_COPY_VEC(row_buffer, y->data, cupdlp_float,
|
|
1394
|
+
problem->nRows);
|
|
1395
|
+
// un-permute row dual
|
|
1396
|
+
for (int i = 0; i < problem->nRows; i++) {
|
|
1397
|
+
row_dual[i] = row_buffer[constraint_new_idx[i]];
|
|
1398
|
+
}
|
|
1399
|
+
} else {
|
|
1400
|
+
CUPDLP_COPY_VEC(row_dual, y->data, cupdlp_float,
|
|
1401
|
+
problem->nRows);
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
ScaleVector(sense, row_dual, problem->nRows);
|
|
1405
|
+
|
|
1406
|
+
if (constraint_type) {
|
|
1407
|
+
// EQ = 0, LEQ = 1, GEQ = 2, BOUND = 3
|
|
1408
|
+
for (int i = 0; i < problem->nRows; i++) {
|
|
1409
|
+
if (constraint_type[i] == 1) { // LEQ: multiply -1
|
|
1410
|
+
row_dual[i] = -row_dual[i];
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
row_dual_flag = 1;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
// valid
|
|
1419
|
+
if (value_valid) {
|
|
1420
|
+
*value_valid = col_value_flag && row_value_flag;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
if (dual_valid) {
|
|
1424
|
+
*dual_valid = col_dual_flag && row_dual_flag;
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
exit_cleanup:
|
|
1428
|
+
// free buffer
|
|
1429
|
+
CUPDLP_FREE(col_buffer);
|
|
1430
|
+
CUPDLP_FREE(row_buffer);
|
|
1431
|
+
CUPDLP_FREE(col_buffer2);
|
|
1432
|
+
// CUPDLP_FREE(row_buffer2);
|
|
1433
|
+
|
|
1434
|
+
return retcode;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
cupdlp_retcode LP_SolvePDHG(
|
|
1438
|
+
CUPDLPwork *pdhg, cupdlp_bool *ifChangeIntParam, cupdlp_int *intParam,
|
|
1439
|
+
cupdlp_bool *ifChangeFloatParam, cupdlp_float *floatParam, char *fp,
|
|
1440
|
+
cupdlp_int nCols_origin, cupdlp_float *col_value, cupdlp_float *col_dual,
|
|
1441
|
+
cupdlp_float *row_value, cupdlp_float *row_dual, cupdlp_int *value_valid,
|
|
1442
|
+
cupdlp_int *dual_valid, cupdlp_bool ifSaveSol, char *fp_sol,
|
|
1443
|
+
cupdlp_int *constraint_new_idx, cupdlp_int *constraint_type,
|
|
1444
|
+
cupdlp_int *model_status, cupdlp_int* num_iter) {
|
|
1445
|
+
cupdlp_retcode retcode = RETCODE_OK;
|
|
1446
|
+
|
|
1447
|
+
// Set the parameters first - which is silent
|
|
1448
|
+
CUPDLP_CALL(PDHG_SetUserParam(pdhg, ifChangeIntParam, intParam,
|
|
1449
|
+
ifChangeFloatParam, floatParam));
|
|
1450
|
+
|
|
1451
|
+
// Call PDHG_PrintHugeCUPDHG() if logging level (set in
|
|
1452
|
+
// PDHG_SetUserParam) is verbose
|
|
1453
|
+
if (pdhg->settings->nLogLevel > 1)
|
|
1454
|
+
PDHG_PrintHugeCUPDHG();
|
|
1455
|
+
|
|
1456
|
+
#if !defined(CUPDLP_CPU)
|
|
1457
|
+
if (pdhg->settings->nLogLevel > 0)
|
|
1458
|
+
print_cuda_info(pdhg->cusparsehandle);
|
|
1459
|
+
#endif
|
|
1460
|
+
|
|
1461
|
+
CUPDLP_CALL(PDHG_PreSolve(pdhg, nCols_origin, constraint_new_idx,
|
|
1462
|
+
constraint_type, col_value, col_dual, row_value,
|
|
1463
|
+
row_dual, value_valid, dual_valid));
|
|
1464
|
+
|
|
1465
|
+
cupdlp_int has_variables = (*value_valid + *dual_valid) != 0;
|
|
1466
|
+
|
|
1467
|
+
if (pdhg->settings->nLogLevel>0 && has_variables)
|
|
1468
|
+
cupdlp_printf("Hot starting with given column primal values and row dual values\n");
|
|
1469
|
+
|
|
1470
|
+
CUPDLP_CALL(PDHG_Solve(&has_variables, pdhg));
|
|
1471
|
+
|
|
1472
|
+
*model_status = (cupdlp_int)pdhg->resobj->termCode;
|
|
1473
|
+
*num_iter = (cupdlp_int)pdhg->timers->nIter;
|
|
1474
|
+
|
|
1475
|
+
CUPDLP_CALL(PDHG_PostSolve(pdhg, nCols_origin, constraint_new_idx,
|
|
1476
|
+
constraint_type, col_value, col_dual, row_value,
|
|
1477
|
+
row_dual, value_valid, dual_valid));
|
|
1478
|
+
|
|
1479
|
+
if (fp)
|
|
1480
|
+
writeJson(fp, pdhg);
|
|
1481
|
+
|
|
1482
|
+
if (ifSaveSol && fp_sol) {
|
|
1483
|
+
if (strcmp(fp, fp_sol) != 0) {
|
|
1484
|
+
writeSol(fp_sol, nCols_origin, pdhg->problem->nRows, col_value, col_dual,
|
|
1485
|
+
row_value, row_dual);
|
|
1486
|
+
} else {
|
|
1487
|
+
if (pdhg->settings->nLogLevel>0)
|
|
1488
|
+
cupdlp_printf("Warning: fp and fp_sol are the same, stop saving solution.\n");
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
exit_cleanup:
|
|
1493
|
+
// Move this to CupdlpWrapper so pdhg->debug_pdlp_log_file_ can
|
|
1494
|
+
// still be used
|
|
1495
|
+
//
|
|
1496
|
+
// PDHG_Destroy(&pdhg);
|
|
1497
|
+
return retcode;
|
|
1498
|
+
}
|