casadi 3.6.5__cp39-none-win_amd64.whl → 3.6.7__cp39-none-win_amd64.whl
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.
- casadi/_casadi.pyd +0 -0
- casadi/bin/libtinyxml2.dll +0 -0
- casadi/blasfeo.lib +0 -0
- casadi/casadi-cli.exe +0 -0
- casadi/casadi.lib +0 -0
- casadi/casadi.py +739 -308
- casadi/cbc.exe +0 -0
- casadi/clp.exe +0 -0
- casadi/cmake/casadi-config-version.cmake +1 -1
- casadi/cmake/highs/highs-config.cmake +7 -14
- casadi/cmake/highs/highs-targets-release.cmake +13 -13
- casadi/cmake/highs/highs-targets.cmake +11 -9
- casadi/daqp.lib +0 -0
- casadi/fatrop.lib +0 -0
- casadi/highs.exe +0 -0
- casadi/highs.lib +0 -0
- casadi/hpipm.lib +0 -0
- casadi/include/casadi/casadi.i +3 -0
- casadi/include/casadi/casadi_c.h +2 -0
- casadi/include/casadi/config.h +8 -8
- casadi/include/casadi/core/casadi_common.hpp +1 -0
- casadi/include/casadi/core/casadi_misc.hpp +52 -0
- casadi/include/casadi/core/casadi_types.hpp +3 -2
- casadi/include/casadi/core/code_generator.hpp +30 -1
- casadi/include/casadi/core/global_options.hpp +2 -0
- casadi/include/casadi/core/mx.hpp +18 -3
- casadi/include/casadi/core/optistack.hpp +23 -0
- casadi/include/casadi/core/runtime/casadi_nlp.hpp +19 -4
- casadi/include/casadi/core/runtime/casadi_ocp_block.hpp +55 -0
- casadi/include/casadi/core/runtime/casadi_oracle.hpp +44 -0
- casadi/include/casadi/core/runtime/casadi_oracle_callback.hpp +39 -0
- casadi/include/casadi/core/runtime/casadi_runtime.hpp +4 -1
- casadi/include/casadi/core/runtime/casadi_scaled_copy.hpp +31 -0
- casadi/include/casadi/core/serializing_stream.hpp +2 -2
- casadi/include/casadi/core/sparsity.hpp +7 -0
- casadi/include/casadi/doc.i +1513 -1016
- casadi/include/casadi/doc_merged.i +965 -719
- casadi/include/casadi/mem.h +1 -0
- casadi/include/daqp/api.h +46 -0
- casadi/include/daqp/auxiliary.h +29 -0
- casadi/include/daqp/bnb.h +32 -0
- casadi/include/daqp/codegen.h +18 -0
- casadi/include/daqp/constants.h +92 -0
- casadi/include/daqp/daqp.h +22 -0
- casadi/include/daqp/daqp_prox.h +18 -0
- casadi/include/daqp/factorization.h +18 -0
- casadi/include/daqp/types.h +161 -0
- casadi/include/daqp/utils.h +44 -0
- casadi/include/dlfcn.h +94 -0
- casadi/include/fatrop/auxiliary/Common.hpp +34 -0
- casadi/include/fatrop/auxiliary/DynamicLib.hpp +34 -0
- casadi/include/fatrop/auxiliary/FatropOptions.hpp +68 -0
- casadi/include/fatrop/auxiliary/FatropVector.hpp +143 -0
- casadi/include/fatrop/auxiliary/LinearAlgebra.hpp +88 -0
- casadi/include/fatrop/auxiliary/VectorUtils.hpp +54 -0
- casadi/include/fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp +493 -0
- casadi/include/fatrop/fatrop.hpp +39 -0
- casadi/include/fatrop/function_evaluation/CasadiCodegen.hpp +104 -0
- casadi/include/fatrop/function_evaluation/FunctionEvaluation.hpp +60 -0
- casadi/include/fatrop/json/json.h +946 -0
- casadi/include/fatrop/ocp/CasadiCApiUserdataWrap.hpp +87 -0
- casadi/include/fatrop/ocp/DuInfEvaluator.hpp +38 -0
- casadi/include/fatrop/ocp/FatropOCP.hpp +161 -0
- casadi/include/fatrop/ocp/FatropOCPBuilder.hpp +52 -0
- casadi/include/fatrop/ocp/FatropOCPResto.hpp +299 -0
- casadi/include/fatrop/ocp/OCP.hpp +82 -0
- casadi/include/fatrop/ocp/OCPAbstract.hpp +254 -0
- casadi/include/fatrop/ocp/OCPAdapter.hpp +197 -0
- casadi/include/fatrop/ocp/OCPCInterface.h +289 -0
- casadi/include/fatrop/ocp/OCPDims.hpp +60 -0
- casadi/include/fatrop/ocp/OCPInitializer.hpp +41 -0
- casadi/include/fatrop/ocp/OCPKKT.hpp +69 -0
- casadi/include/fatrop/ocp/OCPLSRiccati.hpp +198 -0
- casadi/include/fatrop/ocp/OCPLSScaler.hpp +66 -0
- casadi/include/fatrop/ocp/OCPLinearSolver.hpp +75 -0
- casadi/include/fatrop/ocp/OCPNoScaling.hpp +42 -0
- casadi/include/fatrop/ocp/OCPScalingMethod.hpp +42 -0
- casadi/include/fatrop/ocp/StageOCP.hpp +592 -0
- casadi/include/fatrop/ocp/StageOCPApplication.hpp +242 -0
- casadi/include/fatrop/ocp/StageOCPExpressions.hpp +182 -0
- casadi/include/fatrop/ocp/UStageEvalAbstract.hpp +168 -0
- casadi/include/fatrop/ocp/UStageOCPImpl.hpp +152 -0
- casadi/include/fatrop/quasi_newton/bfgs.hpp +159 -0
- casadi/include/fatrop/solver/AlgBuilder.hpp +76 -0
- casadi/include/fatrop/solver/AlgStrategy.hpp +33 -0
- casadi/include/fatrop/solver/FatropAlg.hpp +121 -0
- casadi/include/fatrop/solver/FatropData.hpp +188 -0
- casadi/include/fatrop/solver/FatropOptions.hpp +95 -0
- casadi/include/fatrop/solver/FatropPrinter.hpp +65 -0
- casadi/include/fatrop/solver/FatropStats.hpp +63 -0
- casadi/include/fatrop/solver/Filter.hpp +54 -0
- casadi/include/fatrop/solver/IterationData.hpp +56 -0
- casadi/include/fatrop/solver/LineSearch.hpp +86 -0
- casadi/include/fatrop/solver/NLPL1.hpp +263 -0
- casadi/include/fatrop/templates/NLPAlg.hpp +104 -0
- casadi/include/highs/HConfig.h +6 -5
- casadi/include/highs/Highs.h +93 -23
- casadi/include/highs/filereaderlp/def.hpp +19 -0
- casadi/include/highs/interfaces/highs_c_api.h +200 -24
- casadi/include/highs/io/Filereader.h +1 -1
- casadi/include/highs/io/FilereaderEms.h +1 -1
- casadi/include/highs/io/FilereaderLp.h +1 -1
- casadi/include/highs/io/FilereaderMps.h +1 -1
- casadi/include/highs/io/HMPSIO.h +1 -1
- casadi/include/highs/io/HMpsFF.h +5 -3
- casadi/include/highs/io/HighsIO.h +18 -8
- casadi/include/highs/io/LoadOptions.h +1 -1
- casadi/include/highs/ipm/IpxSolution.h +35 -0
- casadi/include/highs/ipm/IpxWrapper.h +1 -1
- casadi/include/highs/ipm/basiclu/basiclu.h +161 -0
- casadi/include/highs/ipm/basiclu/basiclu_factorize.h +247 -0
- casadi/include/highs/ipm/basiclu/basiclu_get_factors.h +108 -0
- casadi/include/highs/ipm/basiclu/basiclu_initialize.h +119 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_factorize.h +34 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_free.h +19 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_get_factors.h +34 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_initialize.h +46 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_solve_dense.h +29 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_solve_for_update.h +42 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_solve_sparse.h +32 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_update.h +31 -0
- casadi/include/highs/ipm/basiclu/basiclu_object.h +30 -0
- casadi/include/highs/ipm/basiclu/basiclu_solve_dense.h +75 -0
- casadi/include/highs/ipm/basiclu/basiclu_solve_for_update.h +169 -0
- casadi/include/highs/ipm/basiclu/basiclu_solve_sparse.h +112 -0
- casadi/include/highs/ipm/basiclu/basiclu_update.h +125 -0
- casadi/include/highs/ipm/basiclu/lu_def.h +39 -0
- casadi/include/highs/ipm/basiclu/lu_file.h +21 -0
- casadi/include/highs/ipm/basiclu/lu_internal.h +220 -0
- casadi/include/highs/ipm/basiclu/lu_list.h +168 -0
- casadi/include/highs/ipm/ipx/basiclu_kernel.h +20 -0
- casadi/include/highs/ipm/ipx/basiclu_wrapper.h +47 -0
- casadi/include/highs/ipm/ipx/basis.h +351 -0
- casadi/include/highs/ipm/ipx/conjugate_residuals.h +74 -0
- casadi/include/highs/ipm/ipx/control.h +163 -0
- casadi/include/highs/ipm/ipx/crossover.h +157 -0
- casadi/include/highs/ipm/ipx/diagonal_precond.h +45 -0
- casadi/include/highs/ipm/ipx/forrest_tomlin.h +102 -0
- casadi/include/highs/ipm/ipx/guess_basis.h +21 -0
- casadi/include/highs/ipm/ipx/indexed_vector.h +113 -0
- casadi/include/highs/ipm/ipx/info.h +27 -0
- casadi/include/highs/ipm/ipx/ipm.h +94 -0
- casadi/include/highs/ipm/ipx/ipx_c.h +47 -0
- casadi/include/highs/ipm/ipx/ipx_config.h +9 -0
- casadi/include/highs/ipm/ipx/ipx_info.h +111 -0
- casadi/include/highs/ipm/ipx/ipx_internal.h +88 -0
- casadi/include/highs/ipm/ipx/ipx_parameters.h +75 -0
- casadi/include/highs/ipm/ipx/ipx_status.h +57 -0
- casadi/include/highs/ipm/ipx/iterate.h +328 -0
- casadi/include/highs/ipm/ipx/kkt_solver.h +70 -0
- casadi/include/highs/ipm/ipx/kkt_solver_basis.h +66 -0
- casadi/include/highs/ipm/ipx/kkt_solver_diag.h +48 -0
- casadi/include/highs/ipm/ipx/linear_operator.h +26 -0
- casadi/include/highs/ipm/ipx/lp_solver.h +201 -0
- casadi/include/highs/ipm/ipx/lu_factorization.h +79 -0
- casadi/include/highs/ipm/ipx/lu_update.h +129 -0
- casadi/include/highs/ipm/ipx/maxvolume.h +54 -0
- casadi/include/highs/ipm/ipx/model.h +409 -0
- casadi/include/highs/ipm/ipx/multistream.h +52 -0
- casadi/include/highs/ipm/ipx/normal_matrix.h +44 -0
- casadi/include/highs/ipm/ipx/power_method.h +44 -0
- casadi/include/highs/ipm/ipx/sparse_matrix.h +195 -0
- casadi/include/highs/ipm/ipx/sparse_utils.h +58 -0
- casadi/include/highs/ipm/ipx/splitted_normal_matrix.h +63 -0
- casadi/include/highs/ipm/ipx/starting_basis.h +39 -0
- casadi/include/highs/ipm/ipx/symbolic_invert.h +29 -0
- casadi/include/highs/ipm/ipx/timer.h +24 -0
- casadi/include/highs/ipm/ipx/utils.h +39 -0
- casadi/include/highs/lp_data/HConst.h +20 -10
- casadi/include/highs/lp_data/HStruct.h +23 -1
- casadi/include/highs/lp_data/HighsAnalysis.h +1 -1
- casadi/include/highs/lp_data/HighsCallback.h +10 -3
- casadi/include/highs/lp_data/HighsCallbackStruct.h +31 -5
- casadi/include/highs/lp_data/HighsDebug.h +1 -1
- casadi/include/highs/lp_data/HighsInfo.h +20 -2
- casadi/include/highs/lp_data/HighsInfoDebug.h +1 -1
- casadi/include/highs/lp_data/HighsLp.h +17 -1
- casadi/include/highs/lp_data/HighsLpSolverObject.h +1 -1
- casadi/include/highs/lp_data/HighsLpUtils.h +19 -19
- casadi/include/highs/lp_data/HighsModelUtils.h +1 -1
- casadi/include/highs/lp_data/HighsOptions.h +237 -10
- casadi/include/highs/lp_data/HighsRanging.h +1 -1
- casadi/include/highs/lp_data/HighsRuntimeOptions.h +2 -2
- casadi/include/highs/lp_data/HighsSolution.h +2 -2
- casadi/include/highs/lp_data/HighsSolutionDebug.h +1 -1
- casadi/include/highs/lp_data/HighsSolve.h +3 -1
- casadi/include/highs/lp_data/HighsStatus.h +1 -1
- casadi/include/highs/mip/HighsCliqueTable.h +4 -4
- casadi/include/highs/mip/HighsConflictPool.h +1 -1
- casadi/include/highs/mip/HighsCutGeneration.h +1 -1
- casadi/include/highs/mip/HighsCutPool.h +2 -2
- casadi/include/highs/mip/HighsDebugSol.h +22 -29
- casadi/include/highs/mip/HighsDomain.h +10 -2
- casadi/include/highs/mip/HighsDomainChange.h +1 -1
- casadi/include/highs/mip/HighsDynamicRowMatrix.h +5 -3
- casadi/include/highs/mip/HighsGFkSolve.h +3 -3
- casadi/include/highs/mip/HighsImplications.h +3 -3
- casadi/include/highs/mip/HighsLpAggregator.h +1 -1
- casadi/include/highs/mip/HighsLpRelaxation.h +6 -1
- casadi/include/highs/mip/HighsMipSolver.h +4 -2
- casadi/include/highs/mip/HighsMipSolverData.h +47 -4
- casadi/include/highs/mip/HighsModkSeparator.h +2 -2
- casadi/include/highs/mip/HighsNodeQueue.h +5 -3
- casadi/include/highs/mip/HighsObjectiveFunction.h +1 -1
- casadi/include/highs/mip/HighsPathSeparator.h +2 -2
- casadi/include/highs/mip/HighsPrimalHeuristics.h +1 -1
- casadi/include/highs/mip/HighsPseudocost.h +35 -23
- casadi/include/highs/mip/HighsRedcostFixing.h +1 -1
- casadi/include/highs/mip/HighsSearch.h +2 -1
- casadi/include/highs/mip/HighsSeparation.h +1 -1
- casadi/include/highs/mip/HighsSeparator.h +1 -1
- casadi/include/highs/mip/HighsTableauSeparator.h +1 -1
- casadi/include/highs/mip/HighsTransformedLp.h +1 -1
- casadi/include/highs/model/HighsHessian.h +5 -0
- casadi/include/highs/model/HighsHessianUtils.h +2 -0
- casadi/include/highs/model/HighsModel.h +10 -1
- casadi/include/highs/parallel/HighsMutex.h +2 -1
- casadi/include/highs/parallel/HighsParallel.h +7 -2
- casadi/include/highs/parallel/HighsTask.h +1 -2
- casadi/include/highs/pdlp/CupdlpWrapper.h +93 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_cs.h +41 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_defs.h +423 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_linalg.h +183 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_proj.h +19 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_restart.h +31 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_scaling_cuda.h +28 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_solver.h +98 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_step.h +33 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_utils.c +1726 -0
- casadi/include/highs/pdqsort/pdqsort.h +532 -0
- casadi/include/highs/presolve/HPresolve.h +27 -14
- casadi/include/highs/presolve/HPresolveAnalysis.h +1 -1
- casadi/include/highs/presolve/HighsPostsolveStack.h +92 -68
- casadi/include/highs/presolve/HighsSymmetry.h +6 -5
- casadi/include/highs/presolve/ICrash.h +8 -2
- casadi/include/highs/presolve/ICrashUtil.h +1 -1
- casadi/include/highs/presolve/ICrashX.h +1 -1
- casadi/include/highs/presolve/PresolveComponent.h +1 -1
- casadi/include/highs/qpsolver/a_asm.hpp +23 -12
- casadi/include/highs/qpsolver/a_quass.hpp +8 -1
- casadi/include/highs/qpsolver/basis.hpp +150 -0
- casadi/include/highs/qpsolver/crashsolution.hpp +12 -0
- casadi/include/highs/qpsolver/dantzigpricing.hpp +72 -0
- casadi/include/highs/qpsolver/devexpricing.hpp +99 -0
- casadi/include/highs/qpsolver/eventhandler.hpp +23 -0
- casadi/include/highs/qpsolver/factor.hpp +400 -0
- casadi/include/highs/qpsolver/feasibility_bounded.hpp +105 -0
- casadi/include/highs/qpsolver/feasibility_highs.hpp +270 -0
- casadi/include/highs/qpsolver/gradient.hpp +39 -0
- casadi/include/highs/qpsolver/instance.hpp +63 -0
- casadi/include/highs/qpsolver/matrix.hpp +335 -0
- casadi/include/highs/qpsolver/pricing.hpp +15 -0
- casadi/include/highs/qpsolver/qpconst.hpp +27 -0
- casadi/include/highs/qpsolver/{vector.hpp → qpvector.hpp} +25 -25
- casadi/include/highs/qpsolver/quass.hpp +1 -1
- casadi/include/highs/qpsolver/ratiotest.hpp +19 -0
- casadi/include/highs/qpsolver/runtime.hpp +38 -0
- casadi/include/highs/qpsolver/settings.hpp +57 -0
- casadi/include/highs/qpsolver/snippets.hpp +29 -0
- casadi/include/highs/qpsolver/statistics.hpp +23 -0
- casadi/include/highs/qpsolver/steepestedgepricing.hpp +167 -0
- casadi/include/highs/simplex/HApp.h +1 -1
- casadi/include/highs/simplex/HEkk.h +52 -18
- casadi/include/highs/simplex/HEkkDual.h +1 -1
- casadi/include/highs/simplex/HEkkDualRHS.h +6 -7
- casadi/include/highs/simplex/HEkkDualRow.h +2 -2
- casadi/include/highs/simplex/HEkkPrimal.h +6 -1
- casadi/include/highs/simplex/HSimplex.h +1 -3
- casadi/include/highs/simplex/HSimplexDebug.h +1 -1
- casadi/include/highs/simplex/HSimplexNla.h +1 -1
- casadi/include/highs/simplex/HSimplexReport.h +1 -1
- casadi/include/highs/simplex/HighsSimplexAnalysis.h +228 -100
- casadi/include/highs/simplex/SimplexConst.h +1 -1
- casadi/include/highs/simplex/SimplexStruct.h +2 -2
- casadi/include/highs/simplex/SimplexTimer.h +1 -1
- casadi/include/highs/test/DevKkt.h +1 -1
- casadi/include/highs/test/KktCh2.h +1 -1
- casadi/include/highs/util/FactorTimer.h +1 -1
- casadi/include/highs/util/HFactor.h +35 -6
- casadi/include/highs/util/HFactorConst.h +1 -1
- casadi/include/highs/util/HFactorDebug.h +1 -1
- casadi/include/highs/util/HSet.h +1 -1
- casadi/include/highs/util/HVector.h +1 -1
- casadi/include/highs/util/HVectorBase.h +1 -1
- casadi/include/highs/util/HighsCDouble.h +3 -3
- casadi/include/highs/util/HighsComponent.h +1 -1
- casadi/include/highs/util/HighsDataStack.h +4 -4
- casadi/include/highs/util/HighsDisjointSets.h +1 -1
- casadi/include/highs/util/HighsHash.h +28 -21
- casadi/include/highs/util/HighsHashTree.h +63 -63
- casadi/include/highs/util/HighsInt.h +1 -1
- casadi/include/highs/util/HighsIntegers.h +8 -9
- casadi/include/highs/util/HighsLinearSumBounds.h +1 -1
- casadi/include/highs/util/HighsMatrixPic.h +1 -1
- casadi/include/highs/util/HighsMatrixSlice.h +9 -6
- casadi/include/highs/util/HighsMatrixUtils.h +1 -1
- casadi/include/highs/util/HighsMemoryAllocation.h +55 -0
- casadi/include/highs/util/HighsRandom.h +27 -15
- casadi/include/highs/util/HighsRbTree.h +2 -2
- casadi/include/highs/util/HighsSort.h +7 -7
- casadi/include/highs/util/HighsSparseMatrix.h +5 -2
- casadi/include/highs/util/HighsSparseVectorSum.h +2 -2
- casadi/include/highs/util/HighsSplay.h +1 -1
- casadi/include/highs/util/HighsTimer.h +18 -9
- casadi/include/highs/util/HighsUtils.h +15 -8
- casadi/include/highs/util/stringutil.h +9 -4
- casadi/include/highs/zstr/strict_fstream.hpp +237 -0
- casadi/include/highs/zstr/zstr.hpp +472 -0
- casadi/include/highs_export.h +42 -0
- casadi/include/licenses/daqp-external/LICENSE +21 -0
- casadi/include/licenses/fatrop-external/LICENSE.txt +165 -0
- casadi/include/licenses/fatrop-external/external/blasfeo/LICENSE.txt +26 -0
- casadi/include/licenses/fatrop-external/external/pybind11/LICENSE +29 -0
- casadi/include/licenses/highs-external/{LICENSE → LICENSE.txt} +1 -1
- casadi/include/osqp/constants.h +2 -3
- casadi/include/osqp/version.h +9 -0
- casadi/include/sleqp/defs.h +2 -2
- casadi/ipopt.lib +0 -0
- casadi/lapack.lib +0 -0
- casadi/lib/libtinyxml2.dll.a +0 -0
- casadi/libCbc-3.dll +0 -0
- casadi/libCbc.dll.a +0 -0
- casadi/libCbcSolver-3.dll +0 -0
- casadi/libCbcSolver.dll.a +0 -0
- casadi/libCgl-1.dll +0 -0
- casadi/libCgl.dll.a +0 -0
- casadi/libClp-1.dll +0 -0
- casadi/libClp.dll.a +0 -0
- casadi/libClpSolver-1.dll +0 -0
- casadi/libClpSolver.dll.a +0 -0
- casadi/libCoinUtils-3.dll +0 -0
- casadi/libCoinUtils.dll.a +0 -0
- casadi/libOsi-1.dll +0 -0
- casadi/libOsi.dll.a +0 -0
- casadi/libOsiCbc-3.dll +0 -0
- casadi/libOsiCbc.dll.a +0 -0
- casadi/libOsiClp-1.dll +0 -0
- casadi/libOsiClp.dll.a +0 -0
- casadi/libOsiCommonTests-1.dll +0 -0
- casadi/libOsiCommonTests.dll.a +0 -0
- casadi/libalpaqa.dll +0 -0
- casadi/libalpaqa.dll.a +0 -0
- casadi/libblasfeo.dll +0 -0
- casadi/libblasfeo.dll.a +0 -0
- casadi/libbonmin-4.dll +0 -0
- casadi/libbonmin.dll.a +0 -0
- casadi/libcasadi-tp-openblas.dll +0 -0
- casadi/libcasadi-tp-openblas.dll.a +0 -0
- casadi/libcasadi.dll +0 -0
- casadi/libcasadi.dll.a +0 -0
- casadi/libcasadi_conic_cbc.dll +0 -0
- casadi/libcasadi_conic_cbc.dll.a +0 -0
- casadi/libcasadi_conic_clp.dll +0 -0
- casadi/libcasadi_conic_clp.dll.a +0 -0
- casadi/libcasadi_conic_cplex.dll +0 -0
- casadi/libcasadi_conic_cplex.dll.a +0 -0
- casadi/libcasadi_conic_daqp.dll +0 -0
- casadi/libcasadi_conic_daqp.dll.a +0 -0
- casadi/libcasadi_conic_fatrop.dll +0 -0
- casadi/libcasadi_conic_fatrop.dll.a +0 -0
- casadi/libcasadi_conic_gurobi.dll +0 -0
- casadi/libcasadi_conic_gurobi.dll.a +0 -0
- casadi/libcasadi_conic_highs.dll +0 -0
- casadi/libcasadi_conic_highs.dll.a +0 -0
- casadi/libcasadi_conic_hpipm.dll +0 -0
- casadi/libcasadi_conic_hpipm.dll.a +0 -0
- casadi/libcasadi_conic_ipqp.dll +0 -0
- casadi/libcasadi_conic_ipqp.dll.a +0 -0
- casadi/libcasadi_conic_nlpsol.dll +0 -0
- casadi/libcasadi_conic_nlpsol.dll.a +0 -0
- casadi/libcasadi_conic_osqp.dll +0 -0
- casadi/libcasadi_conic_osqp.dll.a +0 -0
- casadi/libcasadi_conic_proxqp.dll +0 -0
- casadi/libcasadi_conic_proxqp.dll.a +0 -0
- casadi/libcasadi_conic_qpoases.dll +0 -0
- casadi/libcasadi_conic_qpoases.dll.a +0 -0
- casadi/libcasadi_conic_qrqp.dll +0 -0
- casadi/libcasadi_conic_qrqp.dll.a +0 -0
- casadi/libcasadi_conic_superscs.dll +0 -0
- casadi/libcasadi_conic_superscs.dll.a +0 -0
- casadi/libcasadi_importer_shell.dll +0 -0
- casadi/libcasadi_importer_shell.dll.a +0 -0
- casadi/libcasadi_integrator_collocation.dll +0 -0
- casadi/libcasadi_integrator_collocation.dll.a +0 -0
- casadi/libcasadi_integrator_cvodes.dll +0 -0
- casadi/libcasadi_integrator_cvodes.dll.a +0 -0
- casadi/libcasadi_integrator_idas.dll +0 -0
- casadi/libcasadi_integrator_idas.dll.a +0 -0
- casadi/libcasadi_integrator_rk.dll +0 -0
- casadi/libcasadi_integrator_rk.dll.a +0 -0
- casadi/libcasadi_interpolant_bspline.dll +0 -0
- casadi/libcasadi_interpolant_bspline.dll.a +0 -0
- casadi/libcasadi_interpolant_linear.dll +0 -0
- casadi/libcasadi_interpolant_linear.dll.a +0 -0
- casadi/libcasadi_linsol_csparse.dll +0 -0
- casadi/libcasadi_linsol_csparse.dll.a +0 -0
- casadi/libcasadi_linsol_csparsecholesky.dll +0 -0
- casadi/libcasadi_linsol_csparsecholesky.dll.a +0 -0
- casadi/libcasadi_linsol_lapacklu.dll +0 -0
- casadi/libcasadi_linsol_lapacklu.dll.a +0 -0
- casadi/libcasadi_linsol_lapackqr.dll +0 -0
- casadi/libcasadi_linsol_lapackqr.dll.a +0 -0
- casadi/libcasadi_linsol_ldl.dll +0 -0
- casadi/libcasadi_linsol_ldl.dll.a +0 -0
- casadi/libcasadi_linsol_lsqr.dll +0 -0
- casadi/libcasadi_linsol_lsqr.dll.a +0 -0
- casadi/libcasadi_linsol_ma27.dll +0 -0
- casadi/libcasadi_linsol_ma27.dll.a +0 -0
- casadi/libcasadi_linsol_mumps.dll +0 -0
- casadi/libcasadi_linsol_mumps.dll.a +0 -0
- casadi/libcasadi_linsol_qr.dll +0 -0
- casadi/libcasadi_linsol_qr.dll.a +0 -0
- casadi/libcasadi_linsol_symbolicqr.dll +0 -0
- casadi/libcasadi_linsol_symbolicqr.dll.a +0 -0
- casadi/libcasadi_linsol_tridiag.dll +0 -0
- casadi/libcasadi_linsol_tridiag.dll.a +0 -0
- casadi/libcasadi_nlpsol_alpaqa.dll +0 -0
- casadi/libcasadi_nlpsol_alpaqa.dll.a +0 -0
- casadi/libcasadi_nlpsol_ampl.dll +0 -0
- casadi/libcasadi_nlpsol_ampl.dll.a +0 -0
- casadi/libcasadi_nlpsol_blocksqp.dll +0 -0
- casadi/libcasadi_nlpsol_blocksqp.dll.a +0 -0
- casadi/libcasadi_nlpsol_bonmin.dll +0 -0
- casadi/libcasadi_nlpsol_bonmin.dll.a +0 -0
- casadi/libcasadi_nlpsol_fatrop.dll +0 -0
- casadi/libcasadi_nlpsol_fatrop.dll.a +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.dll +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.dll.a +0 -0
- casadi/libcasadi_nlpsol_ipopt.dll +0 -0
- casadi/libcasadi_nlpsol_ipopt.dll.a +0 -0
- casadi/libcasadi_nlpsol_knitro.dll +0 -0
- casadi/libcasadi_nlpsol_knitro.dll.a +0 -0
- casadi/libcasadi_nlpsol_madnlp.dll +0 -0
- casadi/libcasadi_nlpsol_madnlp.dll.a +0 -0
- casadi/libcasadi_nlpsol_qrsqp.dll +0 -0
- casadi/libcasadi_nlpsol_qrsqp.dll.a +0 -0
- casadi/libcasadi_nlpsol_scpgen.dll +0 -0
- casadi/libcasadi_nlpsol_scpgen.dll.a +0 -0
- casadi/libcasadi_nlpsol_sleqp.dll +0 -0
- casadi/libcasadi_nlpsol_sleqp.dll.a +0 -0
- casadi/libcasadi_nlpsol_snopt.dll +0 -0
- casadi/libcasadi_nlpsol_snopt.dll.a +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.dll +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.dll.a +0 -0
- casadi/libcasadi_nlpsol_worhp.dll +0 -0
- casadi/libcasadi_nlpsol_worhp.dll.a +0 -0
- casadi/libcasadi_rootfinder_fast_newton.dll +0 -0
- casadi/libcasadi_rootfinder_fast_newton.dll.a +0 -0
- casadi/libcasadi_rootfinder_kinsol.dll +0 -0
- casadi/libcasadi_rootfinder_kinsol.dll.a +0 -0
- casadi/libcasadi_rootfinder_newton.dll +0 -0
- casadi/libcasadi_rootfinder_newton.dll.a +0 -0
- casadi/libcasadi_rootfinder_nlpsol.dll +0 -0
- casadi/libcasadi_rootfinder_nlpsol.dll.a +0 -0
- casadi/libcasadi_sundials_common.dll +0 -0
- casadi/libcasadi_sundials_common.dll.a +0 -0
- casadi/libcasadi_xmlfile_tinyxml.dll +0 -0
- casadi/libcasadi_xmlfile_tinyxml.dll.a +0 -0
- casadi/libcoinmetis-2.dll +0 -0
- casadi/libcoinmetis.dll.a +0 -0
- casadi/libcoinmetis.la +1 -1
- casadi/libcoinmumps-3.dll +0 -0
- casadi/libcoinmumps.dll.a +0 -0
- casadi/libcplex_adaptor.dll +0 -0
- casadi/libdaqp.dll +0 -0
- casadi/libdaqp.dll.a +0 -0
- casadi/libdaqpstat.a +0 -0
- casadi/{libFortranHighs.dll → libdl.dll} +0 -0
- casadi/libdl.dll.a +0 -0
- casadi/libfatrop.dll +0 -0
- casadi/libfatrop.dll.a +0 -0
- casadi/libgurobi_adaptor.dll +0 -0
- casadi/libhighs.dll +0 -0
- casadi/libhighs.dll.a +0 -0
- casadi/libhpipm.dll +0 -0
- casadi/libhpipm.dll.a +0 -0
- casadi/libipopt-3.dll +0 -0
- casadi/libipopt.dll.a +0 -0
- casadi/libmatlab_ipc.dll +0 -0
- casadi/libmatlab_ipc.dll.a +0 -0
- casadi/libosqp.a +0 -0
- casadi/libosqp.dll +0 -0
- casadi/libosqp.dll.a +0 -0
- casadi/libqdldl.dll +0 -0
- casadi/libqdldl.dll.a +0 -0
- casadi/libsipopt-3.dll +0 -0
- casadi/libsipopt.dll.a +0 -0
- casadi/libsleqp.dll +0 -0
- casadi/libsleqp.dll.a +0 -0
- casadi/libtinyxml2.dll +0 -0
- casadi/libtrlib.dll +0 -0
- casadi/libtrlib.dll.a +0 -0
- casadi/matlab_ipc.lib +0 -0
- casadi/osqp.lib +0 -0
- casadi/pkgconfig/casadi.pc +1 -1
- casadi/pkgconfig/highs.pc +1 -1
- casadi/sleqp.lib +0 -0
- casadi/spral_ssids.exe +0 -0
- casadi/tools/__init__.py +4 -0
- casadi/tools/bounds.py +3 -3
- {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/METADATA +2 -2
- {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/RECORD +503 -325
- casadi/include/highs/fortran/highs_fortran_api.mod +0 -0
- casadi/libFortranHighs.dll.a +0 -0
- {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/WHEEL +0 -0
@@ -2,7 +2,7 @@
|
|
2
2
|
/* */
|
3
3
|
/* This file is part of the HiGHS linear optimization suite */
|
4
4
|
/* */
|
5
|
-
/* Written and engineered 2008-
|
5
|
+
/* Written and engineered 2008-2024 by Julian Hall, Ivet Galabova, */
|
6
6
|
/* Leona Gottwald and Michael Feldmeier */
|
7
7
|
/* */
|
8
8
|
/* Available as open-source under the MIT License */
|
@@ -16,6 +16,7 @@
|
|
16
16
|
#ifndef PRESOLVE_HIGHS_POSTSOLVE_STACK_H_
|
17
17
|
#define PRESOLVE_HIGHS_POSTSOLVE_STACK_H_
|
18
18
|
|
19
|
+
#include <algorithm>
|
19
20
|
#include <cassert>
|
20
21
|
#include <cmath>
|
21
22
|
#include <numeric>
|
@@ -104,6 +105,7 @@ class HighsPostsolveStack {
|
|
104
105
|
HighsInt col;
|
105
106
|
bool lowerTightened;
|
106
107
|
bool upperTightened;
|
108
|
+
RowType rowType;
|
107
109
|
|
108
110
|
void undo(const HighsOptions& options,
|
109
111
|
const std::vector<Nonzero>& colValues, HighsSolution& solution,
|
@@ -173,6 +175,7 @@ class HighsPostsolveStack {
|
|
173
175
|
double colBound;
|
174
176
|
HighsInt col;
|
175
177
|
bool atInfiniteUpper;
|
178
|
+
bool colIntegral;
|
176
179
|
|
177
180
|
void undo(const HighsOptions& options,
|
178
181
|
const std::vector<Nonzero>& colValues, HighsSolution& solution,
|
@@ -234,7 +237,7 @@ class HighsPostsolveStack {
|
|
234
237
|
};
|
235
238
|
|
236
239
|
HighsDataStack reductionValues;
|
237
|
-
std::vector<std::pair<ReductionType,
|
240
|
+
std::vector<std::pair<ReductionType, size_t>> reductions;
|
238
241
|
std::vector<HighsInt> origColIndex;
|
239
242
|
std::vector<HighsInt> origRowIndex;
|
240
243
|
std::vector<uint8_t> linearlyTransformable;
|
@@ -245,11 +248,15 @@ class HighsPostsolveStack {
|
|
245
248
|
HighsInt origNumRow = -1;
|
246
249
|
|
247
250
|
void reductionAdded(ReductionType type) {
|
248
|
-
|
251
|
+
size_t position = reductionValues.getCurrentDataSize();
|
249
252
|
reductions.emplace_back(type, position);
|
250
253
|
}
|
251
254
|
|
252
255
|
public:
|
256
|
+
const HighsInt* getOrigRowsIndex() const { return origRowIndex.data(); }
|
257
|
+
|
258
|
+
const HighsInt* getOrigColsIndex() const { return origColIndex.data(); }
|
259
|
+
|
253
260
|
HighsInt getOrigRowIndex(HighsInt row) const {
|
254
261
|
assert(row < (HighsInt)origRowIndex.size());
|
255
262
|
return origRowIndex[row];
|
@@ -261,19 +268,19 @@ class HighsPostsolveStack {
|
|
261
268
|
}
|
262
269
|
|
263
270
|
void appendCutsToModel(HighsInt numCuts) {
|
264
|
-
|
265
|
-
|
271
|
+
size_t currNumRow = origRowIndex.size();
|
272
|
+
size_t newNumRow = currNumRow + numCuts;
|
266
273
|
origRowIndex.resize(newNumRow);
|
267
|
-
for (
|
274
|
+
for (size_t i = currNumRow; i != newNumRow; ++i)
|
268
275
|
origRowIndex[i] = origNumRow++;
|
269
276
|
}
|
270
277
|
|
271
278
|
void removeCutsFromModel(HighsInt numCuts) {
|
272
279
|
origNumRow -= numCuts;
|
273
280
|
|
274
|
-
|
275
|
-
for (
|
276
|
-
if (origRowIndex[i] < origNumRow) break;
|
281
|
+
size_t origRowIndexSize = origRowIndex.size();
|
282
|
+
for (size_t i = origRowIndex.size(); i > 0; --i) {
|
283
|
+
if (origRowIndex[i - 1] < origNumRow) break;
|
277
284
|
--origRowIndexSize;
|
278
285
|
}
|
279
286
|
|
@@ -321,6 +328,7 @@ class HighsPostsolveStack {
|
|
321
328
|
double coefSubst, double coef, double rhs,
|
322
329
|
double substLower, double substUpper, double substCost,
|
323
330
|
bool lowerTightened, bool upperTightened,
|
331
|
+
RowType rowType,
|
324
332
|
const HighsMatrixSlice<ColStorageFormat>& colVec) {
|
325
333
|
colValues.clear();
|
326
334
|
for (const HighsSliceNonzero& colVal : colVec)
|
@@ -329,7 +337,7 @@ class HighsPostsolveStack {
|
|
329
337
|
reductionValues.push(DoubletonEquation{
|
330
338
|
coef, coefSubst, rhs, substLower, substUpper, substCost,
|
331
339
|
row == -1 ? -1 : origRowIndex[row], origColIndex[colSubst],
|
332
|
-
origColIndex[col], lowerTightened, upperTightened});
|
340
|
+
origColIndex[col], lowerTightened, upperTightened, rowType});
|
333
341
|
reductionValues.push(colValues);
|
334
342
|
reductionAdded(ReductionType::kDoubletonEquation);
|
335
343
|
}
|
@@ -445,13 +453,14 @@ class HighsPostsolveStack {
|
|
445
453
|
template <typename ColStorageFormat>
|
446
454
|
void forcingColumn(HighsInt col,
|
447
455
|
const HighsMatrixSlice<ColStorageFormat>& colVec,
|
448
|
-
double cost, double boundVal, bool atInfiniteUpper
|
456
|
+
double cost, double boundVal, bool atInfiniteUpper,
|
457
|
+
bool colIntegral) {
|
449
458
|
colValues.clear();
|
450
459
|
for (const HighsSliceNonzero& colVal : colVec)
|
451
460
|
colValues.emplace_back(origRowIndex[colVal.index()], colVal.value());
|
452
461
|
|
453
|
-
reductionValues.push(
|
454
|
-
|
462
|
+
reductionValues.push(ForcingColumn{cost, boundVal, origColIndex[col],
|
463
|
+
atInfiniteUpper, colIntegral});
|
455
464
|
reductionValues.push(colValues);
|
456
465
|
reductionAdded(ReductionType::kForcingColumn);
|
457
466
|
}
|
@@ -511,7 +520,7 @@ class HighsPostsolveStack {
|
|
511
520
|
const std::vector<double>& origPrimalSolution) {
|
512
521
|
std::vector<double> reducedSolution = origPrimalSolution;
|
513
522
|
|
514
|
-
for (const std::pair<ReductionType,
|
523
|
+
for (const std::pair<ReductionType, size_t>& primalColTransformation :
|
515
524
|
reductions) {
|
516
525
|
switch (primalColTransformation.first) {
|
517
526
|
case ReductionType::kDuplicateColumn: {
|
@@ -533,8 +542,8 @@ class HighsPostsolveStack {
|
|
533
542
|
}
|
534
543
|
}
|
535
544
|
|
536
|
-
|
537
|
-
for (
|
545
|
+
size_t reducedNumCol = origColIndex.size();
|
546
|
+
for (size_t i = 0; i < reducedNumCol; ++i)
|
538
547
|
reducedSolution[i] = reducedSolution[origColIndex[i]];
|
539
548
|
|
540
549
|
reducedSolution.resize(reducedNumCol);
|
@@ -542,7 +551,36 @@ class HighsPostsolveStack {
|
|
542
551
|
}
|
543
552
|
|
544
553
|
bool isColLinearlyTransformable(HighsInt col) const {
|
545
|
-
return linearlyTransformable[col];
|
554
|
+
return (linearlyTransformable[col] != 0);
|
555
|
+
}
|
556
|
+
|
557
|
+
template <typename T>
|
558
|
+
void undoIterateBackwards(std::vector<T>& values,
|
559
|
+
const std::vector<HighsInt>& index,
|
560
|
+
HighsInt origSize) {
|
561
|
+
values.resize(origSize);
|
562
|
+
#ifdef DEBUG_EXTRA
|
563
|
+
// Fill vector with NaN for debugging purposes
|
564
|
+
std::vector<T> valuesNew;
|
565
|
+
valuesNew.resize(origSize, std::numeric_limits<T>::signaling_NaN());
|
566
|
+
for (size_t i = index.size(); i > 0; --i) {
|
567
|
+
assert(static_cast<size_t>(index[i - 1]) >= i - 1);
|
568
|
+
valuesNew[index[i - 1]] = values[i - 1];
|
569
|
+
}
|
570
|
+
std::copy(valuesNew.cbegin(), valuesNew.cend(), values.begin());
|
571
|
+
#else
|
572
|
+
for (size_t i = index.size(); i > 0; --i) {
|
573
|
+
assert(static_cast<size_t>(index[i - 1]) >= i - 1);
|
574
|
+
values[index[i - 1]] = values[i - 1];
|
575
|
+
}
|
576
|
+
#endif
|
577
|
+
}
|
578
|
+
|
579
|
+
/// check if vector contains NaN or Inf
|
580
|
+
bool containsNanOrInf(const std::vector<double>& v) const {
|
581
|
+
return std::find_if(v.cbegin(), v.cend(), [](const double& d) {
|
582
|
+
return (std::isnan(d) || std::isinf(d));
|
583
|
+
}) != v.cend();
|
546
584
|
}
|
547
585
|
|
548
586
|
/// undo presolve steps for primal dual solution and basis
|
@@ -557,49 +595,33 @@ class HighsPostsolveStack {
|
|
557
595
|
|
558
596
|
// expand solution to original index space
|
559
597
|
assert(origNumCol > 0);
|
560
|
-
solution.col_value
|
561
|
-
for (HighsInt i = origColIndex.size() - 1; i >= 0; --i) {
|
562
|
-
assert(origColIndex[i] >= i);
|
563
|
-
solution.col_value[origColIndex[i]] = solution.col_value[i];
|
564
|
-
}
|
598
|
+
undoIterateBackwards(solution.col_value, origColIndex, origNumCol);
|
565
599
|
|
566
600
|
assert(origNumRow >= 0);
|
567
|
-
solution.row_value
|
568
|
-
for (HighsInt i = origRowIndex.size() - 1; i >= 0; --i) {
|
569
|
-
assert(origRowIndex[i] >= i);
|
570
|
-
solution.row_value[origRowIndex[i]] = solution.row_value[i];
|
571
|
-
}
|
601
|
+
undoIterateBackwards(solution.row_value, origRowIndex, origNumRow);
|
572
602
|
|
573
603
|
if (perform_dual_postsolve) {
|
574
604
|
// if dual solution is given, expand dual solution and basis to original
|
575
605
|
// index space
|
576
|
-
solution.col_dual
|
577
|
-
for (HighsInt i = origColIndex.size() - 1; i >= 0; --i)
|
578
|
-
solution.col_dual[origColIndex[i]] = solution.col_dual[i];
|
606
|
+
undoIterateBackwards(solution.col_dual, origColIndex, origNumCol);
|
579
607
|
|
580
|
-
solution.row_dual
|
581
|
-
for (HighsInt i = origRowIndex.size() - 1; i >= 0; --i)
|
582
|
-
solution.row_dual[origRowIndex[i]] = solution.row_dual[i];
|
608
|
+
undoIterateBackwards(solution.row_dual, origRowIndex, origNumRow);
|
583
609
|
}
|
584
610
|
|
585
611
|
if (perform_basis_postsolve) {
|
586
612
|
// if basis is given, expand basis status values to original index space
|
587
|
-
basis.col_status
|
588
|
-
for (HighsInt i = origColIndex.size() - 1; i >= 0; --i)
|
589
|
-
basis.col_status[origColIndex[i]] = basis.col_status[i];
|
613
|
+
undoIterateBackwards(basis.col_status, origColIndex, origNumCol);
|
590
614
|
|
591
|
-
basis.row_status
|
592
|
-
for (HighsInt i = origRowIndex.size() - 1; i >= 0; --i)
|
593
|
-
basis.row_status[origRowIndex[i]] = basis.row_status[i];
|
615
|
+
undoIterateBackwards(basis.row_status, origRowIndex, origNumRow);
|
594
616
|
}
|
595
617
|
|
596
618
|
// now undo the changes
|
597
|
-
for (
|
619
|
+
for (size_t i = reductions.size(); i > 0; --i) {
|
598
620
|
if (report_col >= 0)
|
599
621
|
printf("Before reduction %2d (type %2d): col_value[%2d] = %g\n",
|
600
|
-
int(i), int(reductions[i].first), int(report_col),
|
622
|
+
int(i - 1), int(reductions[i - 1].first), int(report_col),
|
601
623
|
solution.col_value[report_col]);
|
602
|
-
switch (reductions[i].first) {
|
624
|
+
switch (reductions[i - 1].first) {
|
603
625
|
case ReductionType::kLinearTransform: {
|
604
626
|
LinearTransform reduction;
|
605
627
|
reductionValues.pop(reduction);
|
@@ -689,13 +711,23 @@ class HighsPostsolveStack {
|
|
689
711
|
break;
|
690
712
|
}
|
691
713
|
default:
|
692
|
-
printf("Reduction case %d not handled\n",
|
714
|
+
printf("Reduction case %d not handled\n",
|
715
|
+
int(reductions[i - 1].first));
|
693
716
|
if (kAllowDeveloperAssert) assert(1 == 0);
|
694
717
|
}
|
695
718
|
}
|
696
719
|
if (report_col >= 0)
|
697
720
|
printf("After last reduction: col_value[%2d] = %g\n", int(report_col),
|
698
721
|
solution.col_value[report_col]);
|
722
|
+
|
723
|
+
#ifdef DEBUG_EXTRA
|
724
|
+
// solution should not contain NaN or Inf
|
725
|
+
assert(!containsNanOrInf(solution.col_value));
|
726
|
+
// row values are not determined by postsolve
|
727
|
+
// assert(!containsNanOrInf(solution.row_value));
|
728
|
+
assert(!containsNanOrInf(solution.col_dual));
|
729
|
+
assert(!containsNanOrInf(solution.row_dual));
|
730
|
+
#endif
|
699
731
|
}
|
700
732
|
|
701
733
|
/// undo presolve steps for primal solution
|
@@ -727,7 +759,7 @@ class HighsPostsolveStack {
|
|
727
759
|
void undoUntil(const HighsOptions& options,
|
728
760
|
const std::vector<HighsInt>& flagRow,
|
729
761
|
const std::vector<HighsInt>& flagCol, HighsSolution& solution,
|
730
|
-
HighsBasis& basis,
|
762
|
+
HighsBasis& basis, size_t numReductions) {
|
731
763
|
reductionValues.resetPosition();
|
732
764
|
|
733
765
|
// Do these returns ever happen? How is it known that undo has not
|
@@ -746,44 +778,28 @@ class HighsPostsolveStack {
|
|
746
778
|
bool perform_basis_postsolve = basis.valid;
|
747
779
|
|
748
780
|
// expand solution to original index space
|
749
|
-
solution.col_value
|
750
|
-
for (HighsInt i = origColIndex.size() - 1; i >= 0; --i) {
|
751
|
-
assert(origColIndex[i] >= i);
|
752
|
-
solution.col_value[origColIndex[i]] = solution.col_value[i];
|
753
|
-
}
|
781
|
+
undoIterateBackwards(solution.col_value, origColIndex, origNumCol);
|
754
782
|
|
755
|
-
solution.row_value
|
756
|
-
for (HighsInt i = origRowIndex.size() - 1; i >= 0; --i) {
|
757
|
-
assert(origRowIndex[i] >= i);
|
758
|
-
solution.row_value[origRowIndex[i]] = solution.row_value[i];
|
759
|
-
}
|
783
|
+
undoIterateBackwards(solution.row_value, origRowIndex, origNumRow);
|
760
784
|
|
761
785
|
if (perform_dual_postsolve) {
|
762
786
|
// if dual solution is given, expand dual solution and basis to original
|
763
787
|
// index space
|
764
|
-
solution.col_dual
|
765
|
-
for (HighsInt i = origColIndex.size() - 1; i >= 0; --i)
|
766
|
-
solution.col_dual[origColIndex[i]] = solution.col_dual[i];
|
788
|
+
undoIterateBackwards(solution.col_dual, origColIndex, origNumCol);
|
767
789
|
|
768
|
-
solution.row_dual
|
769
|
-
for (HighsInt i = origRowIndex.size() - 1; i >= 0; --i)
|
770
|
-
solution.row_dual[origRowIndex[i]] = solution.row_dual[i];
|
790
|
+
undoIterateBackwards(solution.row_dual, origRowIndex, origNumRow);
|
771
791
|
}
|
772
792
|
|
773
793
|
if (perform_basis_postsolve) {
|
774
794
|
// if basis is given, expand basis status values to original index space
|
775
|
-
basis.col_status
|
776
|
-
for (HighsInt i = origColIndex.size() - 1; i >= 0; --i)
|
777
|
-
basis.col_status[origColIndex[i]] = basis.col_status[i];
|
795
|
+
undoIterateBackwards(basis.col_status, origColIndex, origNumCol);
|
778
796
|
|
779
|
-
basis.row_status
|
780
|
-
for (HighsInt i = origRowIndex.size() - 1; i >= 0; --i)
|
781
|
-
basis.row_status[origRowIndex[i]] = basis.row_status[i];
|
797
|
+
undoIterateBackwards(basis.row_status, origRowIndex, origNumRow);
|
782
798
|
}
|
783
799
|
|
784
800
|
// now undo the changes
|
785
|
-
for (
|
786
|
-
switch (reductions[i].first) {
|
801
|
+
for (size_t i = reductions.size(); i > numReductions; --i) {
|
802
|
+
switch (reductions[i - 1].first) {
|
787
803
|
case ReductionType::kLinearTransform: {
|
788
804
|
LinearTransform reduction;
|
789
805
|
reductionValues.pop(reduction);
|
@@ -873,6 +889,14 @@ class HighsPostsolveStack {
|
|
873
889
|
}
|
874
890
|
}
|
875
891
|
}
|
892
|
+
#ifdef DEBUG_EXTRA
|
893
|
+
// solution should not contain NaN or Inf
|
894
|
+
assert(!containsNanOrInf(solution.col_value));
|
895
|
+
// row values are not determined by postsolve
|
896
|
+
// assert(!containsNanOrInf(solution.row_value));
|
897
|
+
assert(!containsNanOrInf(solution.col_dual));
|
898
|
+
assert(!containsNanOrInf(solution.row_dual));
|
899
|
+
#endif
|
876
900
|
}
|
877
901
|
|
878
902
|
size_t numReductions() const { return reductions.size(); }
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/* */
|
3
3
|
/* This file is part of the HiGHS linear optimization suite */
|
4
4
|
/* */
|
5
|
-
/* Written and engineered 2008-
|
5
|
+
/* Written and engineered 2008-2024 by Julian Hall, Ivet Galabova, */
|
6
6
|
/* Leona Gottwald and Michael Feldmeier */
|
7
7
|
/* */
|
8
8
|
/* Available as open-source under the MIT License */
|
@@ -25,7 +25,7 @@
|
|
25
25
|
#include "util/HighsHash.h"
|
26
26
|
#include "util/HighsInt.h"
|
27
27
|
|
28
|
-
/// class that is responsible for
|
28
|
+
/// class that is responsible for assigning distinct colors for each distinct
|
29
29
|
/// double value
|
30
30
|
class HighsMatrixColoring {
|
31
31
|
using u32 = std::uint32_t;
|
@@ -44,7 +44,6 @@ class HighsMatrixColoring {
|
|
44
44
|
// iterator points to smallest element in map which fulfills key >= value -
|
45
45
|
// tolerance
|
46
46
|
auto it = colorMap.lower_bound(value - tolerance);
|
47
|
-
u32 color;
|
48
47
|
// check if there is no such element, or if this element has a key value +
|
49
48
|
// tolerance in which case we create a new color and store it with the key
|
50
49
|
// value
|
@@ -80,10 +79,12 @@ struct HighsOrbitopeMatrix {
|
|
80
79
|
std::vector<int8_t> rowIsSetPacking;
|
81
80
|
std::vector<HighsInt> matrix;
|
82
81
|
|
83
|
-
HighsInt& entry(HighsInt i, HighsInt j) {
|
82
|
+
HighsInt& entry(HighsInt i, HighsInt j) {
|
83
|
+
return matrix[i + static_cast<size_t>(j) * numRows];
|
84
|
+
}
|
84
85
|
|
85
86
|
const HighsInt& entry(HighsInt i, HighsInt j) const {
|
86
|
-
return matrix[i + j * numRows];
|
87
|
+
return matrix[i + static_cast<size_t>(j) * numRows];
|
87
88
|
}
|
88
89
|
|
89
90
|
HighsInt& operator()(HighsInt i, HighsInt j) { return entry(i, j); }
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/* */
|
3
3
|
/* This file is part of the HiGHS linear optimization suite */
|
4
4
|
/* */
|
5
|
-
/* Written and engineered 2008-
|
5
|
+
/* Written and engineered 2008-2024 by Julian Hall, Ivet Galabova, */
|
6
6
|
/* Leona Gottwald and Michael Feldmeier */
|
7
7
|
/* */
|
8
8
|
/* Available as open-source under the MIT License */
|
@@ -85,7 +85,13 @@ struct Quadratic {
|
|
85
85
|
double mu;
|
86
86
|
std::vector<double> lambda;
|
87
87
|
|
88
|
-
Quadratic(HighsLp lp_, ICrashOptions options_)
|
88
|
+
Quadratic(HighsLp lp_, ICrashOptions options_)
|
89
|
+
: lp(lp_),
|
90
|
+
options(options_),
|
91
|
+
lp_objective(0.0),
|
92
|
+
quadratic_objective(0.0),
|
93
|
+
residual_norm_2(0.0),
|
94
|
+
mu(0.0) {}
|
89
95
|
};
|
90
96
|
|
91
97
|
// Functions: Call.
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/* */
|
3
3
|
/* This file is part of the HiGHS linear optimization suite */
|
4
4
|
/* */
|
5
|
-
/* Written and engineered 2008-
|
5
|
+
/* Written and engineered 2008-2024 by Julian Hall, Ivet Galabova, */
|
6
6
|
/* Leona Gottwald and Michael Feldmeier */
|
7
7
|
/* */
|
8
8
|
/* Available as open-source under the MIT License */
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/* */
|
3
3
|
/* This file is part of the HiGHS linear optimization suite */
|
4
4
|
/* */
|
5
|
-
/* Written and engineered 2008-
|
5
|
+
/* Written and engineered 2008-2024 by Julian Hall, Ivet Galabova, */
|
6
6
|
/* Leona Gottwald and Michael Feldmeier */
|
7
7
|
/* */
|
8
8
|
/* Available as open-source under the MIT License */
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/* */
|
3
3
|
/* This file is part of the HiGHS linear optimization suite */
|
4
4
|
/* */
|
5
|
-
/* Written and engineered 2008-
|
5
|
+
/* Written and engineered 2008-2024 by Julian Hall, Ivet Galabova, */
|
6
6
|
/* Leona Gottwald and Michael Feldmeier */
|
7
7
|
/* */
|
8
8
|
/* Available as open-source under the MIT License */
|
@@ -8,22 +8,24 @@
|
|
8
8
|
#include "util/HighsTimer.h"
|
9
9
|
|
10
10
|
enum class QpAsmStatus {
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
kOk,
|
12
|
+
kWarning,
|
13
|
+
kError
|
14
|
+
// NEGATIVEEIGENVALUEINREDUCEDHESSIAN,
|
15
|
+
// BASISRANKDEFICIENT
|
14
16
|
};
|
15
17
|
|
16
18
|
struct QpSolution {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
QpVector primal;
|
20
|
+
QpVector rowactivity;
|
21
|
+
QpVector dualvar;
|
22
|
+
QpVector dualcon;
|
21
23
|
|
22
24
|
std::vector<BasisStatus> status_var;
|
23
25
|
std::vector<BasisStatus> status_con;
|
24
26
|
|
25
|
-
QpSolution(Instance& instance) : primal(
|
26
|
-
rowactivity(
|
27
|
+
QpSolution(Instance& instance) : primal(QpVector(instance.num_var)),
|
28
|
+
rowactivity(QpVector(instance.num_con)),
|
27
29
|
dualvar(instance.num_var),
|
28
30
|
dualcon(instance.num_con),
|
29
31
|
status_var(instance.num_var),
|
@@ -35,11 +37,11 @@ struct QpHotstartInformation {
|
|
35
37
|
std::vector<HighsInt> active;
|
36
38
|
std::vector<HighsInt> inactive;
|
37
39
|
std::vector<BasisStatus> status;
|
38
|
-
|
39
|
-
|
40
|
+
QpVector primal;
|
41
|
+
QpVector rowact;
|
40
42
|
|
41
43
|
QpHotstartInformation(HighsInt num_var, HighsInt num_row)
|
42
|
-
: primal(
|
44
|
+
: primal(QpVector(num_var)), rowact(QpVector(num_row)) {}
|
43
45
|
};
|
44
46
|
|
45
47
|
// the purpose of this is the pure algorithmic solution of a QP instance with given hotstart information.
|
@@ -50,7 +52,16 @@ struct QpHotstartInformation {
|
|
50
52
|
// 4) start from a qp solution that was attained from a perturbed instance and cleanup
|
51
53
|
// 5) start from a qp solution and cleanup after recomputing basis and reduced hessian factorization
|
52
54
|
|
55
|
+
std::string qpBasisStatusToString(const BasisStatus qp_basis_status);
|
56
|
+
std::string qpModelStatusToString(const QpModelStatus qp_model_status);
|
57
|
+
void assessQpPrimalFeasibility(const Instance& instance, const double primal_feasibility_tolerance,
|
58
|
+
const std::vector<double>& var_value, const std::vector<double>& con_value,
|
59
|
+
HighsInt& num_var_infeasibilities, double& max_var_infeasibility, double& sum_var_infeasibilities,
|
60
|
+
HighsInt& num_con_infeasibilities, double& max_con_infeasibility, double& sum_con_infeasibilities,
|
61
|
+
double& max_con_residual, double& sum_con_residuals);
|
53
62
|
|
54
63
|
QpAsmStatus solveqp_actual(Instance& instance, Settings& settings, QpHotstartInformation& startinfo, Statistics& stats, QpModelStatus& status, QpSolution& solution, HighsTimer& qp_timer);
|
55
64
|
|
65
|
+
|
66
|
+
|
56
67
|
#endif
|
@@ -1,12 +1,19 @@
|
|
1
1
|
#ifndef __SRC_LIB_QPSOLVER_QUASS_HPP__
|
2
2
|
#define __SRC_LIB_QPSOLVER_QUASS_HPP__
|
3
3
|
|
4
|
+
#include "Highs.h"
|
4
5
|
#include "qpsolver/instance.hpp"
|
5
6
|
#include "qpsolver/qpconst.hpp"
|
6
7
|
#include "qpsolver/a_asm.hpp"
|
7
8
|
#include "qpsolver/settings.hpp"
|
8
9
|
|
9
10
|
|
10
|
-
QpAsmStatus solveqp(Instance& instance,
|
11
|
+
QpAsmStatus solveqp(Instance& instance,
|
12
|
+
Settings& settings,
|
13
|
+
Statistics& stats,
|
14
|
+
HighsModelStatus& highs_model_status,
|
15
|
+
HighsBasis& highs_basis,
|
16
|
+
HighsSolution& highs_solution,
|
17
|
+
HighsTimer& timer);
|
11
18
|
|
12
19
|
#endif
|
@@ -0,0 +1,150 @@
|
|
1
|
+
#pragma once
|
2
|
+
#ifndef __SRC_LIB_BASIS_HPP__
|
3
|
+
#define __SRC_LIB_BASIS_HPP__
|
4
|
+
|
5
|
+
#include <map>
|
6
|
+
#include <vector>
|
7
|
+
|
8
|
+
#include "qpsolver/instance.hpp"
|
9
|
+
#include "qpsolver/pricing.hpp"
|
10
|
+
#include "qpsolver/qpconst.hpp"
|
11
|
+
#include "qpsolver/runtime.hpp"
|
12
|
+
#include "qpsolver/snippets.hpp"
|
13
|
+
#include "util/HFactor.h"
|
14
|
+
#include "util/HVector.h"
|
15
|
+
#include "util/HVectorBase.h"
|
16
|
+
|
17
|
+
class Basis {
|
18
|
+
HVector buffer_vec2hvec;
|
19
|
+
QpVector Ztprod_res;
|
20
|
+
QpVector buffer_Zprod;
|
21
|
+
|
22
|
+
HVector& vec2hvec(const QpVector& vec) {
|
23
|
+
buffer_vec2hvec.clear();
|
24
|
+
for (HighsInt i = 0; i < vec.num_nz; i++) {
|
25
|
+
buffer_vec2hvec.index[i] = vec.index[i];
|
26
|
+
buffer_vec2hvec.array[vec.index[i]] = vec.value[vec.index[i]];
|
27
|
+
}
|
28
|
+
buffer_vec2hvec.count = vec.num_nz;
|
29
|
+
buffer_vec2hvec.packFlag = true;
|
30
|
+
return buffer_vec2hvec;
|
31
|
+
}
|
32
|
+
|
33
|
+
QpVector& hvec2vec(const HVector& hvec, QpVector& target) {
|
34
|
+
target.reset();
|
35
|
+
for (HighsInt i = 0; i < hvec.count; i++) {
|
36
|
+
target.index[i] = hvec.index[i];
|
37
|
+
target.value[target.index[i]] = hvec.array[hvec.index[i]];
|
38
|
+
}
|
39
|
+
// for (HighsInt i = 0; i < hvec.size; i++) {
|
40
|
+
// target.index[i] = hvec.index[i];
|
41
|
+
// target.value[i] = hvec.array[i];
|
42
|
+
// }
|
43
|
+
target.num_nz = hvec.count;
|
44
|
+
return target;
|
45
|
+
}
|
46
|
+
|
47
|
+
QpVector hvec2vec(const HVector& hvec) {
|
48
|
+
QpVector vec(hvec.size);
|
49
|
+
|
50
|
+
return hvec2vec(hvec, vec);
|
51
|
+
}
|
52
|
+
|
53
|
+
Runtime& runtime;
|
54
|
+
HFactor basisfactor;
|
55
|
+
HighsInt updatessinceinvert = 0;
|
56
|
+
|
57
|
+
MatrixBase Atran;
|
58
|
+
|
59
|
+
// indices of active constraints in basis
|
60
|
+
std::vector<HighsInt> active_constraint_index;
|
61
|
+
|
62
|
+
// ids of constraints that are in the basis but not active
|
63
|
+
// I need to extract those columns to get Z
|
64
|
+
std::vector<HighsInt> non_active_constraint_index;
|
65
|
+
|
66
|
+
// ids of constraints that are in the basis
|
67
|
+
std::vector<HighsInt> baseindex;
|
68
|
+
|
69
|
+
std::map<int, BasisStatus> basisstatus;
|
70
|
+
|
71
|
+
// index i: -1 if constraint not in basis, [0, num_var] if
|
72
|
+
// constraint in basis (active or not)
|
73
|
+
std::vector<HighsInt> constraintindexinbasisfactor;
|
74
|
+
|
75
|
+
void build();
|
76
|
+
|
77
|
+
// buffer to avoid recreating vectors
|
78
|
+
QpVector buffer_column_aq;
|
79
|
+
QpVector buffer_row_ep;
|
80
|
+
|
81
|
+
// buffers to prevent multiple btran/ftran
|
82
|
+
HighsInt buffered_q = -1;
|
83
|
+
HighsInt buffered_p = -1;
|
84
|
+
HVector row_ep;
|
85
|
+
HVector col_aq;
|
86
|
+
|
87
|
+
bool reinversion_hint = false;
|
88
|
+
public:
|
89
|
+
|
90
|
+
|
91
|
+
Basis(Runtime& rt, std::vector<HighsInt> active,
|
92
|
+
std::vector<BasisStatus> atlower, std::vector<HighsInt> inactive);
|
93
|
+
|
94
|
+
bool getreinversionhint() { return reinversion_hint; }
|
95
|
+
|
96
|
+
void rebuild();
|
97
|
+
|
98
|
+
HighsInt getnupdatessinceinvert() { return updatessinceinvert; }
|
99
|
+
|
100
|
+
HighsInt getnumactive() const { return active_constraint_index.size(); };
|
101
|
+
|
102
|
+
HighsInt getnuminactive() const { return non_active_constraint_index.size(); };
|
103
|
+
|
104
|
+
const std::vector<HighsInt>& getactive() const {
|
105
|
+
return active_constraint_index;
|
106
|
+
};
|
107
|
+
|
108
|
+
const std::vector<HighsInt>& getinactive() const {
|
109
|
+
return non_active_constraint_index;
|
110
|
+
};
|
111
|
+
|
112
|
+
const std::vector<HighsInt>& getindexinfactor() const {
|
113
|
+
return constraintindexinbasisfactor;
|
114
|
+
};
|
115
|
+
|
116
|
+
BasisStatus getstatus(HighsInt conid) { return basisstatus[conid]; };
|
117
|
+
|
118
|
+
void report();
|
119
|
+
|
120
|
+
// move that constraint into V section basis (will correspond to
|
121
|
+
// Nullspace from now on)
|
122
|
+
void deactivate(HighsInt conid);
|
123
|
+
|
124
|
+
QpSolverStatus activate(const Settings& settings, HighsInt conid, BasisStatus atlower,
|
125
|
+
HighsInt nonactivetoremove, Pricing* pricing);
|
126
|
+
|
127
|
+
void updatebasis(const Settings& settings, HighsInt newactivecon, HighsInt droppedcon,
|
128
|
+
Pricing* pricing);
|
129
|
+
|
130
|
+
QpVector btran(const QpVector& rhs, bool buffer = false, HighsInt p = -1);
|
131
|
+
|
132
|
+
QpVector ftran(const QpVector& rhs, bool buffer = false, HighsInt q = -1);
|
133
|
+
|
134
|
+
QpVector& btran(const QpVector& rhs, QpVector& target, bool buffer = false,
|
135
|
+
HighsInt p = -1);
|
136
|
+
|
137
|
+
QpVector& ftran(const QpVector& rhs, QpVector& target, bool buffer = false,
|
138
|
+
HighsInt q = -1);
|
139
|
+
|
140
|
+
QpVector recomputex(const Instance& inst);
|
141
|
+
|
142
|
+
void write(std::string filename);
|
143
|
+
|
144
|
+
QpVector& Ztprod(const QpVector& rhs, QpVector& target, bool buffer = false,
|
145
|
+
HighsInt q = -1);
|
146
|
+
|
147
|
+
QpVector& Zprod(const QpVector& rhs, QpVector& target);
|
148
|
+
};
|
149
|
+
|
150
|
+
#endif
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#ifndef __SRC_LIB_CRASHSOLUTION_HPP__
|
2
|
+
#define __SRC_LIB_CRASHSOLUTION_HPP__
|
3
|
+
|
4
|
+
#include <cstdlib>
|
5
|
+
#include "runtime.hpp"
|
6
|
+
|
7
|
+
inline
|
8
|
+
bool isfreevar(Instance& instance, HighsInt idx) {
|
9
|
+
return instance.var_lo[idx] == -std::numeric_limits<double>::infinity() && instance.var_up[idx] == std::numeric_limits<double>::infinity();
|
10
|
+
}
|
11
|
+
|
12
|
+
#endif
|