casadi 3.6.5__cp311-none-macosx_11_0_arm64.whl → 3.6.7__cp311-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,146 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/accelerators/lbfgs.hpp>
|
4
|
-
#include <alpaqa/config/config.hpp>
|
5
|
-
#include <alpaqa/inner/directions/panoc-direction-update.hpp>
|
6
|
-
#include <alpaqa/inner/internal/panoc-helpers.hpp>
|
7
|
-
#include <alpaqa/problem/type-erased-problem.hpp>
|
8
|
-
#include <optional>
|
9
|
-
|
10
|
-
namespace alpaqa {
|
11
|
-
|
12
|
-
/// Parameters for the @ref StructuredLBFGSDirection class.
|
13
|
-
template <Config Conf>
|
14
|
-
struct StructuredLBFGSDirectionParams {
|
15
|
-
USING_ALPAQA_CONFIG(Conf);
|
16
|
-
/// Set this option to a nonzero value to include the Hessian-vector product
|
17
|
-
/// @f$ \nabla^2_{x_\mathcal{J}x_\mathcal{K}}\psi(x) q_\mathcal{K} @f$ from
|
18
|
-
/// equation 12b in @cite pas2022alpaqa, scaled by this parameter.
|
19
|
-
/// Set it to zero to leave out that term.
|
20
|
-
real_t hessian_vec_factor = 0;
|
21
|
-
/// If @ref hessian_vec_factor is nonzero, set this option to true to
|
22
|
-
/// approximate that term using finite differences instead of using AD.
|
23
|
-
bool hessian_vec_finite_differences = true;
|
24
|
-
/// If @ref hessian_vec_factor is nonzero and
|
25
|
-
/// @ref hessian_vec_finite_differences is true, set this option to true to
|
26
|
-
/// compute the exact Hessian of the augmented Lagrangian, false to
|
27
|
-
/// approximate it using the Hessian of the Lagrangian.
|
28
|
-
bool full_augmented_hessian = true;
|
29
|
-
enum FailurePolicy {
|
30
|
-
/// If L-BFGS fails, propagate the failure and tell PANOC that no
|
31
|
-
/// accelerated step is available, causing it to accept the projected
|
32
|
-
/// gradient step instead.
|
33
|
-
FallbackToProjectedGradient,
|
34
|
-
/// If L-BFGS fails, return @f$ q_\mathcal{J} =
|
35
|
-
/// -\gamma\nabla_{x_\mathcal{J}}\psi(x^k)
|
36
|
-
/// -\gamma\nabla^2_{x_\mathcal{J}x_\mathcal{K}}\psi(x)
|
37
|
-
/// q_\mathcal{K} @f$ as the accelerated step (effectively approximating
|
38
|
-
/// @f$ \nabla_{x_\mathcal{J}x_\mathcal{J}} \approx \gamma I @f$).
|
39
|
-
UseScaledLBFGSInput,
|
40
|
-
}
|
41
|
-
/// What to do when L-BFGS failed (e.g. if there were no pairs (s, y) with
|
42
|
-
/// positive curvature).
|
43
|
-
failure_policy = FallbackToProjectedGradient;
|
44
|
-
};
|
45
|
-
|
46
|
-
/// @ingroup grp_DirectionProviders
|
47
|
-
template <Config Conf = DefaultConfig>
|
48
|
-
struct StructuredLBFGSDirection {
|
49
|
-
USING_ALPAQA_CONFIG(Conf);
|
50
|
-
using Problem = TypeErasedProblem<config_t>;
|
51
|
-
using LBFGS = alpaqa::LBFGS<config_t>;
|
52
|
-
using AcceleratorParams = typename LBFGS::Params;
|
53
|
-
using DirectionParams = StructuredLBFGSDirectionParams<config_t>;
|
54
|
-
|
55
|
-
struct Params {
|
56
|
-
AcceleratorParams accelerator = {};
|
57
|
-
DirectionParams direction = {};
|
58
|
-
};
|
59
|
-
|
60
|
-
StructuredLBFGSDirection() = default;
|
61
|
-
StructuredLBFGSDirection(const Params ¶ms)
|
62
|
-
: lbfgs(params.accelerator), direction_params(params.direction) {}
|
63
|
-
StructuredLBFGSDirection(const typename LBFGS::Params ¶ms,
|
64
|
-
const DirectionParams &directionparams = {})
|
65
|
-
: lbfgs(params), direction_params(directionparams) {}
|
66
|
-
StructuredLBFGSDirection(const LBFGS &lbfgs,
|
67
|
-
const DirectionParams &directionparams = {})
|
68
|
-
: lbfgs(lbfgs), direction_params(directionparams) {}
|
69
|
-
StructuredLBFGSDirection(LBFGS &&lbfgs,
|
70
|
-
const DirectionParams &directionparams = {})
|
71
|
-
: lbfgs(std::move(lbfgs)), direction_params(directionparams) {}
|
72
|
-
|
73
|
-
/// @see @ref PANOCDirection::initialize
|
74
|
-
void initialize(const Problem &problem, crvec y, crvec Σ, real_t γ_0,
|
75
|
-
crvec x_0, crvec x̂_0, crvec p_0, crvec grad_ψx_0);
|
76
|
-
|
77
|
-
/// @see @ref PANOCDirection::has_initial_direction
|
78
|
-
bool has_initial_direction() const { return false; }
|
79
|
-
|
80
|
-
/// @see @ref PANOCDirection::update
|
81
|
-
bool update([[maybe_unused]] real_t γₖ, [[maybe_unused]] real_t γₙₑₓₜ,
|
82
|
-
crvec xₖ, crvec xₙₑₓₜ, [[maybe_unused]] crvec pₖ,
|
83
|
-
[[maybe_unused]] crvec pₙₑₓₜ, crvec grad_ψxₖ,
|
84
|
-
crvec grad_ψxₙₑₓₜ) {
|
85
|
-
const bool force = true;
|
86
|
-
return lbfgs.update(xₖ, xₙₑₓₜ, grad_ψxₖ, grad_ψxₙₑₓₜ,
|
87
|
-
LBFGS::Sign::Positive, force);
|
88
|
-
}
|
89
|
-
|
90
|
-
/// @see @ref PANOCDirection::apply
|
91
|
-
bool apply(real_t γₖ, crvec xₖ, crvec x̂ₖ, crvec pₖ, crvec grad_ψxₖ,
|
92
|
-
rvec qₖ) const;
|
93
|
-
|
94
|
-
/// @see @ref PANOCDirection::changed_γ
|
95
|
-
void changed_γ([[maybe_unused]] real_t γₖ, [[maybe_unused]] real_t old_γₖ) {
|
96
|
-
// Nothing, Hessian approximation is independent of step size
|
97
|
-
}
|
98
|
-
|
99
|
-
/// @see @ref PANOCDirection::reset
|
100
|
-
void reset() { lbfgs.reset(); }
|
101
|
-
|
102
|
-
/// @see @ref PANOCDirection::get_name
|
103
|
-
std::string get_name() const {
|
104
|
-
return "StructuredLBFGSDirection<" + std::string(config_t::get_name()) +
|
105
|
-
'>';
|
106
|
-
}
|
107
|
-
|
108
|
-
auto get_params() const {
|
109
|
-
return std::tie(lbfgs.get_params(), direction_params);
|
110
|
-
}
|
111
|
-
|
112
|
-
private:
|
113
|
-
using Helpers = detail::PANOCHelpers<config_t>;
|
114
|
-
|
115
|
-
const Problem *problem = nullptr;
|
116
|
-
#ifndef _WIN32
|
117
|
-
std::optional<crvec> y = std::nullopt;
|
118
|
-
std::optional<crvec> Σ = std::nullopt;
|
119
|
-
#else
|
120
|
-
std::optional<vec> y = std::nullopt;
|
121
|
-
std::optional<vec> Σ = std::nullopt;
|
122
|
-
#endif
|
123
|
-
|
124
|
-
LBFGS lbfgs;
|
125
|
-
mutable indexvec J_sto;
|
126
|
-
mutable vec HqK;
|
127
|
-
mutable vec work_n;
|
128
|
-
mutable vec work_n2;
|
129
|
-
mutable vec work_m;
|
130
|
-
|
131
|
-
void approximate_hessian_vec_term(crvec xₖ, crvec grad_ψxₖ, rvec qₖ,
|
132
|
-
crindexvec J) const;
|
133
|
-
|
134
|
-
public:
|
135
|
-
DirectionParams direction_params;
|
136
|
-
};
|
137
|
-
|
138
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, StructuredLBFGSDirection, DefaultConfig);
|
139
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, StructuredLBFGSDirection, EigenConfigf);
|
140
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, StructuredLBFGSDirection, EigenConfigd);
|
141
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, StructuredLBFGSDirection, EigenConfigl);
|
142
|
-
#ifdef ALPAQA_WITH_QUAD_PRECISION
|
143
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, StructuredLBFGSDirection, EigenConfigq);
|
144
|
-
#endif
|
145
|
-
|
146
|
-
} // namespace alpaqa
|
@@ -1,264 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/config/config.hpp>
|
4
|
-
#include <alpaqa/export.hpp>
|
5
|
-
#include <alpaqa/inner/directions/panoc-direction-update.hpp>
|
6
|
-
#include <alpaqa/inner/internal/panoc-helpers.hpp>
|
7
|
-
#include <alpaqa/problem/type-erased-problem.hpp>
|
8
|
-
#include <alpaqa/util/alloc-check.hpp>
|
9
|
-
#include <alpaqa/util/index-set.hpp>
|
10
|
-
#include <alpaqa/util/print.hpp>
|
11
|
-
#include <iostream>
|
12
|
-
#include <limits>
|
13
|
-
#include <optional>
|
14
|
-
#include <stdexcept>
|
15
|
-
|
16
|
-
#include <Eigen/Cholesky>
|
17
|
-
#include <Eigen/Eigenvalues>
|
18
|
-
|
19
|
-
namespace alpaqa {
|
20
|
-
|
21
|
-
/// Parameters for the @ref StructuredNewtonDirection class.
|
22
|
-
template <Config Conf>
|
23
|
-
struct StructuredNewtonRegularizationParams {
|
24
|
-
USING_ALPAQA_CONFIG(Conf);
|
25
|
-
/// Minimum eigenvalue of the Hessian, scaled by
|
26
|
-
/// @f$ 1 + |\lambda_\mathrm{max}| @f$, enforced by regularization using
|
27
|
-
/// a multiple of identity.
|
28
|
-
real_t min_eig = std::cbrt(std::numeric_limits<real_t>::epsilon());
|
29
|
-
/// Print the minimum and maximum eigenvalue of the Hessian.
|
30
|
-
bool print_eig = false;
|
31
|
-
};
|
32
|
-
|
33
|
-
/// Parameters for the @ref StructuredNewtonDirection class.
|
34
|
-
template <Config Conf>
|
35
|
-
struct StructuredNewtonDirectionParams {
|
36
|
-
USING_ALPAQA_CONFIG(Conf);
|
37
|
-
/// Set this option to a nonzero value to include the Hessian-vector product
|
38
|
-
/// @f$ \nabla^2_{x_\mathcal{J}x_\mathcal{K}}\psi(x) q_\mathcal{K} @f$ from
|
39
|
-
/// equation 12b in @cite pas2022alpaqa, scaled by this parameter.
|
40
|
-
/// Set it to zero to leave out that term.
|
41
|
-
real_t hessian_vec_factor = 0;
|
42
|
-
};
|
43
|
-
|
44
|
-
/// @ingroup grp_DirectionProviders
|
45
|
-
template <Config Conf = DefaultConfig>
|
46
|
-
struct StructuredNewtonDirection {
|
47
|
-
USING_ALPAQA_CONFIG(Conf);
|
48
|
-
using Problem = TypeErasedProblem<config_t>;
|
49
|
-
using DirectionParams = StructuredNewtonDirectionParams<config_t>;
|
50
|
-
using AcceleratorParams = StructuredNewtonRegularizationParams<config_t>;
|
51
|
-
|
52
|
-
struct Params {
|
53
|
-
AcceleratorParams accelerator = {};
|
54
|
-
DirectionParams direction = {};
|
55
|
-
};
|
56
|
-
|
57
|
-
StructuredNewtonDirection() = default;
|
58
|
-
StructuredNewtonDirection(const Params ¶ms)
|
59
|
-
: reg_params(params.accelerator), direction_params(params.direction) {}
|
60
|
-
StructuredNewtonDirection(const AcceleratorParams ¶ms,
|
61
|
-
const DirectionParams &directionparams = {})
|
62
|
-
: reg_params(params), direction_params(directionparams) {}
|
63
|
-
|
64
|
-
/// @see @ref PANOCDirection::initialize
|
65
|
-
void initialize(const Problem &problem, crvec y, crvec Σ,
|
66
|
-
[[maybe_unused]] real_t γ_0, [[maybe_unused]] crvec x_0,
|
67
|
-
[[maybe_unused]] crvec x̂_0, [[maybe_unused]] crvec p_0,
|
68
|
-
[[maybe_unused]] crvec grad_ψx_0) {
|
69
|
-
if (!(problem.provides_get_box_C() && problem.provides_get_box_D()))
|
70
|
-
throw std::invalid_argument(
|
71
|
-
"Structured Newton only supports box-constrained problems");
|
72
|
-
// TODO: support eval_inactive_indices_res_lna
|
73
|
-
if (!problem.provides_eval_hess_ψ())
|
74
|
-
throw std::invalid_argument("Structured Newton requires hess_ψ");
|
75
|
-
// Store references to problem and ALM variables
|
76
|
-
this->problem = &problem;
|
77
|
-
this->y.emplace(y);
|
78
|
-
this->Σ.emplace(Σ);
|
79
|
-
// Allocate workspaces
|
80
|
-
const auto n = problem.get_n();
|
81
|
-
JK.resize(n);
|
82
|
-
H_storage.resize(n * n);
|
83
|
-
HJ_storage.resize(n * n);
|
84
|
-
// Store sparsity of H
|
85
|
-
length_t nnz_H = problem.get_hess_ψ_num_nonzeros();
|
86
|
-
if (nnz_H > 0) {
|
87
|
-
inner_idx_H.resize(nnz_H);
|
88
|
-
outer_ptr_H.resize(n + 1);
|
89
|
-
mvec null{nullptr, 0};
|
90
|
-
problem.eval_hess_ψ(x_0, y, Σ, 1, inner_idx_H, outer_ptr_H, null);
|
91
|
-
throw std::logic_error("Sparse hessians not yet implemented");
|
92
|
-
}
|
93
|
-
}
|
94
|
-
|
95
|
-
/// @see @ref PANOCDirection::has_initial_direction
|
96
|
-
bool has_initial_direction() const { return true; }
|
97
|
-
|
98
|
-
/// @see @ref PANOCDirection::update
|
99
|
-
bool update([[maybe_unused]] real_t γₖ, [[maybe_unused]] real_t γₙₑₓₜ,
|
100
|
-
[[maybe_unused]] crvec xₖ, [[maybe_unused]] crvec xₙₑₓₜ,
|
101
|
-
[[maybe_unused]] crvec pₖ, [[maybe_unused]] crvec pₙₑₓₜ,
|
102
|
-
[[maybe_unused]] crvec grad_ψxₖ,
|
103
|
-
[[maybe_unused]] crvec grad_ψxₙₑₓₜ) {
|
104
|
-
return true;
|
105
|
-
}
|
106
|
-
|
107
|
-
/// @see @ref PANOCDirection::apply
|
108
|
-
bool apply(real_t γₖ, crvec xₖ, [[maybe_unused]] crvec x̂ₖ, crvec pₖ,
|
109
|
-
crvec grad_ψxₖ, rvec qₖ) const {
|
110
|
-
|
111
|
-
const auto n = problem->get_n();
|
112
|
-
const auto &C = problem->get_box_C();
|
113
|
-
|
114
|
-
// Find inactive indices J
|
115
|
-
auto nJ = 0;
|
116
|
-
for (index_t i = 0; i < n; ++i) {
|
117
|
-
real_t gd = xₖ(i) - γₖ * grad_ψxₖ(i);
|
118
|
-
if (gd <= C.lowerbound(i)) { // i ∊ J̲ ⊆ K
|
119
|
-
qₖ(i) = pₖ(i); //
|
120
|
-
} else if (C.upperbound(i) <= gd) { // i ∊ J̅ ⊆ K
|
121
|
-
qₖ(i) = pₖ(i); //
|
122
|
-
} else { // i ∊ J
|
123
|
-
JK(nJ++) = i;
|
124
|
-
qₖ(i) = -grad_ψxₖ(i);
|
125
|
-
}
|
126
|
-
}
|
127
|
-
|
128
|
-
// There are no inactive indices J
|
129
|
-
if (nJ == 0) {
|
130
|
-
// No free variables, no Newton step possible
|
131
|
-
return false; // Simply use the projection step
|
132
|
-
}
|
133
|
-
|
134
|
-
// Compute the Hessian
|
135
|
-
mmat H{H_storage.data(), n, n};
|
136
|
-
problem->eval_hess_ψ(xₖ, *y, *Σ, 1, inner_idx_H, outer_ptr_H,
|
137
|
-
H_storage);
|
138
|
-
|
139
|
-
// There are no active indices K
|
140
|
-
if (nJ == n) {
|
141
|
-
// If all indices are free, we can factor the entire matrix.
|
142
|
-
// Find the minimum eigenvalue to regularize the Hessian matrix and
|
143
|
-
// make it positive definite.
|
144
|
-
ScopedMallocAllower ma;
|
145
|
-
// Find the minimum eigenvalue to regularize the Hessian matrix and
|
146
|
-
// make it positive definite.
|
147
|
-
Eigen::SelfAdjointEigenSolver<mat> eig{H,
|
148
|
-
Eigen::ComputeEigenvectors};
|
149
|
-
|
150
|
-
auto λ_min = eig.eigenvalues().minCoeff(),
|
151
|
-
λ_max = eig.eigenvalues().maxCoeff();
|
152
|
-
|
153
|
-
if (reg_params.print_eig)
|
154
|
-
std::cout << "λ(H): " << float_to_str(λ_min, 3) << ", "
|
155
|
-
<< float_to_str(λ_max, 3) << std::endl;
|
156
|
-
// Regularization
|
157
|
-
real_t ε = reg_params.min_eig * (1 + std::abs(λ_max)); // TODO
|
158
|
-
// Solve the system
|
159
|
-
qₖ = eig.eigenvectors().transpose() * qₖ;
|
160
|
-
qₖ = eig.eigenvalues().cwiseMax(ε).asDiagonal().inverse() * qₖ;
|
161
|
-
qₖ = eig.eigenvectors() * qₖ;
|
162
|
-
return true;
|
163
|
-
}
|
164
|
-
|
165
|
-
// There are active indices K
|
166
|
-
crindexvec J = JK.topRows(nJ);
|
167
|
-
rindexvec K = JK.bottomRows(n - nJ);
|
168
|
-
detail::IndexSet<config_t>::compute_complement(J, K, n);
|
169
|
-
|
170
|
-
// Compute right-hand side of 6.1c
|
171
|
-
if (direction_params.hessian_vec_factor != 0)
|
172
|
-
qₖ(J).noalias() -=
|
173
|
-
direction_params.hessian_vec_factor * (H(J, K) * qₖ(K));
|
174
|
-
|
175
|
-
// If there are active indices, we need to solve the Newton system with
|
176
|
-
// just the inactive indices.
|
177
|
-
mmat HJ{HJ_storage.data(), nJ, nJ};
|
178
|
-
// We copy the inactive block of the Hessian to a temporary dense matrix.
|
179
|
-
// Since it's symmetric, only the lower part is copied.
|
180
|
-
HJ.template triangularView<Eigen::Lower>() =
|
181
|
-
H(J, J).template triangularView<Eigen::Lower>();
|
182
|
-
|
183
|
-
ScopedMallocAllower ma;
|
184
|
-
// Find the minimum eigenvalue to regularize the Hessian matrix and
|
185
|
-
// make it positive definite.
|
186
|
-
Eigen::SelfAdjointEigenSolver<mat> eig{HJ, Eigen::ComputeEigenvectors};
|
187
|
-
|
188
|
-
auto λ_min = eig.eigenvalues().minCoeff(),
|
189
|
-
λ_max = eig.eigenvalues().maxCoeff();
|
190
|
-
|
191
|
-
if (reg_params.print_eig)
|
192
|
-
std::cout << "λ(H_JJ): " << float_to_str(λ_min, 3) << ", "
|
193
|
-
<< float_to_str(λ_max, 3) << std::endl;
|
194
|
-
// Regularization
|
195
|
-
real_t ε = reg_params.min_eig * (1 + std::abs(λ_max)); // TODO
|
196
|
-
// Solve the system
|
197
|
-
auto qJ = H.col(0).topRows(nJ);
|
198
|
-
qJ = qₖ(J);
|
199
|
-
qJ = eig.eigenvectors().transpose() * qJ;
|
200
|
-
qJ = eig.eigenvalues().cwiseMax(ε).asDiagonal().inverse() * qJ;
|
201
|
-
qₖ(J) = eig.eigenvectors() * qJ;
|
202
|
-
return true;
|
203
|
-
}
|
204
|
-
|
205
|
-
/// @see @ref PANOCDirection::changed_γ
|
206
|
-
void changed_γ([[maybe_unused]] real_t γₖ, [[maybe_unused]] real_t old_γₖ) {
|
207
|
-
}
|
208
|
-
|
209
|
-
/// @see @ref PANOCDirection::reset
|
210
|
-
void reset() {}
|
211
|
-
|
212
|
-
/// @see @ref PANOCDirection::get_name
|
213
|
-
std::string get_name() const {
|
214
|
-
return "StructuredNewtonDirection<" +
|
215
|
-
std::string(config_t::get_name()) + '>';
|
216
|
-
}
|
217
|
-
|
218
|
-
const auto &get_params() const { return direction_params; }
|
219
|
-
|
220
|
-
private:
|
221
|
-
const Problem *problem = nullptr;
|
222
|
-
#ifndef _WIN32
|
223
|
-
std::optional<crvec> y = std::nullopt;
|
224
|
-
std::optional<crvec> Σ = std::nullopt;
|
225
|
-
#else
|
226
|
-
std::optional<vec> y = std::nullopt;
|
227
|
-
std::optional<vec> Σ = std::nullopt;
|
228
|
-
#endif
|
229
|
-
|
230
|
-
mutable indexvec JK;
|
231
|
-
mutable vec H_storage;
|
232
|
-
mutable vec HJ_storage;
|
233
|
-
mutable indexvec inner_idx_H, outer_ptr_H;
|
234
|
-
|
235
|
-
public:
|
236
|
-
AcceleratorParams reg_params;
|
237
|
-
DirectionParams direction_params;
|
238
|
-
};
|
239
|
-
|
240
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, StructuredNewtonDirection, DefaultConfig);
|
241
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, StructuredNewtonDirection, EigenConfigf);
|
242
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, StructuredNewtonDirection, EigenConfigd);
|
243
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, StructuredNewtonDirection, EigenConfigl);
|
244
|
-
#ifdef ALPAQA_WITH_QUAD_PRECISION
|
245
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, StructuredNewtonDirection, EigenConfigq);
|
246
|
-
#endif
|
247
|
-
|
248
|
-
} // namespace alpaqa
|
249
|
-
|
250
|
-
#include <alpaqa/inner/panoc.hpp>
|
251
|
-
|
252
|
-
namespace alpaqa {
|
253
|
-
|
254
|
-
// clang-format off
|
255
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, PANOCSolver, StructuredNewtonDirection<DefaultConfig>);
|
256
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, PANOCSolver, StructuredNewtonDirection<EigenConfigf>);
|
257
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, PANOCSolver, StructuredNewtonDirection<EigenConfigd>);
|
258
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, PANOCSolver, StructuredNewtonDirection<EigenConfigl>);
|
259
|
-
#ifdef ALPAQA_WITH_QUAD_PRECISION
|
260
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, PANOCSolver, StructuredNewtonDirection<EigenConfigq>);
|
261
|
-
#endif
|
262
|
-
// clang-format on
|
263
|
-
|
264
|
-
} // namespace alpaqa
|
@@ -1,96 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/config/config.hpp>
|
4
|
-
#include <alpaqa/problem/type-erased-problem.hpp>
|
5
|
-
|
6
|
-
namespace alpaqa {
|
7
|
-
|
8
|
-
/// This class outlines the interface for direction providers used by PANOC-like
|
9
|
-
/// algorithms.
|
10
|
-
///
|
11
|
-
/// @ingroup grp_DirectionProviders
|
12
|
-
template <Config Conf>
|
13
|
-
struct PANOCDirection {
|
14
|
-
USING_ALPAQA_CONFIG(Conf);
|
15
|
-
using Problem = TypeErasedProblem<config_t>;
|
16
|
-
|
17
|
-
/// Initialize the direction provider.
|
18
|
-
///
|
19
|
-
/// @param[in] problem
|
20
|
-
/// Problem description.
|
21
|
-
/// @param[in] y
|
22
|
-
/// Lagrange multipliers.
|
23
|
-
/// @param[in] Σ
|
24
|
-
/// Penalty factors.
|
25
|
-
/// @param[in] γ_0
|
26
|
-
/// Initial step size.
|
27
|
-
/// @param[in] x_0
|
28
|
-
/// Initial iterate.
|
29
|
-
/// @param[in] x̂_0
|
30
|
-
/// Result of proximal gradient step in @p x_0.
|
31
|
-
/// @param[in] p_0
|
32
|
-
/// Proximal gradient step in @p x_0.
|
33
|
-
/// @param[in] grad_ψx_0
|
34
|
-
/// Gradient of the objective in @p x_0.
|
35
|
-
///
|
36
|
-
/// The references @p problem, @p y and @p Σ are guaranteed to remain valid
|
37
|
-
/// for subsequent calls to @ref update, @ref apply, @ref changed_γ and
|
38
|
-
/// @ref reset.
|
39
|
-
void initialize(const Problem &problem, crvec y, crvec Σ, real_t γ_0,
|
40
|
-
crvec x_0, crvec x̂_0, crvec p_0, crvec grad_ψx_0) = delete;
|
41
|
-
|
42
|
-
/// Return whether a direction is available on the very first iteration,
|
43
|
-
/// before the first call to @ref update.
|
44
|
-
bool has_initial_direction() const = delete;
|
45
|
-
|
46
|
-
/// Update the direction provider when accepting the next iterate.
|
47
|
-
///
|
48
|
-
/// @param[in] γₖ
|
49
|
-
/// Current step size.
|
50
|
-
/// @param[in] γₙₑₓₜ
|
51
|
-
/// Step size for the next iterate.
|
52
|
-
/// @param[in] xₖ
|
53
|
-
/// Current iterate.
|
54
|
-
/// @param[in] xₙₑₓₜ
|
55
|
-
/// Next iterate.
|
56
|
-
/// @param[in] pₖ
|
57
|
-
/// Proximal gradient step in the current iterate.
|
58
|
-
/// @param[in] pₙₑₓₜ
|
59
|
-
/// Proximal gradient step in the next iterate.
|
60
|
-
/// @param[in] grad_ψxₖ
|
61
|
-
/// Gradient of the objective in the current iterate.
|
62
|
-
/// @param[in] grad_ψxₙₑₓₜ
|
63
|
-
/// Gradient of the objective in the next iterate.
|
64
|
-
bool update(real_t γₖ, real_t γₙₑₓₜ, crvec xₖ, crvec xₙₑₓₜ, crvec pₖ,
|
65
|
-
crvec pₙₑₓₜ, crvec grad_ψxₖ, crvec grad_ψxₙₑₓₜ) = delete;
|
66
|
-
|
67
|
-
/// Apply the direction estimation in the current point.
|
68
|
-
///
|
69
|
-
/// @param[in] γₖ
|
70
|
-
/// Current step size.
|
71
|
-
/// @param[in] xₖ
|
72
|
-
/// Current iterate.
|
73
|
-
/// @param[in] x̂ₖ
|
74
|
-
/// Result of proximal gradient step in @p xₖ.
|
75
|
-
/// @param[in] pₖ
|
76
|
-
/// Proximal gradient step in @p xₖ.
|
77
|
-
/// @param[in] grad_ψxₖ
|
78
|
-
/// Gradient of the objective at @p xₖ.
|
79
|
-
/// @param[out] qₖ
|
80
|
-
/// Resulting step.
|
81
|
-
bool apply(real_t γₖ, crvec xₖ, crvec x̂ₖ, crvec pₖ, crvec grad_ψxₖ,
|
82
|
-
rvec qₖ) const = delete;
|
83
|
-
|
84
|
-
/// Called when the PANOC step size changes.
|
85
|
-
void changed_γ(real_t γₖ, real_t old_γₖ) = delete;
|
86
|
-
|
87
|
-
/// Called when using the direction failed. A possible behavior could be to
|
88
|
-
/// flush the buffers, hopefully yielding a better direction on the next
|
89
|
-
/// iteration.
|
90
|
-
void reset() = delete;
|
91
|
-
|
92
|
-
/// Get a human-readable name for this direction provider.
|
93
|
-
std::string get_name() const = delete;
|
94
|
-
};
|
95
|
-
|
96
|
-
} // namespace alpaqa
|
@@ -1,181 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/config/config.hpp>
|
4
|
-
#include <Eigen/Cholesky>
|
5
|
-
#include <Eigen/LU>
|
6
|
-
#include <cassert>
|
7
|
-
|
8
|
-
namespace alpaqa {
|
9
|
-
|
10
|
-
template <Config Conf>
|
11
|
-
struct Dim {
|
12
|
-
USING_ALPAQA_CONFIG(Conf);
|
13
|
-
length_t N, nx, nu;
|
14
|
-
struct Horizon {
|
15
|
-
length_t N;
|
16
|
-
struct Iter {
|
17
|
-
index_t i;
|
18
|
-
Iter &operator++() {
|
19
|
-
++i;
|
20
|
-
return *this;
|
21
|
-
}
|
22
|
-
Iter operator++(int) const {
|
23
|
-
Iter t = *this;
|
24
|
-
++i;
|
25
|
-
return t;
|
26
|
-
}
|
27
|
-
index_t &operator*() { return i; }
|
28
|
-
const index_t &operator*() const { return i; }
|
29
|
-
friend auto operator<=>(const Iter &, const Iter &) = default;
|
30
|
-
};
|
31
|
-
static Iter begin() { return {0}; }
|
32
|
-
Iter end() const { return {N}; }
|
33
|
-
};
|
34
|
-
Horizon horizon() const { return {N}; }
|
35
|
-
};
|
36
|
-
|
37
|
-
template <Config Conf>
|
38
|
-
struct StatefulLQRFactor {
|
39
|
-
USING_ALPAQA_CONFIG(Conf);
|
40
|
-
|
41
|
-
using Dim = alpaqa::Dim<config_t>;
|
42
|
-
|
43
|
-
StatefulLQRFactor(Dim d) : dim{d} {}
|
44
|
-
Dim dim;
|
45
|
-
mat P{dim.nx, dim.nx};
|
46
|
-
mat gain_K{dim.nu * dim.nx, dim.N};
|
47
|
-
mat e{dim.nu, dim.N};
|
48
|
-
vec s{dim.nx};
|
49
|
-
vec c{dim.nx};
|
50
|
-
vec y{dim.nx};
|
51
|
-
vec t{dim.nu};
|
52
|
-
vec R̅_sto{dim.nu * dim.nu};
|
53
|
-
vec S̅_sto{dim.nu * dim.nx};
|
54
|
-
vec BiJ_sto{dim.nx * dim.nu};
|
55
|
-
vec PBiJ_sto{dim.nx * dim.nu};
|
56
|
-
mat PA{dim.nx, dim.nx};
|
57
|
-
real_t min_rcond = 1;
|
58
|
-
|
59
|
-
void factor_masked(auto &&AB, ///< System matrix A & input matrix B
|
60
|
-
auto &&Q, ///< State cost matrix Q
|
61
|
-
auto &&R, ///< Input cost matrix R
|
62
|
-
auto &&S, ///< Cross cost matrix S
|
63
|
-
auto &&R_prod, ///< Product with input cost matrix R
|
64
|
-
auto &&S_prod, ///< Product with cross cost matrix S
|
65
|
-
auto &&q, ///< Linear state factor q
|
66
|
-
auto &&r, ///< Linear input factor r
|
67
|
-
auto &&u, ///< Fixed inputs u
|
68
|
-
auto &&J, ///< Index set of inactive constraints
|
69
|
-
auto &&K, ///< Index set of active constraints
|
70
|
-
bool use_cholesky ///< Use Cholesky instead of LU solver
|
71
|
-
) {
|
72
|
-
using mmat = Eigen::Map<mat>;
|
73
|
-
using Eigen::indexing::all;
|
74
|
-
auto [N, nx, nu] = dim;
|
75
|
-
|
76
|
-
min_rcond = 1;
|
77
|
-
P.setZero();
|
78
|
-
Q(N)(P);
|
79
|
-
s = q(N);
|
80
|
-
for (index_t i = N; i-- > 0;) {
|
81
|
-
auto &&ABi = AB(i);
|
82
|
-
auto &&Ai = ABi.leftCols(nx);
|
83
|
-
auto &&Bi = ABi.rightCols(nu);
|
84
|
-
auto &&ui = u(i);
|
85
|
-
auto &&Ji = J(i);
|
86
|
-
auto &&Ki = K(i);
|
87
|
-
length_t nJ = Ji.size(); // number of inactive constraints
|
88
|
-
mmat R̅{R̅_sto.data(), nJ, nJ};
|
89
|
-
mmat S̅{S̅_sto.data(), nJ, nx};
|
90
|
-
mmat BiJ{BiJ_sto.data(), nx, nJ};
|
91
|
-
mmat PBiJ{PBiJ_sto.data(), nx, nJ};
|
92
|
-
auto &&ti = t.topRows(nJ);
|
93
|
-
mmat gain_Ki{gain_K.col(i).data(), nJ, nx};
|
94
|
-
auto &&ei = e.col(i).topRows(nJ);
|
95
|
-
// R̅ ← R + Bᵀ P B
|
96
|
-
BiJ.noalias() = Bi(all, Ji);
|
97
|
-
PBiJ.noalias() = P * BiJ;
|
98
|
-
R̅.noalias() = BiJ.transpose() * PBiJ;
|
99
|
-
R(i)(Ji, R̅);
|
100
|
-
// S̅ ← S + Bᵀ P A
|
101
|
-
PA.noalias() = P * Ai;
|
102
|
-
S̅.noalias() = BiJ.transpose() * PA;
|
103
|
-
S(i)(Ji, S̅);
|
104
|
-
// c = B(·,K) u(K), y ← P c + s
|
105
|
-
c.noalias() = Bi(all, Ki) * ui(Ki);
|
106
|
-
y.noalias() = P * c;
|
107
|
-
y += s;
|
108
|
-
// t ← Bᵀy + r + R(J,K) u(K)
|
109
|
-
ti.noalias() = BiJ.transpose() * y;
|
110
|
-
ti += r(i)(Ji);
|
111
|
-
R_prod(i)(Ji, Ki, ui, ti);
|
112
|
-
// Factor R̅
|
113
|
-
if (use_cholesky) {
|
114
|
-
#ifdef EIGEN_RUNTIME_NO_MALLOC
|
115
|
-
bool prev = Eigen::internal::is_malloc_allowed();
|
116
|
-
Eigen::internal::set_is_malloc_allowed(true); // TODO
|
117
|
-
#endif
|
118
|
-
Eigen::LDLT<rmat> R̅LU{R̅};
|
119
|
-
min_rcond = std::min(R̅LU.rcond(), min_rcond);
|
120
|
-
#ifdef EIGEN_RUNTIME_NO_MALLOC
|
121
|
-
Eigen::internal::set_is_malloc_allowed(prev);
|
122
|
-
#endif
|
123
|
-
// K ← -R̅⁻¹S̅
|
124
|
-
gain_Ki.noalias() = R̅LU.solve(S̅);
|
125
|
-
// e ← -R̅⁻¹(Bᵀy + r)
|
126
|
-
ei.noalias() = R̅LU.solve(ti);
|
127
|
-
} else {
|
128
|
-
#ifdef EIGEN_RUNTIME_NO_MALLOC
|
129
|
-
bool prev = Eigen::internal::is_malloc_allowed();
|
130
|
-
Eigen::internal::set_is_malloc_allowed(true); // TODO
|
131
|
-
#endif
|
132
|
-
Eigen::PartialPivLU<rmat> R̅LU{R̅};
|
133
|
-
min_rcond = std::min(R̅LU.rcond(), min_rcond);
|
134
|
-
#ifdef EIGEN_RUNTIME_NO_MALLOC
|
135
|
-
Eigen::internal::set_is_malloc_allowed(prev);
|
136
|
-
#endif
|
137
|
-
// K ← -R̅⁻¹S̅
|
138
|
-
gain_Ki.noalias() = R̅LU.solve(S̅);
|
139
|
-
// e ← -R̅⁻¹(Bᵀy + r)
|
140
|
-
ei.noalias() = R̅LU.solve(ti);
|
141
|
-
}
|
142
|
-
gain_Ki = -gain_Ki;
|
143
|
-
ei = -ei;
|
144
|
-
if (i > 0) {
|
145
|
-
// P ← Q + Aᵀ P A + S̅ᵀ K
|
146
|
-
P.noalias() = Ai.transpose() * PA;
|
147
|
-
P.noalias() += S̅.transpose() * gain_Ki;
|
148
|
-
// s ← S̅ᵀ e + Aᵀ y + q + Sᵀ(·,K) u(K)
|
149
|
-
s.noalias() = S̅.transpose() * ei;
|
150
|
-
s.noalias() += Ai.transpose() * y;
|
151
|
-
s += q(i);
|
152
|
-
S_prod(i)(Ki, ui, s);
|
153
|
-
Q(i)(P);
|
154
|
-
}
|
155
|
-
}
|
156
|
-
}
|
157
|
-
|
158
|
-
void solve_masked(auto &&AB, auto &&J, rvec Δu_eq, rvec Δx) {
|
159
|
-
auto [N, nx, nu] = dim;
|
160
|
-
assert(Δx.size() == 2 * nx);
|
161
|
-
Δx.topRows(nx).setZero();
|
162
|
-
for (index_t i = 0; i < N; ++i) {
|
163
|
-
auto &&ABi = AB(i);
|
164
|
-
auto &&Ai = ABi.leftCols(nx);
|
165
|
-
auto &&Bi = ABi.rightCols(nu);
|
166
|
-
auto &&Ji = J(i);
|
167
|
-
auto &&Δxi = Δx.segment((i % 2) * nx, nx);
|
168
|
-
auto &&Δx_next = Δx.segment(((i + 1) % 2) * nx, nx);
|
169
|
-
length_t nJ = Ji.size();
|
170
|
-
mmat Ki{gain_K.col(i).data(), nJ, nx};
|
171
|
-
auto &&ei = e.col(i).topRows(nJ);
|
172
|
-
auto &&Δui = Δu_eq.segment(i * nu, nu);
|
173
|
-
ei.noalias() += Ki * Δxi;
|
174
|
-
Δui(Ji).noalias() = ei;
|
175
|
-
Δx_next.noalias() = Ai * Δxi;
|
176
|
-
Δx_next.noalias() += Bi * Δui;
|
177
|
-
}
|
178
|
-
}
|
179
|
-
};
|
180
|
-
|
181
|
-
} // namespace alpaqa
|