casadi 3.6.5__cp311-none-manylinux2014_x86_64.whl → 3.6.7__cp311-none-manylinux2014_x86_64.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.so +0 -0
- casadi/casadi.py +739 -308
- casadi/cbc +0 -0
- casadi/clp +0 -0
- casadi/cmake/casadi-config-version.cmake +1 -1
- casadi/cmake/highs/highs-config.cmake +6 -13
- casadi/cmake/highs/highs-targets-release.cmake +13 -13
- casadi/cmake/highs/highs-targets.cmake +13 -10
- casadi/highs +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/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/lib64/libtinyxml2.a +0 -0
- casadi/libCbcSolver.so +0 -0
- casadi/libCbcSolver.so.3 +0 -0
- casadi/libCbcSolver.so.3.10.11 +0 -0
- casadi/libClpSolver.so +0 -0
- casadi/libClpSolver.so.1 +0 -0
- casadi/libClpSolver.so.1.14.9 +0 -0
- casadi/libbonmin.so +0 -0
- casadi/libbonmin.so.4 +0 -0
- casadi/libbonmin.so.4.8.9 +0 -0
- casadi/libcasadi.so +0 -0
- casadi/libcasadi.so.3.7 +0 -0
- casadi/libcasadi_conic_cbc.so +0 -0
- casadi/libcasadi_conic_cbc.so.3.7 +0 -0
- casadi/libcasadi_conic_clp.so +0 -0
- casadi/libcasadi_conic_clp.so.3.7 +0 -0
- casadi/libcasadi_conic_cplex.so +0 -0
- casadi/libcasadi_conic_cplex.so.3.7 +0 -0
- casadi/libcasadi_conic_daqp.so +0 -0
- casadi/libcasadi_conic_daqp.so.3.7 +0 -0
- casadi/libcasadi_conic_fatrop.so +0 -0
- casadi/libcasadi_conic_fatrop.so.3.7 +0 -0
- casadi/libcasadi_conic_gurobi.so +0 -0
- casadi/libcasadi_conic_gurobi.so.3.7 +0 -0
- casadi/libcasadi_conic_highs.so +0 -0
- casadi/libcasadi_conic_highs.so.3.7 +0 -0
- casadi/libcasadi_conic_hpipm.so +0 -0
- casadi/libcasadi_conic_hpipm.so.3.7 +0 -0
- casadi/libcasadi_conic_ipqp.so +0 -0
- casadi/libcasadi_conic_ipqp.so.3.7 +0 -0
- casadi/libcasadi_conic_nlpsol.so +0 -0
- casadi/libcasadi_conic_nlpsol.so.3.7 +0 -0
- casadi/libcasadi_conic_osqp.so +0 -0
- casadi/libcasadi_conic_osqp.so.3.7 +0 -0
- casadi/libcasadi_conic_proxqp.so +0 -0
- casadi/libcasadi_conic_proxqp.so.3.7 +0 -0
- casadi/libcasadi_conic_qpoases.so +0 -0
- casadi/libcasadi_conic_qpoases.so.3.7 +0 -0
- casadi/libcasadi_conic_qrqp.so +0 -0
- casadi/libcasadi_conic_qrqp.so.3.7 +0 -0
- casadi/libcasadi_conic_superscs.so +0 -0
- casadi/libcasadi_conic_superscs.so.3.7 +0 -0
- casadi/libcasadi_integrator_collocation.so +0 -0
- casadi/libcasadi_integrator_collocation.so.3.7 +0 -0
- casadi/libcasadi_integrator_cvodes.so +0 -0
- casadi/libcasadi_integrator_cvodes.so.3.7 +0 -0
- casadi/libcasadi_integrator_idas.so +0 -0
- casadi/libcasadi_integrator_idas.so.3.7 +0 -0
- casadi/libcasadi_integrator_rk.so +0 -0
- casadi/libcasadi_integrator_rk.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_alpaqa.so +0 -0
- casadi/libcasadi_nlpsol_alpaqa.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_ampl.so +0 -0
- casadi/libcasadi_nlpsol_ampl.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_blocksqp.so +0 -0
- casadi/libcasadi_nlpsol_blocksqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_bonmin.so +0 -0
- casadi/libcasadi_nlpsol_bonmin.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_fatrop.so +0 -0
- casadi/libcasadi_nlpsol_fatrop.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.so +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_ipopt.so +0 -0
- casadi/libcasadi_nlpsol_ipopt.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_knitro.so +0 -0
- casadi/libcasadi_nlpsol_knitro.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_madnlp.so +0 -0
- casadi/libcasadi_nlpsol_madnlp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_qrsqp.so +0 -0
- casadi/libcasadi_nlpsol_qrsqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_scpgen.so +0 -0
- casadi/libcasadi_nlpsol_scpgen.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_sleqp.so +0 -0
- casadi/libcasadi_nlpsol_sleqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_snopt.so +0 -0
- casadi/libcasadi_nlpsol_snopt.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.so +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_worhp.so +0 -0
- casadi/libcasadi_nlpsol_worhp.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_fast_newton.so +0 -0
- casadi/libcasadi_rootfinder_fast_newton.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_kinsol.so +0 -0
- casadi/libcasadi_rootfinder_kinsol.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_newton.so +0 -0
- casadi/libcasadi_rootfinder_newton.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_nlpsol.so +0 -0
- casadi/libcasadi_rootfinder_nlpsol.so.3.7 +0 -0
- casadi/libcasadi_sundials_common.so +0 -0
- casadi/libcasadi_sundials_common.so.3.7 +0 -0
- casadi/libcoinmetis.la +1 -1
- casadi/libcoinmetis.so +0 -0
- casadi/libcoinmetis.so.2 +0 -0
- casadi/libcoinmetis.so.2.0.0 +0 -0
- casadi/libdaqp.so +0 -0
- casadi/libdaqpstat.a +0 -0
- casadi/libfatrop.so +0 -0
- casadi/libhighs.so +0 -0
- casadi/libhighs.so.1 +0 -0
- casadi/libhighs.so.1.7.2 +0 -0
- casadi/libindirect.a +0 -0
- casadi/liblinsys.a +0 -0
- casadi/libmatlab_ipc.so +0 -0
- casadi/libosqp.a +0 -0
- casadi/libosqp.so +0 -0
- casadi/libqdldl.a +0 -0
- casadi/libsleqp.so +0 -0
- casadi/libsleqp.so.1.0.1 +0 -0
- casadi/libspral.a +0 -0
- casadi/libsuperscs.a +0 -0
- casadi/pkgconfig/casadi.pc +1 -1
- casadi/pkgconfig/highs.pc +1 -1
- 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 +425 -255
- casadi/include/highs/fortran/highs_fortran_api.mod +0 -0
- casadi/libFortranHighs.so +0 -0
- casadi/libhighs.so.1.6 +0 -0
- casadi/libhighs.so.1.6.0 +0 -0
- {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/WHEEL +0 -0
@@ -0,0 +1,72 @@
|
|
1
|
+
#ifndef __SRC_LIB_PRICING_DANTZIGPRICING_HPP__
|
2
|
+
#define __SRC_LIB_PRICING_DANTZIGPRICING_HPP__
|
3
|
+
|
4
|
+
#include "basis.hpp"
|
5
|
+
#include "pricing.hpp"
|
6
|
+
#include "reducedcosts.hpp"
|
7
|
+
#include "runtime.hpp"
|
8
|
+
|
9
|
+
// 51561, 78965838.346823, 559, 213.280772, 0.000812, 801
|
10
|
+
|
11
|
+
class DantzigPricing : public Pricing {
|
12
|
+
private:
|
13
|
+
Runtime& runtime;
|
14
|
+
Basis& basis;
|
15
|
+
ReducedCosts& redcosts;
|
16
|
+
|
17
|
+
HighsInt chooseconstrainttodrop(const QpVector& lambda) {
|
18
|
+
auto active_constraint_index = basis.getactive();
|
19
|
+
auto constraintindexinbasisfactor = basis.getindexinfactor();
|
20
|
+
|
21
|
+
HighsInt minidx = -1;
|
22
|
+
double maxabslambda = 0.0;
|
23
|
+
for (size_t i = 0; i < active_constraint_index.size(); i++) {
|
24
|
+
HighsInt indexinbasis =
|
25
|
+
constraintindexinbasisfactor[active_constraint_index[i]];
|
26
|
+
if (indexinbasis == -1) {
|
27
|
+
printf("error\n");
|
28
|
+
}
|
29
|
+
assert(indexinbasis != -1);
|
30
|
+
|
31
|
+
if (basis.getstatus(active_constraint_index[i]) ==
|
32
|
+
BasisStatus::kActiveAtLower &&
|
33
|
+
-lambda.value[indexinbasis] > maxabslambda) {
|
34
|
+
minidx = active_constraint_index[i];
|
35
|
+
maxabslambda = -lambda.value[indexinbasis];
|
36
|
+
} else if (basis.getstatus(active_constraint_index[i]) ==
|
37
|
+
BasisStatus::kActiveAtUpper &&
|
38
|
+
lambda.value[indexinbasis] > maxabslambda) {
|
39
|
+
minidx = active_constraint_index[i];
|
40
|
+
maxabslambda = lambda.value[indexinbasis];
|
41
|
+
} else {
|
42
|
+
// TODO
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
if (maxabslambda <= runtime.settings.lambda_zero_threshold) {
|
47
|
+
// printf("maxabslambda %lf\n", log(maxabslambda));
|
48
|
+
return -1;
|
49
|
+
}
|
50
|
+
return minidx;
|
51
|
+
}
|
52
|
+
|
53
|
+
public:
|
54
|
+
DantzigPricing(Runtime& rt, Basis& bas, ReducedCosts& rc)
|
55
|
+
: runtime(rt), basis(bas), redcosts(rc){};
|
56
|
+
|
57
|
+
HighsInt price(const QpVector& x, const QpVector& gradient) {
|
58
|
+
HighsInt minidx = chooseconstrainttodrop(redcosts.getReducedCosts());
|
59
|
+
return minidx;
|
60
|
+
}
|
61
|
+
|
62
|
+
void recompute() {
|
63
|
+
// do nothing
|
64
|
+
}
|
65
|
+
|
66
|
+
void update_weights(const QpVector& aq, const QpVector& ep, HighsInt p,
|
67
|
+
HighsInt q) {
|
68
|
+
// does nothing
|
69
|
+
}
|
70
|
+
};
|
71
|
+
|
72
|
+
#endif
|
@@ -0,0 +1,99 @@
|
|
1
|
+
#ifndef __SRC_LIB_PRICING_DEVEXPRICING_HPP__
|
2
|
+
#define __SRC_LIB_PRICING_DEVEXPRICING_HPP__
|
3
|
+
|
4
|
+
#include "qpsolver/basis.hpp"
|
5
|
+
#include "qpsolver/pricing.hpp"
|
6
|
+
#include "qpsolver/reducedcosts.hpp"
|
7
|
+
#include "qpsolver/runtime.hpp"
|
8
|
+
|
9
|
+
// 42726, 78965776.391299, 559, 104.321553, 0.000669, 7937
|
10
|
+
|
11
|
+
class DevexPricing : public Pricing {
|
12
|
+
private:
|
13
|
+
Runtime& runtime;
|
14
|
+
Basis& basis;
|
15
|
+
ReducedCosts& redcosts;
|
16
|
+
|
17
|
+
std::vector<double> weights;
|
18
|
+
|
19
|
+
HighsInt chooseconstrainttodrop(const QpVector& lambda) {
|
20
|
+
auto active_constraint_index = basis.getactive();
|
21
|
+
auto constraintindexinbasisfactor = basis.getindexinfactor();
|
22
|
+
|
23
|
+
HighsInt minidx = -1;
|
24
|
+
double maxabslambda = 0.0;
|
25
|
+
for (size_t i = 0; i < active_constraint_index.size(); i++) {
|
26
|
+
HighsInt indexinbasis =
|
27
|
+
constraintindexinbasisfactor[active_constraint_index[i]];
|
28
|
+
if (indexinbasis == -1) {
|
29
|
+
printf("error\n");
|
30
|
+
}
|
31
|
+
assert(indexinbasis != -1);
|
32
|
+
|
33
|
+
double val = lambda.value[indexinbasis] * lambda.value[indexinbasis] /
|
34
|
+
weights[indexinbasis];
|
35
|
+
if (val > maxabslambda && fabs(lambda.value[indexinbasis]) >
|
36
|
+
runtime.settings.lambda_zero_threshold) {
|
37
|
+
if (basis.getstatus(active_constraint_index[i]) ==
|
38
|
+
BasisStatus::kActiveAtLower &&
|
39
|
+
-lambda.value[indexinbasis] > 0) {
|
40
|
+
minidx = active_constraint_index[i];
|
41
|
+
maxabslambda = val;
|
42
|
+
} else if (basis.getstatus(active_constraint_index[i]) ==
|
43
|
+
BasisStatus::kActiveAtUpper &&
|
44
|
+
lambda.value[indexinbasis] > 0) {
|
45
|
+
minidx = active_constraint_index[i];
|
46
|
+
maxabslambda = val;
|
47
|
+
} else {
|
48
|
+
// TODO
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
return minidx;
|
54
|
+
}
|
55
|
+
|
56
|
+
public:
|
57
|
+
DevexPricing(Runtime& rt, Basis& bas, ReducedCosts& rc)
|
58
|
+
: runtime(rt),
|
59
|
+
basis(bas),
|
60
|
+
redcosts(rc),
|
61
|
+
weights(std::vector<double>(rt.instance.num_var, 1.0)){};
|
62
|
+
|
63
|
+
// B lambda = g
|
64
|
+
// lambda = inv(B)g
|
65
|
+
// lambda = Z'g == reduced gradient ??
|
66
|
+
// no: lambda = Y'g !!
|
67
|
+
// dual values updated as:
|
68
|
+
// c_N^T += alpha_D * a_p^T (pivotal row)
|
69
|
+
// alpha_D = -c_q / a_pq
|
70
|
+
HighsInt price(const QpVector& x, const QpVector& gradient) {
|
71
|
+
QpVector& lambda = redcosts.getReducedCosts();
|
72
|
+
HighsInt minidx = chooseconstrainttodrop(lambda);
|
73
|
+
return minidx;
|
74
|
+
}
|
75
|
+
|
76
|
+
void recompute() {
|
77
|
+
// do nothing
|
78
|
+
}
|
79
|
+
|
80
|
+
void update_weights(const QpVector& aq, const QpVector& ep, HighsInt p,
|
81
|
+
HighsInt q) {
|
82
|
+
HighsInt rowindex_p = basis.getindexinfactor()[p];
|
83
|
+
double weight_p = weights[rowindex_p];
|
84
|
+
for (HighsInt i = 0; i < runtime.instance.num_var; i++) {
|
85
|
+
if (i == rowindex_p) {
|
86
|
+
weights[i] = weight_p / (aq.value[rowindex_p] * aq.value[rowindex_p]);
|
87
|
+
} else {
|
88
|
+
weights[i] += (aq.value[i] * aq.value[i]) /
|
89
|
+
(aq.value[rowindex_p] * aq.value[rowindex_p]) * weight_p *
|
90
|
+
weight_p;
|
91
|
+
}
|
92
|
+
if (weights[i] > 1e7) {
|
93
|
+
weights[i] = 1.0;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
};
|
98
|
+
|
99
|
+
#endif
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#ifndef __SRC_LIB_EVENTHANDLER_HPP__
|
2
|
+
#define __SRC_LIB_EVENTHANDLER_HPP__
|
3
|
+
|
4
|
+
#include <functional>
|
5
|
+
#include <vector>
|
6
|
+
|
7
|
+
template <typename T> // T: void (*fncptr)(int, double)
|
8
|
+
class Eventhandler {
|
9
|
+
std::vector<std::function<void(T)>> subscribers;
|
10
|
+
|
11
|
+
public:
|
12
|
+
void subscribe(std::function<void(T)> subscriber) {
|
13
|
+
subscribers.push_back(subscriber);
|
14
|
+
}
|
15
|
+
|
16
|
+
void fire(T args) {
|
17
|
+
for (std::function<void(T)> fun : subscribers) {
|
18
|
+
fun(args);
|
19
|
+
}
|
20
|
+
}
|
21
|
+
};
|
22
|
+
|
23
|
+
#endif
|
@@ -0,0 +1,400 @@
|
|
1
|
+
#ifndef __SRC_LIB_NEWFACTOR_HPP__
|
2
|
+
#define __SRC_LIB_NEWFACTOR_HPP__
|
3
|
+
|
4
|
+
#include <cassert>
|
5
|
+
#include <vector>
|
6
|
+
|
7
|
+
#include "matrix.hpp"
|
8
|
+
#include "qpconst.hpp"
|
9
|
+
#include "runtime.hpp"
|
10
|
+
|
11
|
+
using std::min;
|
12
|
+
|
13
|
+
class CholeskyFactor {
|
14
|
+
private:
|
15
|
+
bool uptodate = false;
|
16
|
+
HighsInt numberofreduces = 0;
|
17
|
+
|
18
|
+
Runtime& runtime;
|
19
|
+
|
20
|
+
Basis& basis;
|
21
|
+
|
22
|
+
HighsInt current_k = 0;
|
23
|
+
HighsInt current_k_max;
|
24
|
+
std::vector<double> L;
|
25
|
+
|
26
|
+
bool has_negative_eigenvalue = false;
|
27
|
+
std::vector<double> a;
|
28
|
+
|
29
|
+
void resize(HighsInt new_k_max) {
|
30
|
+
std::vector<double> L_old = L;
|
31
|
+
L.clear();
|
32
|
+
L.resize((new_k_max) * (new_k_max));
|
33
|
+
const HighsInt l_size = L.size();
|
34
|
+
// Driven by #958, changes made in following lines to avoid array
|
35
|
+
// bound error when new_k_max < current_k_max
|
36
|
+
HighsInt min_k_max = min(new_k_max, current_k_max);
|
37
|
+
for (HighsInt i = 0; i < min_k_max; i++) {
|
38
|
+
for (HighsInt j = 0; j < min_k_max; j++) {
|
39
|
+
assert(i * (new_k_max) + j < l_size);
|
40
|
+
L[i * (new_k_max) + j] = L_old[i * current_k_max + j];
|
41
|
+
}
|
42
|
+
}
|
43
|
+
current_k_max = new_k_max;
|
44
|
+
}
|
45
|
+
|
46
|
+
public:
|
47
|
+
CholeskyFactor(Runtime& rt, Basis& bas) : runtime(rt), basis(bas) {
|
48
|
+
uptodate = false;
|
49
|
+
current_k_max =
|
50
|
+
max(min((HighsInt)ceil(rt.instance.num_var / 16.0), (HighsInt)1000),
|
51
|
+
basis.getnuminactive());
|
52
|
+
L.resize(current_k_max * current_k_max);
|
53
|
+
}
|
54
|
+
|
55
|
+
|
56
|
+
void recompute() {
|
57
|
+
std::vector<std::vector<double>> orig;
|
58
|
+
HighsInt dim_ns = basis.getinactive().size();
|
59
|
+
numberofreduces = 0;
|
60
|
+
|
61
|
+
orig.assign(dim_ns, std::vector<double>(dim_ns, 0.0));
|
62
|
+
resize(dim_ns);
|
63
|
+
|
64
|
+
Matrix temp(dim_ns, 0);
|
65
|
+
|
66
|
+
QpVector buffer_Qcol(runtime.instance.num_var);
|
67
|
+
QpVector buffer_ZtQi(dim_ns);
|
68
|
+
for (HighsInt i = 0; i < runtime.instance.num_var; i++) {
|
69
|
+
runtime.instance.Q.mat.extractcol(i, buffer_Qcol);
|
70
|
+
basis.Ztprod(buffer_Qcol, buffer_ZtQi);
|
71
|
+
temp.append(buffer_ZtQi);
|
72
|
+
}
|
73
|
+
MatrixBase& temp_t = temp.t();
|
74
|
+
for (HighsInt i = 0; i < dim_ns; i++) {
|
75
|
+
basis.Ztprod(temp_t.extractcol(i, buffer_Qcol), buffer_ZtQi);
|
76
|
+
for (HighsInt j = 0; j < buffer_ZtQi.num_nz; j++) {
|
77
|
+
orig[i][buffer_ZtQi.index[j]] = buffer_ZtQi.value[buffer_ZtQi.index[j]];
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
for (size_t col = 0; col < orig.size(); col++) {
|
82
|
+
for (size_t row = 0; row <= col; row++) {
|
83
|
+
double sum = 0;
|
84
|
+
if (row == col) {
|
85
|
+
for (size_t k = 0; k < row; k++)
|
86
|
+
sum += L[k * current_k_max + row] * L[k * current_k_max + row];
|
87
|
+
L[row * current_k_max + row] = sqrt(orig[row][row] - sum);
|
88
|
+
} else {
|
89
|
+
for (size_t k = 0; k < row; k++)
|
90
|
+
sum += (L[k * current_k_max + col] * L[k * current_k_max + row]);
|
91
|
+
L[row * current_k_max + col] =
|
92
|
+
(orig[col][row] - sum) / L[row * current_k_max + row];
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
current_k = dim_ns;
|
97
|
+
uptodate = true;
|
98
|
+
}
|
99
|
+
|
100
|
+
QpSolverStatus expand(const QpVector& yp, QpVector& gyp, QpVector& l, QpVector& m) {
|
101
|
+
if (!uptodate) {
|
102
|
+
return QpSolverStatus::OK;
|
103
|
+
}
|
104
|
+
double mu = gyp * yp;
|
105
|
+
l.resparsify();
|
106
|
+
double lambda = mu - l.norm2();
|
107
|
+
if (lambda > 0.0) {
|
108
|
+
if (current_k_max <= current_k + 1) {
|
109
|
+
resize(current_k_max * 2);
|
110
|
+
}
|
111
|
+
|
112
|
+
for (HighsInt i = 0; i < current_k; i++) {
|
113
|
+
L[i * current_k_max + current_k] = l.value[i];
|
114
|
+
}
|
115
|
+
L[current_k * current_k_max + current_k] = sqrt(lambda);
|
116
|
+
|
117
|
+
current_k++;
|
118
|
+
} else {
|
119
|
+
return QpSolverStatus::NOTPOSITIVDEFINITE;
|
120
|
+
|
121
|
+
// |LL' 0|
|
122
|
+
// M = |0' 0| + bb' -aa'
|
123
|
+
// a = (k * m, alpha), b = (k * m, beta)
|
124
|
+
// b*b -a*a = mu
|
125
|
+
// k(b-a) = 1
|
126
|
+
// b + a = k*mu
|
127
|
+
// Commented out unreachable code
|
128
|
+
// const double tolerance = 0.001;
|
129
|
+
//
|
130
|
+
// double beta = max(tolerance, sqrt(m.norm2() / L[0] + fabs(mu)));
|
131
|
+
// double k = 1 / (beta + sqrt(beta * beta - mu));
|
132
|
+
// double alpha = k * mu - beta;
|
133
|
+
//
|
134
|
+
// printf("k = %d, alpha = %lf, beta = %lf, k = %lf\n", (int)current_k, alpha,
|
135
|
+
// beta, k);
|
136
|
+
//
|
137
|
+
// a.clear();
|
138
|
+
// a.resize(current_k + 1);
|
139
|
+
// for (HighsInt i = 0; i < current_k; i++) {
|
140
|
+
// a[i] = k * m.value[i];
|
141
|
+
// }
|
142
|
+
// a[current_k] = alpha;
|
143
|
+
//
|
144
|
+
// std::vector<double> b(current_k + 1);
|
145
|
+
// for (HighsInt i = 0; i < current_k; i++) {
|
146
|
+
// b[i] = k * m.value[i];
|
147
|
+
// }
|
148
|
+
// b[current_k] = beta;
|
149
|
+
//
|
150
|
+
// if (current_k_max <= current_k + 1) {
|
151
|
+
// resize(current_k_max * 2);
|
152
|
+
// }
|
153
|
+
//
|
154
|
+
// // append b to the left of L
|
155
|
+
// for (HighsInt row = current_k; row > 0; row--) {
|
156
|
+
// // move row one position down
|
157
|
+
// for (HighsInt i = 0; i < current_k; i++) {
|
158
|
+
// L[row * current_k_max + i] = L[(row - 1) * current_k_max + i];
|
159
|
+
// }
|
160
|
+
// }
|
161
|
+
// for (HighsInt i = 0; i < current_k + 1; i++) {
|
162
|
+
// L[i] = b[i];
|
163
|
+
// }
|
164
|
+
//
|
165
|
+
// // re-triangulize
|
166
|
+
// for (HighsInt i = 0; i < current_k + 1; i++) {
|
167
|
+
// eliminate(L, i, i + 1, current_k_max, current_k + 1);
|
168
|
+
// }
|
169
|
+
//
|
170
|
+
// current_k = current_k + 1;
|
171
|
+
}
|
172
|
+
return QpSolverStatus::OK;
|
173
|
+
}
|
174
|
+
|
175
|
+
void solveL(QpVector& rhs) {
|
176
|
+
if (!uptodate) {
|
177
|
+
recompute();
|
178
|
+
}
|
179
|
+
|
180
|
+
if (current_k != rhs.dim) {
|
181
|
+
printf("dimension mismatch\n");
|
182
|
+
return;
|
183
|
+
}
|
184
|
+
|
185
|
+
for (HighsInt r = 0; r < rhs.dim; r++) {
|
186
|
+
for (HighsInt j = 0; j < r; j++) {
|
187
|
+
rhs.value[r] -= rhs.value[j] * L[j * current_k_max + r];
|
188
|
+
}
|
189
|
+
|
190
|
+
rhs.value[r] /= L[r * current_k_max + r];
|
191
|
+
}
|
192
|
+
}
|
193
|
+
|
194
|
+
// solve L' u = v
|
195
|
+
void solveLT(QpVector& rhs) {
|
196
|
+
for (HighsInt i = rhs.dim - 1; i >= 0; i--) {
|
197
|
+
double sum = 0.0;
|
198
|
+
for (HighsInt j = rhs.dim - 1; j > i; j--) {
|
199
|
+
sum += rhs.value[j] * L[i * current_k_max + j];
|
200
|
+
}
|
201
|
+
rhs.value[i] = (rhs.value[i] - sum) / L[i * current_k_max + i];
|
202
|
+
}
|
203
|
+
}
|
204
|
+
|
205
|
+
void solve(QpVector& rhs) {
|
206
|
+
if (!uptodate || (numberofreduces >= runtime.instance.num_var / 2 &&
|
207
|
+
!has_negative_eigenvalue)) {
|
208
|
+
recompute();
|
209
|
+
}
|
210
|
+
solveL(rhs);
|
211
|
+
solveLT(rhs);
|
212
|
+
|
213
|
+
rhs.resparsify();
|
214
|
+
}
|
215
|
+
|
216
|
+
void eliminate(std::vector<double>& m, HighsInt i, HighsInt j, HighsInt kmax,
|
217
|
+
HighsInt currentk) {
|
218
|
+
// i = col, j = row
|
219
|
+
if (m[j * kmax + i] == 0.0) {
|
220
|
+
return;
|
221
|
+
}
|
222
|
+
double z = sqrt(m[i * kmax + i] * m[i * kmax + i] +
|
223
|
+
m[j * kmax + i] * m[j * kmax + i]);
|
224
|
+
double cos_, sin_;
|
225
|
+
if (z == 0) {
|
226
|
+
cos_ = 1.0;
|
227
|
+
sin_ = 0.0;
|
228
|
+
} else {
|
229
|
+
cos_ = m[i * kmax + i] / z;
|
230
|
+
sin_ = -m[j * kmax + i] / z;
|
231
|
+
}
|
232
|
+
|
233
|
+
if (sin_ == 0.0) {
|
234
|
+
if (cos_ > 0.0) {
|
235
|
+
// nothing
|
236
|
+
} else {
|
237
|
+
for (HighsInt k = 0; k < current_k; k++) {
|
238
|
+
// update entry i and j of column k
|
239
|
+
double a_ik = m[i * kmax + k];
|
240
|
+
// entry i
|
241
|
+
m[i * kmax + k] = -a_ik;
|
242
|
+
m[j * kmax + k] = -m[j * kmax + k];
|
243
|
+
}
|
244
|
+
}
|
245
|
+
} else if (cos_ == 0.0) {
|
246
|
+
if (sin_ > 0.0) {
|
247
|
+
for (HighsInt k = 0; k < current_k; k++) {
|
248
|
+
// update entry i and j of column k
|
249
|
+
double a_ik = m[i * kmax + k];
|
250
|
+
// entry i
|
251
|
+
m[i * kmax + k] = -m[j * kmax + k];
|
252
|
+
m[j * kmax + k] = a_ik;
|
253
|
+
}
|
254
|
+
} else {
|
255
|
+
for (HighsInt k = 0; k < current_k; k++) {
|
256
|
+
// update entry i and j of column k
|
257
|
+
double a_ik = m[i * kmax + k];
|
258
|
+
// entry i
|
259
|
+
m[i * kmax + k] = m[j * kmax + k];
|
260
|
+
m[j * kmax + k] = -a_ik;
|
261
|
+
}
|
262
|
+
}
|
263
|
+
} else {
|
264
|
+
// #pragma omp parallel for
|
265
|
+
for (HighsInt k = 0; k < current_k; k++) {
|
266
|
+
// update entry i and j of column k
|
267
|
+
double a_ik = m[i * kmax + k];
|
268
|
+
// entry i
|
269
|
+
m[i * kmax + k] = cos_ * a_ik - sin_ * m[j * kmax + k];
|
270
|
+
m[j * kmax + k] = sin_ * a_ik + cos_ * m[j * kmax + k];
|
271
|
+
}
|
272
|
+
}
|
273
|
+
m[j * kmax + i] = 0.0;
|
274
|
+
}
|
275
|
+
|
276
|
+
void reduce(const QpVector& buffer_d, const HighsInt maxabsd, bool p_in_v) {
|
277
|
+
if (current_k == 0) {
|
278
|
+
return;
|
279
|
+
}
|
280
|
+
if (!uptodate) {
|
281
|
+
return;
|
282
|
+
}
|
283
|
+
numberofreduces++;
|
284
|
+
|
285
|
+
unsigned p = maxabsd; // col we push to the right and remove
|
286
|
+
|
287
|
+
// start situation: p=3, current_k = 5
|
288
|
+
// |1 x | |x | |1 | |xxxxx|
|
289
|
+
// | 1x | |xx | === | 1 | | xxxx|
|
290
|
+
// | x1 | |xxx | |xxxx| | xxx|
|
291
|
+
// | x 1| |xxxx | | 1 | | xx|
|
292
|
+
// |xxxxx| | 1| | x|
|
293
|
+
// next step: move row/col p to the bottom/right
|
294
|
+
|
295
|
+
//> save row p
|
296
|
+
std::vector<double> row_p(current_k, 0.0);
|
297
|
+
for (HighsInt i = 0; i < current_k; i++) {
|
298
|
+
row_p[i] = L[p * current_k_max + i];
|
299
|
+
}
|
300
|
+
|
301
|
+
//> move all rows > p up by one row
|
302
|
+
for (HighsInt row = p; row < current_k - 1; row++) {
|
303
|
+
for (HighsInt i = 0; i < current_k; i++) {
|
304
|
+
L[row * current_k_max + i] = L[(row + 1) * current_k_max + i];
|
305
|
+
}
|
306
|
+
}
|
307
|
+
|
308
|
+
//> load row p
|
309
|
+
for (HighsInt i = 0; i < current_k; i++) {
|
310
|
+
L[(current_k - 1) * current_k_max + i] = row_p[i];
|
311
|
+
}
|
312
|
+
|
313
|
+
//> now move col p to the right in each row
|
314
|
+
for (HighsInt row = 0; row < current_k; row++) {
|
315
|
+
double p_entry = L[row * current_k_max + p];
|
316
|
+
for (HighsInt col = p; col < current_k - 1; col++) {
|
317
|
+
L[row * current_k_max + col] = L[row * current_k_max + col + 1];
|
318
|
+
}
|
319
|
+
L[row * current_k_max + current_k - 1] = p_entry;
|
320
|
+
}
|
321
|
+
|
322
|
+
if (current_k == 1) {
|
323
|
+
current_k--;
|
324
|
+
return;
|
325
|
+
}
|
326
|
+
|
327
|
+
if (!p_in_v) {
|
328
|
+
// situation now:
|
329
|
+
// |1 x| |x | |1 | |xxxxx|
|
330
|
+
// | 1 x| |xx | === | 1 | | xxxx|
|
331
|
+
// | 1 x| |xxx x| | 1 | | xx |
|
332
|
+
// | 1x| |xxxxx| | 1| | x |
|
333
|
+
// |xx x| |xxxx| | xxx|
|
334
|
+
// next: remove nonzero entries in last column except for diagonal element
|
335
|
+
for (HighsInt r = (HighsInt)p - 1; r >= 0; r--) { // to current_k-1
|
336
|
+
eliminate(L, current_k - 1, r, current_k_max, current_k);
|
337
|
+
}
|
338
|
+
|
339
|
+
// situation now:
|
340
|
+
// |1 x| |x x| |xxxx | |1 |
|
341
|
+
// | 1 x| |xx x| === | xxx | | 1 |
|
342
|
+
// | 1 x| |xxx x| | xx | | 1 |
|
343
|
+
// | 1x| |xxxxx| | x | | 1|
|
344
|
+
// | x| |xxxxx| |xxxx|
|
345
|
+
// next: multiply product
|
346
|
+
// new last row: old last row (first current_k-1 elements) + r *
|
347
|
+
// R_current_k_current_k
|
348
|
+
|
349
|
+
for (HighsInt i = 0; i < buffer_d.num_nz; i++) {
|
350
|
+
HighsInt idx = buffer_d.index[i];
|
351
|
+
if (idx == maxabsd) {
|
352
|
+
continue;
|
353
|
+
}
|
354
|
+
if (idx < maxabsd) {
|
355
|
+
L[(current_k - 1) * current_k_max + idx] +=
|
356
|
+
-buffer_d.value[idx] / buffer_d.value[maxabsd] *
|
357
|
+
L[(current_k - 1) * current_k_max + current_k - 1];
|
358
|
+
} else {
|
359
|
+
L[(current_k - 1) * current_k_max + idx - 1] +=
|
360
|
+
-buffer_d.value[idx] / buffer_d.value[maxabsd] *
|
361
|
+
L[(current_k - 1) * current_k_max + current_k - 1];
|
362
|
+
}
|
363
|
+
}
|
364
|
+
// situation now: as above, but no more product
|
365
|
+
}
|
366
|
+
// next: eliminate last row
|
367
|
+
for (HighsInt i = 0; i < current_k - 1; i++) {
|
368
|
+
eliminate(L, i, current_k - 1, current_k_max, current_k);
|
369
|
+
}
|
370
|
+
current_k--;
|
371
|
+
}
|
372
|
+
|
373
|
+
void report(std::string name = "") {
|
374
|
+
printf("%s\n", name.c_str());
|
375
|
+
for (HighsInt i = 0; i < current_k; i++) {
|
376
|
+
for (HighsInt j = 0; j < current_k; j++) {
|
377
|
+
printf("%lf ", L[i * current_k_max + j]);
|
378
|
+
}
|
379
|
+
printf("\n");
|
380
|
+
}
|
381
|
+
}
|
382
|
+
|
383
|
+
double density() {
|
384
|
+
if (current_k == 0) {
|
385
|
+
return 0.0;
|
386
|
+
}
|
387
|
+
|
388
|
+
HighsInt num_nz = 0;
|
389
|
+
for (HighsInt i = 0; i < current_k; i++) {
|
390
|
+
for (HighsInt j = 0; j < current_k; j++) {
|
391
|
+
if (fabs(L[i * current_k_max + j]) > 1e-7) {
|
392
|
+
num_nz++;
|
393
|
+
}
|
394
|
+
}
|
395
|
+
}
|
396
|
+
return (double)num_nz / (current_k * (current_k + 1) / 2.0);
|
397
|
+
}
|
398
|
+
};
|
399
|
+
|
400
|
+
#endif
|
@@ -0,0 +1,105 @@
|
|
1
|
+
#ifndef __SRC_LIB_FEASIBILITYBOUNDED_HPP__
|
2
|
+
#define __SRC_LIB_FEASIBILITYBOUNDED_HPP__
|
3
|
+
|
4
|
+
#include "Highs.h"
|
5
|
+
#include "qpsolver/a_asm.hpp"
|
6
|
+
#include "qpsolver/crashsolution.hpp"
|
7
|
+
|
8
|
+
static void computeStartingPointBounded(Instance& instance,
|
9
|
+
Settings& settings,
|
10
|
+
Statistics& stats,
|
11
|
+
QpModelStatus& modelstatus,
|
12
|
+
QpHotstartInformation& result,
|
13
|
+
HighsTimer& timer) {
|
14
|
+
// compute initial feasible point for problems with bounds only (no general linear constraints)
|
15
|
+
|
16
|
+
// compute Qx + c = 0 --> x = Q^-1c
|
17
|
+
std::vector<double> L;
|
18
|
+
L.resize(instance.num_var * instance.num_var);
|
19
|
+
|
20
|
+
// compute cholesky factorization of Q
|
21
|
+
for (size_t col = 0; col < (size_t)instance.num_var; col++) {
|
22
|
+
for (size_t idx = instance.Q.mat.start[col]; idx < (size_t)instance.Q.mat.start[col+1]; idx++) {
|
23
|
+
double sum = 0;
|
24
|
+
size_t row = instance.Q.mat.index[idx];
|
25
|
+
if (row == col) {
|
26
|
+
for (size_t k = 0; k < row; k++)
|
27
|
+
sum += L[k * instance.num_var + row] * L[k * instance.num_var + row];
|
28
|
+
L[row * instance.num_var + row] = sqrt(instance.Q.mat.value[idx] - sum);
|
29
|
+
} else {
|
30
|
+
for (size_t k = 0; k < row; k++)
|
31
|
+
sum += (L[k * instance.num_var + col] * L[k * instance.num_var + row]);
|
32
|
+
L[row * instance.num_var + col] =
|
33
|
+
(instance.Q.mat.value[idx] - sum) / L[row * instance.num_var + row];
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
// solve for c
|
39
|
+
QpVector res = -instance.c;
|
40
|
+
for (HighsInt r = 0; r <res.dim; r++) {
|
41
|
+
for (HighsInt j = 0; j < r; j++) {
|
42
|
+
res.value[r] -= res.value[j] * L[j * instance.num_var + r];
|
43
|
+
}
|
44
|
+
res.value[r] /= L[r * instance.num_var + r];
|
45
|
+
}
|
46
|
+
|
47
|
+
for (HighsInt i = res.dim - 1; i >= 0; i--) {
|
48
|
+
double sum = 0.0;
|
49
|
+
for (HighsInt j = res.dim - 1; j > i; j--) {
|
50
|
+
sum += res.value[j] * L[i * instance.num_var + j];
|
51
|
+
}
|
52
|
+
res.value[i] = (res.value[i] - sum) / L[i * instance.num_var + i];
|
53
|
+
}
|
54
|
+
|
55
|
+
// project solution to bounds and collect active bounds
|
56
|
+
QpVector x0(instance.num_var);
|
57
|
+
QpVector ra(instance.num_con);
|
58
|
+
std::vector<HighsInt> initialactive;
|
59
|
+
std::vector<HighsInt> initialinactive;
|
60
|
+
std::vector<BasisStatus> atlower;
|
61
|
+
|
62
|
+
for (int i=0; i<instance.num_var; i++) {
|
63
|
+
if (res.value[i] > 0.5/settings.hessianregularizationfactor
|
64
|
+
&& instance.var_up[i] == std::numeric_limits<double>::infinity()
|
65
|
+
&& instance.c.value[i] < 0.0) {
|
66
|
+
modelstatus = QpModelStatus::kUnbounded;
|
67
|
+
return;
|
68
|
+
} else if (res.value[i] < 0.5/settings.hessianregularizationfactor
|
69
|
+
&& instance.var_lo[i] == std::numeric_limits<double>::infinity()
|
70
|
+
&& instance.c.value[i] > 0.0) {
|
71
|
+
modelstatus = QpModelStatus::kUnbounded;
|
72
|
+
return;
|
73
|
+
} else if (res.value[i] <= instance.var_lo[i]) {
|
74
|
+
res.value[i] = instance.var_lo[i];
|
75
|
+
initialactive.push_back(i + instance.num_con);
|
76
|
+
atlower.push_back(BasisStatus::kActiveAtLower);
|
77
|
+
} else if (res.value[i] >= instance.var_up[i]) {
|
78
|
+
res.value[i] = instance.var_up[i];
|
79
|
+
initialactive.push_back(i + instance.num_con);
|
80
|
+
atlower.push_back(BasisStatus::kActiveAtUpper);
|
81
|
+
} else {
|
82
|
+
initialinactive.push_back(i + instance.num_con);
|
83
|
+
}
|
84
|
+
if (fabs(res.value[i]) > 1e-4) {
|
85
|
+
x0.value[i] = res.value[i];
|
86
|
+
x0.index[x0.num_nz++] = i;
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
// if no bounds are active, solution lies in the interior -> optimal
|
91
|
+
if (initialactive.size() == 0) {
|
92
|
+
modelstatus = QpModelStatus::kOptimal;
|
93
|
+
}
|
94
|
+
|
95
|
+
assert((HighsInt)(initialactive.size() + initialinactive.size()) ==
|
96
|
+
instance.num_var);
|
97
|
+
|
98
|
+
result.status = atlower;
|
99
|
+
result.active = initialactive;
|
100
|
+
result.inactive = initialinactive;
|
101
|
+
result.primal = x0;
|
102
|
+
result.rowact = ra;
|
103
|
+
}
|
104
|
+
|
105
|
+
#endif
|