casadi 3.6.5__cp39-none-macosx_11_0_arm64.whl → 3.6.7__cp39-none-macosx_11_0_arm64.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-cli +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/casadi-targets.cmake +10 -6
- casadi/cmake/highs/highs-config.cmake +6 -13
- casadi/cmake/highs/highs-targets-release.cmake +13 -13
- casadi/cmake/highs/highs-targets.cmake +25 -22
- casadi/cmake/osqp/osqp-targets.cmake +10 -6
- casadi/cmake/proxsuite/proxsuiteConfigVersion.cmake +0 -5
- casadi/cmake/proxsuite/proxsuiteTargets.cmake +12 -12
- casadi/cmake/qdldl/qdldl-targets.cmake +10 -6
- casadi/cmake/sleqp/sleqp-config-version.cmake +0 -5
- casadi/cmake/sleqp/sleqp-targets.cmake +10 -6
- casadi/cmake/trlib/trlib-config-release.cmake +1 -1
- casadi/cmake/trlib/trlib-config-version.cmake +0 -5
- casadi/cmake/trlib/trlib-config.cmake +12 -12
- casadi/highs +0 -0
- casadi/include/casadi/casadi.i +3 -0
- casadi/include/casadi/casadi_c.h +2 -0
- casadi/include/casadi/config.h +9 -9
- casadi/include/casadi/core/casadi_common.hpp +1 -0
- casadi/include/casadi/core/casadi_export.h +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 +8 -7
- 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 +43 -0
- casadi/include/licenses/daqp-external/LICENSE +21 -0
- casadi/include/licenses/{alpaqa-external/LICENSE → fatrop-external/LICENSE.txt} +2 -2
- casadi/include/licenses/fatrop-external/external/blasfeo/LICENSE.txt +26 -0
- casadi/include/licenses/fatrop-external/external/pybind11/LICENSE +29 -0
- casadi/include/licenses/fatrop-external/misc/license_header.txt +17 -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 +4 -4
- casadi/include/sleqp/export.h +1 -0
- casadi/lib/cmake/tinyxml2/tinyxml2-config-version.cmake +0 -5
- casadi/lib/cmake/tinyxml2/tinyxml2-static-targets.cmake +10 -6
- casadi/lib/libtinyxml2.a +0 -0
- casadi/lib/pkgconfig/tinyxml2.pc +1 -1
- casadi/libCbc.3.10.11.dylib +0 -0
- casadi/libCbc.3.dylib +0 -0
- casadi/libCbc.dylib +0 -0
- casadi/libCbc.la +2 -2
- casadi/libCbcSolver.3.10.11.dylib +0 -0
- casadi/libCbcSolver.3.dylib +0 -0
- casadi/libCbcSolver.dylib +0 -0
- casadi/libCbcSolver.la +2 -2
- casadi/libCgl.1.10.8.dylib +0 -0
- casadi/libCgl.1.dylib +0 -0
- casadi/libCgl.dylib +0 -0
- casadi/libCgl.la +2 -2
- casadi/libClp.1.14.9.dylib +0 -0
- casadi/libClp.1.dylib +0 -0
- casadi/libClp.dylib +0 -0
- casadi/libClp.la +2 -2
- casadi/libClpSolver.1.14.9.dylib +0 -0
- casadi/libClpSolver.1.dylib +0 -0
- casadi/libClpSolver.dylib +0 -0
- casadi/libClpSolver.la +2 -2
- casadi/libCoinUtils.3.11.10.dylib +0 -0
- casadi/libCoinUtils.3.dylib +0 -0
- casadi/libCoinUtils.dylib +0 -0
- casadi/libCoinUtils.la +1 -1
- casadi/libOsi.1.13.9.dylib +0 -0
- casadi/libOsi.1.dylib +0 -0
- casadi/libOsi.dylib +0 -0
- casadi/libOsi.la +2 -2
- casadi/libOsiCbc.3.10.11.dylib +0 -0
- casadi/libOsiCbc.3.dylib +0 -0
- casadi/libOsiCbc.dylib +0 -0
- casadi/libOsiCbc.la +2 -2
- casadi/libOsiClp.1.14.9.dylib +0 -0
- casadi/libOsiClp.1.dylib +0 -0
- casadi/libOsiClp.dylib +0 -0
- casadi/libOsiClp.la +2 -2
- casadi/libOsiCommonTests.1.13.9.dylib +0 -0
- casadi/libOsiCommonTests.1.dylib +0 -0
- casadi/libOsiCommonTests.dylib +0 -0
- casadi/libOsiCommonTests.la +2 -2
- casadi/libblasfeo.dylib +0 -0
- casadi/libbonmin.4.8.9.dylib +0 -0
- casadi/libbonmin.4.dylib +0 -0
- casadi/libbonmin.dylib +0 -0
- casadi/libbonmin.la +2 -2
- casadi/libc++.1.0.dylib +0 -0
- casadi/libcasadi.3.7.dylib +0 -0
- casadi/libcasadi.dylib +0 -0
- casadi/libcasadi_conic_cbc.3.7.dylib +0 -0
- casadi/libcasadi_conic_cbc.dylib +0 -0
- casadi/libcasadi_conic_clp.3.7.dylib +0 -0
- casadi/libcasadi_conic_clp.dylib +0 -0
- casadi/libcasadi_conic_cplex.3.7.dylib +0 -0
- casadi/libcasadi_conic_cplex.dylib +0 -0
- casadi/libcasadi_conic_daqp.3.7.dylib +0 -0
- casadi/libcasadi_conic_daqp.dylib +0 -0
- casadi/libcasadi_conic_fatrop.3.7.dylib +0 -0
- casadi/libcasadi_conic_fatrop.dylib +0 -0
- casadi/libcasadi_conic_gurobi.3.7.dylib +0 -0
- casadi/libcasadi_conic_gurobi.dylib +0 -0
- casadi/libcasadi_conic_highs.3.7.dylib +0 -0
- casadi/libcasadi_conic_highs.dylib +0 -0
- casadi/libcasadi_conic_ipqp.3.7.dylib +0 -0
- casadi/libcasadi_conic_ipqp.dylib +0 -0
- casadi/libcasadi_conic_nlpsol.3.7.dylib +0 -0
- casadi/libcasadi_conic_nlpsol.dylib +0 -0
- casadi/libcasadi_conic_osqp.3.7.dylib +0 -0
- casadi/libcasadi_conic_osqp.dylib +0 -0
- casadi/libcasadi_conic_proxqp.3.7.dylib +0 -0
- casadi/libcasadi_conic_proxqp.dylib +0 -0
- casadi/libcasadi_conic_qpoases.3.7.dylib +0 -0
- casadi/libcasadi_conic_qpoases.dylib +0 -0
- casadi/libcasadi_conic_qrqp.3.7.dylib +0 -0
- casadi/libcasadi_conic_qrqp.dylib +0 -0
- casadi/libcasadi_conic_superscs.3.7.dylib +0 -0
- casadi/libcasadi_conic_superscs.dylib +0 -0
- casadi/libcasadi_importer_shell.3.7.dylib +0 -0
- casadi/libcasadi_importer_shell.dylib +0 -0
- casadi/libcasadi_integrator_collocation.3.7.dylib +0 -0
- casadi/libcasadi_integrator_collocation.dylib +0 -0
- casadi/libcasadi_integrator_cvodes.3.7.dylib +0 -0
- casadi/libcasadi_integrator_cvodes.dylib +0 -0
- casadi/libcasadi_integrator_idas.3.7.dylib +0 -0
- casadi/libcasadi_integrator_idas.dylib +0 -0
- casadi/libcasadi_integrator_rk.3.7.dylib +0 -0
- casadi/libcasadi_integrator_rk.dylib +0 -0
- casadi/libcasadi_interpolant_bspline.3.7.dylib +0 -0
- casadi/libcasadi_interpolant_bspline.dylib +0 -0
- casadi/libcasadi_interpolant_linear.3.7.dylib +0 -0
- casadi/libcasadi_interpolant_linear.dylib +0 -0
- casadi/libcasadi_linsol_csparse.3.7.dylib +0 -0
- casadi/libcasadi_linsol_csparse.dylib +0 -0
- casadi/libcasadi_linsol_csparsecholesky.3.7.dylib +0 -0
- casadi/libcasadi_linsol_csparsecholesky.dylib +0 -0
- casadi/libcasadi_linsol_lapacklu.3.7.dylib +0 -0
- casadi/libcasadi_linsol_lapacklu.dylib +0 -0
- casadi/libcasadi_linsol_lapackqr.3.7.dylib +0 -0
- casadi/libcasadi_linsol_lapackqr.dylib +0 -0
- casadi/libcasadi_linsol_ldl.3.7.dylib +0 -0
- casadi/libcasadi_linsol_ldl.dylib +0 -0
- casadi/libcasadi_linsol_lsqr.3.7.dylib +0 -0
- casadi/libcasadi_linsol_lsqr.dylib +0 -0
- casadi/libcasadi_linsol_ma27.3.7.dylib +0 -0
- casadi/libcasadi_linsol_ma27.dylib +0 -0
- casadi/libcasadi_linsol_mumps.3.7.dylib +0 -0
- casadi/libcasadi_linsol_mumps.dylib +0 -0
- casadi/libcasadi_linsol_qr.3.7.dylib +0 -0
- casadi/libcasadi_linsol_qr.dylib +0 -0
- casadi/libcasadi_linsol_symbolicqr.3.7.dylib +0 -0
- casadi/libcasadi_linsol_symbolicqr.dylib +0 -0
- casadi/libcasadi_linsol_tridiag.3.7.dylib +0 -0
- casadi/libcasadi_linsol_tridiag.dylib +0 -0
- casadi/libcasadi_nlpsol_ampl.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_ampl.dylib +0 -0
- casadi/libcasadi_nlpsol_blocksqp.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_blocksqp.dylib +0 -0
- casadi/libcasadi_nlpsol_bonmin.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_bonmin.dylib +0 -0
- casadi/libcasadi_nlpsol_fatrop.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_fatrop.dylib +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.dylib +0 -0
- casadi/libcasadi_nlpsol_ipopt.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_ipopt.dylib +0 -0
- casadi/libcasadi_nlpsol_knitro.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_knitro.dylib +0 -0
- casadi/libcasadi_nlpsol_madnlp.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_madnlp.dylib +0 -0
- casadi/libcasadi_nlpsol_qrsqp.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_qrsqp.dylib +0 -0
- casadi/libcasadi_nlpsol_scpgen.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_scpgen.dylib +0 -0
- casadi/libcasadi_nlpsol_sleqp.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_sleqp.dylib +0 -0
- casadi/libcasadi_nlpsol_snopt.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_snopt.dylib +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.dylib +0 -0
- casadi/libcasadi_rootfinder_fast_newton.3.7.dylib +0 -0
- casadi/libcasadi_rootfinder_fast_newton.dylib +0 -0
- casadi/libcasadi_rootfinder_kinsol.3.7.dylib +0 -0
- casadi/libcasadi_rootfinder_kinsol.dylib +0 -0
- casadi/libcasadi_rootfinder_newton.3.7.dylib +0 -0
- casadi/libcasadi_rootfinder_newton.dylib +0 -0
- casadi/libcasadi_rootfinder_nlpsol.3.7.dylib +0 -0
- casadi/libcasadi_rootfinder_nlpsol.dylib +0 -0
- casadi/libcasadi_sundials_common.3.7.dylib +0 -0
- casadi/libcasadi_sundials_common.dylib +0 -0
- casadi/libcasadi_xmlfile_tinyxml.3.7.dylib +0 -0
- casadi/libcasadi_xmlfile_tinyxml.dylib +0 -0
- casadi/libcoinmetis.2.dylib +0 -0
- casadi/libcoinmetis.dylib +0 -0
- casadi/libcoinmetis.la +1 -1
- casadi/libcoinmumps.3.dylib +0 -0
- casadi/libcoinmumps.dylib +0 -0
- casadi/libcoinmumps.la +2 -2
- casadi/libcplex_adaptor.dylib +0 -0
- casadi/{libamd.3.0.3.dylib → libdaqp.dylib} +0 -0
- casadi/libdaqpstat.a +0 -0
- casadi/libfatrop.dylib +0 -0
- casadi/libgcc_s.1.1.dylib +0 -0
- casadi/libgfortran.5.dylib +0 -0
- casadi/libgurobi_adaptor.dylib +0 -0
- casadi/libhighs.1.7.dylib +0 -0
- casadi/libhighs.1.dylib +0 -0
- casadi/libhighs.dylib +0 -0
- casadi/libindirect.a +0 -0
- casadi/libipopt.3.dylib +0 -0
- casadi/libipopt.dylib +0 -0
- casadi/libipopt.la +2 -2
- casadi/liblinsys.a +0 -0
- casadi/{libsuitesparseconfig.7.0.1.dylib → libmatlab_ipc.dylib} +0 -0
- casadi/libosqp.a +0 -0
- casadi/libosqp.dylib +0 -0
- casadi/libqdldl.a +0 -0
- casadi/libqdldl.dylib +0 -0
- casadi/libquadmath.0.dylib +0 -0
- casadi/libsipopt.3.dylib +0 -0
- casadi/libsipopt.dylib +0 -0
- casadi/libsipopt.la +2 -2
- casadi/libsleqp.1.0.1.dylib +0 -0
- casadi/libsleqp.dylib +0 -0
- casadi/libsuperscs.a +0 -0
- casadi/libtrlib.0.4.dylib +0 -0
- casadi/libtrlib.dylib +0 -0
- casadi/libz.1.2.13.dylib +0 -0
- casadi/pkgconfig/bonmin.pc +1 -1
- casadi/pkgconfig/casadi.pc +5 -5
- casadi/pkgconfig/cbc.pc +1 -1
- casadi/pkgconfig/cgl.pc +1 -1
- casadi/pkgconfig/clp.pc +1 -1
- casadi/pkgconfig/coinmetis.pc +1 -1
- casadi/pkgconfig/coinmumps.pc +2 -2
- casadi/pkgconfig/coinutils.pc +2 -2
- casadi/pkgconfig/highs.pc +4 -4
- casadi/pkgconfig/ipopt.pc +2 -2
- casadi/pkgconfig/osi-cbc.pc +1 -1
- casadi/pkgconfig/osi-clp.pc +1 -1
- casadi/pkgconfig/osi-unittests.pc +1 -1
- casadi/pkgconfig/osi.pc +1 -1
- casadi/pkgconfig/sleqp.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 +532 -477
- casadi/cmake/alpaqa/alpaqaConfig.cmake +0 -24
- casadi/cmake/alpaqa/alpaqaConfigVersion.cmake +0 -70
- casadi/cmake/alpaqa/alpaqaTargets-release.cmake +0 -19
- casadi/cmake/alpaqa/alpaqaTargets.cmake +0 -116
- casadi/include/alpaqa/accelerators/anderson.hpp +0 -133
- casadi/include/alpaqa/accelerators/internal/anderson-helpers.hpp +0 -92
- casadi/include/alpaqa/accelerators/internal/limited-memory-qr.hpp +0 -295
- casadi/include/alpaqa/accelerators/lbfgs.hpp +0 -244
- casadi/include/alpaqa/accelerators/steihaugcg.hpp +0 -143
- casadi/include/alpaqa/alpaqa.hpp +0 -3
- casadi/include/alpaqa/casadi/CasADiControlProblem.hpp +0 -185
- casadi/include/alpaqa/casadi/CasADiFunctionWrapper.hpp +0 -104
- casadi/include/alpaqa/casadi/CasADiProblem.hpp +0 -102
- casadi/include/alpaqa/casadi-loader-export.hpp +0 -15
- casadi/include/alpaqa/casadi-ocp-loader-export.hpp +0 -15
- casadi/include/alpaqa/config/config.hpp +0 -165
- casadi/include/alpaqa/dl/dl-problem.h +0 -476
- casadi/include/alpaqa/dl/dl-problem.hpp +0 -301
- casadi/include/alpaqa/export.h +0 -42
- casadi/include/alpaqa/export.hpp +0 -30
- casadi/include/alpaqa/implementation/accelerators/lbfgs.tpp +0 -240
- casadi/include/alpaqa/implementation/casadi/CasADiControlProblem.tpp +0 -594
- casadi/include/alpaqa/implementation/casadi/CasADiLoader-util.hpp +0 -50
- casadi/include/alpaqa/implementation/casadi/CasADiProblem.tpp +0 -425
- casadi/include/alpaqa/implementation/inner/directions/panoc/structured-lbfgs.tpp +0 -164
- casadi/include/alpaqa/implementation/inner/panoc-helpers.tpp +0 -389
- casadi/include/alpaqa/implementation/inner/panoc-ocp.tpp +0 -798
- casadi/include/alpaqa/implementation/inner/panoc.tpp +0 -448
- casadi/include/alpaqa/implementation/inner/pantr.tpp +0 -474
- casadi/include/alpaqa/implementation/inner/zerofpr.tpp +0 -482
- casadi/include/alpaqa/implementation/outer/alm.tpp +0 -228
- casadi/include/alpaqa/implementation/outer/internal/alm-helpers.tpp +0 -80
- casadi/include/alpaqa/implementation/params/params.tpp +0 -158
- casadi/include/alpaqa/implementation/problem/ocproblem.tpp +0 -56
- casadi/include/alpaqa/implementation/problem/type-erased-problem.tpp +0 -211
- casadi/include/alpaqa/implementation/util/io/csv.tpp +0 -120
- casadi/include/alpaqa/implementation/util/print.tpp +0 -151
- casadi/include/alpaqa/inner/directions/panoc/anderson.hpp +0 -98
- casadi/include/alpaqa/inner/directions/panoc/lbfgs.hpp +0 -94
- casadi/include/alpaqa/inner/directions/panoc/structured-lbfgs.hpp +0 -146
- casadi/include/alpaqa/inner/directions/panoc/structured-newton.hpp +0 -264
- casadi/include/alpaqa/inner/directions/panoc-direction-update.hpp +0 -96
- casadi/include/alpaqa/inner/directions/panoc-ocp/lqr.hpp +0 -181
- casadi/include/alpaqa/inner/directions/panoc-ocp/ocp-vars.hpp +0 -492
- casadi/include/alpaqa/inner/directions/pantr/newton-tr.hpp +0 -192
- casadi/include/alpaqa/inner/directions/pantr/pantr-direction.hpp +0 -99
- casadi/include/alpaqa/inner/inner-solve-options.hpp +0 -30
- casadi/include/alpaqa/inner/internal/lipschitz.hpp +0 -27
- casadi/include/alpaqa/inner/internal/panoc-helpers.hpp +0 -10
- casadi/include/alpaqa/inner/internal/panoc-stop-crit.hpp +0 -124
- casadi/include/alpaqa/inner/internal/solverstatus.hpp +0 -42
- casadi/include/alpaqa/inner/panoc-ocp.hpp +0 -302
- casadi/include/alpaqa/inner/panoc.hpp +0 -274
- casadi/include/alpaqa/inner/pantr.hpp +0 -284
- casadi/include/alpaqa/inner/zerofpr.hpp +0 -274
- casadi/include/alpaqa/ipopt/ipopt-adapter.hpp +0 -81
- casadi/include/alpaqa/ipopt/ipopt-enums.hpp +0 -35
- casadi/include/alpaqa/lbfgsb/lbfgsb-adapter.hpp +0 -111
- casadi/include/alpaqa/newton-tr-pantr-alm.hpp +0 -27
- casadi/include/alpaqa/outer/alm.hpp +0 -190
- casadi/include/alpaqa/outer/internal/alm-helpers.hpp +0 -10
- casadi/include/alpaqa/panoc-alm.hpp +0 -27
- casadi/include/alpaqa/panoc-anderson-alm.hpp +0 -27
- casadi/include/alpaqa/params/params.hpp +0 -60
- casadi/include/alpaqa/problem/box-constr-problem.hpp +0 -220
- casadi/include/alpaqa/problem/box.hpp +0 -82
- casadi/include/alpaqa/problem/functional-problem.hpp +0 -73
- casadi/include/alpaqa/problem/kkt-error.hpp +0 -43
- casadi/include/alpaqa/problem/ocproblem-counters.hpp +0 -116
- casadi/include/alpaqa/problem/ocproblem.hpp +0 -662
- casadi/include/alpaqa/problem/problem-counters.hpp +0 -116
- casadi/include/alpaqa/problem/problem-with-counters.hpp +0 -141
- casadi/include/alpaqa/problem/type-erased-problem.hpp +0 -874
- casadi/include/alpaqa/problem/unconstr-problem.hpp +0 -37
- casadi/include/alpaqa/structured-panoc-alm.hpp +0 -27
- casadi/include/alpaqa/structured-zerofpr-alm.hpp +0 -27
- casadi/include/alpaqa/util/alloc-check.hpp +0 -23
- casadi/include/alpaqa/util/atomic-stop-signal.hpp +0 -24
- casadi/include/alpaqa/util/check-dim.hpp +0 -64
- casadi/include/alpaqa/util/copyable_unique_ptr.hpp +0 -32
- casadi/include/alpaqa/util/demangled-typename.hpp +0 -9
- casadi/include/alpaqa/util/enumerate.hpp +0 -70
- casadi/include/alpaqa/util/float.hpp +0 -25
- casadi/include/alpaqa/util/index-set.hpp +0 -97
- casadi/include/alpaqa/util/io/csv.hpp +0 -43
- casadi/include/alpaqa/util/iter-adapter.hpp +0 -68
- casadi/include/alpaqa/util/max-history.hpp +0 -47
- casadi/include/alpaqa/util/noop-delete.hpp +0 -15
- casadi/include/alpaqa/util/not-implemented.hpp +0 -12
- casadi/include/alpaqa/util/print.hpp +0 -78
- casadi/include/alpaqa/util/quadmath/quadmath-print.hpp +0 -20
- casadi/include/alpaqa/util/quadmath/quadmath.hpp +0 -137
- casadi/include/alpaqa/util/required-method.hpp +0 -29
- casadi/include/alpaqa/util/ringbuffer.hpp +0 -212
- casadi/include/alpaqa/util/set-intersection.hpp +0 -129
- casadi/include/alpaqa/util/sparse-ops.hpp +0 -164
- casadi/include/alpaqa/util/timed.hpp +0 -22
- casadi/include/alpaqa/util/type-erasure.hpp +0 -568
- casadi/include/alpaqa/util/type-traits.hpp +0 -58
- casadi/include/alpaqa/zerofpr-alm.hpp +0 -27
- casadi/include/alpaqa/zerofpr-anderson-alm.hpp +0 -27
- casadi/include/alpaqa-version.h +0 -8
- casadi/include/highs/fortran/highs_fortran_api.mod +0 -0
- casadi/include/licenses/alpaqa-external/src/thirdparty/lbfgsb/Lbfgsb.3.0/License.txt +0 -71
- casadi/libFortranHighs.dylib +0 -0
- casadi/libalpaqa.1.0.0.dylib +0 -0
- casadi/libalpaqa.dylib +0 -0
- casadi/libcamd.3.0.3.dylib +0 -0
- casadi/libcasadi_nlpsol_alpaqa.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_alpaqa.dylib +0 -0
- casadi/libccolamd.3.0.3.dylib +0 -0
- casadi/libcholmod.4.0.3.dylib +0 -0
- casadi/libcholmod_cuda.4.0.3.dylib +0 -0
- casadi/libcolamd.3.0.3.dylib +0 -0
- casadi/libhighs.1.6.0.dylib +0 -0
- casadi/libhighs.1.6.dylib +0 -0
- casadi/libumfpack.6.1.0.dylib +0 -0
- {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/WHEEL +0 -0
@@ -1,190 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/config/config.hpp>
|
4
|
-
#include <alpaqa/export.hpp>
|
5
|
-
#include <alpaqa/inner/internal/solverstatus.hpp>
|
6
|
-
#include <alpaqa/outer/internal/alm-helpers.hpp>
|
7
|
-
#include <alpaqa/problem/type-erased-problem.hpp>
|
8
|
-
|
9
|
-
#include <chrono>
|
10
|
-
#include <iostream>
|
11
|
-
#include <string>
|
12
|
-
|
13
|
-
namespace alpaqa {
|
14
|
-
|
15
|
-
template <class InnerSolverStats>
|
16
|
-
struct InnerStatsAccumulator;
|
17
|
-
|
18
|
-
/// Parameters for the Augmented Lagrangian solver.
|
19
|
-
template <Config Conf = DefaultConfig>
|
20
|
-
struct ALPAQA_EXPORT ALMParams {
|
21
|
-
USING_ALPAQA_CONFIG(Conf);
|
22
|
-
|
23
|
-
/// Primal tolerance (used for stopping criterion of inner solver).
|
24
|
-
real_t tolerance = real_t(1e-5);
|
25
|
-
/// Dual tolerance (constraint violation and complementarity).
|
26
|
-
real_t dual_tolerance = real_t(1e-5);
|
27
|
-
/// Factor used in updating the penalty parameters.
|
28
|
-
real_t penalty_update_factor = 10;
|
29
|
-
/// Factor to reduce @ref penalty_update_factor when inner convergence fails.
|
30
|
-
real_t penalty_update_factor_lower = real_t(0.8);
|
31
|
-
/// Minimum value for @ref penalty_update_factor after reduction because of inner convergence
|
32
|
-
/// failure.
|
33
|
-
real_t min_penalty_update_factor = real_t(1.1);
|
34
|
-
/// Initial penalty parameter. When set to zero (which is the default),
|
35
|
-
/// it is computed automatically, based on the constraint violation in the
|
36
|
-
/// starting point and the parameter @ref initial_penalty_factor.
|
37
|
-
/// @todo Change default to 0.
|
38
|
-
real_t initial_penalty = 1;
|
39
|
-
/// Initial penalty parameter factor. Active if @ref initial_penalty is set
|
40
|
-
/// to zero.
|
41
|
-
real_t initial_penalty_factor = 20;
|
42
|
-
/// Factor to reduce the initial penalty factor by if convergence fails in
|
43
|
-
/// in the first iteration.
|
44
|
-
real_t initial_penalty_lower = real_t(0.6);
|
45
|
-
/// Initial primal tolerance.
|
46
|
-
real_t initial_tolerance = 1;
|
47
|
-
/// Factor to increase the initial primal tolerance if convergence fails in
|
48
|
-
/// the first iteration.
|
49
|
-
real_t initial_tolerance_increase = real_t(1.1);
|
50
|
-
/// Update factor for primal tolerance.
|
51
|
-
real_t tolerance_update_factor = real_t(1e-1);
|
52
|
-
/// Factor to increase the primal tolerance update factor by if convergence
|
53
|
-
/// fails.
|
54
|
-
real_t ρ_increase = real_t(2);
|
55
|
-
/// Maximum value of @ref tolerance_update_factor after increase because of inner convergence
|
56
|
-
/// failure.
|
57
|
-
real_t ρ_max = real_t(0.5);
|
58
|
-
/// Error tolerance for penalty increase
|
59
|
-
real_t rel_penalty_increase_threshold = real_t(0.1);
|
60
|
-
/// Lagrange multiplier bound.
|
61
|
-
real_t max_multiplier = real_t(1e9);
|
62
|
-
/// Maximum penalty factor.
|
63
|
-
real_t max_penalty = real_t(1e9);
|
64
|
-
/// Minimum penalty factor (used during initialization).
|
65
|
-
real_t min_penalty = real_t(1e-9);
|
66
|
-
/// Maximum number of outer ALM iterations.
|
67
|
-
unsigned int max_iter = 100;
|
68
|
-
/// Maximum duration.
|
69
|
-
std::chrono::nanoseconds max_time = std::chrono::minutes(5);
|
70
|
-
|
71
|
-
/// How many times can the initial penalty @ref initial_penalty or
|
72
|
-
/// @ref initial_penalty_factor and the initial primal tolerance @ref initial_tolerance
|
73
|
-
/// be reduced.
|
74
|
-
unsigned max_num_initial_retries = 0;
|
75
|
-
/// How many times can the penalty update factor @ref penalty_update_factor and the
|
76
|
-
/// primal tolerance factor @ref tolerance_update_factor be reduced.
|
77
|
-
unsigned max_num_retries = 0;
|
78
|
-
/// Combined limit for @ref max_num_initial_retries and
|
79
|
-
/// @ref max_num_retries.
|
80
|
-
unsigned max_total_num_retries = 0;
|
81
|
-
|
82
|
-
/// When to print progress. If set to zero, nothing will be printed.
|
83
|
-
/// If set to N != 0, progress is printed every N iterations.
|
84
|
-
unsigned print_interval = 0;
|
85
|
-
/// The precision of the floating point values printed by the solver.
|
86
|
-
int print_precision = std::numeric_limits<real_t>::max_digits10 / 2;
|
87
|
-
|
88
|
-
/// Use one penalty factor for all m constraints.
|
89
|
-
bool single_penalty_factor = false;
|
90
|
-
};
|
91
|
-
|
92
|
-
/// Augmented Lagrangian Method solver
|
93
|
-
///
|
94
|
-
/// @ingroup grp_ALMSolver
|
95
|
-
template <class InnerSolverT>
|
96
|
-
class ALPAQA_EXPORT ALMSolver {
|
97
|
-
public:
|
98
|
-
USING_ALPAQA_CONFIG_TEMPLATE(InnerSolverT::config_t);
|
99
|
-
|
100
|
-
using Params = ALMParams<config_t>;
|
101
|
-
using InnerSolver = InnerSolverT;
|
102
|
-
using Problem = typename InnerSolver::Problem;
|
103
|
-
|
104
|
-
struct Stats {
|
105
|
-
/// Total number of outer ALM iterations (i.e. the number of times that
|
106
|
-
/// the inner solver was invoked).
|
107
|
-
unsigned outer_iterations = 0;
|
108
|
-
/// Total elapsed time.
|
109
|
-
std::chrono::nanoseconds elapsed_time{};
|
110
|
-
/// The number of times that the initial penalty factor was reduced by
|
111
|
-
/// @ref ALMParams::initial_penalty_lower and that the initial tolerance was
|
112
|
-
/// increased by @ref ALMParams::initial_tolerance_increase because the inner solver
|
113
|
-
/// failed to converge in the first ALM iteration. If this number is
|
114
|
-
/// greater than zero, consider lowering the initial penalty factor
|
115
|
-
/// @ref ALMParams::initial_penalty or @ref ALMParams::initial_penalty_factor or increasing the initial
|
116
|
-
/// tolerance @ref ALMParams::initial_tolerance (or both).
|
117
|
-
unsigned initial_penalty_reduced = 0;
|
118
|
-
/// The number of times that the penalty update factor @ref ALMParams::penalty_update_factor
|
119
|
-
/// was reduced, that the tolerance update factor @ref ALMParams::tolerance_update_factor was
|
120
|
-
/// increased, and that an ALM iteration had to be restarted with a
|
121
|
-
/// lower penalty factor and a higher tolerance because the inner solver
|
122
|
-
/// failed to converge (not applicable in the first ALM iteration).
|
123
|
-
/// If this number is greater than zero, consider lowerering the
|
124
|
-
/// penalty update factor @ref ALMParams::penalty_update_factor or increasing the tolerance
|
125
|
-
/// update factor (or both). Lowering the initial penalty factor could
|
126
|
-
/// help as well.
|
127
|
-
unsigned penalty_reduced = 0;
|
128
|
-
/// The total number of times that the inner solver failed to converge.
|
129
|
-
unsigned inner_convergence_failures = 0;
|
130
|
-
/// Final primal tolerance that was reached, depends on the stopping
|
131
|
-
/// criterion used by the inner solver, see for example
|
132
|
-
/// @ref PANOCStopCrit.
|
133
|
-
real_t ε = inf<config_t>;
|
134
|
-
/// Final dual tolerance or constraint violation that was reached:
|
135
|
-
/// @f[
|
136
|
-
/// \delta = \| \Pi_D\left(g(x^k) + \Sigma^{-1}y\right) \|_\infty
|
137
|
-
/// @f]
|
138
|
-
real_t δ = inf<config_t>;
|
139
|
-
/// 2-norm of the final penalty factors @f$ \| \Sigma \|_2 @f$.
|
140
|
-
real_t norm_penalty = 0;
|
141
|
-
|
142
|
-
/// Whether the solver converged or not.
|
143
|
-
/// @see @ref SolverStatus
|
144
|
-
SolverStatus status = SolverStatus::Busy;
|
145
|
-
|
146
|
-
/// The statistics of the inner solver invocations, accumulated over all
|
147
|
-
/// ALM iterations.
|
148
|
-
InnerStatsAccumulator<typename InnerSolver::Stats> inner;
|
149
|
-
};
|
150
|
-
|
151
|
-
ALMSolver(Params params, InnerSolver &&inner_solver)
|
152
|
-
: params(params),
|
153
|
-
inner_solver(std::forward<InnerSolver>(inner_solver)) {}
|
154
|
-
ALMSolver(Params params, const InnerSolver &inner_solver)
|
155
|
-
: params(params), inner_solver(inner_solver) {}
|
156
|
-
|
157
|
-
Stats operator()(const Problem &problem, rvec x, rvec y);
|
158
|
-
template <class P>
|
159
|
-
Stats operator()(const P &problem, rvec x, rvec y) {
|
160
|
-
return operator()(Problem::template make<P>(problem), x, y);
|
161
|
-
}
|
162
|
-
|
163
|
-
std::string get_name() const {
|
164
|
-
return "ALMSolver<" + inner_solver.get_name() + ">";
|
165
|
-
}
|
166
|
-
|
167
|
-
/// Abort the computation and return the result so far.
|
168
|
-
/// Can be called from other threads or signal handlers.
|
169
|
-
void stop() { inner_solver.stop(); }
|
170
|
-
|
171
|
-
const Params &get_params() const { return params; }
|
172
|
-
|
173
|
-
private:
|
174
|
-
Params params;
|
175
|
-
using Helpers = detail::ALMHelpers<config_t>;
|
176
|
-
|
177
|
-
public:
|
178
|
-
InnerSolver inner_solver;
|
179
|
-
std::ostream *os = &std::cout;
|
180
|
-
};
|
181
|
-
|
182
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, ALMParams, DefaultConfig);
|
183
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, ALMParams, EigenConfigf);
|
184
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, ALMParams, EigenConfigd);
|
185
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, ALMParams, EigenConfigl);
|
186
|
-
#ifdef ALPAQA_WITH_QUAD_PRECISION
|
187
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, ALMParams, EigenConfigq);
|
188
|
-
#endif
|
189
|
-
|
190
|
-
} // namespace alpaqa
|
@@ -1,27 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/inner/directions/panoc/lbfgs.hpp>
|
4
|
-
#include <alpaqa/inner/panoc.hpp>
|
5
|
-
#include <alpaqa/outer/alm.hpp>
|
6
|
-
|
7
|
-
namespace alpaqa {
|
8
|
-
|
9
|
-
// clang-format off
|
10
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, PANOCSolver, LBFGSDirection<DefaultConfig>);
|
11
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, PANOCSolver, LBFGSDirection<EigenConfigf>);
|
12
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, PANOCSolver, LBFGSDirection<EigenConfigd>);
|
13
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, PANOCSolver, LBFGSDirection<EigenConfigl>);
|
14
|
-
#ifdef ALPAQA_WITH_QUAD_PRECISION
|
15
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, PANOCSolver, LBFGSDirection<EigenConfigq>);
|
16
|
-
#endif
|
17
|
-
|
18
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, PANOCSolver<LBFGSDirection<DefaultConfig>>);
|
19
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, PANOCSolver<LBFGSDirection<EigenConfigf>>);
|
20
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, PANOCSolver<LBFGSDirection<EigenConfigd>>);
|
21
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, PANOCSolver<LBFGSDirection<EigenConfigl>>);
|
22
|
-
#ifdef ALPAQA_WITH_QUAD_PRECISION
|
23
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, PANOCSolver<LBFGSDirection<EigenConfigq>>);
|
24
|
-
#endif
|
25
|
-
// clang-format on
|
26
|
-
|
27
|
-
} // namespace alpaqa
|
@@ -1,27 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/inner/directions/panoc/anderson.hpp>
|
4
|
-
#include <alpaqa/inner/panoc.hpp>
|
5
|
-
#include <alpaqa/outer/alm.hpp>
|
6
|
-
|
7
|
-
namespace alpaqa {
|
8
|
-
|
9
|
-
// clang-format off
|
10
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, PANOCSolver, AndersonDirection<DefaultConfig>);
|
11
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, PANOCSolver, AndersonDirection<EigenConfigf>);
|
12
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, PANOCSolver, AndersonDirection<EigenConfigd>);
|
13
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, PANOCSolver, AndersonDirection<EigenConfigl>);
|
14
|
-
#ifdef ALPAQA_WITH_QUAD_PRECISION
|
15
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, PANOCSolver, AndersonDirection<EigenConfigq>);
|
16
|
-
#endif
|
17
|
-
|
18
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, PANOCSolver<AndersonDirection<DefaultConfig>>);
|
19
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, PANOCSolver<AndersonDirection<EigenConfigf>>);
|
20
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, PANOCSolver<AndersonDirection<EigenConfigd>>);
|
21
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, PANOCSolver<AndersonDirection<EigenConfigl>>);
|
22
|
-
#ifdef ALPAQA_WITH_QUAD_PRECISION
|
23
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, PANOCSolver<AndersonDirection<EigenConfigq>>);
|
24
|
-
#endif
|
25
|
-
// clang-format on
|
26
|
-
|
27
|
-
} // namespace alpaqa
|
@@ -1,60 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/config/config.hpp>
|
4
|
-
#include <alpaqa/export.hpp>
|
5
|
-
|
6
|
-
#include <optional>
|
7
|
-
#include <span>
|
8
|
-
#include <stdexcept>
|
9
|
-
#include <string_view>
|
10
|
-
#include <tuple>
|
11
|
-
|
12
|
-
namespace alpaqa::params {
|
13
|
-
|
14
|
-
/// Represents a parameter value encoded as a string in the format
|
15
|
-
/// `abc.def.key=value`.
|
16
|
-
struct ALPAQA_EXPORT ParamString {
|
17
|
-
/// Full key string, used for diagnostics.
|
18
|
-
std::string_view full_key;
|
19
|
-
/// The subkey to resolve next.
|
20
|
-
std::string_view key;
|
21
|
-
/// The value of the parameter to store.
|
22
|
-
std::string_view value;
|
23
|
-
};
|
24
|
-
|
25
|
-
/// Custom parameter parsing exception.
|
26
|
-
struct ALPAQA_EXPORT invalid_param : std::invalid_argument {
|
27
|
-
using std::invalid_argument::invalid_argument;
|
28
|
-
};
|
29
|
-
|
30
|
-
/// Split the string @p full on the first occurrence of @p tok.
|
31
|
-
/// Returns (s, "") if tok was not found.
|
32
|
-
inline auto split_key(std::string_view full, char tok = '.') {
|
33
|
-
auto tok_pos = full.find(tok);
|
34
|
-
if (tok_pos == full.npos)
|
35
|
-
return std::make_tuple(full, std::string_view{});
|
36
|
-
std::string_view key{full.begin(), full.begin() + tok_pos};
|
37
|
-
std::string_view rem{full.begin() + tok_pos + 1, full.end()};
|
38
|
-
return std::make_tuple(key, rem);
|
39
|
-
}
|
40
|
-
|
41
|
-
/// Update/overwrite the first argument based on the option in @p s.
|
42
|
-
template <class T>
|
43
|
-
void ALPAQA_EXPORT set_param(T &, ParamString); /* deliberately undefined */
|
44
|
-
|
45
|
-
/// Overwrites @p t based on the @p options that start with @p prefix.
|
46
|
-
/// If @p used is not `nullopt`, sets corresponding flag of the options that
|
47
|
-
/// were used.
|
48
|
-
template <class T>
|
49
|
-
void ALPAQA_EXPORT set_params(
|
50
|
-
T &t, std::string_view prefix, std::span<const std::string_view> options,
|
51
|
-
std::optional<std::span<bool>> used = std::nullopt);
|
52
|
-
|
53
|
-
template <Config Conf>
|
54
|
-
struct ALPAQA_EXPORT vec_from_file {
|
55
|
-
USING_ALPAQA_CONFIG(Conf);
|
56
|
-
length_t expected_size;
|
57
|
-
std::optional<vec> value = std::nullopt;
|
58
|
-
};
|
59
|
-
|
60
|
-
} // namespace alpaqa::params
|
@@ -1,220 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/problem/box.hpp>
|
4
|
-
#include <alpaqa/util/check-dim.hpp>
|
5
|
-
|
6
|
-
namespace alpaqa {
|
7
|
-
|
8
|
-
/// Implements common problem functions for minimization problems with box
|
9
|
-
/// constraints. Meant to be used as a base class for custom problem
|
10
|
-
/// implementations.
|
11
|
-
/// @ingroup grp_Problems
|
12
|
-
template <Config Conf>
|
13
|
-
class BoxConstrProblem {
|
14
|
-
public:
|
15
|
-
USING_ALPAQA_CONFIG(Conf);
|
16
|
-
using Box = alpaqa::Box<config_t>;
|
17
|
-
|
18
|
-
/// Number of decision variables, dimension of x
|
19
|
-
length_t n;
|
20
|
-
/// Number of constraints, dimension of g(x) and z
|
21
|
-
length_t m;
|
22
|
-
|
23
|
-
/// Components of the constraint function with indices below this number are
|
24
|
-
/// handled using a quadratic penalty method rather than using an
|
25
|
-
/// augmented Lagrangian method. Specifically, the Lagrange multipliers for
|
26
|
-
/// these components (which determine the shifts in ALM) are kept at zero.
|
27
|
-
index_t penalty_alm_split = 0;
|
28
|
-
|
29
|
-
BoxConstrProblem(length_t n, ///< Number of decision variables
|
30
|
-
length_t m) ///< Number of constraints
|
31
|
-
: n{n}, m{m} {}
|
32
|
-
|
33
|
-
BoxConstrProblem(Box C, Box D, vec l1_reg = vec(0))
|
34
|
-
: n{C.lowerbound.size()}, m{D.lowerbound.size()}, C{std::move(C)}, D{std::move(D)},
|
35
|
-
l1_reg{std::move(l1_reg)} {}
|
36
|
-
|
37
|
-
void resize(length_t n, length_t m) {
|
38
|
-
this->n = n;
|
39
|
-
this->m = m;
|
40
|
-
C = Box{n};
|
41
|
-
D = Box{m};
|
42
|
-
}
|
43
|
-
|
44
|
-
BoxConstrProblem(const BoxConstrProblem &) = default;
|
45
|
-
BoxConstrProblem &operator=(const BoxConstrProblem &) = default;
|
46
|
-
BoxConstrProblem(BoxConstrProblem &&) noexcept = default;
|
47
|
-
BoxConstrProblem &operator=(BoxConstrProblem &&) noexcept = default;
|
48
|
-
|
49
|
-
/// Constraints of the decision variables, @f$ x \in C @f$
|
50
|
-
Box C{this->n};
|
51
|
-
/// Other constraints, @f$ g(x) \in D @f$
|
52
|
-
Box D{this->m};
|
53
|
-
/// @f$ \ell_1 @f$ (1-norm) regularization parameter.
|
54
|
-
/// Possible dimensions are: @f$ 0 @f$ (no regularization), @f$ 1 @f$ (a
|
55
|
-
/// single scalar factor), or @f$ n @f$ (a different factor for each
|
56
|
-
/// variable).
|
57
|
-
vec l1_reg{};
|
58
|
-
|
59
|
-
/// Number of decision variables, @ref n
|
60
|
-
length_t get_n() const { return n; }
|
61
|
-
/// Number of constraints, @ref m
|
62
|
-
length_t get_m() const { return m; }
|
63
|
-
|
64
|
-
/** Projected gradient step for rectangular box C.
|
65
|
-
* @f[ \begin{aligned} \hat x &= \Pi_C(x - \gamma\nabla\psi(x)) \\
|
66
|
-
* p &= \hat x - x \\
|
67
|
-
* &= \max(\underline x - x, \;\min(-\gamma\nabla\psi(x), \overline x - x)
|
68
|
-
* \end{aligned} @f] */
|
69
|
-
static real_t eval_proj_grad_step_box(const Box &C, real_t γ, crvec x, crvec grad_ψ, rvec x̂,
|
70
|
-
rvec p) {
|
71
|
-
p = (-γ * grad_ψ).cwiseMax(C.lowerbound - x).cwiseMin(C.upperbound - x);
|
72
|
-
x̂ = x + p;
|
73
|
-
return real_t(0);
|
74
|
-
}
|
75
|
-
|
76
|
-
/** Proximal gradient step for rectangular box C with ℓ₁-regularization.
|
77
|
-
* @f[ \begin{aligned} h(x) &= \|x\|_1 + \delta_C(x) \\
|
78
|
-
* \hat x &= \prox_{\gamma h}(x - \gamma\nabla\psi(x)) \\
|
79
|
-
* &= -\max\big(
|
80
|
-
* x - \overline x,
|
81
|
-
* \;\min\big(
|
82
|
-
* x - \underline x,
|
83
|
-
* \;\min\big(
|
84
|
-
* \gamma(\nabla\psi(x) + \lambda),
|
85
|
-
* \;\max\big(
|
86
|
-
* \gamma(\nabla\psi(x) - \lambda),
|
87
|
-
* x
|
88
|
-
* \big)
|
89
|
-
* \big)
|
90
|
-
* \big)
|
91
|
-
* \big) \end{aligned} @f] */
|
92
|
-
static void eval_prox_grad_step_box_l1_impl(const Box &C, const auto &λ, real_t γ, crvec x,
|
93
|
-
crvec grad_ψ, rvec x̂, rvec p) {
|
94
|
-
p = -x.cwiseMax(γ * (grad_ψ - λ))
|
95
|
-
.cwiseMin(γ * (grad_ψ + λ))
|
96
|
-
.cwiseMin(x - C.lowerbound)
|
97
|
-
.cwiseMax(x - C.upperbound);
|
98
|
-
x̂ = x + p;
|
99
|
-
}
|
100
|
-
/// @copydoc eval_prox_grad_step_box_l1_impl
|
101
|
-
static real_t eval_prox_grad_step_box_l1(const Box &C, const auto &λ, real_t γ, crvec x,
|
102
|
-
crvec grad_ψ, rvec x̂, rvec p) {
|
103
|
-
eval_prox_grad_step_box_l1_impl(C, λ, γ, x, grad_ψ, x̂, p);
|
104
|
-
return vec_util::norm_1(x̂.cwiseProduct(λ));
|
105
|
-
}
|
106
|
-
|
107
|
-
/// @copydoc eval_prox_grad_step_box_l1_impl
|
108
|
-
static real_t eval_prox_grad_step_box_l1_scal(const Box &C, real_t λ, real_t γ, crvec x,
|
109
|
-
crvec grad_ψ, rvec x̂, rvec p) {
|
110
|
-
auto n = x.size();
|
111
|
-
auto λ_vec = vec::Constant(n, λ);
|
112
|
-
eval_prox_grad_step_box_l1_impl(C, λ_vec, γ, x, grad_ψ, x̂, p);
|
113
|
-
return λ * vec_util ::norm_1(x̂);
|
114
|
-
}
|
115
|
-
|
116
|
-
/// @see @ref TypeErasedProblem::eval_prox_grad_step
|
117
|
-
real_t eval_prox_grad_step(real_t γ, crvec x, crvec grad_ψ, rvec x̂, rvec p) const {
|
118
|
-
if (l1_reg.size() == 0)
|
119
|
-
return eval_proj_grad_step_box(C, γ, x, grad_ψ, x̂, p);
|
120
|
-
else if (l1_reg.size() == 1)
|
121
|
-
return eval_prox_grad_step_box_l1_scal(C, l1_reg(0), γ, x, grad_ψ, x̂, p);
|
122
|
-
else
|
123
|
-
return eval_prox_grad_step_box_l1(C, l1_reg, γ, x, grad_ψ, x̂, p);
|
124
|
-
}
|
125
|
-
|
126
|
-
/// @see @ref TypeErasedProblem::eval_proj_diff_g
|
127
|
-
void eval_proj_diff_g(crvec z, rvec p) const { p = alpaqa::projecting_difference(z, D); }
|
128
|
-
|
129
|
-
static void eval_proj_multipliers_box(const Box &D, rvec y, real_t M,
|
130
|
-
index_t penalty_alm_split) {
|
131
|
-
// If there's no lower bound, the multipliers can only be positive
|
132
|
-
auto max_lb = [M](real_t y, real_t z_lb) {
|
133
|
-
real_t y_lb = z_lb == -alpaqa::inf<config_t> ? 0 : -M;
|
134
|
-
return std::max(y, y_lb);
|
135
|
-
};
|
136
|
-
// If there's no upper bound, the multipliers can only be negative
|
137
|
-
auto min_ub = [M](real_t y, real_t z_ub) {
|
138
|
-
real_t y_ub = z_ub == alpaqa::inf<config_t> ? 0 : M;
|
139
|
-
return std::min(y, y_ub);
|
140
|
-
};
|
141
|
-
auto num_alm = y.size() - penalty_alm_split;
|
142
|
-
auto &&y_qpm = y.topRows(penalty_alm_split);
|
143
|
-
auto &&y_alm = y.bottomRows(num_alm);
|
144
|
-
auto &&z_alm_lb = D.lowerbound.bottomRows(num_alm);
|
145
|
-
auto &&z_alm_ub = D.upperbound.bottomRows(num_alm);
|
146
|
-
y_qpm.setZero();
|
147
|
-
y_alm = y_alm.binaryExpr(z_alm_lb, max_lb).binaryExpr(z_alm_ub, min_ub);
|
148
|
-
}
|
149
|
-
|
150
|
-
/// @see @ref TypeErasedProblem::eval_proj_multipliers
|
151
|
-
void eval_proj_multipliers(rvec y, real_t M) const {
|
152
|
-
eval_proj_multipliers_box(D, y, M, penalty_alm_split);
|
153
|
-
}
|
154
|
-
|
155
|
-
/// @see @ref TypeErasedProblem::get_box_C
|
156
|
-
const Box &get_box_C() const { return C; }
|
157
|
-
/// @see @ref TypeErasedProblem::get_box_D
|
158
|
-
const Box &get_box_D() const { return D; }
|
159
|
-
|
160
|
-
/// @see @ref TypeErasedProblem::eval_inactive_indices_res_lna
|
161
|
-
index_t eval_inactive_indices_res_lna(real_t γ, crvec x, crvec grad_ψ, rindexvec J) const {
|
162
|
-
index_t nJ = 0;
|
163
|
-
// Helper that adds i to index set J if x ∊ C
|
164
|
-
const auto add_to_J_if_in_box_interior = [&](real_t x_fw, index_t i) {
|
165
|
-
if (C.lowerbound(i) < x_fw && x_fw < C.upperbound(i))
|
166
|
-
J(nJ++) = i;
|
167
|
-
};
|
168
|
-
// Update the index set J for the general box + l1 case
|
169
|
-
const auto update_J_general = [&](real_t λ, real_t x_fw, index_t i) {
|
170
|
-
if (λ == 0) {
|
171
|
-
add_to_J_if_in_box_interior(x_fw, i);
|
172
|
-
} else {
|
173
|
-
if (x_fw > γ * λ)
|
174
|
-
add_to_J_if_in_box_interior(x_fw - γ * λ, i);
|
175
|
-
else if (x_fw < -γ * λ)
|
176
|
-
add_to_J_if_in_box_interior(x_fw + γ * λ, i);
|
177
|
-
}
|
178
|
-
};
|
179
|
-
const auto nλ = l1_reg.size();
|
180
|
-
const bool λ_is_0 = nλ == 0 || (nλ == 1 && l1_reg(0) == 0);
|
181
|
-
// Only box constraints
|
182
|
-
if (λ_is_0)
|
183
|
-
for (index_t i = 0; i < n; ++i) {
|
184
|
-
real_t x_fw = x(i) - γ * grad_ψ(i);
|
185
|
-
add_to_J_if_in_box_interior(x_fw, i);
|
186
|
-
}
|
187
|
-
// Box constraints and l1
|
188
|
-
else
|
189
|
-
for (index_t i = 0; i < n; ++i) {
|
190
|
-
real_t λi = nλ == 0 ? 0 : nλ == 1 ? l1_reg(0) : l1_reg(i);
|
191
|
-
real_t x_fw = x(i) - γ * grad_ψ(i);
|
192
|
-
update_J_general(λi, x_fw, i);
|
193
|
-
}
|
194
|
-
return nJ;
|
195
|
-
}
|
196
|
-
|
197
|
-
/// @see @ref TypeErasedProblem::check
|
198
|
-
void check() const {
|
199
|
-
util::check_dim_msg<config_t>(
|
200
|
-
C.lowerbound, n,
|
201
|
-
"Length of problem.C.lowerbound does not match problem size problem.n");
|
202
|
-
util::check_dim_msg<config_t>(
|
203
|
-
C.upperbound, n,
|
204
|
-
"Length of problem.C.upperbound does not match problem size problem.n");
|
205
|
-
util::check_dim_msg<config_t>(
|
206
|
-
D.lowerbound, m,
|
207
|
-
"Length of problem.D.lowerbound does not match problem size problem.m");
|
208
|
-
util::check_dim_msg<config_t>(
|
209
|
-
D.upperbound, m,
|
210
|
-
"Length of problem.D.upperbound does not match problem size problem.m");
|
211
|
-
if (l1_reg.size() > 1)
|
212
|
-
util::check_dim_msg<config_t>(
|
213
|
-
l1_reg, n,
|
214
|
-
"Length of problem.l1_reg does not match problem size problem.n, 1 or 0");
|
215
|
-
if (penalty_alm_split < 0 || penalty_alm_split > m)
|
216
|
-
throw std::invalid_argument("Invalid penalty_alm_split");
|
217
|
-
}
|
218
|
-
};
|
219
|
-
|
220
|
-
} // namespace alpaqa
|
@@ -1,82 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/config/config.hpp>
|
4
|
-
#include <alpaqa/util/float.hpp>
|
5
|
-
|
6
|
-
namespace alpaqa {
|
7
|
-
|
8
|
-
template <Config Conf = DefaultConfig>
|
9
|
-
struct Box {
|
10
|
-
USING_ALPAQA_CONFIG(Conf);
|
11
|
-
|
12
|
-
Box() : Box{0} {}
|
13
|
-
Box(length_t n)
|
14
|
-
: lowerbound{vec::Constant(n, -inf<config_t>)}, upperbound{
|
15
|
-
vec::Constant(n, +inf<config_t>)} {}
|
16
|
-
|
17
|
-
static Box NaN(length_t n) {
|
18
|
-
return Box{vec::Constant(n, alpaqa::NaN<config_t>),
|
19
|
-
vec::Constant(n, alpaqa::NaN<config_t>)};
|
20
|
-
}
|
21
|
-
static Box from_lower_upper(vec lower, vec upper) {
|
22
|
-
return Box{std::move(lower), std::move(upper)};
|
23
|
-
}
|
24
|
-
|
25
|
-
vec lowerbound;
|
26
|
-
vec upperbound;
|
27
|
-
|
28
|
-
private:
|
29
|
-
Box(vec lower, vec upper) : lowerbound{std::move(lower)}, upperbound{std::move(upper)} {}
|
30
|
-
};
|
31
|
-
|
32
|
-
/// Project a vector onto a box.
|
33
|
-
/// @f[ \Pi_C(v) @f]
|
34
|
-
template <Config Conf>
|
35
|
-
inline auto project(const auto &v, ///< [in] The vector to project
|
36
|
-
const Box<Conf> &box ///< [in] The box to project onto
|
37
|
-
) {
|
38
|
-
USING_ALPAQA_CONFIG(Conf);
|
39
|
-
using binary_real_f = real_t (*)(real_t, real_t);
|
40
|
-
return v.binaryExpr(box.lowerbound, binary_real_f(std::fmax))
|
41
|
-
.binaryExpr(box.upperbound, binary_real_f(std::fmin));
|
42
|
-
}
|
43
|
-
|
44
|
-
/// Get the difference between the given vector and its projection.
|
45
|
-
/// @f[ v - \Pi_C(v) @f]
|
46
|
-
/// @warning Beware catastrophic cancellation!
|
47
|
-
template <Config Conf>
|
48
|
-
inline auto //
|
49
|
-
projecting_difference(const auto &v, ///< [in] The vector to project
|
50
|
-
const Box<Conf> &box ///< [in] The box to project onto
|
51
|
-
) {
|
52
|
-
return v - project(v, box);
|
53
|
-
}
|
54
|
-
|
55
|
-
/// Get the distance squared between the given vector and its projection.
|
56
|
-
/// @f[ \left\| v - \Pi_C(v) \right\|_2^2 @f]
|
57
|
-
/// @warning Beware catastrophic cancellation!
|
58
|
-
|
59
|
-
template <Config Conf>
|
60
|
-
inline auto dist_squared(const auto &v, ///< [in] The vector to project
|
61
|
-
const Box<Conf> &box ///< [in] The box to project onto
|
62
|
-
) {
|
63
|
-
return projecting_difference(v, box).squaredNorm();
|
64
|
-
}
|
65
|
-
|
66
|
-
/// Get the distance squared between the given vector and its projection in the
|
67
|
-
/// Σ norm.
|
68
|
-
/// @f[ \left\| v - \Pi_C(v) \right\|_\Sigma^2
|
69
|
-
/// = \left(v - \Pi_C(v)\right)^\top \Sigma \left(v - \Pi_C(v)\right) @f]
|
70
|
-
/// @warning Beware catastrophic cancellation!
|
71
|
-
template <Config Conf>
|
72
|
-
inline auto dist_squared(const auto &v, ///< [in] The vector to project
|
73
|
-
const Box<Conf> &box, ///< [in] The box to project onto
|
74
|
-
const auto &Σ ///< [in] Diagonal matrix defining norm
|
75
|
-
) -> real_t<Conf> {
|
76
|
-
// TODO: Does this allocate?
|
77
|
-
// Does it have dangling references to temporaries?
|
78
|
-
auto d = v - project(v, box);
|
79
|
-
return d.dot(Σ.asDiagonal() * d);
|
80
|
-
}
|
81
|
-
|
82
|
-
} // namespace alpaqa
|