casadi 3.6.5__cp39-none-macosx_11_0_arm64.whl → 3.6.7__cp39-none-macosx_11_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (649) hide show
  1. casadi/_casadi.so +0 -0
  2. casadi/casadi-cli +0 -0
  3. casadi/casadi.py +739 -308
  4. casadi/cbc +0 -0
  5. casadi/clp +0 -0
  6. casadi/cmake/casadi-config-version.cmake +1 -1
  7. casadi/cmake/casadi-targets.cmake +10 -6
  8. casadi/cmake/highs/highs-config.cmake +6 -13
  9. casadi/cmake/highs/highs-targets-release.cmake +13 -13
  10. casadi/cmake/highs/highs-targets.cmake +25 -22
  11. casadi/cmake/osqp/osqp-targets.cmake +10 -6
  12. casadi/cmake/proxsuite/proxsuiteConfigVersion.cmake +0 -5
  13. casadi/cmake/proxsuite/proxsuiteTargets.cmake +12 -12
  14. casadi/cmake/qdldl/qdldl-targets.cmake +10 -6
  15. casadi/cmake/sleqp/sleqp-config-version.cmake +0 -5
  16. casadi/cmake/sleqp/sleqp-targets.cmake +10 -6
  17. casadi/cmake/trlib/trlib-config-release.cmake +1 -1
  18. casadi/cmake/trlib/trlib-config-version.cmake +0 -5
  19. casadi/cmake/trlib/trlib-config.cmake +12 -12
  20. casadi/highs +0 -0
  21. casadi/include/casadi/casadi.i +3 -0
  22. casadi/include/casadi/casadi_c.h +2 -0
  23. casadi/include/casadi/config.h +9 -9
  24. casadi/include/casadi/core/casadi_common.hpp +1 -0
  25. casadi/include/casadi/core/casadi_export.h +1 -0
  26. casadi/include/casadi/core/casadi_misc.hpp +52 -0
  27. casadi/include/casadi/core/casadi_types.hpp +3 -2
  28. casadi/include/casadi/core/code_generator.hpp +30 -1
  29. casadi/include/casadi/core/global_options.hpp +2 -0
  30. casadi/include/casadi/core/mx.hpp +18 -3
  31. casadi/include/casadi/core/optistack.hpp +23 -0
  32. casadi/include/casadi/core/runtime/casadi_nlp.hpp +19 -4
  33. casadi/include/casadi/core/runtime/casadi_ocp_block.hpp +55 -0
  34. casadi/include/casadi/core/runtime/casadi_oracle.hpp +44 -0
  35. casadi/include/casadi/core/runtime/casadi_oracle_callback.hpp +39 -0
  36. casadi/include/casadi/core/runtime/casadi_runtime.hpp +4 -1
  37. casadi/include/casadi/core/runtime/casadi_scaled_copy.hpp +31 -0
  38. casadi/include/casadi/core/serializing_stream.hpp +2 -2
  39. casadi/include/casadi/core/sparsity.hpp +7 -0
  40. casadi/include/casadi/doc.i +1513 -1016
  41. casadi/include/casadi/doc_merged.i +965 -719
  42. casadi/include/casadi/mem.h +1 -0
  43. casadi/include/daqp/api.h +46 -0
  44. casadi/include/daqp/auxiliary.h +29 -0
  45. casadi/include/daqp/bnb.h +32 -0
  46. casadi/include/daqp/codegen.h +18 -0
  47. casadi/include/daqp/constants.h +92 -0
  48. casadi/include/daqp/daqp.h +22 -0
  49. casadi/include/daqp/daqp_prox.h +18 -0
  50. casadi/include/daqp/factorization.h +18 -0
  51. casadi/include/daqp/types.h +161 -0
  52. casadi/include/daqp/utils.h +44 -0
  53. casadi/include/fatrop/auxiliary/Common.hpp +34 -0
  54. casadi/include/fatrop/auxiliary/DynamicLib.hpp +34 -0
  55. casadi/include/fatrop/auxiliary/FatropOptions.hpp +68 -0
  56. casadi/include/fatrop/auxiliary/FatropVector.hpp +143 -0
  57. casadi/include/fatrop/auxiliary/LinearAlgebra.hpp +88 -0
  58. casadi/include/fatrop/auxiliary/VectorUtils.hpp +54 -0
  59. casadi/include/fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp +493 -0
  60. casadi/include/fatrop/fatrop.hpp +39 -0
  61. casadi/include/fatrop/function_evaluation/CasadiCodegen.hpp +104 -0
  62. casadi/include/fatrop/function_evaluation/FunctionEvaluation.hpp +60 -0
  63. casadi/include/fatrop/json/json.h +946 -0
  64. casadi/include/fatrop/ocp/CasadiCApiUserdataWrap.hpp +87 -0
  65. casadi/include/fatrop/ocp/DuInfEvaluator.hpp +38 -0
  66. casadi/include/fatrop/ocp/FatropOCP.hpp +161 -0
  67. casadi/include/fatrop/ocp/FatropOCPBuilder.hpp +52 -0
  68. casadi/include/fatrop/ocp/FatropOCPResto.hpp +299 -0
  69. casadi/include/fatrop/ocp/OCP.hpp +82 -0
  70. casadi/include/fatrop/ocp/OCPAbstract.hpp +254 -0
  71. casadi/include/fatrop/ocp/OCPAdapter.hpp +197 -0
  72. casadi/include/fatrop/ocp/OCPCInterface.h +289 -0
  73. casadi/include/fatrop/ocp/OCPDims.hpp +60 -0
  74. casadi/include/fatrop/ocp/OCPInitializer.hpp +41 -0
  75. casadi/include/fatrop/ocp/OCPKKT.hpp +69 -0
  76. casadi/include/fatrop/ocp/OCPLSRiccati.hpp +198 -0
  77. casadi/include/fatrop/ocp/OCPLSScaler.hpp +66 -0
  78. casadi/include/fatrop/ocp/OCPLinearSolver.hpp +75 -0
  79. casadi/include/fatrop/ocp/OCPNoScaling.hpp +42 -0
  80. casadi/include/fatrop/ocp/OCPScalingMethod.hpp +42 -0
  81. casadi/include/fatrop/ocp/StageOCP.hpp +592 -0
  82. casadi/include/fatrop/ocp/StageOCPApplication.hpp +242 -0
  83. casadi/include/fatrop/ocp/StageOCPExpressions.hpp +182 -0
  84. casadi/include/fatrop/ocp/UStageEvalAbstract.hpp +168 -0
  85. casadi/include/fatrop/ocp/UStageOCPImpl.hpp +152 -0
  86. casadi/include/fatrop/quasi_newton/bfgs.hpp +159 -0
  87. casadi/include/fatrop/solver/AlgBuilder.hpp +76 -0
  88. casadi/include/fatrop/solver/AlgStrategy.hpp +33 -0
  89. casadi/include/fatrop/solver/FatropAlg.hpp +121 -0
  90. casadi/include/fatrop/solver/FatropData.hpp +188 -0
  91. casadi/include/fatrop/solver/FatropOptions.hpp +95 -0
  92. casadi/include/fatrop/solver/FatropPrinter.hpp +65 -0
  93. casadi/include/fatrop/solver/FatropStats.hpp +63 -0
  94. casadi/include/fatrop/solver/Filter.hpp +54 -0
  95. casadi/include/fatrop/solver/IterationData.hpp +56 -0
  96. casadi/include/fatrop/solver/LineSearch.hpp +86 -0
  97. casadi/include/fatrop/solver/NLPL1.hpp +263 -0
  98. casadi/include/fatrop/templates/NLPAlg.hpp +104 -0
  99. casadi/include/highs/HConfig.h +8 -7
  100. casadi/include/highs/Highs.h +93 -23
  101. casadi/include/highs/filereaderlp/def.hpp +19 -0
  102. casadi/include/highs/interfaces/highs_c_api.h +200 -24
  103. casadi/include/highs/io/Filereader.h +1 -1
  104. casadi/include/highs/io/FilereaderEms.h +1 -1
  105. casadi/include/highs/io/FilereaderLp.h +1 -1
  106. casadi/include/highs/io/FilereaderMps.h +1 -1
  107. casadi/include/highs/io/HMPSIO.h +1 -1
  108. casadi/include/highs/io/HMpsFF.h +5 -3
  109. casadi/include/highs/io/HighsIO.h +18 -8
  110. casadi/include/highs/io/LoadOptions.h +1 -1
  111. casadi/include/highs/ipm/IpxSolution.h +35 -0
  112. casadi/include/highs/ipm/IpxWrapper.h +1 -1
  113. casadi/include/highs/ipm/basiclu/basiclu.h +161 -0
  114. casadi/include/highs/ipm/basiclu/basiclu_factorize.h +247 -0
  115. casadi/include/highs/ipm/basiclu/basiclu_get_factors.h +108 -0
  116. casadi/include/highs/ipm/basiclu/basiclu_initialize.h +119 -0
  117. casadi/include/highs/ipm/basiclu/basiclu_obj_factorize.h +34 -0
  118. casadi/include/highs/ipm/basiclu/basiclu_obj_free.h +19 -0
  119. casadi/include/highs/ipm/basiclu/basiclu_obj_get_factors.h +34 -0
  120. casadi/include/highs/ipm/basiclu/basiclu_obj_initialize.h +46 -0
  121. casadi/include/highs/ipm/basiclu/basiclu_obj_solve_dense.h +29 -0
  122. casadi/include/highs/ipm/basiclu/basiclu_obj_solve_for_update.h +42 -0
  123. casadi/include/highs/ipm/basiclu/basiclu_obj_solve_sparse.h +32 -0
  124. casadi/include/highs/ipm/basiclu/basiclu_obj_update.h +31 -0
  125. casadi/include/highs/ipm/basiclu/basiclu_object.h +30 -0
  126. casadi/include/highs/ipm/basiclu/basiclu_solve_dense.h +75 -0
  127. casadi/include/highs/ipm/basiclu/basiclu_solve_for_update.h +169 -0
  128. casadi/include/highs/ipm/basiclu/basiclu_solve_sparse.h +112 -0
  129. casadi/include/highs/ipm/basiclu/basiclu_update.h +125 -0
  130. casadi/include/highs/ipm/basiclu/lu_def.h +39 -0
  131. casadi/include/highs/ipm/basiclu/lu_file.h +21 -0
  132. casadi/include/highs/ipm/basiclu/lu_internal.h +220 -0
  133. casadi/include/highs/ipm/basiclu/lu_list.h +168 -0
  134. casadi/include/highs/ipm/ipx/basiclu_kernel.h +20 -0
  135. casadi/include/highs/ipm/ipx/basiclu_wrapper.h +47 -0
  136. casadi/include/highs/ipm/ipx/basis.h +351 -0
  137. casadi/include/highs/ipm/ipx/conjugate_residuals.h +74 -0
  138. casadi/include/highs/ipm/ipx/control.h +163 -0
  139. casadi/include/highs/ipm/ipx/crossover.h +157 -0
  140. casadi/include/highs/ipm/ipx/diagonal_precond.h +45 -0
  141. casadi/include/highs/ipm/ipx/forrest_tomlin.h +102 -0
  142. casadi/include/highs/ipm/ipx/guess_basis.h +21 -0
  143. casadi/include/highs/ipm/ipx/indexed_vector.h +113 -0
  144. casadi/include/highs/ipm/ipx/info.h +27 -0
  145. casadi/include/highs/ipm/ipx/ipm.h +94 -0
  146. casadi/include/highs/ipm/ipx/ipx_c.h +47 -0
  147. casadi/include/highs/ipm/ipx/ipx_config.h +9 -0
  148. casadi/include/highs/ipm/ipx/ipx_info.h +111 -0
  149. casadi/include/highs/ipm/ipx/ipx_internal.h +88 -0
  150. casadi/include/highs/ipm/ipx/ipx_parameters.h +75 -0
  151. casadi/include/highs/ipm/ipx/ipx_status.h +57 -0
  152. casadi/include/highs/ipm/ipx/iterate.h +328 -0
  153. casadi/include/highs/ipm/ipx/kkt_solver.h +70 -0
  154. casadi/include/highs/ipm/ipx/kkt_solver_basis.h +66 -0
  155. casadi/include/highs/ipm/ipx/kkt_solver_diag.h +48 -0
  156. casadi/include/highs/ipm/ipx/linear_operator.h +26 -0
  157. casadi/include/highs/ipm/ipx/lp_solver.h +201 -0
  158. casadi/include/highs/ipm/ipx/lu_factorization.h +79 -0
  159. casadi/include/highs/ipm/ipx/lu_update.h +129 -0
  160. casadi/include/highs/ipm/ipx/maxvolume.h +54 -0
  161. casadi/include/highs/ipm/ipx/model.h +409 -0
  162. casadi/include/highs/ipm/ipx/multistream.h +52 -0
  163. casadi/include/highs/ipm/ipx/normal_matrix.h +44 -0
  164. casadi/include/highs/ipm/ipx/power_method.h +44 -0
  165. casadi/include/highs/ipm/ipx/sparse_matrix.h +195 -0
  166. casadi/include/highs/ipm/ipx/sparse_utils.h +58 -0
  167. casadi/include/highs/ipm/ipx/splitted_normal_matrix.h +63 -0
  168. casadi/include/highs/ipm/ipx/starting_basis.h +39 -0
  169. casadi/include/highs/ipm/ipx/symbolic_invert.h +29 -0
  170. casadi/include/highs/ipm/ipx/timer.h +24 -0
  171. casadi/include/highs/ipm/ipx/utils.h +39 -0
  172. casadi/include/highs/lp_data/HConst.h +20 -10
  173. casadi/include/highs/lp_data/HStruct.h +23 -1
  174. casadi/include/highs/lp_data/HighsAnalysis.h +1 -1
  175. casadi/include/highs/lp_data/HighsCallback.h +10 -3
  176. casadi/include/highs/lp_data/HighsCallbackStruct.h +31 -5
  177. casadi/include/highs/lp_data/HighsDebug.h +1 -1
  178. casadi/include/highs/lp_data/HighsInfo.h +20 -2
  179. casadi/include/highs/lp_data/HighsInfoDebug.h +1 -1
  180. casadi/include/highs/lp_data/HighsLp.h +17 -1
  181. casadi/include/highs/lp_data/HighsLpSolverObject.h +1 -1
  182. casadi/include/highs/lp_data/HighsLpUtils.h +19 -19
  183. casadi/include/highs/lp_data/HighsModelUtils.h +1 -1
  184. casadi/include/highs/lp_data/HighsOptions.h +237 -10
  185. casadi/include/highs/lp_data/HighsRanging.h +1 -1
  186. casadi/include/highs/lp_data/HighsRuntimeOptions.h +2 -2
  187. casadi/include/highs/lp_data/HighsSolution.h +2 -2
  188. casadi/include/highs/lp_data/HighsSolutionDebug.h +1 -1
  189. casadi/include/highs/lp_data/HighsSolve.h +3 -1
  190. casadi/include/highs/lp_data/HighsStatus.h +1 -1
  191. casadi/include/highs/mip/HighsCliqueTable.h +4 -4
  192. casadi/include/highs/mip/HighsConflictPool.h +1 -1
  193. casadi/include/highs/mip/HighsCutGeneration.h +1 -1
  194. casadi/include/highs/mip/HighsCutPool.h +2 -2
  195. casadi/include/highs/mip/HighsDebugSol.h +22 -29
  196. casadi/include/highs/mip/HighsDomain.h +10 -2
  197. casadi/include/highs/mip/HighsDomainChange.h +1 -1
  198. casadi/include/highs/mip/HighsDynamicRowMatrix.h +5 -3
  199. casadi/include/highs/mip/HighsGFkSolve.h +3 -3
  200. casadi/include/highs/mip/HighsImplications.h +3 -3
  201. casadi/include/highs/mip/HighsLpAggregator.h +1 -1
  202. casadi/include/highs/mip/HighsLpRelaxation.h +6 -1
  203. casadi/include/highs/mip/HighsMipSolver.h +4 -2
  204. casadi/include/highs/mip/HighsMipSolverData.h +47 -4
  205. casadi/include/highs/mip/HighsModkSeparator.h +2 -2
  206. casadi/include/highs/mip/HighsNodeQueue.h +5 -3
  207. casadi/include/highs/mip/HighsObjectiveFunction.h +1 -1
  208. casadi/include/highs/mip/HighsPathSeparator.h +2 -2
  209. casadi/include/highs/mip/HighsPrimalHeuristics.h +1 -1
  210. casadi/include/highs/mip/HighsPseudocost.h +35 -23
  211. casadi/include/highs/mip/HighsRedcostFixing.h +1 -1
  212. casadi/include/highs/mip/HighsSearch.h +2 -1
  213. casadi/include/highs/mip/HighsSeparation.h +1 -1
  214. casadi/include/highs/mip/HighsSeparator.h +1 -1
  215. casadi/include/highs/mip/HighsTableauSeparator.h +1 -1
  216. casadi/include/highs/mip/HighsTransformedLp.h +1 -1
  217. casadi/include/highs/model/HighsHessian.h +5 -0
  218. casadi/include/highs/model/HighsHessianUtils.h +2 -0
  219. casadi/include/highs/model/HighsModel.h +10 -1
  220. casadi/include/highs/parallel/HighsMutex.h +2 -1
  221. casadi/include/highs/parallel/HighsParallel.h +7 -2
  222. casadi/include/highs/parallel/HighsTask.h +1 -2
  223. casadi/include/highs/pdlp/CupdlpWrapper.h +93 -0
  224. casadi/include/highs/pdlp/cupdlp/cupdlp_cs.h +41 -0
  225. casadi/include/highs/pdlp/cupdlp/cupdlp_defs.h +423 -0
  226. casadi/include/highs/pdlp/cupdlp/cupdlp_linalg.h +183 -0
  227. casadi/include/highs/pdlp/cupdlp/cupdlp_proj.h +19 -0
  228. casadi/include/highs/pdlp/cupdlp/cupdlp_restart.h +31 -0
  229. casadi/include/highs/pdlp/cupdlp/cupdlp_scaling_cuda.h +28 -0
  230. casadi/include/highs/pdlp/cupdlp/cupdlp_solver.h +98 -0
  231. casadi/include/highs/pdlp/cupdlp/cupdlp_step.h +33 -0
  232. casadi/include/highs/pdlp/cupdlp/cupdlp_utils.c +1726 -0
  233. casadi/include/highs/pdqsort/pdqsort.h +532 -0
  234. casadi/include/highs/presolve/HPresolve.h +27 -14
  235. casadi/include/highs/presolve/HPresolveAnalysis.h +1 -1
  236. casadi/include/highs/presolve/HighsPostsolveStack.h +92 -68
  237. casadi/include/highs/presolve/HighsSymmetry.h +6 -5
  238. casadi/include/highs/presolve/ICrash.h +8 -2
  239. casadi/include/highs/presolve/ICrashUtil.h +1 -1
  240. casadi/include/highs/presolve/ICrashX.h +1 -1
  241. casadi/include/highs/presolve/PresolveComponent.h +1 -1
  242. casadi/include/highs/qpsolver/a_asm.hpp +23 -12
  243. casadi/include/highs/qpsolver/a_quass.hpp +8 -1
  244. casadi/include/highs/qpsolver/basis.hpp +150 -0
  245. casadi/include/highs/qpsolver/crashsolution.hpp +12 -0
  246. casadi/include/highs/qpsolver/dantzigpricing.hpp +72 -0
  247. casadi/include/highs/qpsolver/devexpricing.hpp +99 -0
  248. casadi/include/highs/qpsolver/eventhandler.hpp +23 -0
  249. casadi/include/highs/qpsolver/factor.hpp +400 -0
  250. casadi/include/highs/qpsolver/feasibility_bounded.hpp +105 -0
  251. casadi/include/highs/qpsolver/feasibility_highs.hpp +270 -0
  252. casadi/include/highs/qpsolver/gradient.hpp +39 -0
  253. casadi/include/highs/qpsolver/instance.hpp +63 -0
  254. casadi/include/highs/qpsolver/matrix.hpp +335 -0
  255. casadi/include/highs/qpsolver/pricing.hpp +15 -0
  256. casadi/include/highs/qpsolver/qpconst.hpp +27 -0
  257. casadi/include/highs/qpsolver/{vector.hpp → qpvector.hpp} +25 -25
  258. casadi/include/highs/qpsolver/quass.hpp +1 -1
  259. casadi/include/highs/qpsolver/ratiotest.hpp +19 -0
  260. casadi/include/highs/qpsolver/runtime.hpp +38 -0
  261. casadi/include/highs/qpsolver/settings.hpp +57 -0
  262. casadi/include/highs/qpsolver/snippets.hpp +29 -0
  263. casadi/include/highs/qpsolver/statistics.hpp +23 -0
  264. casadi/include/highs/qpsolver/steepestedgepricing.hpp +167 -0
  265. casadi/include/highs/simplex/HApp.h +1 -1
  266. casadi/include/highs/simplex/HEkk.h +52 -18
  267. casadi/include/highs/simplex/HEkkDual.h +1 -1
  268. casadi/include/highs/simplex/HEkkDualRHS.h +6 -7
  269. casadi/include/highs/simplex/HEkkDualRow.h +2 -2
  270. casadi/include/highs/simplex/HEkkPrimal.h +6 -1
  271. casadi/include/highs/simplex/HSimplex.h +1 -3
  272. casadi/include/highs/simplex/HSimplexDebug.h +1 -1
  273. casadi/include/highs/simplex/HSimplexNla.h +1 -1
  274. casadi/include/highs/simplex/HSimplexReport.h +1 -1
  275. casadi/include/highs/simplex/HighsSimplexAnalysis.h +228 -100
  276. casadi/include/highs/simplex/SimplexConst.h +1 -1
  277. casadi/include/highs/simplex/SimplexStruct.h +2 -2
  278. casadi/include/highs/simplex/SimplexTimer.h +1 -1
  279. casadi/include/highs/test/DevKkt.h +1 -1
  280. casadi/include/highs/test/KktCh2.h +1 -1
  281. casadi/include/highs/util/FactorTimer.h +1 -1
  282. casadi/include/highs/util/HFactor.h +35 -6
  283. casadi/include/highs/util/HFactorConst.h +1 -1
  284. casadi/include/highs/util/HFactorDebug.h +1 -1
  285. casadi/include/highs/util/HSet.h +1 -1
  286. casadi/include/highs/util/HVector.h +1 -1
  287. casadi/include/highs/util/HVectorBase.h +1 -1
  288. casadi/include/highs/util/HighsCDouble.h +3 -3
  289. casadi/include/highs/util/HighsComponent.h +1 -1
  290. casadi/include/highs/util/HighsDataStack.h +4 -4
  291. casadi/include/highs/util/HighsDisjointSets.h +1 -1
  292. casadi/include/highs/util/HighsHash.h +28 -21
  293. casadi/include/highs/util/HighsHashTree.h +63 -63
  294. casadi/include/highs/util/HighsInt.h +1 -1
  295. casadi/include/highs/util/HighsIntegers.h +8 -9
  296. casadi/include/highs/util/HighsLinearSumBounds.h +1 -1
  297. casadi/include/highs/util/HighsMatrixPic.h +1 -1
  298. casadi/include/highs/util/HighsMatrixSlice.h +9 -6
  299. casadi/include/highs/util/HighsMatrixUtils.h +1 -1
  300. casadi/include/highs/util/HighsMemoryAllocation.h +55 -0
  301. casadi/include/highs/util/HighsRandom.h +27 -15
  302. casadi/include/highs/util/HighsRbTree.h +2 -2
  303. casadi/include/highs/util/HighsSort.h +7 -7
  304. casadi/include/highs/util/HighsSparseMatrix.h +5 -2
  305. casadi/include/highs/util/HighsSparseVectorSum.h +2 -2
  306. casadi/include/highs/util/HighsSplay.h +1 -1
  307. casadi/include/highs/util/HighsTimer.h +18 -9
  308. casadi/include/highs/util/HighsUtils.h +15 -8
  309. casadi/include/highs/util/stringutil.h +9 -4
  310. casadi/include/highs/zstr/strict_fstream.hpp +237 -0
  311. casadi/include/highs/zstr/zstr.hpp +472 -0
  312. casadi/include/highs_export.h +43 -0
  313. casadi/include/licenses/daqp-external/LICENSE +21 -0
  314. casadi/include/licenses/{alpaqa-external/LICENSE → fatrop-external/LICENSE.txt} +2 -2
  315. casadi/include/licenses/fatrop-external/external/blasfeo/LICENSE.txt +26 -0
  316. casadi/include/licenses/fatrop-external/external/pybind11/LICENSE +29 -0
  317. casadi/include/licenses/fatrop-external/misc/license_header.txt +17 -0
  318. casadi/include/licenses/highs-external/{LICENSE → LICENSE.txt} +1 -1
  319. casadi/include/osqp/constants.h +2 -3
  320. casadi/include/osqp/version.h +9 -0
  321. casadi/include/sleqp/defs.h +4 -4
  322. casadi/include/sleqp/export.h +1 -0
  323. casadi/lib/cmake/tinyxml2/tinyxml2-config-version.cmake +0 -5
  324. casadi/lib/cmake/tinyxml2/tinyxml2-static-targets.cmake +10 -6
  325. casadi/lib/libtinyxml2.a +0 -0
  326. casadi/lib/pkgconfig/tinyxml2.pc +1 -1
  327. casadi/libCbc.3.10.11.dylib +0 -0
  328. casadi/libCbc.3.dylib +0 -0
  329. casadi/libCbc.dylib +0 -0
  330. casadi/libCbc.la +2 -2
  331. casadi/libCbcSolver.3.10.11.dylib +0 -0
  332. casadi/libCbcSolver.3.dylib +0 -0
  333. casadi/libCbcSolver.dylib +0 -0
  334. casadi/libCbcSolver.la +2 -2
  335. casadi/libCgl.1.10.8.dylib +0 -0
  336. casadi/libCgl.1.dylib +0 -0
  337. casadi/libCgl.dylib +0 -0
  338. casadi/libCgl.la +2 -2
  339. casadi/libClp.1.14.9.dylib +0 -0
  340. casadi/libClp.1.dylib +0 -0
  341. casadi/libClp.dylib +0 -0
  342. casadi/libClp.la +2 -2
  343. casadi/libClpSolver.1.14.9.dylib +0 -0
  344. casadi/libClpSolver.1.dylib +0 -0
  345. casadi/libClpSolver.dylib +0 -0
  346. casadi/libClpSolver.la +2 -2
  347. casadi/libCoinUtils.3.11.10.dylib +0 -0
  348. casadi/libCoinUtils.3.dylib +0 -0
  349. casadi/libCoinUtils.dylib +0 -0
  350. casadi/libCoinUtils.la +1 -1
  351. casadi/libOsi.1.13.9.dylib +0 -0
  352. casadi/libOsi.1.dylib +0 -0
  353. casadi/libOsi.dylib +0 -0
  354. casadi/libOsi.la +2 -2
  355. casadi/libOsiCbc.3.10.11.dylib +0 -0
  356. casadi/libOsiCbc.3.dylib +0 -0
  357. casadi/libOsiCbc.dylib +0 -0
  358. casadi/libOsiCbc.la +2 -2
  359. casadi/libOsiClp.1.14.9.dylib +0 -0
  360. casadi/libOsiClp.1.dylib +0 -0
  361. casadi/libOsiClp.dylib +0 -0
  362. casadi/libOsiClp.la +2 -2
  363. casadi/libOsiCommonTests.1.13.9.dylib +0 -0
  364. casadi/libOsiCommonTests.1.dylib +0 -0
  365. casadi/libOsiCommonTests.dylib +0 -0
  366. casadi/libOsiCommonTests.la +2 -2
  367. casadi/libblasfeo.dylib +0 -0
  368. casadi/libbonmin.4.8.9.dylib +0 -0
  369. casadi/libbonmin.4.dylib +0 -0
  370. casadi/libbonmin.dylib +0 -0
  371. casadi/libbonmin.la +2 -2
  372. casadi/libc++.1.0.dylib +0 -0
  373. casadi/libcasadi.3.7.dylib +0 -0
  374. casadi/libcasadi.dylib +0 -0
  375. casadi/libcasadi_conic_cbc.3.7.dylib +0 -0
  376. casadi/libcasadi_conic_cbc.dylib +0 -0
  377. casadi/libcasadi_conic_clp.3.7.dylib +0 -0
  378. casadi/libcasadi_conic_clp.dylib +0 -0
  379. casadi/libcasadi_conic_cplex.3.7.dylib +0 -0
  380. casadi/libcasadi_conic_cplex.dylib +0 -0
  381. casadi/libcasadi_conic_daqp.3.7.dylib +0 -0
  382. casadi/libcasadi_conic_daqp.dylib +0 -0
  383. casadi/libcasadi_conic_fatrop.3.7.dylib +0 -0
  384. casadi/libcasadi_conic_fatrop.dylib +0 -0
  385. casadi/libcasadi_conic_gurobi.3.7.dylib +0 -0
  386. casadi/libcasadi_conic_gurobi.dylib +0 -0
  387. casadi/libcasadi_conic_highs.3.7.dylib +0 -0
  388. casadi/libcasadi_conic_highs.dylib +0 -0
  389. casadi/libcasadi_conic_ipqp.3.7.dylib +0 -0
  390. casadi/libcasadi_conic_ipqp.dylib +0 -0
  391. casadi/libcasadi_conic_nlpsol.3.7.dylib +0 -0
  392. casadi/libcasadi_conic_nlpsol.dylib +0 -0
  393. casadi/libcasadi_conic_osqp.3.7.dylib +0 -0
  394. casadi/libcasadi_conic_osqp.dylib +0 -0
  395. casadi/libcasadi_conic_proxqp.3.7.dylib +0 -0
  396. casadi/libcasadi_conic_proxqp.dylib +0 -0
  397. casadi/libcasadi_conic_qpoases.3.7.dylib +0 -0
  398. casadi/libcasadi_conic_qpoases.dylib +0 -0
  399. casadi/libcasadi_conic_qrqp.3.7.dylib +0 -0
  400. casadi/libcasadi_conic_qrqp.dylib +0 -0
  401. casadi/libcasadi_conic_superscs.3.7.dylib +0 -0
  402. casadi/libcasadi_conic_superscs.dylib +0 -0
  403. casadi/libcasadi_importer_shell.3.7.dylib +0 -0
  404. casadi/libcasadi_importer_shell.dylib +0 -0
  405. casadi/libcasadi_integrator_collocation.3.7.dylib +0 -0
  406. casadi/libcasadi_integrator_collocation.dylib +0 -0
  407. casadi/libcasadi_integrator_cvodes.3.7.dylib +0 -0
  408. casadi/libcasadi_integrator_cvodes.dylib +0 -0
  409. casadi/libcasadi_integrator_idas.3.7.dylib +0 -0
  410. casadi/libcasadi_integrator_idas.dylib +0 -0
  411. casadi/libcasadi_integrator_rk.3.7.dylib +0 -0
  412. casadi/libcasadi_integrator_rk.dylib +0 -0
  413. casadi/libcasadi_interpolant_bspline.3.7.dylib +0 -0
  414. casadi/libcasadi_interpolant_bspline.dylib +0 -0
  415. casadi/libcasadi_interpolant_linear.3.7.dylib +0 -0
  416. casadi/libcasadi_interpolant_linear.dylib +0 -0
  417. casadi/libcasadi_linsol_csparse.3.7.dylib +0 -0
  418. casadi/libcasadi_linsol_csparse.dylib +0 -0
  419. casadi/libcasadi_linsol_csparsecholesky.3.7.dylib +0 -0
  420. casadi/libcasadi_linsol_csparsecholesky.dylib +0 -0
  421. casadi/libcasadi_linsol_lapacklu.3.7.dylib +0 -0
  422. casadi/libcasadi_linsol_lapacklu.dylib +0 -0
  423. casadi/libcasadi_linsol_lapackqr.3.7.dylib +0 -0
  424. casadi/libcasadi_linsol_lapackqr.dylib +0 -0
  425. casadi/libcasadi_linsol_ldl.3.7.dylib +0 -0
  426. casadi/libcasadi_linsol_ldl.dylib +0 -0
  427. casadi/libcasadi_linsol_lsqr.3.7.dylib +0 -0
  428. casadi/libcasadi_linsol_lsqr.dylib +0 -0
  429. casadi/libcasadi_linsol_ma27.3.7.dylib +0 -0
  430. casadi/libcasadi_linsol_ma27.dylib +0 -0
  431. casadi/libcasadi_linsol_mumps.3.7.dylib +0 -0
  432. casadi/libcasadi_linsol_mumps.dylib +0 -0
  433. casadi/libcasadi_linsol_qr.3.7.dylib +0 -0
  434. casadi/libcasadi_linsol_qr.dylib +0 -0
  435. casadi/libcasadi_linsol_symbolicqr.3.7.dylib +0 -0
  436. casadi/libcasadi_linsol_symbolicqr.dylib +0 -0
  437. casadi/libcasadi_linsol_tridiag.3.7.dylib +0 -0
  438. casadi/libcasadi_linsol_tridiag.dylib +0 -0
  439. casadi/libcasadi_nlpsol_ampl.3.7.dylib +0 -0
  440. casadi/libcasadi_nlpsol_ampl.dylib +0 -0
  441. casadi/libcasadi_nlpsol_blocksqp.3.7.dylib +0 -0
  442. casadi/libcasadi_nlpsol_blocksqp.dylib +0 -0
  443. casadi/libcasadi_nlpsol_bonmin.3.7.dylib +0 -0
  444. casadi/libcasadi_nlpsol_bonmin.dylib +0 -0
  445. casadi/libcasadi_nlpsol_fatrop.3.7.dylib +0 -0
  446. casadi/libcasadi_nlpsol_fatrop.dylib +0 -0
  447. casadi/libcasadi_nlpsol_feasiblesqpmethod.3.7.dylib +0 -0
  448. casadi/libcasadi_nlpsol_feasiblesqpmethod.dylib +0 -0
  449. casadi/libcasadi_nlpsol_ipopt.3.7.dylib +0 -0
  450. casadi/libcasadi_nlpsol_ipopt.dylib +0 -0
  451. casadi/libcasadi_nlpsol_knitro.3.7.dylib +0 -0
  452. casadi/libcasadi_nlpsol_knitro.dylib +0 -0
  453. casadi/libcasadi_nlpsol_madnlp.3.7.dylib +0 -0
  454. casadi/libcasadi_nlpsol_madnlp.dylib +0 -0
  455. casadi/libcasadi_nlpsol_qrsqp.3.7.dylib +0 -0
  456. casadi/libcasadi_nlpsol_qrsqp.dylib +0 -0
  457. casadi/libcasadi_nlpsol_scpgen.3.7.dylib +0 -0
  458. casadi/libcasadi_nlpsol_scpgen.dylib +0 -0
  459. casadi/libcasadi_nlpsol_sleqp.3.7.dylib +0 -0
  460. casadi/libcasadi_nlpsol_sleqp.dylib +0 -0
  461. casadi/libcasadi_nlpsol_snopt.3.7.dylib +0 -0
  462. casadi/libcasadi_nlpsol_snopt.dylib +0 -0
  463. casadi/libcasadi_nlpsol_sqpmethod.3.7.dylib +0 -0
  464. casadi/libcasadi_nlpsol_sqpmethod.dylib +0 -0
  465. casadi/libcasadi_rootfinder_fast_newton.3.7.dylib +0 -0
  466. casadi/libcasadi_rootfinder_fast_newton.dylib +0 -0
  467. casadi/libcasadi_rootfinder_kinsol.3.7.dylib +0 -0
  468. casadi/libcasadi_rootfinder_kinsol.dylib +0 -0
  469. casadi/libcasadi_rootfinder_newton.3.7.dylib +0 -0
  470. casadi/libcasadi_rootfinder_newton.dylib +0 -0
  471. casadi/libcasadi_rootfinder_nlpsol.3.7.dylib +0 -0
  472. casadi/libcasadi_rootfinder_nlpsol.dylib +0 -0
  473. casadi/libcasadi_sundials_common.3.7.dylib +0 -0
  474. casadi/libcasadi_sundials_common.dylib +0 -0
  475. casadi/libcasadi_xmlfile_tinyxml.3.7.dylib +0 -0
  476. casadi/libcasadi_xmlfile_tinyxml.dylib +0 -0
  477. casadi/libcoinmetis.2.dylib +0 -0
  478. casadi/libcoinmetis.dylib +0 -0
  479. casadi/libcoinmetis.la +1 -1
  480. casadi/libcoinmumps.3.dylib +0 -0
  481. casadi/libcoinmumps.dylib +0 -0
  482. casadi/libcoinmumps.la +2 -2
  483. casadi/libcplex_adaptor.dylib +0 -0
  484. casadi/{libamd.3.0.3.dylib → libdaqp.dylib} +0 -0
  485. casadi/libdaqpstat.a +0 -0
  486. casadi/libfatrop.dylib +0 -0
  487. casadi/libgcc_s.1.1.dylib +0 -0
  488. casadi/libgfortran.5.dylib +0 -0
  489. casadi/libgurobi_adaptor.dylib +0 -0
  490. casadi/libhighs.1.7.dylib +0 -0
  491. casadi/libhighs.1.dylib +0 -0
  492. casadi/libhighs.dylib +0 -0
  493. casadi/libindirect.a +0 -0
  494. casadi/libipopt.3.dylib +0 -0
  495. casadi/libipopt.dylib +0 -0
  496. casadi/libipopt.la +2 -2
  497. casadi/liblinsys.a +0 -0
  498. casadi/{libsuitesparseconfig.7.0.1.dylib → libmatlab_ipc.dylib} +0 -0
  499. casadi/libosqp.a +0 -0
  500. casadi/libosqp.dylib +0 -0
  501. casadi/libqdldl.a +0 -0
  502. casadi/libqdldl.dylib +0 -0
  503. casadi/libquadmath.0.dylib +0 -0
  504. casadi/libsipopt.3.dylib +0 -0
  505. casadi/libsipopt.dylib +0 -0
  506. casadi/libsipopt.la +2 -2
  507. casadi/libsleqp.1.0.1.dylib +0 -0
  508. casadi/libsleqp.dylib +0 -0
  509. casadi/libsuperscs.a +0 -0
  510. casadi/libtrlib.0.4.dylib +0 -0
  511. casadi/libtrlib.dylib +0 -0
  512. casadi/libz.1.2.13.dylib +0 -0
  513. casadi/pkgconfig/bonmin.pc +1 -1
  514. casadi/pkgconfig/casadi.pc +5 -5
  515. casadi/pkgconfig/cbc.pc +1 -1
  516. casadi/pkgconfig/cgl.pc +1 -1
  517. casadi/pkgconfig/clp.pc +1 -1
  518. casadi/pkgconfig/coinmetis.pc +1 -1
  519. casadi/pkgconfig/coinmumps.pc +2 -2
  520. casadi/pkgconfig/coinutils.pc +2 -2
  521. casadi/pkgconfig/highs.pc +4 -4
  522. casadi/pkgconfig/ipopt.pc +2 -2
  523. casadi/pkgconfig/osi-cbc.pc +1 -1
  524. casadi/pkgconfig/osi-clp.pc +1 -1
  525. casadi/pkgconfig/osi-unittests.pc +1 -1
  526. casadi/pkgconfig/osi.pc +1 -1
  527. casadi/pkgconfig/sleqp.pc +1 -1
  528. casadi/tools/__init__.py +4 -0
  529. casadi/tools/bounds.py +3 -3
  530. {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/METADATA +2 -2
  531. {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/RECORD +532 -477
  532. casadi/cmake/alpaqa/alpaqaConfig.cmake +0 -24
  533. casadi/cmake/alpaqa/alpaqaConfigVersion.cmake +0 -70
  534. casadi/cmake/alpaqa/alpaqaTargets-release.cmake +0 -19
  535. casadi/cmake/alpaqa/alpaqaTargets.cmake +0 -116
  536. casadi/include/alpaqa/accelerators/anderson.hpp +0 -133
  537. casadi/include/alpaqa/accelerators/internal/anderson-helpers.hpp +0 -92
  538. casadi/include/alpaqa/accelerators/internal/limited-memory-qr.hpp +0 -295
  539. casadi/include/alpaqa/accelerators/lbfgs.hpp +0 -244
  540. casadi/include/alpaqa/accelerators/steihaugcg.hpp +0 -143
  541. casadi/include/alpaqa/alpaqa.hpp +0 -3
  542. casadi/include/alpaqa/casadi/CasADiControlProblem.hpp +0 -185
  543. casadi/include/alpaqa/casadi/CasADiFunctionWrapper.hpp +0 -104
  544. casadi/include/alpaqa/casadi/CasADiProblem.hpp +0 -102
  545. casadi/include/alpaqa/casadi-loader-export.hpp +0 -15
  546. casadi/include/alpaqa/casadi-ocp-loader-export.hpp +0 -15
  547. casadi/include/alpaqa/config/config.hpp +0 -165
  548. casadi/include/alpaqa/dl/dl-problem.h +0 -476
  549. casadi/include/alpaqa/dl/dl-problem.hpp +0 -301
  550. casadi/include/alpaqa/export.h +0 -42
  551. casadi/include/alpaqa/export.hpp +0 -30
  552. casadi/include/alpaqa/implementation/accelerators/lbfgs.tpp +0 -240
  553. casadi/include/alpaqa/implementation/casadi/CasADiControlProblem.tpp +0 -594
  554. casadi/include/alpaqa/implementation/casadi/CasADiLoader-util.hpp +0 -50
  555. casadi/include/alpaqa/implementation/casadi/CasADiProblem.tpp +0 -425
  556. casadi/include/alpaqa/implementation/inner/directions/panoc/structured-lbfgs.tpp +0 -164
  557. casadi/include/alpaqa/implementation/inner/panoc-helpers.tpp +0 -389
  558. casadi/include/alpaqa/implementation/inner/panoc-ocp.tpp +0 -798
  559. casadi/include/alpaqa/implementation/inner/panoc.tpp +0 -448
  560. casadi/include/alpaqa/implementation/inner/pantr.tpp +0 -474
  561. casadi/include/alpaqa/implementation/inner/zerofpr.tpp +0 -482
  562. casadi/include/alpaqa/implementation/outer/alm.tpp +0 -228
  563. casadi/include/alpaqa/implementation/outer/internal/alm-helpers.tpp +0 -80
  564. casadi/include/alpaqa/implementation/params/params.tpp +0 -158
  565. casadi/include/alpaqa/implementation/problem/ocproblem.tpp +0 -56
  566. casadi/include/alpaqa/implementation/problem/type-erased-problem.tpp +0 -211
  567. casadi/include/alpaqa/implementation/util/io/csv.tpp +0 -120
  568. casadi/include/alpaqa/implementation/util/print.tpp +0 -151
  569. casadi/include/alpaqa/inner/directions/panoc/anderson.hpp +0 -98
  570. casadi/include/alpaqa/inner/directions/panoc/lbfgs.hpp +0 -94
  571. casadi/include/alpaqa/inner/directions/panoc/structured-lbfgs.hpp +0 -146
  572. casadi/include/alpaqa/inner/directions/panoc/structured-newton.hpp +0 -264
  573. casadi/include/alpaqa/inner/directions/panoc-direction-update.hpp +0 -96
  574. casadi/include/alpaqa/inner/directions/panoc-ocp/lqr.hpp +0 -181
  575. casadi/include/alpaqa/inner/directions/panoc-ocp/ocp-vars.hpp +0 -492
  576. casadi/include/alpaqa/inner/directions/pantr/newton-tr.hpp +0 -192
  577. casadi/include/alpaqa/inner/directions/pantr/pantr-direction.hpp +0 -99
  578. casadi/include/alpaqa/inner/inner-solve-options.hpp +0 -30
  579. casadi/include/alpaqa/inner/internal/lipschitz.hpp +0 -27
  580. casadi/include/alpaqa/inner/internal/panoc-helpers.hpp +0 -10
  581. casadi/include/alpaqa/inner/internal/panoc-stop-crit.hpp +0 -124
  582. casadi/include/alpaqa/inner/internal/solverstatus.hpp +0 -42
  583. casadi/include/alpaqa/inner/panoc-ocp.hpp +0 -302
  584. casadi/include/alpaqa/inner/panoc.hpp +0 -274
  585. casadi/include/alpaqa/inner/pantr.hpp +0 -284
  586. casadi/include/alpaqa/inner/zerofpr.hpp +0 -274
  587. casadi/include/alpaqa/ipopt/ipopt-adapter.hpp +0 -81
  588. casadi/include/alpaqa/ipopt/ipopt-enums.hpp +0 -35
  589. casadi/include/alpaqa/lbfgsb/lbfgsb-adapter.hpp +0 -111
  590. casadi/include/alpaqa/newton-tr-pantr-alm.hpp +0 -27
  591. casadi/include/alpaqa/outer/alm.hpp +0 -190
  592. casadi/include/alpaqa/outer/internal/alm-helpers.hpp +0 -10
  593. casadi/include/alpaqa/panoc-alm.hpp +0 -27
  594. casadi/include/alpaqa/panoc-anderson-alm.hpp +0 -27
  595. casadi/include/alpaqa/params/params.hpp +0 -60
  596. casadi/include/alpaqa/problem/box-constr-problem.hpp +0 -220
  597. casadi/include/alpaqa/problem/box.hpp +0 -82
  598. casadi/include/alpaqa/problem/functional-problem.hpp +0 -73
  599. casadi/include/alpaqa/problem/kkt-error.hpp +0 -43
  600. casadi/include/alpaqa/problem/ocproblem-counters.hpp +0 -116
  601. casadi/include/alpaqa/problem/ocproblem.hpp +0 -662
  602. casadi/include/alpaqa/problem/problem-counters.hpp +0 -116
  603. casadi/include/alpaqa/problem/problem-with-counters.hpp +0 -141
  604. casadi/include/alpaqa/problem/type-erased-problem.hpp +0 -874
  605. casadi/include/alpaqa/problem/unconstr-problem.hpp +0 -37
  606. casadi/include/alpaqa/structured-panoc-alm.hpp +0 -27
  607. casadi/include/alpaqa/structured-zerofpr-alm.hpp +0 -27
  608. casadi/include/alpaqa/util/alloc-check.hpp +0 -23
  609. casadi/include/alpaqa/util/atomic-stop-signal.hpp +0 -24
  610. casadi/include/alpaqa/util/check-dim.hpp +0 -64
  611. casadi/include/alpaqa/util/copyable_unique_ptr.hpp +0 -32
  612. casadi/include/alpaqa/util/demangled-typename.hpp +0 -9
  613. casadi/include/alpaqa/util/enumerate.hpp +0 -70
  614. casadi/include/alpaqa/util/float.hpp +0 -25
  615. casadi/include/alpaqa/util/index-set.hpp +0 -97
  616. casadi/include/alpaqa/util/io/csv.hpp +0 -43
  617. casadi/include/alpaqa/util/iter-adapter.hpp +0 -68
  618. casadi/include/alpaqa/util/max-history.hpp +0 -47
  619. casadi/include/alpaqa/util/noop-delete.hpp +0 -15
  620. casadi/include/alpaqa/util/not-implemented.hpp +0 -12
  621. casadi/include/alpaqa/util/print.hpp +0 -78
  622. casadi/include/alpaqa/util/quadmath/quadmath-print.hpp +0 -20
  623. casadi/include/alpaqa/util/quadmath/quadmath.hpp +0 -137
  624. casadi/include/alpaqa/util/required-method.hpp +0 -29
  625. casadi/include/alpaqa/util/ringbuffer.hpp +0 -212
  626. casadi/include/alpaqa/util/set-intersection.hpp +0 -129
  627. casadi/include/alpaqa/util/sparse-ops.hpp +0 -164
  628. casadi/include/alpaqa/util/timed.hpp +0 -22
  629. casadi/include/alpaqa/util/type-erasure.hpp +0 -568
  630. casadi/include/alpaqa/util/type-traits.hpp +0 -58
  631. casadi/include/alpaqa/zerofpr-alm.hpp +0 -27
  632. casadi/include/alpaqa/zerofpr-anderson-alm.hpp +0 -27
  633. casadi/include/alpaqa-version.h +0 -8
  634. casadi/include/highs/fortran/highs_fortran_api.mod +0 -0
  635. casadi/include/licenses/alpaqa-external/src/thirdparty/lbfgsb/Lbfgsb.3.0/License.txt +0 -71
  636. casadi/libFortranHighs.dylib +0 -0
  637. casadi/libalpaqa.1.0.0.dylib +0 -0
  638. casadi/libalpaqa.dylib +0 -0
  639. casadi/libcamd.3.0.3.dylib +0 -0
  640. casadi/libcasadi_nlpsol_alpaqa.3.7.dylib +0 -0
  641. casadi/libcasadi_nlpsol_alpaqa.dylib +0 -0
  642. casadi/libccolamd.3.0.3.dylib +0 -0
  643. casadi/libcholmod.4.0.3.dylib +0 -0
  644. casadi/libcholmod_cuda.4.0.3.dylib +0 -0
  645. casadi/libcolamd.3.0.3.dylib +0 -0
  646. casadi/libhighs.1.6.0.dylib +0 -0
  647. casadi/libhighs.1.6.dylib +0 -0
  648. casadi/libumfpack.6.1.0.dylib +0 -0
  649. {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/WHEEL +0 -0
@@ -1,662 +0,0 @@
1
- #pragma once
2
-
3
- #include <alpaqa/config/config.hpp>
4
- #include <alpaqa/problem/box.hpp>
5
- #include <alpaqa/problem/ocproblem-counters.hpp>
6
- #include <alpaqa/problem/problem-counters.hpp>
7
- #include <alpaqa/util/not-implemented.hpp>
8
- #include <alpaqa/util/required-method.hpp>
9
- #include <alpaqa/util/timed.hpp>
10
- #include <alpaqa/util/type-erasure.hpp>
11
- #include <array>
12
- #include <concepts>
13
- #include <stdexcept>
14
- #include <type_traits>
15
-
16
- #if !ALPAQA_WITH_OCP
17
- #error "OCP support disabled"
18
- #endif
19
-
20
- #ifndef NDEBUG
21
- #include <iostream>
22
- #endif
23
-
24
- namespace alpaqa {
25
-
26
- template <Config Conf>
27
- struct OCPDim {
28
- USING_ALPAQA_CONFIG(Conf);
29
- length_t N, nx, nu, nh, nc;
30
- };
31
-
32
- template <Config Conf>
33
- struct ControlProblemVTable : util::BasicVTable {
34
- USING_ALPAQA_CONFIG(Conf);
35
- using Box = alpaqa::Box<config_t>;
36
-
37
- template <class F>
38
- using optional_function_t = util::BasicVTable::optional_function_t<F, ControlProblemVTable>;
39
- template <class F>
40
- using optional_const_function_t =
41
- util::BasicVTable::optional_const_function_t<F, ControlProblemVTable>;
42
-
43
- // clang-format off
44
- required_const_function_t<void(crvec z, rvec e)>
45
- eval_proj_diff_g;
46
- required_const_function_t<void(rvec y, real_t M)>
47
- eval_proj_multipliers;
48
- required_const_function_t<void(Box &U)>
49
- get_U;
50
- optional_const_function_t<void(Box &D)>
51
- get_D = nullptr;
52
- optional_const_function_t<void(Box &D)>
53
- get_D_N = &default_get_D_N;
54
- required_const_function_t<void(rvec x_init)>
55
- get_x_init;
56
- required_const_function_t<void(index_t timestep, crvec x, crvec u, rvec fxu)>
57
- eval_f;
58
- required_const_function_t<void(index_t timestep, crvec x, crvec u, rmat J_fxu)>
59
- eval_jac_f;
60
- required_const_function_t<void(index_t timestep, crvec x, crvec u, crvec p, rvec grad_fxu_p)>
61
- eval_grad_f_prod;
62
- optional_const_function_t<void(index_t timestep, crvec x, crvec u, rvec h)>
63
- eval_h = nullptr;
64
- optional_const_function_t<void(crvec x, rvec h)>
65
- eval_h_N = nullptr;
66
- required_const_function_t<real_t(index_t timestep, crvec h)>
67
- eval_l;
68
- required_const_function_t<real_t(crvec h)>
69
- eval_l_N;
70
- required_const_function_t<void(index_t timestep, crvec xu, crvec h, rvec qr)>
71
- eval_qr;
72
- required_const_function_t<void(crvec x, crvec h, rvec q)>
73
- eval_q_N;
74
- required_const_function_t<void(index_t timestep, crvec xu, crvec h, rmat Q)>
75
- eval_add_Q;
76
- optional_const_function_t<void(crvec x, crvec h, rmat Q)>
77
- eval_add_Q_N = &default_eval_add_Q_N;
78
- required_const_function_t<void(index_t timestep, crvec xu, crvec h, crindexvec mask, rmat R, rvec work)>
79
- eval_add_R_masked;
80
- required_const_function_t<void(index_t timestep, crvec xu, crvec h, crindexvec mask, rmat S, rvec work)>
81
- eval_add_S_masked;
82
- optional_const_function_t<void(index_t timestep, crvec xu, crvec h, crindexvec mask_J, crindexvec mask_K, crvec v, rvec out, rvec work)>
83
- eval_add_R_prod_masked = &default_eval_add_R_prod_masked;
84
- optional_const_function_t<void(index_t timestep, crvec xu, crvec h, crindexvec mask_K, crvec v, rvec out, rvec work)>
85
- eval_add_S_prod_masked = &default_eval_add_S_prod_masked;
86
- optional_const_function_t<length_t()>
87
- get_R_work_size = &default_get_R_work_size;
88
- optional_const_function_t<length_t()>
89
- get_S_work_size = &default_get_S_work_size;
90
- optional_const_function_t<void(index_t timestep, crvec x, rvec c)>
91
- eval_constr = nullptr;
92
- optional_const_function_t<void(crvec x, rvec c)>
93
- eval_constr_N = &default_eval_constr_N;
94
- optional_const_function_t<void(index_t timestep, crvec x, crvec p, rvec grad_cx_p)>
95
- eval_grad_constr_prod = nullptr;
96
- optional_const_function_t<void(crvec x, crvec p, rvec grad_cx_p)>
97
- eval_grad_constr_prod_N = &default_eval_grad_constr_prod_N;
98
- optional_const_function_t<void(index_t timestep, crvec x, crvec M, rmat out)>
99
- eval_add_gn_hess_constr = nullptr;
100
- optional_const_function_t<void(crvec x, crvec M, rmat out)>
101
- eval_add_gn_hess_constr_N = &default_eval_add_gn_hess_constr_N;
102
- required_const_function_t<void()>
103
- check;
104
- // clang-format on
105
-
106
- length_t N, nu, nx, nh, nh_N, nc, nc_N;
107
-
108
- template <class P>
109
- ControlProblemVTable(std::in_place_t, P &p) : util::BasicVTable{std::in_place, p} {
110
- ALPAQA_TE_REQUIRED_METHOD(*this, P, eval_proj_diff_g);
111
- ALPAQA_TE_REQUIRED_METHOD(*this, P, eval_proj_multipliers);
112
- ALPAQA_TE_REQUIRED_METHOD(*this, P, get_U);
113
- ALPAQA_TE_OPTIONAL_METHOD(*this, P, get_D, p);
114
- ALPAQA_TE_OPTIONAL_METHOD(*this, P, get_D_N, p);
115
- ALPAQA_TE_REQUIRED_METHOD(*this, P, get_x_init);
116
- ALPAQA_TE_REQUIRED_METHOD(*this, P, eval_f);
117
- ALPAQA_TE_REQUIRED_METHOD(*this, P, eval_jac_f);
118
- ALPAQA_TE_REQUIRED_METHOD(*this, P, eval_grad_f_prod);
119
- ALPAQA_TE_OPTIONAL_METHOD(*this, P, eval_h, p);
120
- ALPAQA_TE_OPTIONAL_METHOD(*this, P, eval_h_N, p);
121
- ALPAQA_TE_REQUIRED_METHOD(*this, P, eval_l);
122
- ALPAQA_TE_REQUIRED_METHOD(*this, P, eval_l_N);
123
- ALPAQA_TE_REQUIRED_METHOD(*this, P, eval_qr);
124
- ALPAQA_TE_REQUIRED_METHOD(*this, P, eval_q_N);
125
- ALPAQA_TE_REQUIRED_METHOD(*this, P, eval_add_Q);
126
- ALPAQA_TE_OPTIONAL_METHOD(*this, P, eval_add_Q_N, p);
127
- ALPAQA_TE_REQUIRED_METHOD(*this, P, eval_add_R_masked);
128
- ALPAQA_TE_REQUIRED_METHOD(*this, P, eval_add_S_masked);
129
- ALPAQA_TE_OPTIONAL_METHOD(*this, P, eval_add_R_prod_masked, p);
130
- ALPAQA_TE_OPTIONAL_METHOD(*this, P, eval_add_S_prod_masked, p);
131
- ALPAQA_TE_OPTIONAL_METHOD(*this, P, get_R_work_size, p);
132
- ALPAQA_TE_OPTIONAL_METHOD(*this, P, get_S_work_size, p);
133
- ALPAQA_TE_OPTIONAL_METHOD(*this, P, eval_constr, p);
134
- ALPAQA_TE_OPTIONAL_METHOD(*this, P, eval_constr_N, p);
135
- ALPAQA_TE_OPTIONAL_METHOD(*this, P, eval_grad_constr_prod, p);
136
- ALPAQA_TE_OPTIONAL_METHOD(*this, P, eval_grad_constr_prod_N, p);
137
- ALPAQA_TE_OPTIONAL_METHOD(*this, P, eval_add_gn_hess_constr, p);
138
- ALPAQA_TE_OPTIONAL_METHOD(*this, P, eval_add_gn_hess_constr_N, p);
139
- ALPAQA_TE_REQUIRED_METHOD(*this, P, check);
140
- N = p.get_N();
141
- nu = p.get_nu();
142
- nx = p.get_nx();
143
- nh = p.get_nh();
144
- nh_N = p.get_nh_N();
145
- nc = p.get_nc();
146
- nc_N = p.get_nc_N();
147
- if (nc > 0 && get_D == nullptr)
148
- throw std::runtime_error("ControlProblem: missing 'get_D'");
149
- if (nc > 0 && eval_constr == nullptr)
150
- throw std::runtime_error("ControlProblem: missing 'eval_constr'");
151
- if (nc > 0 && eval_grad_constr_prod == nullptr)
152
- throw std::runtime_error("ControlProblem: missing 'eval_grad_constr_prod'");
153
- if (nh > 0 && eval_h == nullptr)
154
- throw std::runtime_error("ControlProblem: missing 'eval_h'");
155
- if (nh_N > 0 && eval_h_N == nullptr)
156
- throw std::runtime_error("ControlProblem: missing 'eval_h_N'");
157
- }
158
- ControlProblemVTable() = default;
159
-
160
- ALPAQA_EXPORT static void default_get_D_N(const void *self, Box &D,
161
- const ControlProblemVTable &vtable);
162
- ALPAQA_EXPORT static void default_eval_add_Q_N(const void *self, crvec x, crvec h, rmat Q,
163
- const ControlProblemVTable &vtable);
164
- ALPAQA_EXPORT static void default_eval_add_R_prod_masked(const void *, index_t, crvec, crvec,
165
- crindexvec, crindexvec, crvec, rvec,
166
- rvec, const ControlProblemVTable &);
167
- ALPAQA_EXPORT static void default_eval_add_S_prod_masked(const void *, index_t, crvec, crvec,
168
- crindexvec, crvec, rvec, rvec,
169
- const ControlProblemVTable &);
170
- [[nodiscard]] ALPAQA_EXPORT static length_t
171
- default_get_R_work_size(const void *, const ControlProblemVTable &);
172
- [[nodiscard]] ALPAQA_EXPORT static length_t
173
- default_get_S_work_size(const void *, const ControlProblemVTable &);
174
- ALPAQA_EXPORT static void default_eval_constr_N(const void *self, crvec x, rvec c,
175
- const ControlProblemVTable &vtable);
176
- ALPAQA_EXPORT static void default_eval_grad_constr_prod_N(const void *self, crvec x, crvec p,
177
- rvec grad_cx_p,
178
- const ControlProblemVTable &vtable);
179
- ALPAQA_EXPORT static void default_eval_add_gn_hess_constr_N(const void *self, crvec x, crvec M,
180
- rmat out,
181
- const ControlProblemVTable &vtable);
182
- };
183
-
184
- ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, ControlProblemVTable, DefaultConfig);
185
- ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, ControlProblemVTable, EigenConfigf);
186
- ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, ControlProblemVTable, EigenConfigd);
187
- ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, ControlProblemVTable, EigenConfigl);
188
- #ifdef ALPAQA_WITH_QUAD_PRECISION
189
- ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, ControlProblemVTable, EigenConfigq);
190
- #endif
191
-
192
- /**
193
- * Nonlinear optimal control problem with finite horizon @f$ N @f$.
194
- * @f[
195
- * \newcommand\U{U}
196
- * \newcommand\D{D}
197
- * \newcommand\nnu{{n_u}}
198
- * \newcommand\nnx{{n_x}}
199
- * \newcommand\nny{{n_y}}
200
- * \newcommand\xinit{x_\text{init}}
201
- * \begin{equation}\label{eq:OCP} \tag{OCP}\hspace{-0.8em}
202
- * \begin{aligned}
203
- * &\minimize_{u,x} && \sum_{k=0}^{N-1} \ell_k\big(h_k(x^k, u^k)\big) + \ell_N\big(h_N(x^N)\big)\hspace{-0.8em} \\
204
- * &\subjto && u^k \in \U \\
205
- * &&& c_k(x^k) \in \D \\
206
- * &&& c_N(x^N) \in \D_N \\
207
- * &&& x^0 = \xinit \\
208
- * &&& x^{k+1} = f(x^k, u^k) \quad\quad (0 \le k \lt N)
209
- * \end{aligned}
210
- * \end{equation}
211
- * @f]
212
- *
213
- * The function @f$ f : \R^\nnx \times \R^\nnu \to \R^\nnx @f$ models the
214
- * discrete-time, nonlinear dynamics of the system, which starts from an initial
215
- * state @f$ \xinit @f$.
216
- * The functions @f$ h_k : \R^\nnx \times \R^\nnu \to \R^{n_h} @f$ for
217
- * @f$ 0 \le k \lt N @f$ and @f$ h_N : \R^\nnx \to \R^{n_h^N} @f$ can be used to
218
- * represent the (possibly time-varying) output mapping of the system,
219
- * and the convex functions @f$ \ell_k : \R^{n_h} \to \R @f$ and
220
- * @f$ \ell_N : \R^{n_h^N} \to \R @f$ define the stage costs and the terminal
221
- * cost respectively. Stage constraints and terminal constraints are represented
222
- * by the functions @f$ c_k : \R^{n_x} \to \R^{n_c} @f$ and
223
- * @f$ c_N : \R^{n_x} \to \R^{n_c^N} @f$, and the boxes @f$ D @f$ and
224
- * @f$ D_N @f$.
225
- *
226
- * Additional functions for computing Gauss-Newton approximations of the cost
227
- * Hessian are included as well:
228
- * @f[ \begin{aligned}
229
- * q^k &\defeq \tp{\jac_{h_k}^x\!(\barxuk)} \nabla \ell_k(\hhbar^k) \\
230
- * r^k &\defeq \tp{\jac_{h_k}^u\!(\barxuk)} \nabla \ell_k(\hhbar^k) \\
231
- * \Lambda_k &\defeq \partial^2 \ell_k(\hhbar^k) \\
232
- * Q_k &\defeq \tp{\jac_{h_k}^x\!(\barxuk)} \Lambda_k\, \jac_{h_k}^x\!(\barxuk) \\
233
- * S_k &\defeq \tp{\jac_{h_k}^u\!(\barxuk)} \Lambda_k\, \jac_{h_k}^x\!(\barxuk) \\
234
- * R_k &\defeq \tp{\jac_{h_k}^u\!(\barxuk)} \Lambda_k\, \jac_{h_k}^u\!(\barxuk). \\
235
- * \end{aligned} @f]
236
- * See @cite pas2022gaussnewton for more details.
237
- *
238
- * @ingroup grp_Problems
239
- */
240
- template <Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
241
- class TypeErasedControlProblem : public util::TypeErased<ControlProblemVTable<Conf>, Allocator> {
242
- public:
243
- USING_ALPAQA_CONFIG(Conf);
244
- using VTable = ControlProblemVTable<config_t>;
245
- using allocator_type = Allocator;
246
- using Box = typename VTable::Box;
247
- using Dim = OCPDim<config_t>;
248
- using TypeErased = util::TypeErased<VTable, allocator_type>;
249
- using TypeErased::TypeErased;
250
-
251
- protected:
252
- using TypeErased::call;
253
- using TypeErased::self;
254
- using TypeErased::vtable;
255
-
256
- public:
257
- template <class T, class... Args>
258
- static TypeErasedControlProblem make(Args &&...args) {
259
- return TypeErased::template make<TypeErasedControlProblem, T>(std::forward<Args>(args)...);
260
- }
261
-
262
- /// @name Problem dimensions
263
- /// @{
264
-
265
- /// Horizon length.
266
- [[nodiscard]] length_t get_N() const { return vtable.N; }
267
- /// Number of inputs.
268
- [[nodiscard]] length_t get_nu() const { return vtable.nu; }
269
- /// Number of states.
270
- [[nodiscard]] length_t get_nx() const { return vtable.nx; }
271
- /// Number of outputs.
272
- [[nodiscard]] length_t get_nh() const { return vtable.nh; }
273
- [[nodiscard]] length_t get_nh_N() const { return vtable.nh_N; }
274
- /// Number of constraints.
275
- [[nodiscard]] length_t get_nc() const { return vtable.nc; }
276
- [[nodiscard]] length_t get_nc_N() const { return vtable.nc_N; }
277
- /// All dimensions
278
- [[nodiscard]] Dim get_dim() const {
279
- return {
280
- .N = vtable.N,
281
- .nx = vtable.nx,
282
- .nu = vtable.nu,
283
- .nh = vtable.nh,
284
- .nh_N = vtable.nh_N,
285
- .nc = vtable.nc,
286
- .nc_N = vtable.nc_N,
287
- };
288
- }
289
- /// Total number of variables.
290
- [[nodiscard]] length_t get_n() const { return get_N() * get_nu(); }
291
- /// Total number of constraints.
292
- [[nodiscard]] length_t get_m() const { return get_N() * get_nc() + get_nc_N(); }
293
-
294
- /// @}
295
-
296
- /// @name Projections onto constraint sets
297
- /// @{
298
-
299
- /// **[Required]**
300
- /// Function that evaluates the difference between the given point @f$ z @f$
301
- /// and its projection onto the constraint set @f$ D @f$.
302
- /// @param [in] z
303
- /// Slack variable, @f$ z \in \R^m @f$
304
- /// @param [out] e
305
- /// The difference relative to its projection,
306
- /// @f$ e = z - \Pi_D(z) \in \R^m @f$
307
- /// @note @p z and @p e can refer to the same vector.
308
- void eval_proj_diff_g(crvec z, rvec e) const;
309
- /// **[Required]**
310
- /// Function that projects the Lagrange multipliers for ALM.
311
- /// @param [inout] y
312
- /// Multipliers, @f$ y \leftarrow \Pi_Y(y) \in \R^m @f$
313
- /// @param [in] M
314
- /// The radius/size of the set @f$ Y @f$.
315
- /// See @ref ALMParams::max_multiplier.
316
- void eval_proj_multipliers(rvec y, real_t M) const;
317
-
318
- /// @}
319
-
320
- /// @name Constraint sets
321
- /// @{
322
-
323
- /// Input box constraints @f$ U @f$.
324
- void get_U(Box &U) const;
325
- /// Stage box constraints @f$ D @f$.
326
- void get_D(Box &D) const;
327
- /// Terminal box constraints @f$ D_N @f$.
328
- void get_D_N(Box &D) const;
329
-
330
- /// @}
331
-
332
- /// @name Dynamics and initial state
333
- /// @{
334
-
335
- /// Initial state @f$ x_\text{init} @f$.
336
- void get_x_init(rvec x_init) const;
337
- /// Discrete-time dynamics @f$ x^{k+1} = f_k(x^k, u^k) @f$.
338
- void eval_f(index_t timestep, crvec x, crvec u, rvec fxu) const;
339
- /// Jacobian of discrete-time dynamics @f$ \jac_f(x^k, u^k) @f$.
340
- void eval_jac_f(index_t timestep, crvec x, crvec u, rmat J_fxu) const;
341
- /// Gradient-vector product of discrete-time dynamics @f$ \nabla f(x^k, u^k)\,p @f$.
342
- void eval_grad_f_prod(index_t timestep, crvec x, crvec u, crvec p, rvec grad_fxu_p) const;
343
-
344
- /// @}
345
-
346
- /// @name Output mapping
347
- /// @{
348
-
349
- /// Stage output mapping @f$ h_k(x^k, u^k) @f$.
350
- void eval_h(index_t timestep, crvec x, crvec u, rvec h) const;
351
- /// Terminal output mapping @f$ h_N(x^N) @f$.
352
- void eval_h_N(crvec x, rvec h) const;
353
-
354
- /// @}
355
-
356
- /// @name Stage and terminal cost
357
- /// @{
358
-
359
- /// Stage cost @f$ \ell_k(\hbar^k) @f$.
360
- [[nodiscard]] real_t eval_l(index_t timestep, crvec h) const;
361
- /// Terminal cost @f$ \ell_N(\hbar^N) @f$.
362
- [[nodiscard]] real_t eval_l_N(crvec h) const;
363
-
364
- /// @}
365
-
366
- /// @name Gauss-Newton approximations
367
- /// @{
368
-
369
- /// Cost gradients w.r.t. states and inputs
370
- /// @f$ q^k = \tp{\jac_{h_k}^x\!(\barxuk)} \nabla \ell_k(\hbar^k) @f$ and
371
- /// @f$ r^k = \tp{\jac_{h_k}^u\!(\barxuk)} \nabla \ell_k(\hbar^k) @f$.
372
- void eval_qr(index_t timestep, crvec xu, crvec h, rvec qr) const;
373
- /// Terminal cost gradient w.r.t. states
374
- /// @f$ q^N = \tp{\jac_{h_N}(\bar x^N)} \nabla \ell_k(\hbar^N) @f$.
375
- void eval_q_N(crvec x, crvec h, rvec q) const;
376
- /// Cost Hessian w.r.t. states @f$ Q_k = \tp{\jac_{h_k}^x\!(\barxuk)}
377
- /// \partial^2\ell_k(\hbar^k)\, \jac_{h_k}^x\!(\barxuk) @f$,
378
- /// added to the given matrix @p Q.
379
- /// @f$ Q \leftarrow Q + Q_k @f$.
380
- void eval_add_Q(index_t timestep, crvec xu, crvec h, rmat Q) const;
381
- /// Terminal cost Hessian w.r.t. states @f$ Q_N = \tp{\jac_{h_N}(\bar x^N)}
382
- /// \partial^2\ell_N(\hbar^N)\, \jac_{h_N}(\bar x^N) @f$,
383
- /// added to the given matrix @p Q.
384
- /// @f$ Q \leftarrow Q + Q_N @f$.
385
- void eval_add_Q_N(crvec x, crvec h, rmat Q) const;
386
- /// Cost Hessian w.r.t. inputs @f$ R_k = \tp{\jac_{h_k}^u\!(\barxuk)}
387
- /// \partial^2\ell_k(\hbar^k)\, \jac_{h_k}^u\!(\barxuk) @f$, keeping only
388
- /// rows and columns in the mask @f$ \mathcal J @f$, added to the given
389
- /// matrix @p R.
390
- /// @f$ R \leftarrow R + R_k[\mathcal J, \mathcal J] @f$.
391
- /// The size of @p work should be @ref get_R_work_size().
392
- void eval_add_R_masked(index_t timestep, crvec xu, crvec h, crindexvec mask, rmat R,
393
- rvec work) const;
394
- /// Cost Hessian w.r.t. inputs and states @f$ S_k = \tp{\jac_{h_k}^u\!(\barxuk)}
395
- /// \partial^2\ell_k(\hbar^k)\, \jac_{h_k}^x\!(\barxuk) @f$, keeping only
396
- /// rows in the mask @f$ \mathcal J @f$, added to the given matrix @p S.
397
- /// @f$ S \leftarrow S + S_k[\mathcal J, \cdot] @f$.
398
- /// The size of @p work should be @ref get_S_work_size().
399
- void eval_add_S_masked(index_t timestep, crvec xu, crvec h, crindexvec mask, rmat S,
400
- rvec work) const;
401
- /// @f$ out \leftarrow out + R[\mathcal J, \mathcal K]\,v[\mathcal K] @f$.
402
- /// Work should contain the contents written to it by a prior call to
403
- /// @ref eval_add_R_masked() in the same point.
404
- void eval_add_R_prod_masked(index_t timestep, crvec xu, crvec h, crindexvec mask_J,
405
- crindexvec mask_K, crvec v, rvec out, rvec work) const;
406
- /// @f$ out \leftarrow out + \tp{S[\mathcal K, \cdot]}\, v[\mathcal K] @f$.
407
- /// Work should contain the contents written to it by a prior call to
408
- /// @ref eval_add_S_masked() in the same point.
409
- void eval_add_S_prod_masked(index_t timestep, crvec xu, crvec h, crindexvec mask_K, crvec v,
410
- rvec out, rvec work) const;
411
- /// Size of the workspace required by @ref eval_add_R_masked() and
412
- /// @ref eval_add_R_prod_masked().
413
- [[nodiscard]] length_t get_R_work_size() const;
414
- /// Size of the workspace required by @ref eval_add_S_masked() and
415
- /// @ref eval_add_S_prod_masked().
416
- [[nodiscard]] length_t get_S_work_size() const;
417
-
418
- /// @}
419
-
420
- /// @name Constraints
421
- /// @{
422
-
423
- /// Stage constraints @f$ c_k(x^k) @f$.
424
- void eval_constr(index_t timestep, crvec x, rvec c) const;
425
- /// Terminal constraints @f$ c_N(x^N) @f$.
426
- void eval_constr_N(crvec x, rvec c) const;
427
- /// Gradient-vector product of stage constraints @f$ \nabla c_k(x^k)\, p @f$.
428
- void eval_grad_constr_prod(index_t timestep, crvec x, crvec p, rvec grad_cx_p) const;
429
- /// Gradient-vector product of terminal constraints @f$ \nabla c_N(x^N)\, p @f$.
430
- void eval_grad_constr_prod_N(crvec x, crvec p, rvec grad_cx_p) const;
431
- /// Gauss-Newton Hessian of stage constraints @f$ \tp{\jac_{c_k}}(x^k)\,
432
- /// \operatorname{diag}(M)\; \jac_{c_k}(x^k) @f$.
433
- void eval_add_gn_hess_constr(index_t timestep, crvec x, crvec M, rmat out) const;
434
- /// Gauss-Newton Hessian of terminal constraints @f$ \tp{\jac_{c_N}}(x^N)\,
435
- /// \operatorname{diag}(M)\; \jac_{c_N}(x^N) @f$.
436
- void eval_add_gn_hess_constr_N(crvec x, crvec M, rmat out) const;
437
-
438
- /// @}
439
-
440
- /// @name Checks
441
- /// @{
442
-
443
- /// Check that the problem formulation is well-defined, the dimensions match,
444
- /// etc. Throws an exception if this is not the case.
445
- void check() const;
446
-
447
- /// @}
448
-
449
- /// @name Querying specialized implementations
450
- /// @{
451
-
452
- // clang-format off
453
- [[nodiscard]] bool provides_get_D() const { return vtable.get_D != nullptr; }
454
- [[nodiscard]] bool provides_get_D_N() const { return vtable.get_D_N != &vtable.default_get_D_N; }
455
- [[nodiscard]] bool provides_eval_h() const { return vtable.eval_h != nullptr; }
456
- [[nodiscard]] bool provides_eval_h_N() const { return vtable.eval_h_N != nullptr; }
457
- [[nodiscard]] bool provides_eval_add_Q_N() const { return vtable.eval_add_Q_N != &vtable.default_eval_add_Q_N; }
458
- [[nodiscard]] bool provides_eval_add_R_prod_masked() const { return vtable.eval_add_R_prod_masked != &vtable.default_eval_add_R_prod_masked; }
459
- [[nodiscard]] bool provides_eval_add_S_prod_masked() const { return vtable.eval_add_S_prod_masked != &vtable.default_eval_add_S_prod_masked; }
460
- [[nodiscard]] bool provides_get_R_work_size() const { return vtable.get_R_work_size != &vtable.default_get_R_work_size; }
461
- [[nodiscard]] bool provides_get_S_work_size() const { return vtable.get_S_work_size != &vtable.default_get_S_work_size; }
462
- [[nodiscard]] bool provides_eval_constr() const { return vtable.eval_constr != nullptr; }
463
- [[nodiscard]] bool provides_eval_constr_N() const { return vtable.eval_constr_N != &vtable.default_eval_constr_N; }
464
- [[nodiscard]] bool provides_eval_grad_constr_prod() const { return vtable.eval_grad_constr_prod != nullptr; }
465
- [[nodiscard]] bool provides_eval_grad_constr_prod_N() const { return vtable.eval_grad_constr_prod_N != &vtable.default_eval_grad_constr_prod_N; }
466
- [[nodiscard]] bool provides_eval_add_gn_hess_constr() const { return vtable.eval_add_gn_hess_constr != nullptr; }
467
- [[nodiscard]] bool provides_eval_add_gn_hess_constr_N() const { return vtable.eval_add_gn_hess_constr_N != &vtable.default_eval_add_gn_hess_constr_N; }
468
- // clang-format on
469
-
470
- /// @}
471
- };
472
-
473
- // clang-format off
474
- #ifdef NDEBUG
475
- [[gnu::always_inline]] inline void check_finiteness(auto &&, auto &&) {}
476
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_proj_diff_g(crvec z, rvec e) const { return call(vtable.eval_proj_diff_g, z, e); }
477
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_proj_multipliers(rvec y, real_t M) const { return call(vtable.eval_proj_multipliers, y, M); }
478
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::get_U(Box &U) const { return call(vtable.get_U, U); }
479
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::get_D(Box &D) const { return call(vtable.get_D, D); }
480
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::get_D_N(Box &D) const { return call(vtable.get_D_N, D); }
481
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::get_x_init(rvec x_init) const { return call(vtable.get_x_init, x_init); }
482
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_f(index_t timestep, crvec x, crvec u, rvec fxu) const { return call(vtable.eval_f, timestep, x, u, fxu); }
483
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_jac_f(index_t timestep, crvec x, crvec u, rmat J_fxu) const { return call(vtable.eval_jac_f, timestep, x, u, J_fxu); }
484
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_grad_f_prod(index_t timestep, crvec x, crvec u, crvec p, rvec grad_fxu_p) const { return call(vtable.eval_grad_f_prod, timestep, x, u, p, grad_fxu_p); }
485
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_h(index_t timestep, crvec x, crvec u, rvec h) const { return call(vtable.eval_h, timestep, x, u, h); }
486
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_h_N(crvec x, rvec h) const { return call(vtable.eval_h_N, x, h); }
487
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline auto TypeErasedControlProblem<Conf, Allocator>::eval_l(index_t timestep, crvec h) const -> real_t { return call(vtable.eval_l, timestep, h); }
488
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline auto TypeErasedControlProblem<Conf, Allocator>::eval_l_N(crvec h) const -> real_t { return call(vtable.eval_l_N, h); }
489
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_qr(index_t timestep, crvec xu, crvec h, rvec qr) const { return call(vtable.eval_qr, timestep, xu, h, qr); }
490
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_q_N(crvec x, crvec h, rvec q) const { return call(vtable.eval_q_N, x, h, q); }
491
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_Q(index_t timestep, crvec xu, crvec h, rmat Q) const { return call(vtable.eval_add_Q, timestep, xu, h, Q); }
492
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_Q_N(crvec x, crvec h, rmat Q) const { return call(vtable.eval_add_Q_N, x, h, Q); }
493
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_R_masked(index_t timestep, crvec xu, crvec h, crindexvec mask, rmat R, rvec work) const { return call(vtable.eval_add_R_masked, timestep, xu, h, mask, R, work); }
494
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_S_masked(index_t timestep, crvec xu, crvec h, crindexvec mask, rmat S, rvec work) const { return call(vtable.eval_add_S_masked, timestep, xu, h, mask, S, work); }
495
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_R_prod_masked(index_t timestep, crvec xu, crvec h, crindexvec mask_J, crindexvec mask_K, crvec v, rvec out, rvec work) const { return call(vtable.eval_add_R_prod_masked, timestep, xu, h, mask_J, mask_K, v, out, work); }
496
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_S_prod_masked(index_t timestep, crvec xu, crvec h, crindexvec mask_K, crvec v, rvec out, rvec work) const { return call(vtable.eval_add_S_prod_masked, timestep, xu, h, mask_K, v, out, work); }
497
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline auto TypeErasedControlProblem<Conf, Allocator>::get_R_work_size() const -> length_t { return call(vtable.get_R_work_size); }
498
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline auto TypeErasedControlProblem<Conf, Allocator>::get_S_work_size() const -> length_t { return call(vtable.get_S_work_size); }
499
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_constr(index_t timestep, crvec x, rvec c) const { return call(vtable.eval_constr, timestep, x, c); }
500
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_constr_N(crvec x, rvec c) const { return call(vtable.eval_constr_N, x, c); }
501
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_grad_constr_prod(index_t timestep, crvec x, crvec p, rvec grad_cx_p) const { return call(vtable.eval_grad_constr_prod, timestep, x, p, grad_cx_p); }
502
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_grad_constr_prod_N(crvec x, crvec p, rvec grad_cx_p) const { return call(vtable.eval_grad_constr_prod_N, x, p, grad_cx_p); }
503
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_gn_hess_constr(index_t timestep, crvec x, crvec M, rmat out) const { return call(vtable.eval_add_gn_hess_constr, timestep, x, M, out); }
504
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_gn_hess_constr_N(crvec x, crvec M, rmat out) const { return call(vtable.eval_add_gn_hess_constr_N, x, M, out); }
505
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::check() const { return call(vtable.check); }
506
- #else
507
- /// If the given vector @p v is not finite, break or throw an exception with the
508
- /// given message @p msg.
509
- inline void check_finiteness(const auto &v, std::string_view msg) {
510
- using std::begin;
511
- using std::end;
512
- if (!v.allFinite()) {
513
- std::cout << msg << std::endl;
514
- throw std::runtime_error(std::string(msg));
515
- }
516
- }
517
- inline void check_finiteness(const std::floating_point auto &v, std::string_view msg) {
518
- if (!std::isfinite(v)) {
519
- std::cout << msg << std::endl;
520
- throw std::runtime_error(std::string(msg));
521
- }
522
- }
523
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_proj_diff_g(crvec z, rvec e) const { return call(vtable.eval_proj_diff_g, z, e); }
524
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_proj_multipliers(rvec y, real_t M) const { return call(vtable.eval_proj_multipliers, y, M); }
525
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::get_U(Box &U) const { return call(vtable.get_U, U); }
526
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::get_D(Box &D) const { return call(vtable.get_D, D); }
527
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::get_D_N(Box &D_N) const { return call(vtable.get_D_N, D_N); }
528
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::get_x_init(rvec x_init) const { call(vtable.get_x_init, x_init); check_finiteness(x_init, "Infinite output of get_x_init"); }
529
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_f(index_t timestep, crvec x, crvec u, rvec fxu) const { check_finiteness(x, "Infinite input x of f"); check_finiteness(u, "Infinite input u of f"); call(vtable.eval_f, timestep, x, u, fxu); check_finiteness(fxu, "Infinite output of f"); }
530
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_jac_f(index_t timestep, crvec x, crvec u, rmat J_fxu) const { check_finiteness(x, "Infinite input x of jac_f"); check_finiteness(u, "Infinite input u of jac_f"); call(vtable.eval_jac_f, timestep, x, u, J_fxu); check_finiteness(J_fxu.reshaped(), "Infinite output of jac_f"); }
531
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_grad_f_prod(index_t timestep, crvec x, crvec u, crvec p, rvec grad_fxu_p) const { check_finiteness(x, "Infinite input x of grad_f_prod"); check_finiteness(u, "Infinite input u of grad_f_prod"); check_finiteness(p, "Infinite input p of grad_f_prod"); call(vtable.eval_grad_f_prod, timestep, x, u, p, grad_fxu_p); check_finiteness(grad_fxu_p, "Infinite output of jac_f"); }
532
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_h(index_t timestep, crvec x, crvec u, rvec h) const { check_finiteness(x, "Infinite input x of h"); check_finiteness(u, "Infinite input u of h"); call(vtable.eval_h, timestep, x, u, h); check_finiteness(h, "Infinite output of h"); }
533
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_h_N(crvec x, rvec h) const { check_finiteness(x, "Infinite input x of h_N"); call(vtable.eval_h_N, x, h); check_finiteness(h, "Infinite output of h_N"); }
534
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline auto TypeErasedControlProblem<Conf, Allocator>::eval_l(index_t timestep, crvec h) const -> real_t { check_finiteness(h, "Infinite input h of l"); auto l = call(vtable.eval_l, timestep, h); check_finiteness(l, "Infinite output of l"); return l; }
535
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline auto TypeErasedControlProblem<Conf, Allocator>::eval_l_N(crvec h) const -> real_t { check_finiteness(h, "Infinite input h of l_N"); auto l = call(vtable.eval_l_N, h); check_finiteness(l, "Infinite output of l_N"); return l; }
536
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_qr(index_t timestep, crvec xu, crvec h, rvec qr) const { return call(vtable.eval_qr, timestep, xu, h, qr); }
537
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_q_N(crvec x, crvec h, rvec q) const { check_finiteness(x, "Infinite input x of q_N"); check_finiteness(h, "Infinite input h of q_N"); call(vtable.eval_q_N, x, h, q); check_finiteness(q, "Infinite output of q_N"); }
538
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_Q(index_t timestep, crvec xu, crvec h, rmat Q) const { return call(vtable.eval_add_Q, timestep, xu, h, Q); }
539
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_Q_N(crvec x, crvec h, rmat Q) const { return call(vtable.eval_add_Q_N, x, h, Q); }
540
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_R_masked(index_t timestep, crvec xu, crvec h, crindexvec mask, rmat R, rvec work) const { return call(vtable.eval_add_R_masked, timestep, xu, h, mask, R, work); }
541
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_S_masked(index_t timestep, crvec xu, crvec h, crindexvec mask, rmat S, rvec work) const { return call(vtable.eval_add_S_masked, timestep, xu, h, mask, S, work); }
542
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_R_prod_masked(index_t timestep, crvec xu, crvec h, crindexvec mask_J, crindexvec mask_K, crvec v, rvec out, rvec work) const { return call(vtable.eval_add_R_prod_masked, timestep, xu, h, mask_J, mask_K, v, out, work); }
543
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_S_prod_masked(index_t timestep, crvec xu, crvec h, crindexvec mask_K, crvec v, rvec out, rvec work) const { return call(vtable.eval_add_S_prod_masked, timestep, xu, h, mask_K, v, out, work); }
544
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline auto TypeErasedControlProblem<Conf, Allocator>::get_R_work_size() const -> length_t { return call(vtable.get_R_work_size); }
545
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline auto TypeErasedControlProblem<Conf, Allocator>::get_S_work_size() const -> length_t { return call(vtable.get_S_work_size); }
546
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_constr(index_t timestep, crvec x, rvec c) const { return call(vtable.eval_constr, timestep, x, c); }
547
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_constr_N(crvec x, rvec c) const { return call(vtable.eval_constr_N, x, c); }
548
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_grad_constr_prod(index_t timestep, crvec x, crvec p, rvec grad_cx_p) const { return call(vtable.eval_grad_constr_prod, timestep, x, p, grad_cx_p); }
549
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_grad_constr_prod_N(crvec x, crvec p, rvec grad_cx_p) const { return call(vtable.eval_grad_constr_prod_N, x, p, grad_cx_p); }
550
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_gn_hess_constr(index_t timestep, crvec x, crvec M, rmat out) const { return call(vtable.eval_add_gn_hess_constr, timestep, x, M, out); }
551
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::eval_add_gn_hess_constr_N(crvec x, crvec M, rmat out) const { return call(vtable.eval_add_gn_hess_constr_N, x, M, out); }
552
- template <Config Conf, class Allocator> [[gnu::always_inline]] inline void TypeErasedControlProblem<Conf, Allocator>::check() const { return call(vtable.check); }
553
- #endif
554
- // clang-format on
555
-
556
- template <class Problem>
557
- struct ControlProblemWithCounters {
558
- USING_ALPAQA_CONFIG_TEMPLATE(std::remove_cvref_t<Problem>::config_t);
559
- using Box = typename TypeErasedControlProblem<config_t>::Box;
560
-
561
- [[nodiscard, gnu::always_inline]] length_t get_N() const { return problem.get_N(); }
562
- [[nodiscard, gnu::always_inline]] length_t get_nu() const { return problem.get_nu(); }
563
- [[nodiscard, gnu::always_inline]] length_t get_nx() const { return problem.get_nx(); }
564
- [[nodiscard, gnu::always_inline]] length_t get_nh() const { return problem.get_nh(); }
565
- [[nodiscard, gnu::always_inline]] length_t get_nh_N() const { return problem.get_nh_N(); }
566
- [[nodiscard, gnu::always_inline]] length_t get_nc() const { return problem.get_nc(); }
567
- [[nodiscard, gnu::always_inline]] length_t get_nc_N() const { return problem.get_nc_N(); }
568
-
569
- // clang-format off
570
- [[gnu::always_inline]] void eval_proj_diff_g(crvec z, rvec e) const { return problem.eval_proj_diff_g(z, e); }
571
- [[gnu::always_inline]] void eval_proj_multipliers(rvec y, real_t M) const { return problem.eval_proj_multipliers(y, M); }
572
- [[gnu::always_inline]] void get_x_init(rvec x_init) const { return problem.get_x_init(x_init); }
573
- [[nodiscard, gnu::always_inline]] length_t get_R_work_size() const requires requires { &std::remove_cvref_t<Problem>::get_R_work_size; } { return problem.get_R_work_size(); }
574
- [[nodiscard, gnu::always_inline]] length_t get_S_work_size() const requires requires { &std::remove_cvref_t<Problem>::get_S_work_size; } { return problem.get_S_work_size(); }
575
- [[gnu::always_inline]] void get_U(Box &U) const requires requires { &std::remove_cvref_t<Problem>::get_U; } { return problem.get_U(U); }
576
- [[gnu::always_inline]] void get_D(Box &D) const requires requires { &std::remove_cvref_t<Problem>::get_D; } { return problem.get_D(D); }
577
- [[gnu::always_inline]] void get_D_N(Box &D) const requires requires { &std::remove_cvref_t<Problem>::get_D_N; } { return problem.get_D_N(D); }
578
- [[gnu::always_inline]] void eval_f(index_t timestep, crvec x, crvec u, rvec fxu) const { ++evaluations->f; return timed(evaluations->time.f, std::bind(&std::remove_cvref_t<Problem>::eval_f, &problem, timestep, x, u, fxu)); }
579
- [[gnu::always_inline]] void eval_jac_f(index_t timestep, crvec x, crvec u, rmat J_fxu) const { ++evaluations->jac_f; return timed(evaluations->time.jac_f, std::bind(&std::remove_cvref_t<Problem>::eval_jac_f, &problem, timestep, x, u, J_fxu)); }
580
- [[gnu::always_inline]] void eval_grad_f_prod(index_t timestep, crvec x, crvec u, crvec p, rvec grad_fxu_p) const { ++evaluations->grad_f_prod; return timed(evaluations->time.grad_f_prod, std::bind(&std::remove_cvref_t<Problem>::eval_grad_f_prod, &problem, timestep, x, u, p, grad_fxu_p)); }
581
- [[gnu::always_inline]] void eval_h(index_t timestep, crvec x, crvec u, rvec h) const { ++evaluations->h; return timed(evaluations->time.h, std::bind(&std::remove_cvref_t<Problem>::eval_h, &problem, timestep, x, u, h)); }
582
- [[gnu::always_inline]] void eval_h_N(crvec x, rvec h) const { ++evaluations->h_N; return timed(evaluations->time.h_N, std::bind(&std::remove_cvref_t<Problem>::eval_h_N, &problem, x, h)); }
583
- [[nodiscard, gnu::always_inline]] real_t eval_l(index_t timestep, crvec h) const { ++evaluations->l; return timed(evaluations->time.l, std::bind(&std::remove_cvref_t<Problem>::eval_l, &problem, timestep, h)); }
584
- [[nodiscard, gnu::always_inline]] real_t eval_l_N(crvec h) const { ++evaluations->l_N; return timed(evaluations->time.l_N, std::bind(&std::remove_cvref_t<Problem>::eval_l_N, &problem, h)); }
585
- [[gnu::always_inline]] void eval_qr(index_t timestep, crvec xu, crvec h, rvec qr) const { ++evaluations->qr; return timed(evaluations->time.qr, std::bind(&std::remove_cvref_t<Problem>::eval_qr, &problem, timestep, xu, h, qr)); }
586
- [[gnu::always_inline]] void eval_q_N(crvec x, crvec h, rvec q) const requires requires { &std::remove_cvref_t<Problem>::eval_q_N; } { ++evaluations->q_N; return timed(evaluations->time.q_N, std::bind(&std::remove_cvref_t<Problem>::eval_q_N, &problem, x, h, q)); }
587
- [[gnu::always_inline]] void eval_add_Q(index_t timestep, crvec xu, crvec h, rmat Q) const { ++evaluations->add_Q; return timed(evaluations->time.add_Q, std::bind(&std::remove_cvref_t<Problem>::eval_add_Q, &problem, timestep, xu, h, Q)); }
588
- [[gnu::always_inline]] void eval_add_Q_N(crvec x, crvec h, rmat Q) const requires requires { &std::remove_cvref_t<Problem>::eval_add_Q_N; } { ++evaluations->add_Q_N; return timed(evaluations->time.add_Q_N, std::bind(&std::remove_cvref_t<Problem>::eval_add_Q_N, &problem, x, h, Q)); }
589
- [[gnu::always_inline]] void eval_add_R_masked(index_t timestep, crvec xu, crvec h, crindexvec mask, rmat R, rvec work) const { ++evaluations->add_R_masked; return timed(evaluations->time.add_R_masked, std::bind(&std::remove_cvref_t<Problem>::eval_add_R_masked, &problem, timestep, xu, h, mask, R, work)); }
590
- [[gnu::always_inline]] void eval_add_S_masked(index_t timestep, crvec xu, crvec h, crindexvec mask, rmat S, rvec work) const { ++evaluations->add_S_masked; return timed(evaluations->time.add_S_masked, std::bind(&std::remove_cvref_t<Problem>::eval_add_S_masked, &problem, timestep, xu, h, mask, S, work)); }
591
- [[gnu::always_inline]] void eval_add_R_prod_masked(index_t timestep, crvec xu, crvec h, crindexvec mask_J, crindexvec mask_K, crvec v, rvec out, rvec work) const requires requires { &std::remove_cvref_t<Problem>::eval_add_R_prod_masked; } { ++evaluations->add_R_prod_masked; return timed(evaluations->time.add_R_prod_masked, std::bind(&std::remove_cvref_t<Problem>::eval_add_R_prod_masked, &problem, timestep, xu, h, mask_J, mask_K, v, out, work)); }
592
- [[gnu::always_inline]] void eval_add_S_prod_masked(index_t timestep, crvec xu, crvec h, crindexvec mask_K, crvec v, rvec out, rvec work) const requires requires { &std::remove_cvref_t<Problem>::eval_add_S_prod_masked; } { ++evaluations->add_S_prod_masked; return timed(evaluations->time.add_S_prod_masked, std::bind(&std::remove_cvref_t<Problem>::eval_add_S_prod_masked, &problem, timestep, xu, h, mask_K, v, out, work)); }
593
- [[gnu::always_inline]] void eval_constr(index_t timestep, crvec x, rvec c) const requires requires { &std::remove_cvref_t<Problem>::eval_constr; } { ++evaluations->constr; return timed(evaluations->time.constr, std::bind(&std::remove_cvref_t<Problem>::eval_constr, &problem, timestep, x, c)); }
594
- [[gnu::always_inline]] void eval_constr_N(crvec x, rvec c) const requires requires { &std::remove_cvref_t<Problem>::eval_constr_N; } { ++evaluations->constr_N; return timed(evaluations->time.constr_N, std::bind(&std::remove_cvref_t<Problem>::eval_constr_N, &problem, x, c)); }
595
- [[gnu::always_inline]] void eval_grad_constr_prod(index_t timestep, crvec x, crvec p, rvec grad_cx_p) const requires requires { &std::remove_cvref_t<Problem>::eval_grad_constr_prod; } { ++evaluations->grad_constr_prod; return timed(evaluations->time.grad_constr_prod, std::bind(&std::remove_cvref_t<Problem>::eval_grad_constr_prod, &problem, timestep, x, p, grad_cx_p)); }
596
- [[gnu::always_inline]] void eval_grad_constr_prod_N(crvec x, crvec p, rvec grad_cx_p) const requires requires { &std::remove_cvref_t<Problem>::eval_grad_constr_prod_N; } { ++evaluations->grad_constr_prod_N; return timed(evaluations->time.grad_constr_prod_N, std::bind(&std::remove_cvref_t<Problem>::eval_grad_constr_prod_N, &problem, x, p, grad_cx_p)); }
597
- [[gnu::always_inline]] void eval_add_gn_hess_constr(index_t timestep, crvec x, crvec M, rmat out) const requires requires { &std::remove_cvref_t<Problem>::eval_add_gn_hess_constr; } { ++evaluations->add_gn_hess_constr; return timed(evaluations->time.add_gn_hess_constr, std::bind(&std::remove_cvref_t<Problem>::eval_add_gn_hess_constr, &problem, timestep, x, M, out)); }
598
- [[gnu::always_inline]] void eval_add_gn_hess_constr_N(crvec x, crvec M, rmat out) const requires requires { &std::remove_cvref_t<Problem>::eval_add_gn_hess_constr_N; } { ++evaluations->add_gn_hess_constr_N; return timed(evaluations->time.add_gn_hess_constr_N, std::bind(&std::remove_cvref_t<Problem>::eval_add_gn_hess_constr_N, &problem, x, M, out)); }
599
- [[gnu::always_inline]] void check() const { problem.check(); }
600
-
601
- [[nodiscard]] bool provides_get_D() const requires requires (Problem p) { { p.provides_get_D() } -> std::convertible_to<bool>; } { return problem.provides_get_D(); }
602
- [[nodiscard]] bool provides_get_D_N() const requires requires (Problem p) { { p.provides_get_D_N() } -> std::convertible_to<bool>; } { return problem.provides_get_D_N(); }
603
- [[nodiscard]] bool provides_eval_add_Q_N() const requires requires (Problem p) { { p.provides_eval_add_Q_N() } -> std::convertible_to<bool>; } { return problem.provides_eval_add_Q_N(); }
604
- [[nodiscard]] bool provides_eval_add_R_prod_masked() const requires requires (Problem p) { { p.provides_eval_add_R_prod_masked() } -> std::convertible_to<bool>; } { return problem.provides_eval_add_R_prod_masked(); }
605
- [[nodiscard]] bool provides_eval_add_S_prod_masked() const requires requires (Problem p) { { p.provides_eval_add_S_prod_masked() } -> std::convertible_to<bool>; } { return problem.provides_eval_add_S_prod_masked(); }
606
- [[nodiscard]] bool provides_get_R_work_size() const requires requires (Problem p) { { p.provides_get_R_work_size() } -> std::convertible_to<bool>; } { return problem.provides_get_R_work_size(); }
607
- [[nodiscard]] bool provides_get_S_work_size() const requires requires (Problem p) { { p.provides_get_S_work_size() } -> std::convertible_to<bool>; } { return problem.provides_get_S_work_size(); }
608
- [[nodiscard]] bool provides_eval_constr() const requires requires (Problem p) { { p.provides_eval_constr() } -> std::convertible_to<bool>; } { return problem.provides_eval_constr(); }
609
- [[nodiscard]] bool provides_eval_constr_N() const requires requires (Problem p) { { p.provides_eval_constr_N() } -> std::convertible_to<bool>; } { return problem.provides_eval_constr_N(); }
610
- [[nodiscard]] bool provides_eval_grad_constr_prod() const requires requires (Problem p) { { p.provides_eval_grad_constr_prod() } -> std::convertible_to<bool>; } { return problem.provides_eval_grad_constr_prod(); }
611
- [[nodiscard]] bool provides_eval_grad_constr_prod_N() const requires requires (Problem p) { { p.provides_eval_grad_constr_prod_N() } -> std::convertible_to<bool>; } { return problem.provides_eval_grad_constr_prod_N(); }
612
- [[nodiscard]] bool provides_eval_add_gn_hess_constr() const requires requires (Problem p) { { p.provides_eval_add_gn_hess_constr() } -> std::convertible_to<bool>; } { return problem.provides_eval_add_gn_hess_constr(); }
613
- [[nodiscard]] bool provides_eval_add_gn_hess_constr_N() const requires requires (Problem p) { { p.provides_eval_add_gn_hess_constr_N() } -> std::convertible_to<bool>; } { return problem.provides_eval_add_gn_hess_constr_N(); }
614
- // clang-format on
615
-
616
- std::shared_ptr<OCPEvalCounter> evaluations = std::make_shared<OCPEvalCounter>();
617
- Problem problem;
618
-
619
- ControlProblemWithCounters()
620
- requires std::is_default_constructible_v<Problem>
621
- = default;
622
- template <class P>
623
- explicit ControlProblemWithCounters(P &&problem)
624
- requires std::is_same_v<std::remove_cvref_t<P>, std::remove_cvref_t<Problem>>
625
- : problem{std::forward<P>(problem)} {}
626
- template <class... Args>
627
- explicit ControlProblemWithCounters(std::in_place_t, Args &&...args)
628
- requires(!std::is_lvalue_reference_v<Problem>)
629
- : problem{std::forward<Args>(args)...} {}
630
-
631
- /// Reset all evaluation counters and timers to zero. Affects all instances
632
- /// that share the same evaluations. If you only want to reset the counters
633
- /// of this instance, use @ref decouple_evaluations first.
634
- void reset_evaluations() { evaluations.reset(); }
635
- /// Give this instance its own evaluation counters and timers, decoupling
636
- /// it from any other instances they might have previously been shared with.
637
- /// The evaluation counters and timers are preserved (a copy is made).
638
- void decouple_evaluations() { evaluations = std::make_shared<OCPEvalCounter>(*evaluations); }
639
-
640
- private:
641
- template <class TimeT, class FunT>
642
- [[gnu::always_inline]] static decltype(auto) timed(TimeT &time, FunT &&f) {
643
- alpaqa::util::Timed timed{time};
644
- return std::forward<FunT>(f)();
645
- }
646
- };
647
-
648
- template <class Problem>
649
- [[nodiscard]] auto ocproblem_with_counters(Problem &&p) {
650
- using Prob = std::remove_cvref_t<Problem>;
651
- using ProbWithCnt = ControlProblemWithCounters<Prob>;
652
- return ProbWithCnt{std::forward<Problem>(p)};
653
- }
654
-
655
- template <class Problem>
656
- [[nodiscard]] auto ocproblem_with_counters_ref(Problem &p) {
657
- using Prob = std::remove_cvref_t<Problem>;
658
- using ProbWithCnt = ControlProblemWithCounters<const Prob &>;
659
- return ProbWithCnt{p};
660
- }
661
-
662
- } // namespace alpaqa