casadi 3.6.5__cp312-none-macosx_11_0_arm64.whl → 3.6.7__cp312-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,185 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/casadi-ocp-loader-export.hpp>
|
4
|
-
#include <alpaqa/config/config.hpp>
|
5
|
-
#include <alpaqa/problem/box.hpp>
|
6
|
-
#include <alpaqa/util/check-dim.hpp>
|
7
|
-
#include <alpaqa/util/copyable_unique_ptr.hpp>
|
8
|
-
#include <filesystem>
|
9
|
-
|
10
|
-
namespace alpaqa {
|
11
|
-
|
12
|
-
namespace casadi_loader {
|
13
|
-
template <Config>
|
14
|
-
struct CasADiControlFunctionsWithParam;
|
15
|
-
} // namespace casadi_loader
|
16
|
-
|
17
|
-
template <Config Conf>
|
18
|
-
class CasADiControlProblem {
|
19
|
-
public:
|
20
|
-
USING_ALPAQA_CONFIG(Conf);
|
21
|
-
using Box = alpaqa::Box<config_t>;
|
22
|
-
length_t N, nx, nu, nh, nh_N, nc, nc_N;
|
23
|
-
vec x_init;
|
24
|
-
vec param;
|
25
|
-
Box U, D, D_N;
|
26
|
-
mutable vec work;
|
27
|
-
|
28
|
-
/// Components of the constraint function with indices below this number are
|
29
|
-
/// handled using a quadratic penalty method rather than using an
|
30
|
-
/// augmented Lagrangian method. Specifically, the Lagrange multipliers for
|
31
|
-
/// these components (which determine the shifts in ALM) are kept at zero.
|
32
|
-
index_t penalty_alm_split = 0;
|
33
|
-
/// Same as @ref penalty_alm_split, but for the terminal constraint.
|
34
|
-
index_t penalty_alm_split_N = 0;
|
35
|
-
|
36
|
-
CasADiControlProblem(const std::string &so_name, length_t N);
|
37
|
-
~CasADiControlProblem();
|
38
|
-
|
39
|
-
CasADiControlProblem(const CasADiControlProblem &);
|
40
|
-
CasADiControlProblem &operator=(const CasADiControlProblem &);
|
41
|
-
CasADiControlProblem(CasADiControlProblem &&) noexcept;
|
42
|
-
CasADiControlProblem &operator=(CasADiControlProblem &&) noexcept;
|
43
|
-
|
44
|
-
/// Load the numerical problem data (bounds and parameters) from a CSV file.
|
45
|
-
/// The file should contain 8 rows, with the following contents:
|
46
|
-
/// 1. @ref U lower bound [nu]
|
47
|
-
/// 2. @ref U upper bound [nu]
|
48
|
-
/// 3. @ref D lower bound [nc]
|
49
|
-
/// 4. @ref D upper bound [nc]
|
50
|
-
/// 5. @ref D_N lower bound [nc_N]
|
51
|
-
/// 6. @ref D_N upper bound [nc_N]
|
52
|
-
/// 7. @ref x_init [nx]
|
53
|
-
/// 8. @ref param [p]
|
54
|
-
///
|
55
|
-
/// Line endings are encoded using a single line feed (`\n`), and the column
|
56
|
-
/// separator can be specified using the @p sep argument.
|
57
|
-
void load_numerical_data(const std::filesystem::path &filepath,
|
58
|
-
char sep = ',');
|
59
|
-
|
60
|
-
void get_U(Box &U) const { U = this->U; }
|
61
|
-
void get_D(Box &D) const { D = this->D; }
|
62
|
-
void get_D_N(Box &D_N) const { D_N = this->D_N; }
|
63
|
-
void get_x_init(rvec x_init) const { x_init = this->x_init; }
|
64
|
-
|
65
|
-
void eval_f(index_t timestep, crvec x, crvec u, rvec fxu) const;
|
66
|
-
void eval_jac_f(index_t timestep, crvec x, crvec u, rmat J_fxu) const;
|
67
|
-
void eval_grad_f_prod(index_t timestep, crvec x, crvec u, crvec p,
|
68
|
-
rvec grad_fxu_p) const;
|
69
|
-
void eval_h(index_t timestep, crvec x, crvec u, rvec h) const;
|
70
|
-
void eval_h_N(crvec x, rvec h) const;
|
71
|
-
[[nodiscard]] real_t eval_l(index_t timestep, crvec h) const;
|
72
|
-
[[nodiscard]] real_t eval_l_N(crvec h) const;
|
73
|
-
void eval_qr(index_t timestep, crvec xu, crvec h, rvec qr) const;
|
74
|
-
void eval_q_N(crvec x, crvec h, rvec q) const;
|
75
|
-
void eval_add_Q(index_t timestep, crvec xu, crvec h, rmat Q) const;
|
76
|
-
void eval_add_Q_N(crvec x, crvec h, rmat Q) const;
|
77
|
-
void eval_add_R_masked(index_t timestep, crvec xu, crvec h, crindexvec mask,
|
78
|
-
rmat R, rvec work) const;
|
79
|
-
void eval_add_S_masked(index_t timestep, crvec xu, crvec h, crindexvec mask,
|
80
|
-
rmat S, rvec work) const;
|
81
|
-
void eval_add_R_prod_masked(index_t timestep, crvec xu, crvec h,
|
82
|
-
crindexvec mask_J, crindexvec mask_K, crvec v,
|
83
|
-
rvec out, rvec work) const;
|
84
|
-
void eval_add_S_prod_masked(index_t timestep, crvec xu, crvec h,
|
85
|
-
crindexvec mask_K, crvec v, rvec out,
|
86
|
-
rvec work) const;
|
87
|
-
[[nodiscard]] length_t get_R_work_size() const;
|
88
|
-
[[nodiscard]] length_t get_S_work_size() const;
|
89
|
-
void eval_constr(index_t timestep, crvec x, rvec c) const;
|
90
|
-
void eval_grad_constr_prod(index_t timestep, crvec x, crvec p,
|
91
|
-
rvec grad_cx_p) const;
|
92
|
-
void eval_add_gn_hess_constr(index_t timestep, crvec x, crvec M,
|
93
|
-
rmat out) const;
|
94
|
-
void eval_constr_N(crvec x, rvec c) const;
|
95
|
-
void eval_grad_constr_prod_N(crvec x, crvec p, rvec grad_cx_p) const;
|
96
|
-
void eval_add_gn_hess_constr_N(crvec x, crvec M, rmat out) const;
|
97
|
-
|
98
|
-
void check() const {
|
99
|
-
util::check_dim_msg<config_t>(U.lowerbound, nu,
|
100
|
-
"Length of problem.U.lowerbound does not "
|
101
|
-
"match problem size problem.nu");
|
102
|
-
util::check_dim_msg<config_t>(U.upperbound, nu,
|
103
|
-
"Length of problem.U.upperbound does not "
|
104
|
-
"match problem size problem.nu");
|
105
|
-
util::check_dim_msg<config_t>(D.lowerbound, nc,
|
106
|
-
"Length of problem.D.lowerbound does not "
|
107
|
-
"match problem size problem.nc");
|
108
|
-
util::check_dim_msg<config_t>(D.upperbound, nc,
|
109
|
-
"Length of problem.D.upperbound does not "
|
110
|
-
"match problem size problem.nc");
|
111
|
-
util::check_dim_msg<config_t>(D_N.lowerbound, nc_N,
|
112
|
-
"Length of problem.D_N.lowerbound does "
|
113
|
-
"not match problem size problem.nc_N");
|
114
|
-
util::check_dim_msg<config_t>(D_N.upperbound, nc_N,
|
115
|
-
"Length of problem.D_N.upperbound does "
|
116
|
-
"not match problem size problem.nc_N");
|
117
|
-
if (penalty_alm_split < 0 || penalty_alm_split > nc)
|
118
|
-
throw std::invalid_argument("Invalid penalty_alm_split");
|
119
|
-
if (penalty_alm_split_N < 0 || penalty_alm_split > nc_N)
|
120
|
-
throw std::invalid_argument("Invalid penalty_alm_split_N");
|
121
|
-
}
|
122
|
-
|
123
|
-
[[nodiscard]] length_t get_N() const { return N; }
|
124
|
-
[[nodiscard]] length_t get_nx() const { return nx; }
|
125
|
-
[[nodiscard]] length_t get_nu() const { return nu; }
|
126
|
-
[[nodiscard]] length_t get_nh() const { return nh; }
|
127
|
-
[[nodiscard]] length_t get_nh_N() const { return nh_N; }
|
128
|
-
[[nodiscard]] length_t get_nc() const { return nc; }
|
129
|
-
[[nodiscard]] length_t get_nc_N() const { return nc_N; }
|
130
|
-
|
131
|
-
/// @see @ref TypeErasedControlProblem::eval_proj_diff_g
|
132
|
-
void eval_proj_diff_g(crvec z, rvec e) const {
|
133
|
-
for (index_t t = 0; t < N; ++t)
|
134
|
-
e.segment(t * nc, nc) =
|
135
|
-
alpaqa::projecting_difference(z.segment(t * nc, nc), D);
|
136
|
-
e.segment(N * nc, nc_N) =
|
137
|
-
alpaqa::projecting_difference(z.segment(N * nc, nc_N), D_N);
|
138
|
-
}
|
139
|
-
/// @see @ref TypeErasedControlProblem::eval_proj_multipliers
|
140
|
-
void eval_proj_multipliers(rvec y, real_t M) const {
|
141
|
-
// If there's no lower bound, the multipliers can only be positive
|
142
|
-
auto max_lb = [M](real_t y, real_t z_lb) {
|
143
|
-
real_t y_lb = z_lb == -alpaqa::inf<config_t> ? 0 : -M;
|
144
|
-
return std::max(y, y_lb);
|
145
|
-
};
|
146
|
-
// If there's no upper bound, the multipliers can only be negative
|
147
|
-
auto min_ub = [M](real_t y, real_t z_ub) {
|
148
|
-
real_t y_ub = z_ub == alpaqa::inf<config_t> ? 0 : M;
|
149
|
-
return std::min(y, y_ub);
|
150
|
-
};
|
151
|
-
for (index_t t = 0; t < N; ++t) {
|
152
|
-
auto num_alm = nc - penalty_alm_split;
|
153
|
-
auto &&yt = y.segment(t * nc, nc);
|
154
|
-
auto &&y_qpm = yt.topRows(penalty_alm_split);
|
155
|
-
auto &&y_alm = yt.bottomRows(num_alm);
|
156
|
-
auto &&z_alm_lb = D.lowerbound.bottomRows(num_alm);
|
157
|
-
auto &&z_alm_ub = D.upperbound.bottomRows(num_alm);
|
158
|
-
y_qpm.setZero();
|
159
|
-
y_alm =
|
160
|
-
y_alm.binaryExpr(z_alm_lb, max_lb).binaryExpr(z_alm_ub, min_ub);
|
161
|
-
}
|
162
|
-
{
|
163
|
-
auto &&yt = y.segment(N * nc, nc_N);
|
164
|
-
auto num_alm = nc_N - penalty_alm_split_N;
|
165
|
-
auto &&y_qpm = yt.topRows(penalty_alm_split_N);
|
166
|
-
auto &&y_alm = yt.bottomRows(num_alm);
|
167
|
-
auto &&z_alm_lb = D.lowerbound.bottomRows(num_alm);
|
168
|
-
auto &&z_alm_ub = D.upperbound.bottomRows(num_alm);
|
169
|
-
y_qpm.setZero();
|
170
|
-
y_alm =
|
171
|
-
y_alm.binaryExpr(z_alm_lb, max_lb).binaryExpr(z_alm_ub, min_ub);
|
172
|
-
}
|
173
|
-
}
|
174
|
-
|
175
|
-
private:
|
176
|
-
using Functions = casadi_loader::CasADiControlFunctionsWithParam<Conf>;
|
177
|
-
util::copyable_unique_ptr<Functions> impl;
|
178
|
-
};
|
179
|
-
|
180
|
-
CASADI_OCP_LOADER_EXPORT_EXTERN_TEMPLATE(class, CasADiControlProblem,
|
181
|
-
EigenConfigd);
|
182
|
-
CASADI_OCP_LOADER_EXPORT_EXTERN_TEMPLATE(class, CasADiControlProblem,
|
183
|
-
DefaultConfig);
|
184
|
-
|
185
|
-
} // namespace alpaqa
|
@@ -1,104 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/config/config.hpp>
|
4
|
-
|
5
|
-
#include <stdexcept>
|
6
|
-
#include <string>
|
7
|
-
#include <vector>
|
8
|
-
|
9
|
-
#include <casadi/core/function.hpp>
|
10
|
-
#include <casadi/mem.h>
|
11
|
-
|
12
|
-
namespace alpaqa::casadi_loader {
|
13
|
-
|
14
|
-
/// Class for evaluating CasADi functions, allocating the necessary workspace
|
15
|
-
/// storage in advance for allocation-free evaluations.
|
16
|
-
template <Config Conf, size_t N_in, size_t N_out>
|
17
|
-
class CasADiFunctionEvaluator {
|
18
|
-
public:
|
19
|
-
USING_ALPAQA_CONFIG(Conf);
|
20
|
-
static_assert(std::is_same_v<real_t, casadi_real>);
|
21
|
-
|
22
|
-
using casadi_dim = std::pair<casadi_int, casadi_int>;
|
23
|
-
|
24
|
-
/// @throws std::invalid_argument
|
25
|
-
CasADiFunctionEvaluator(casadi::Function &&f)
|
26
|
-
: fun(std::move(f)), iwork(fun.sz_iw()), dwork(fun.sz_w()),
|
27
|
-
arg_work(fun.sz_arg()), res_work(fun.sz_res()) {
|
28
|
-
using namespace std::literals::string_literals;
|
29
|
-
if (N_in != fun.n_in())
|
30
|
-
throw std::invalid_argument(
|
31
|
-
"Invalid number of input arguments: got "s +
|
32
|
-
std::to_string(fun.n_in()) + ", should be " +
|
33
|
-
std::to_string(N_in) + ".");
|
34
|
-
if (N_out != fun.n_out())
|
35
|
-
throw std::invalid_argument(
|
36
|
-
"Invalid number of output arguments: got "s +
|
37
|
-
std::to_string(fun.n_out()) + ", should be " +
|
38
|
-
std::to_string(N_out) + ".");
|
39
|
-
}
|
40
|
-
|
41
|
-
/// @throws std::invalid_argument
|
42
|
-
CasADiFunctionEvaluator(casadi::Function &&f,
|
43
|
-
const std::array<casadi_dim, N_in> &dim_in,
|
44
|
-
const std::array<casadi_dim, N_out> &dim_out)
|
45
|
-
: CasADiFunctionEvaluator{std::move(f)} {
|
46
|
-
validate_dimensions(dim_in, dim_out);
|
47
|
-
}
|
48
|
-
|
49
|
-
/// @throws std::invalid_argument
|
50
|
-
void
|
51
|
-
validate_dimensions(const std::array<casadi_dim, N_in> &dim_in = {},
|
52
|
-
const std::array<casadi_dim, N_out> &dim_out = {}) {
|
53
|
-
using namespace std::literals::string_literals;
|
54
|
-
static constexpr std::array count{"first", "second", "third",
|
55
|
-
"fourth", "fifth", "sixth",
|
56
|
-
"seventh", "eighth"};
|
57
|
-
static_assert(N_in <= count.size());
|
58
|
-
static_assert(N_out <= count.size());
|
59
|
-
auto to_string = [](casadi_dim d) {
|
60
|
-
return "(" + std::to_string(d.first) + ", " +
|
61
|
-
std::to_string(d.second) + ")";
|
62
|
-
};
|
63
|
-
for (size_t n = 0; n < N_in; ++n) {
|
64
|
-
auto cs_n = static_cast<casadi_int>(n);
|
65
|
-
if (dim_in[n].first != 0 && dim_in[n] != fun.size_in(cs_n))
|
66
|
-
throw std::invalid_argument(
|
67
|
-
"Invalid dimension of "s + count[n] +
|
68
|
-
" input argument: got " + to_string(fun.size_in(cs_n)) +
|
69
|
-
", should be " + to_string(dim_in[n]) + ".");
|
70
|
-
}
|
71
|
-
for (size_t n = 0; n < N_out; ++n) {
|
72
|
-
auto cs_n = static_cast<casadi_int>(n);
|
73
|
-
if (dim_out[n].first != 0 && dim_out[n] != fun.size_out(cs_n))
|
74
|
-
throw std::invalid_argument(
|
75
|
-
"Invalid dimension of "s + count[n] +
|
76
|
-
" output argument: got " + to_string(fun.size_out(cs_n)) +
|
77
|
-
", should be " + to_string(dim_out[n]) + ".");
|
78
|
-
}
|
79
|
-
}
|
80
|
-
|
81
|
-
protected:
|
82
|
-
void operator()(const double *const *in, double *const *out) const {
|
83
|
-
std::copy_n(in, N_in, arg_work.begin());
|
84
|
-
std::copy_n(out, N_out, res_work.begin());
|
85
|
-
fun(arg_work.data(), res_work.data(), iwork.data(), dwork.data(), 0);
|
86
|
-
}
|
87
|
-
|
88
|
-
public:
|
89
|
-
void operator()(const double *const (&in)[N_in],
|
90
|
-
double *const (&out)[N_out]) const {
|
91
|
-
this->operator()(&in[0], &out[0]);
|
92
|
-
}
|
93
|
-
|
94
|
-
public:
|
95
|
-
casadi::Function fun;
|
96
|
-
|
97
|
-
private:
|
98
|
-
mutable std::vector<casadi_int> iwork;
|
99
|
-
mutable std::vector<double> dwork;
|
100
|
-
mutable std::vector<const double *> arg_work;
|
101
|
-
mutable std::vector<double *> res_work;
|
102
|
-
};
|
103
|
-
|
104
|
-
} // namespace alpaqa::casadi_loader
|
@@ -1,102 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/casadi-loader-export.hpp>
|
4
|
-
#include <alpaqa/config/config.hpp>
|
5
|
-
#include <alpaqa/problem/box-constr-problem.hpp>
|
6
|
-
#include <alpaqa/util/copyable_unique_ptr.hpp>
|
7
|
-
#include <filesystem>
|
8
|
-
|
9
|
-
namespace alpaqa {
|
10
|
-
namespace casadi_loader {
|
11
|
-
template <Config>
|
12
|
-
struct CasADiFunctionsWithParam;
|
13
|
-
} // namespace casadi_loader
|
14
|
-
|
15
|
-
/// Problem definition for a CasADi problem, loaded from a DLL.
|
16
|
-
/// @ingroup grp_Problems
|
17
|
-
template <Config Conf = DefaultConfig>
|
18
|
-
class CasADiProblem : public BoxConstrProblem<Conf> {
|
19
|
-
public:
|
20
|
-
USING_ALPAQA_CONFIG(Conf);
|
21
|
-
vec param;
|
22
|
-
|
23
|
-
/// Load a problem generated by CasADi (with parameters).
|
24
|
-
///
|
25
|
-
/// @param filename
|
26
|
-
/// Filename of the shared library to load the functions from.
|
27
|
-
///
|
28
|
-
/// The file should contain functions with the names `f`, `grad_f`, `g` and
|
29
|
-
/// `grad_g`. These functions evaluate the objective function, its gradient,
|
30
|
-
/// the constraints, and the constraint gradient times a vector respectively.
|
31
|
-
/// For second order solvers, additional functions `hess_L`, `hess_ψ`,
|
32
|
-
/// `hess_L_prod` and `hess_ψ_prod` can be provided to evaluate the
|
33
|
-
/// Hessian of the (augmented) Lagrangian and Hessian-vector products.
|
34
|
-
///
|
35
|
-
/// @throws std::invalid_argument
|
36
|
-
/// The dimensions of the loaded functions do not match.
|
37
|
-
CasADiProblem(const std::string &filename);
|
38
|
-
~CasADiProblem();
|
39
|
-
|
40
|
-
CasADiProblem(const CasADiProblem &);
|
41
|
-
CasADiProblem &operator=(const CasADiProblem &);
|
42
|
-
CasADiProblem(CasADiProblem &&) noexcept;
|
43
|
-
CasADiProblem &operator=(CasADiProblem &&) noexcept;
|
44
|
-
|
45
|
-
/// Load the numerical problem data (bounds and parameters) from a CSV file.
|
46
|
-
/// The file should contain 7 rows, with the following contents:
|
47
|
-
/// 1. @ref C lower bound [n]
|
48
|
-
/// 2. @ref C upper bound [n]
|
49
|
-
/// 3. @ref D lower bound [m]
|
50
|
-
/// 4. @ref D upper bound [m]
|
51
|
-
/// 5. @ref param [p]
|
52
|
-
/// 6. @ref l1_reg [0, 1 or n]
|
53
|
-
/// 7. @ref penalty_alm_split [1]
|
54
|
-
///
|
55
|
-
/// Line endings are encoded using a single line feed (`\n`), and the column
|
56
|
-
/// separator can be specified using the @p sep argument.
|
57
|
-
void load_numerical_data(const std::filesystem::path &filepath,
|
58
|
-
char sep = ',');
|
59
|
-
|
60
|
-
// clang-format off
|
61
|
-
[[nodiscard]] real_t eval_f(crvec x) const;
|
62
|
-
void eval_grad_f(crvec x, rvec grad_fx) const;
|
63
|
-
real_t eval_f_grad_f(crvec x, rvec grad_fx) const; // NOLINT(*nodiscard)
|
64
|
-
void eval_g(crvec x, rvec g) const;
|
65
|
-
void eval_grad_g_prod(crvec x, crvec y, rvec grad_gxy) const;
|
66
|
-
void eval_grad_ψ(crvec x, crvec y, crvec Σ, rvec grad_ψ, rvec work_n, rvec work_m) const;
|
67
|
-
real_t eval_ψ_grad_ψ(crvec x, crvec y, crvec Σ, rvec grad_ψ, rvec work_n, rvec work_m) const; // NOLINT(*nodiscard)
|
68
|
-
void eval_grad_L(crvec x, crvec y, rvec grad_L, rvec work_n) const;
|
69
|
-
[[nodiscard]] real_t eval_ψ(crvec x, crvec y, crvec Σ, rvec ŷ) const;
|
70
|
-
void eval_grad_gi(crvec x, index_t i, rvec grad_i) const;
|
71
|
-
[[nodiscard]] length_t get_jac_g_num_nonzeros() const;
|
72
|
-
void eval_jac_g(crvec x, rindexvec inner_idx, rindexvec outer_ptr, rvec J_values) const;
|
73
|
-
void eval_hess_L_prod(crvec x, crvec y, real_t scale, crvec v, rvec Hv) const;
|
74
|
-
[[nodiscard]] length_t get_hess_L_num_nonzeros() const;
|
75
|
-
void eval_hess_L(crvec x, crvec y, real_t scale, rindexvec inner_idx, rindexvec outer_ptr, rvec H_values) const;
|
76
|
-
void eval_hess_ψ_prod(crvec x, crvec y, crvec Σ, real_t scale, crvec v, rvec Hv) const;
|
77
|
-
[[nodiscard]] length_t get_hess_ψ_num_nonzeros() const;
|
78
|
-
void eval_hess_ψ(crvec x, crvec y, crvec Σ, real_t scale, rindexvec inner_idx, rindexvec outer_ptr, rvec H_values) const;
|
79
|
-
// clang-format on
|
80
|
-
|
81
|
-
/// @see @ref TypeErasedProblem::provides_eval_grad_gi
|
82
|
-
[[nodiscard]] bool provides_eval_grad_gi() const;
|
83
|
-
/// @see @ref TypeErasedProblem::provides_eval_jac_g
|
84
|
-
[[nodiscard]] bool provides_eval_jac_g() const;
|
85
|
-
/// @see @ref TypeErasedProblem::provides_eval_hess_L_prod
|
86
|
-
[[nodiscard]] bool provides_eval_hess_L_prod() const;
|
87
|
-
/// @see @ref TypeErasedProblem::provides_eval_hess_L
|
88
|
-
[[nodiscard]] bool provides_eval_hess_L() const;
|
89
|
-
/// @see @ref TypeErasedProblem::provides_eval_hess_ψ_prod
|
90
|
-
[[nodiscard]] bool provides_eval_hess_ψ_prod() const;
|
91
|
-
/// @see @ref TypeErasedProblem::provides_eval_hess_ψ
|
92
|
-
[[nodiscard]] bool provides_eval_hess_ψ() const;
|
93
|
-
|
94
|
-
private:
|
95
|
-
using Functions = casadi_loader::CasADiFunctionsWithParam<Conf>;
|
96
|
-
util::copyable_unique_ptr<Functions> impl;
|
97
|
-
};
|
98
|
-
|
99
|
-
CASADI_LOADER_EXPORT_EXTERN_TEMPLATE(class, CasADiProblem, EigenConfigd);
|
100
|
-
CASADI_LOADER_EXPORT_EXTERN_TEMPLATE(class, CasADiProblem, DefaultConfig);
|
101
|
-
|
102
|
-
} // namespace alpaqa
|
@@ -1,15 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/casadi-loader-export.h>
|
4
|
-
|
5
|
-
#ifdef _WIN32
|
6
|
-
#define CASADI_LOADER_EXPORT_EXTERN_TEMPLATE(strcls, name, ...) \
|
7
|
-
extern template strcls name<__VA_ARGS__>
|
8
|
-
#define CASADI_LOADER_EXPORT_TEMPLATE(strcls, name, ...) \
|
9
|
-
template strcls CASADI_LOADER_EXPORT name<__VA_ARGS__>
|
10
|
-
#else
|
11
|
-
#define CASADI_LOADER_EXPORT_EXTERN_TEMPLATE(strcls, name, ...) \
|
12
|
-
extern template strcls CASADI_LOADER_EXPORT name<__VA_ARGS__>
|
13
|
-
#define CASADI_LOADER_EXPORT_TEMPLATE(strcls, name, ...) \
|
14
|
-
template strcls name<__VA_ARGS__>
|
15
|
-
#endif
|
@@ -1,15 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/casadi-ocp-loader-export.h>
|
4
|
-
|
5
|
-
#ifdef _WIN32
|
6
|
-
#define CASADI_OCP_LOADER_EXPORT_EXTERN_TEMPLATE(strcls, name, ...) \
|
7
|
-
extern template strcls name<__VA_ARGS__>
|
8
|
-
#define CASADI_OCP_LOADER_EXPORT_TEMPLATE(strcls, name, ...) \
|
9
|
-
template strcls CASADI_OCP_LOADER_EXPORT name<__VA_ARGS__>
|
10
|
-
#else
|
11
|
-
#define CASADI_OCP_LOADER_EXPORT_EXTERN_TEMPLATE(strcls, name, ...) \
|
12
|
-
extern template strcls CASADI_OCP_LOADER_EXPORT name<__VA_ARGS__>
|
13
|
-
#define CASADI_OCP_LOADER_EXPORT_TEMPLATE(strcls, name, ...) \
|
14
|
-
template strcls name<__VA_ARGS__>
|
15
|
-
#endif
|
@@ -1,165 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/util/quadmath/quadmath.hpp>
|
4
|
-
|
5
|
-
#include <limits>
|
6
|
-
#include <type_traits>
|
7
|
-
|
8
|
-
#include <Eigen/Core>
|
9
|
-
|
10
|
-
namespace alpaqa {
|
11
|
-
|
12
|
-
template <class T>
|
13
|
-
struct is_config : std::false_type {};
|
14
|
-
template <class T>
|
15
|
-
inline constexpr bool is_config_v = is_config<T>::value;
|
16
|
-
|
17
|
-
template <class Conf>
|
18
|
-
concept Config = is_config_v<Conf>;
|
19
|
-
|
20
|
-
struct DefaultConfig;
|
21
|
-
template <>
|
22
|
-
struct is_config<DefaultConfig> : std::true_type {};
|
23
|
-
|
24
|
-
#define USING_ALPAQA_CONFIG_NO_TYPENAME(Conf) \
|
25
|
-
using real_t [[maybe_unused]] = Conf::real_t; \
|
26
|
-
using vec [[maybe_unused]] = Conf::vec; \
|
27
|
-
using mvec [[maybe_unused]] = Conf::mvec; \
|
28
|
-
using cmvec [[maybe_unused]] = Conf::cmvec; \
|
29
|
-
using rvec [[maybe_unused]] = Conf::rvec; \
|
30
|
-
using crvec [[maybe_unused]] = Conf::crvec; \
|
31
|
-
using mat [[maybe_unused]] = Conf::mat; \
|
32
|
-
using mmat [[maybe_unused]] = Conf::mmat; \
|
33
|
-
using cmmat [[maybe_unused]] = Conf::cmmat; \
|
34
|
-
using rmat [[maybe_unused]] = Conf::rmat; \
|
35
|
-
using crmat [[maybe_unused]] = Conf::crmat; \
|
36
|
-
using length_t [[maybe_unused]] = Conf::length_t; \
|
37
|
-
using index_t [[maybe_unused]] = Conf::index_t; \
|
38
|
-
using indexvec [[maybe_unused]] = Conf::indexvec; \
|
39
|
-
using rindexvec [[maybe_unused]] = Conf::rindexvec; \
|
40
|
-
using crindexvec [[maybe_unused]] = Conf::crindexvec
|
41
|
-
|
42
|
-
#define USING_ALPAQA_CONFIG(Conf) /** @cond CONFIG_TYPES */ \
|
43
|
-
using config_t [[maybe_unused]] = Conf; \
|
44
|
-
USING_ALPAQA_CONFIG_NO_TYPENAME(typename Conf) /** @endcond */
|
45
|
-
|
46
|
-
#define USING_ALPAQA_CONFIG_TEMPLATE(Conf) /** @cond CONFIG_TYPES */ \
|
47
|
-
using config_t [[maybe_unused]] = typename Conf; \
|
48
|
-
USING_ALPAQA_CONFIG_NO_TYPENAME(typename Conf) /** @endcond */
|
49
|
-
|
50
|
-
// clang-format off
|
51
|
-
template <Config Conf = DefaultConfig> using real_t = typename Conf::real_t;
|
52
|
-
template <Config Conf = DefaultConfig> using vec = typename Conf::vec;
|
53
|
-
template <Config Conf = DefaultConfig> using mvec = typename Conf::mvec;
|
54
|
-
template <Config Conf = DefaultConfig> using cmvec = typename Conf::cmvec;
|
55
|
-
template <Config Conf = DefaultConfig> using rvec = typename Conf::rvec;
|
56
|
-
template <Config Conf = DefaultConfig> using crvec = typename Conf::crvec;
|
57
|
-
template <Config Conf = DefaultConfig> using mat = typename Conf::mat;
|
58
|
-
template <Config Conf = DefaultConfig> using mmat = typename Conf::mmat;
|
59
|
-
template <Config Conf = DefaultConfig> using cmmat = typename Conf::cmmat;
|
60
|
-
template <Config Conf = DefaultConfig> using rmat = typename Conf::rmat;
|
61
|
-
template <Config Conf = DefaultConfig> using crmat = typename Conf::crmat;
|
62
|
-
template <Config Conf = DefaultConfig> using length_t = typename Conf::length_t;
|
63
|
-
template <Config Conf = DefaultConfig> using index_t = typename Conf::index_t;
|
64
|
-
template <Config Conf = DefaultConfig> using indexvec = typename Conf::indexvec;
|
65
|
-
template <Config Conf = DefaultConfig> using rindexvec = typename Conf::rindexvec;
|
66
|
-
template <Config Conf = DefaultConfig> using crindexvec = typename Conf::crindexvec;
|
67
|
-
|
68
|
-
template <Config Conf>
|
69
|
-
constexpr const auto inf = std::numeric_limits<real_t<Conf>>::infinity();
|
70
|
-
template <Config Conf>
|
71
|
-
constexpr const auto NaN = std::numeric_limits<real_t<Conf>>::quiet_NaN();
|
72
|
-
// clang-format on
|
73
|
-
|
74
|
-
template <class RealT>
|
75
|
-
struct EigenConfig {
|
76
|
-
/// Real scalar element type.
|
77
|
-
using real_t = RealT;
|
78
|
-
/// Dynamic vector type.
|
79
|
-
using vec = Eigen::VectorX<real_t>;
|
80
|
-
/// Map of vector type.
|
81
|
-
using mvec = Eigen::Map<vec>;
|
82
|
-
/// Immutable map of vector type.
|
83
|
-
using cmvec = Eigen::Map<const vec>;
|
84
|
-
/// Reference to mutable vector.
|
85
|
-
using rvec = Eigen::Ref<vec>;
|
86
|
-
/// Reference to immutable vector.
|
87
|
-
using crvec = Eigen::Ref<const vec>;
|
88
|
-
/// Dynamic matrix type.
|
89
|
-
using mat = Eigen::MatrixX<real_t>;
|
90
|
-
/// Map of matrix type.
|
91
|
-
using mmat = Eigen::Map<mat>;
|
92
|
-
/// Immutable map of matrix type.
|
93
|
-
using cmmat = Eigen::Map<const mat>;
|
94
|
-
/// Reference to mutable matrix.
|
95
|
-
using rmat = Eigen::Ref<mat>;
|
96
|
-
/// Reference to immutable matrix.
|
97
|
-
using crmat = Eigen::Ref<const mat>;
|
98
|
-
/// Type for lengths and sizes.
|
99
|
-
using length_t = Eigen::Index;
|
100
|
-
/// Type for vector and matrix indices.
|
101
|
-
using index_t = Eigen::Index;
|
102
|
-
/// Dynamic vector of indices.
|
103
|
-
using indexvec = Eigen::VectorX<index_t>;
|
104
|
-
/// Reference to mutable index vector.
|
105
|
-
using rindexvec = Eigen::Ref<indexvec>;
|
106
|
-
/// Reference to immutable index vector.
|
107
|
-
using crindexvec = Eigen::Ref<const indexvec>;
|
108
|
-
};
|
109
|
-
|
110
|
-
/// Single-precision `float` configuration.
|
111
|
-
struct EigenConfigf : EigenConfig<float> {
|
112
|
-
static constexpr const char *get_name() { return "EigenConfigf"; }
|
113
|
-
};
|
114
|
-
/// Double-precision `double` configuration.
|
115
|
-
struct EigenConfigd : EigenConfig<double> {
|
116
|
-
static constexpr const char *get_name() { return "EigenConfigd"; }
|
117
|
-
};
|
118
|
-
/// `long double` configuration. (Quad precision on ARM64, 80-bit x87 floats
|
119
|
-
/// on Intel/AMD x86)
|
120
|
-
struct EigenConfigl : EigenConfig<long double> {
|
121
|
-
static constexpr const char *get_name() { return "EigenConfigl"; }
|
122
|
-
};
|
123
|
-
#ifdef ALPAQA_WITH_QUAD_PRECISION
|
124
|
-
/// Quad-precision `__float128` configuration.
|
125
|
-
struct EigenConfigq : EigenConfig<__float128> {
|
126
|
-
static constexpr const char *get_name() { return "EigenConfigq"; }
|
127
|
-
};
|
128
|
-
template <>
|
129
|
-
struct is_config<EigenConfigq> : std::true_type {};
|
130
|
-
#endif
|
131
|
-
|
132
|
-
struct DefaultConfig : EigenConfigd {};
|
133
|
-
|
134
|
-
template <>
|
135
|
-
struct is_config<EigenConfigf> : std::true_type {};
|
136
|
-
template <>
|
137
|
-
struct is_config<EigenConfigd> : std::true_type {};
|
138
|
-
template <>
|
139
|
-
struct is_config<EigenConfigl> : std::true_type {};
|
140
|
-
|
141
|
-
/// Global empty vector for convenience.
|
142
|
-
template <Config Conf>
|
143
|
-
inline const rvec<Conf> null_vec = mvec<Conf>{nullptr, 0};
|
144
|
-
|
145
|
-
namespace vec_util {
|
146
|
-
|
147
|
-
/// Get the maximum or infinity-norm of the given vector.
|
148
|
-
/// @returns @f$ \left\|v\right\|_\infty @f$
|
149
|
-
template <class Derived>
|
150
|
-
requires(Derived::ColsAtCompileTime == 1)
|
151
|
-
auto norm_inf(const Eigen::MatrixBase<Derived> &v) {
|
152
|
-
return v.template lpNorm<Eigen::Infinity>();
|
153
|
-
}
|
154
|
-
|
155
|
-
/// Get the 1-norm of the given vector.
|
156
|
-
/// @returns @f$ \left\|v\right\|_1 @f$
|
157
|
-
template <class Derived>
|
158
|
-
requires(Derived::ColsAtCompileTime == 1)
|
159
|
-
auto norm_1(const Eigen::MatrixBase<Derived> &v) {
|
160
|
-
return v.template lpNorm<1>();
|
161
|
-
}
|
162
|
-
|
163
|
-
} // namespace vec_util
|
164
|
-
|
165
|
-
} // namespace alpaqa
|