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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,295 +0,0 @@
1
- #include <alpaqa/config/config.hpp>
2
- #include <alpaqa/util/ringbuffer.hpp>
3
- #include <Eigen/Jacobi>
4
- #include <type_traits>
5
-
6
- namespace alpaqa {
7
-
8
- /// Incremental QR factorization using modified Gram-Schmidt with
9
- /// reorthogonalization.
10
- ///
11
- /// Computes A = QR while allowing efficient removal of the first
12
- /// column of A or adding new columns at the end of A.
13
- template <Config Conf = DefaultConfig>
14
- class LimitedMemoryQR {
15
- public:
16
- USING_ALPAQA_CONFIG(Conf);
17
- LimitedMemoryQR() = default;
18
-
19
- /// @param n
20
- /// The size of the vectors, the number of rows of A.
21
- /// @param m
22
- /// The maximum number of columns of A.
23
- ///
24
- /// The maximum dimensions of Q are n×m and the maximum dimensions of R are
25
- /// m×m.
26
- LimitedMemoryQR(length_t n, length_t m) : Q(n, m), R(m, m) {}
27
-
28
- length_t n() const { return Q.rows(); }
29
- length_t m() const { return Q.cols(); }
30
- length_t size() const { return n(); }
31
- length_t history() const { return m(); }
32
-
33
- /// Add the given column to the right.
34
- template <class VecV>
35
- void add_column(const VecV &v) {
36
- assert(num_columns() < m());
37
-
38
- auto q = Q.col(q_idx);
39
- auto r = R.col(r_idx_end);
40
-
41
- // Modified Gram-Schmidt to make q orthogonal to Q
42
- q = v;
43
- for (index_t i = 0; i < q_idx; ++i) {
44
- real_t s = Q.col(i).dot(q);
45
- r(i) = s;
46
- q -= s * Q.col(i);
47
- }
48
-
49
- // Compute the norms of orthogonalized q and original v
50
- real_t norm_q = q.norm();
51
- real_t norm_v = v.norm();
52
-
53
- // If ‖q‖ is significantly smaller than ‖v‖, perform
54
- // reorthogonalization
55
- auto η = real_t(0.7);
56
- while (norm_q < η * norm_v) {
57
- ++reorth_count;
58
- for (index_t i = 0; i < q_idx; ++i) {
59
- real_t s = Q.col(i).dot(q);
60
- r(i) += s;
61
- q -= s * Q.col(i);
62
- }
63
- norm_v = norm_q;
64
- norm_q = q.norm();
65
- }
66
-
67
- // Normalize q such that new matrix (Q q) remains orthogonal (i.e. has
68
- // orthonormal columns)
69
- r(q_idx) = norm_q;
70
- q /= norm_q;
71
- // Keep track of the minimum/maximum diagonal element of R
72
- min_eig = std::min(min_eig, norm_q);
73
- max_eig = std::max(max_eig, norm_q);
74
-
75
- // Increment indices, add a column to Q and R.
76
- ++q_idx;
77
- r_idx_end = r_succ(r_idx_end);
78
- }
79
-
80
- /// Remove the leftmost column.
81
- void remove_column() {
82
- assert(num_columns() > 0);
83
-
84
- // After removing the first column of the upper triangular matrix R,
85
- // it becomes upper Hessenberg. Givens rotations are used to make it
86
- // triangular again.
87
- Eigen::JacobiRotation<real_t> G;
88
- index_t r = 0; // row index of R
89
- index_t c = r_succ(r_idx_start); // column index of R in storage
90
- // Loop over the diagonal elements of R:
91
- while (r < q_idx - 1) {
92
- // Compute the Givens rotation that makes the subdiagonal element
93
- // of column c of R zero.
94
- G.makeGivens(R(r, c), R(r + 1, c), &R(r, c));
95
- // Apply it to the remaining columns of R.
96
- // Not the current column, because the diagonal element was updated
97
- // by the makeGivens function, and the subdiagonal element doesn't
98
- // have to be set to zero explicitly, it's implicit.
99
- // Also not the previous columns, because they are already
100
- // implicitly zero below the diagonal and this rotation wouldn't
101
- // have any effect there.
102
- // TODO: can this be sped up by applying it in two blocks instead
103
- // of column by column?
104
- for (index_t cc = r_succ(c); cc != r_idx_end; cc = r_succ(cc))
105
- R.col(cc).applyOnTheLeft(r, r + 1, G.adjoint());
106
- // Apply the inverse of the Givens rotation to Q.
107
- Q.block(0, 0, Q.rows(), q_idx).applyOnTheRight(r, r + 1, G);
108
- // Keep track of the minimum/maximum diagonal element of R
109
- min_eig = std::min(min_eig, R(r, c));
110
- max_eig = std::max(max_eig, R(r, c));
111
- // Advance indices to next diagonal element of R.
112
- ++r;
113
- c = r_succ(c);
114
- }
115
- // Remove rightmost column of Q, since it corresponds to the bottom row
116
- // of R, which was set to zero by the Givens rotations
117
- --q_idx;
118
- // Remove the first column of R.
119
- r_idx_start = r_succ(r_idx_start);
120
- }
121
-
122
- /// Solve the least squares problem Ax = b.
123
- /// Do not divide by elements that are smaller in absolute value than @p tol.
124
- template <class VecB, class VecX>
125
- void solve_col(const VecB &b, VecX &x, real_t tol = 0) const {
126
- // Iterate over the diagonal of R, starting at the bottom right,
127
- // this is standard back substitution
128
- // (recall that R is stored in a circular buffer, so R.col(i) is
129
- // not the mathematical i-th column)
130
- auto rev_bgn = ring_reverse_iter().begin();
131
- auto rev_end = ring_reverse_iter().end();
132
- auto fwd_end = ring_iter().end();
133
- for (auto it_d = rev_bgn; it_d != rev_end; ++it_d) {
134
- // Row/column index of diagonal element of R
135
- auto [rR, cR] = *it_d;
136
- // Don't divide by very small diagonal elements
137
- if (std::abs(R(rR, cR)) < tol) {
138
- x(rR) = real_t{0};
139
- continue;
140
- }
141
- // (r is the zero-based mathematical index, c is the index in
142
- // the circular buffer)
143
- x(rR) = Q.col(rR).transpose() * b; // Compute rhs Qᵀb
144
- // In the current row of R, iterate over the elements to the
145
- // right of the diagonal
146
- // Iterating from left to right seems to give better results
147
- for (auto it_c = it_d.forwardit; it_c != fwd_end; ++it_c) {
148
- auto [rX2, cR2] = *it_c;
149
- x(rR) -= R(rR, cR2) * x(rX2);
150
- }
151
- x(rR) /= R(rR, cR); // Divide by diagonal element
152
- }
153
- }
154
-
155
- /// Solve the least squares problem AX = B.
156
- /// Do not divide by elements that are smaller in absolute value than @p tol.
157
- template <class MatB, class MatX>
158
- void solve(const MatB &B, MatX &X, real_t tol = 0) const {
159
- assert(B.cols() <= X.cols());
160
- assert(B.rows() >= Q.rows());
161
- assert(X.rows() >= Eigen::Index(num_columns()));
162
- // Each column of the right hand side is solved as an individual system
163
- for (Eigen::Index cB = 0; cB < B.cols(); ++cB) {
164
- auto b = B.col(cB);
165
- auto x = X.col(cB);
166
- solve_col(b, x, tol);
167
- }
168
- }
169
-
170
- template <class Derived>
171
- using solve_ret_t = std::conditional_t<
172
- Eigen::internal::traits<Derived>::ColsAtCompileTime == 1, vec, mat>;
173
-
174
- /// Solve the least squares problem AX = B.
175
- template <class Derived>
176
- solve_ret_t<Derived> solve(const Eigen::DenseBase<Derived> &B) {
177
- solve_ret_t<Derived> X(m(), B.cols());
178
- solve(B, X);
179
- return X;
180
- }
181
-
182
- /// Get the full, raw storage for the orthogonal matrix Q.
183
- const mat &get_raw_Q() const { return Q; }
184
- /// Get the full, raw storage for the upper triangular matrix R.
185
- /// The columns of this matrix are permuted because it's stored as a
186
- /// circular buffer for efficiently appending columns to the end and
187
- /// popping columns from the front.
188
- const mat &get_raw_R() const { return R; }
189
-
190
- /// Get the full storage for the upper triangular matrix R but with the
191
- /// columns in the correct order.
192
- /// @note Meant for tests only, creates a permuted copy.
193
- mat get_full_R() const {
194
- if (r_idx_start == 0)
195
- return R;
196
- // Using a permutation matrix here isn't as efficient as rotating the
197
- // matrix manually, but this function is only used in tests, so it
198
- // shouldn't matter.
199
- Eigen::PermutationMatrix<Eigen::Dynamic> P(R.cols());
200
- P.setIdentity();
201
- std::rotate(P.indices().data(), P.indices().data() + r_idx_start,
202
- P.indices().data() + P.size());
203
- return R * P;
204
- }
205
- /// Get the matrix R such that Q times R is the original matrix.
206
- /// @note Meant for tests only, creates a permuted copy.
207
- mat get_R() const {
208
- return get_full_R()
209
- .block(0, 0, q_idx, q_idx)
210
- .template triangularView<Eigen::Upper>();
211
- }
212
- /// Get the matrix Q such that Q times R is the original matrix.
213
- /// @note Meant for tests only, creates a copy.
214
- mat get_Q() const { return Q.block(0, 0, n(), q_idx); }
215
-
216
- /// Multiply the matrix R by a scalar.
217
- void scale_R(real_t scal) {
218
- for (auto [i, r_idx] : ring_iter())
219
- R.col(r_idx).topRows(i + 1) *= scal;
220
- min_eig *= scal;
221
- max_eig *= scal;
222
- }
223
-
224
- /// Get the number of MGS reorthogonalizations.
225
- unsigned long get_reorth_count() const { return reorth_count; }
226
- /// Reset the number of MGS reorthogonalizations.
227
- void clear_reorth_count() { reorth_count = 0; }
228
-
229
- /// Get the minimum eigenvalue of R.
230
- real_t get_min_eig() const { return min_eig; }
231
- /// Get the maximum eigenvalue of R.
232
- real_t get_max_eig() const { return max_eig; }
233
-
234
- /// Reset all indices, clearing the Q and R matrices.
235
- void reset() {
236
- q_idx = 0;
237
- r_idx_start = 0;
238
- r_idx_end = 0;
239
- reorth_count = 0;
240
- min_eig = +inf<config_t>;
241
- max_eig = -inf<config_t>;
242
- }
243
-
244
- /// Re-allocate storage for a problem with a different size. Causes
245
- /// a @ref reset.
246
- void resize(length_t n, length_t m) {
247
- Q.resize(n, m);
248
- R.resize(m, m);
249
- reset();
250
- }
251
-
252
- /// Get the number of columns that are currently stored.
253
- length_t num_columns() const { return q_idx; }
254
- /// Get the head index of the circular buffer (points to the oldest
255
- /// element).
256
- index_t ring_head() const { return r_idx_start; }
257
- /// Get the tail index of the circular buffer (points to one past the most
258
- /// recent element).
259
- index_t ring_tail() const { return r_idx_end; }
260
- /// Get the next index in the circular buffer.
261
- index_t ring_next(index_t i) const { return r_succ(i); }
262
- /// Get the previous index in the circular buffer.
263
- index_t ring_prev(index_t i) const { return r_pred(i); }
264
- /// Get the number of columns currently stored in the buffer.
265
- length_t current_history() const { return q_idx; }
266
-
267
- /// Get iterators in the circular buffer.
268
- CircularRange<index_t> ring_iter() const {
269
- return {q_idx, r_idx_start, r_idx_end, m()};
270
- }
271
- /// Get reverse iterators in the circular buffer.
272
- ReverseCircularRange<index_t> ring_reverse_iter() const {
273
- return ring_iter();
274
- }
275
-
276
- private:
277
- mat Q; ///< Storage for orthogonal factor Q.
278
- mat R; ///< Storage for upper triangular factor R.
279
-
280
- index_t q_idx = 0; ///< Number of columns of Q being stored.
281
- index_t r_idx_start = 0; ///< Index of the first column of R.
282
- index_t r_idx_end = 0; ///< Index of the one-past-last column of R.
283
-
284
- unsigned long reorth_count = 0; ///< Number of MGS reorthogonalizations.
285
-
286
- real_t min_eig = +inf<config_t>; ///< Minimum eigenvalue of R.
287
- real_t max_eig = -inf<config_t>; ///< Maximum eigenvalue of R.
288
-
289
- /// Get the next index in the circular storage for R.
290
- index_t r_succ(index_t i) const { return i + 1 < m() ? i + 1 : 0; }
291
- /// Get the previous index in the circular storage for R.
292
- index_t r_pred(index_t i) const { return i == 0 ? m() - 1 : i - 1; }
293
- };
294
-
295
- } // namespace alpaqa
@@ -1,244 +0,0 @@
1
- #pragma once
2
-
3
- #include <alpaqa/config/config.hpp>
4
- #include <alpaqa/export.hpp>
5
-
6
- #include <cmath>
7
- #include <limits>
8
- #include <string>
9
- #include <utility>
10
- #include <vector>
11
-
12
- namespace alpaqa {
13
-
14
- /// Cautious BFGS update.
15
- /// @see @ref LBFGSParams::cbfgs
16
- template <Config Conf = DefaultConfig>
17
- struct CBFGSParams {
18
- USING_ALPAQA_CONFIG(Conf);
19
- real_t α = 1;
20
- real_t ϵ = 0; ///< Set to zero to disable CBFGS check.
21
- explicit operator bool() const { return ϵ > 0; }
22
- };
23
-
24
- /// Which method to use to select the L-BFGS step size.
25
- enum class LBFGSStepSize {
26
- /// Initial inverse Hessian approximation is set to
27
- /// @f$ H_0 = \gamma I @f$.
28
- BasedOnExternalStepSize = 0,
29
- /// Initial inverse Hessian approximation is set to
30
- /// @f$ H_0 = \frac{s^\top y}{y^\top y} I @f$.
31
- BasedOnCurvature = 1,
32
- BasedOnGradientStepSize
33
- [[deprecated("use BasedOnExternalStepSize instead")]] =
34
- BasedOnExternalStepSize,
35
- };
36
-
37
- /// Parameters for the @ref LBFGS class.
38
- template <Config Conf = DefaultConfig>
39
- struct LBFGSParams {
40
- USING_ALPAQA_CONFIG(Conf);
41
-
42
- /// Length of the history to keep.
43
- length_t memory = 10;
44
- /// Reject update if @f$ y^\top s \le \text{min_div_fac} \cdot s^\top s @f$.
45
- real_t min_div_fac = std::numeric_limits<real_t>::epsilon();
46
- /// Reject update if @f$ s^\top s \le \text{min_abs_s} @f$.
47
- real_t min_abs_s =
48
- std::pow(std::numeric_limits<real_t>::epsilon(), real_t(2));
49
- /// Parameters in the cautious BFGS update condition
50
- /// @f[ \frac{y^\top s}{s^\top s} \ge \epsilon \| g \|^\alpha @f]
51
- /// @see https://epubs.siam.org/doi/10.1137/S1052623499354242
52
- CBFGSParams<config_t> cbfgs = {};
53
- /// If set to true, the inverse Hessian estimate should remain definite,
54
- /// i.e. a check is performed that rejects the update if
55
- /// @f$ y^\top s \le \text{min_div_fac} \cdot s^\top s @f$.
56
- /// If set to false, just try to prevent a singular Hessian by rejecting the
57
- /// update if
58
- /// @f$ \left| y^\top s \right| \le \text{min_div_fac} \cdot s^\top s @f$.
59
- bool force_pos_def = true;
60
- /// @see LBFGSStepSize
61
- LBFGSStepSize stepsize = LBFGSStepSize::BasedOnCurvature;
62
- };
63
-
64
- /// Layout:
65
- /// ~~~
66
- /// ┌───── 2 m ─────┐
67
- /// ┌ ┌───┬───┬───┬───┐
68
- /// │ │ │ │ │ │
69
- /// │ │ s │ y │ s │ y │
70
- /// n+1 │ │ │ │ │ │
71
- /// │ ├───┼───┼───┼───┤
72
- /// │ │ ρ │ α │ ρ │ α │
73
- /// └ └───┴───┴───┴───┘
74
- /// ~~~
75
- template <Config Conf = DefaultConfig>
76
- struct LBFGSStorage {
77
- USING_ALPAQA_CONFIG(Conf);
78
-
79
- /// Re-allocate storage for a problem with a different size.
80
- void resize(length_t n, length_t history);
81
-
82
- /// Get the size of the s and y vectors in the buffer.
83
- length_t n() const { return sto.rows() - 1; }
84
- /// Get the number of previous vectors s and y stored in the buffer.
85
- length_t history() const { return sto.cols() / 2; }
86
-
87
- auto s(index_t i) { return sto.col(2 * i).topRows(n()); }
88
- auto s(index_t i) const {
89
- return std::as_const(sto).col(2 * i).topRows(n());
90
- }
91
- auto y(index_t i) { return sto.col(2 * i + 1).topRows(n()); }
92
- auto y(index_t i) const {
93
- return std::as_const(sto).col(2 * i + 1).topRows(n());
94
- }
95
- real_t &ρ(index_t i) { return sto.coeffRef(n(), 2 * i); }
96
- real_t &ρ(index_t i) const { return sto.coeffRef(n(), 2 * i); }
97
- real_t &α(index_t i) { return sto.coeffRef(n(), 2 * i + 1); }
98
- real_t &α(index_t i) const { return sto.coeffRef(n(), 2 * i + 1); }
99
-
100
- using storage_t = mat;
101
- static_assert(!storage_t::IsRowMajor);
102
- mutable storage_t sto;
103
- };
104
-
105
- /// Limited memory Broyden–Fletcher–Goldfarb–Shanno (L-BFGS) algorithm
106
- /// @ingroup grp_Accelerators
107
- template <Config Conf = DefaultConfig>
108
- class ALPAQA_EXPORT LBFGS {
109
- public:
110
- USING_ALPAQA_CONFIG(Conf);
111
-
112
- using Params = LBFGSParams<config_t>;
113
-
114
- /// The sign of the vectors @f$ p @f$ passed to the @ref update method.
115
- enum class Sign {
116
- Positive, ///< @f$ p \sim \nabla \psi(x) @f$
117
- Negative, ///< @f$ p \sim -\nabla \psi(x) @f$
118
- };
119
-
120
- LBFGS() = default;
121
- LBFGS(Params params) : params(params) {}
122
- LBFGS(Params params, length_t n) : params(params) { resize(n); }
123
-
124
- /// Check if the new vectors s and y allow for a valid BFGS update that
125
- /// preserves the positive definiteness of the Hessian approximation.
126
- static bool update_valid(const Params &params, real_t yᵀs, real_t sᵀs,
127
- real_t pᵀp);
128
-
129
- /// Update the inverse Hessian approximation using the new vectors
130
- /// sₖ = xₙₑₓₜ - xₖ and yₖ = pₙₑₓₜ - pₖ.
131
- bool update_sy(crvec s, crvec y, real_t pₙₑₓₜᵀpₙₑₓₜ, bool forced = false);
132
- /// @see @ref update_sy
133
- bool update_sy_impl(const auto &s, const auto &y, real_t pₙₑₓₜᵀpₙₑₓₜ,
134
- bool forced = false);
135
-
136
- /// Update the inverse Hessian approximation using the new vectors xₙₑₓₜ
137
- /// and pₙₑₓₜ.
138
- bool update(crvec xₖ, crvec xₙₑₓₜ, crvec pₖ, crvec pₙₑₓₜ,
139
- Sign sign = Sign::Positive, bool forced = false);
140
-
141
- /// Apply the inverse Hessian approximation to the given vector q.
142
- /// Initial inverse Hessian approximation is set to @f$ H_0 = \gamma I @f$.
143
- /// If @p γ is negative, @f$ H_0 = \frac{s^\top y}{y^\top y} I @f$.
144
- bool apply(rvec q, real_t γ = -1) const;
145
-
146
- /// Apply the inverse Hessian approximation to the given vector q, applying
147
- /// only the columns and rows of the Hessian in the index set J.
148
- bool apply_masked(rvec q, real_t γ, crindexvec J) const;
149
- /// @copydoc apply_masked(rvec, real_t, crindexvec) const
150
- bool apply_masked(rvec q, real_t γ, const std::vector<index_t> &J) const;
151
- /// @copydoc apply_masked(rvec, real_t, crindexvec) const
152
- bool apply_masked_impl(rvec q, real_t γ, const auto &J) const;
153
-
154
- /// Throw away the approximation and all previous vectors s and y.
155
- void reset();
156
- /// Re-allocate storage for a problem with a different size. Causes
157
- /// a @ref reset.
158
- void resize(length_t n);
159
-
160
- /// Scale the stored y vectors by the given factor.
161
- void scale_y(real_t factor);
162
-
163
- /// Get a string identifier for this accelerator.
164
- std::string get_name() const {
165
- return "LBFGS<" + std::string(config_t::get_name()) + '>';
166
- }
167
- /// Get the parameters.
168
- const Params &get_params() const { return params; }
169
-
170
- /// Get the size of the s and y vectors in the buffer.
171
- length_t n() const { return sto.n(); }
172
- /// Get the number of previous vectors s and y stored in the buffer.
173
- length_t history() const { return sto.history(); }
174
- /// Get the next index in the circular buffer of previous s and y vectors.
175
- index_t succ(index_t i) const { return i + 1 < history() ? i + 1 : 0; }
176
- /// Get the previous index in the circular buffer of s and y vectors.
177
- index_t pred(index_t i) const { return i > 0 ? i - 1 : history() - 1; }
178
- /// Get the number of previous s and y vectors currently stored in the
179
- /// buffer.
180
- length_t current_history() const { return full ? history() : idx; }
181
-
182
- auto s(index_t i) { return sto.s(i); }
183
- auto s(index_t i) const { return sto.s(i); }
184
- auto y(index_t i) { return sto.y(i); }
185
- auto y(index_t i) const { return sto.y(i); }
186
- real_t &ρ(index_t i) { return sto.ρ(i); }
187
- real_t &ρ(index_t i) const { return sto.ρ(i); }
188
- real_t &α(index_t i) { return sto.α(i); }
189
- real_t &α(index_t i) const { return sto.α(i); }
190
-
191
- /// Iterate over the indices in the history buffer, oldest first.
192
- template <class F>
193
- void foreach_fwd(const F &fun) const {
194
- if (full)
195
- for (index_t i = idx; i < history(); ++i)
196
- fun(i);
197
- if (idx)
198
- for (index_t i = 0; i < idx; ++i)
199
- fun(i);
200
- }
201
-
202
- /// Iterate over the indices in the history buffer, newest first.
203
- template <class F>
204
- void foreach_rev(const F &fun) const {
205
- if (idx)
206
- for (index_t i = idx; i-- > 0;)
207
- fun(i);
208
- if (full)
209
- for (index_t i = history(); i-- > idx;)
210
- fun(i);
211
- }
212
-
213
- private:
214
- LBFGSStorage<config_t> sto;
215
- index_t idx = 0;
216
- bool full = false;
217
- Params params;
218
- };
219
-
220
- ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, CBFGSParams, DefaultConfig);
221
- ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, CBFGSParams, EigenConfigf);
222
- ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, CBFGSParams, EigenConfigd);
223
- ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, CBFGSParams, EigenConfigl);
224
- #ifdef ALPAQA_WITH_QUAD_PRECISION
225
- ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, CBFGSParams, EigenConfigq);
226
- #endif
227
-
228
- ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, LBFGSParams, DefaultConfig);
229
- ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, LBFGSParams, EigenConfigf);
230
- ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, LBFGSParams, EigenConfigd);
231
- ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, LBFGSParams, EigenConfigl);
232
- #ifdef ALPAQA_WITH_QUAD_PRECISION
233
- ALPAQA_EXPORT_EXTERN_TEMPLATE(struct, LBFGSParams, EigenConfigq);
234
- #endif
235
-
236
- ALPAQA_EXPORT_EXTERN_TEMPLATE(class, LBFGS, DefaultConfig);
237
- ALPAQA_EXPORT_EXTERN_TEMPLATE(class, LBFGS, EigenConfigf);
238
- ALPAQA_EXPORT_EXTERN_TEMPLATE(class, LBFGS, EigenConfigd);
239
- ALPAQA_EXPORT_EXTERN_TEMPLATE(class, LBFGS, EigenConfigl);
240
- #ifdef ALPAQA_WITH_QUAD_PRECISION
241
- ALPAQA_EXPORT_EXTERN_TEMPLATE(class, LBFGS, EigenConfigq);
242
- #endif
243
-
244
- } // namespace alpaqa
@@ -1,143 +0,0 @@
1
- #pragma once
2
-
3
- #include <alpaqa/config/config.hpp>
4
- #include <alpaqa/util/alloc-check.hpp>
5
-
6
- namespace alpaqa {
7
-
8
- template <Config Conf>
9
- struct SteihaugCGParams {
10
- USING_ALPAQA_CONFIG(Conf);
11
- real_t tol_scale = 1;
12
- real_t tol_scale_root = real_t(0.5);
13
- real_t tol_max = inf<config_t>;
14
- real_t max_iter_factor = 1;
15
- };
16
-
17
- /// Steihaug conjugate gradients procedure based on
18
- /// https://github.com/scipy/scipy/blob/583e70a50573169fc352b5dc6d94588a97c7389a/scipy/optimize/_trustregion_ncg.py#L44
19
- template <Config Conf>
20
- struct SteihaugCG {
21
- USING_ALPAQA_CONFIG(Conf);
22
-
23
- using Params = SteihaugCGParams<config_t>;
24
- Params params;
25
-
26
- SteihaugCG() = default;
27
- SteihaugCG(const Params &params) : params{params} {}
28
-
29
- mutable vec z, r, d, Bd, work_eval;
30
-
31
- void resize(length_t n) {
32
- z.resize(n);
33
- r.resize(n);
34
- d.resize(n);
35
- Bd.resize(n);
36
- work_eval.resize(n);
37
- }
38
-
39
- template <class HessFun>
40
- real_t solve(const auto &grad, const HessFun &hess_prod,
41
- real_t trust_radius, rvec step) const {
42
- length_t n = grad.size();
43
- // get the norm of jacobian and define the origin
44
- auto v = [n](auto &v) { return v.topRows(n); };
45
- auto z = v(this->z), r = v(this->r), d = v(this->d), Bd = v(this->Bd);
46
- auto g = v(grad);
47
- auto s = v(step);
48
- // init the state for the first iteration
49
- z.setZero();
50
- r = g;
51
- d = -r;
52
- real_t r_sq = r.squaredNorm();
53
- real_t grad_mag = g.norm();
54
-
55
- // define a default tolerance
56
- real_t tolerance =
57
- std::fmin(params.tol_max, params.tol_scale * grad_mag *
58
- std::fmin(params.tol_scale_root,
59
- std::sqrt(grad_mag)));
60
-
61
- // Workspaces and function evaluation
62
- auto eval = [&](crvec p) {
63
- hess_prod(p, work_eval);
64
- return p.dot(g) + real_t(0.5) * p.dot(v(work_eval));
65
- };
66
-
67
- // Search for the min of the approximation of the objective function.
68
- index_t i = 0;
69
- const auto max_iter = static_cast<index_t>(
70
- std::round(static_cast<real_t>(n) * params.max_iter_factor));
71
- while (true) {
72
- // do an iteration
73
- hess_prod(d, Bd);
74
- real_t dBd = d.dot(Bd);
75
- if (dBd <= 0) {
76
- // Look at the two boundary points.
77
- // Find both values of t to get the boundary points such that
78
- // ||z + t d|| == trust_radius
79
- // and then choose the one with the predicted min value.
80
- auto [ta, tb] =
81
- get_boundaries_intersections(z, d, trust_radius);
82
- auto &pa = r; // Reuse storage
83
- auto &pb = d; // Reuse storage
84
- pa = z + ta * d;
85
- pb = z + tb * d;
86
- real_t q_a = eval(pa), q_b = eval(pb);
87
- real_t q_min = std::fmin(q_a, q_b);
88
- if (q_a == q_min) {
89
- s = pa;
90
- return q_a;
91
- } else {
92
- s = pb;
93
- return q_b;
94
- }
95
- }
96
-
97
- real_t alpha = r_sq / dBd;
98
- s = z + alpha * d;
99
- if (s.norm() >= trust_radius) {
100
- // Find t >= 0 to get the boundary point such that
101
- // ||z + t d|| == trust_radius
102
- auto [ta, tb] =
103
- get_boundaries_intersections(z, d, trust_radius);
104
- s = z + tb * d;
105
- return eval(s);
106
- }
107
- r += alpha * Bd;
108
- real_t r_next_sq = r.squaredNorm();
109
- if (std::sqrt(r_next_sq) < tolerance || i > max_iter)
110
- return eval(s);
111
- real_t beta_next = r_next_sq / r_sq;
112
- r_sq = r_next_sq;
113
- d = beta_next * d - r;
114
- z = s;
115
- ++i;
116
- }
117
- }
118
-
119
- /// Solve the scalar quadratic equation ||z + t d|| == trust_radius.
120
- /// This is like a line-sphere intersection.
121
- /// Return the two values of t, sorted from low to high.
122
- static auto get_boundaries_intersections(crvec z, crvec d,
123
- real_t trust_radius) {
124
- real_t a = d.squaredNorm();
125
- real_t b = 2 * z.dot(d);
126
- real_t c = z.squaredNorm() - trust_radius * trust_radius;
127
- real_t sqrt_discriminant = std::sqrt(b * b - 4 * a * c);
128
-
129
- // The following calculation is mathematically
130
- // equivalent to:
131
- // ta = (-b - sqrt_discriminant) / (2*a)
132
- // tb = (-b + sqrt_discriminant) / (2*a)
133
- // but produce smaller round off errors.
134
- // Look at Matrix Computation p.97
135
- // for a better justification.
136
- real_t aux = b + std::copysign(sqrt_discriminant, b);
137
- real_t ta = -aux / (2 * a);
138
- real_t tb = -2 * c / aux;
139
- return std::make_tuple(std::fmin(ta, tb), std::fmax(ta, tb));
140
- }
141
- };
142
-
143
- } // namespace alpaqa
@@ -1,3 +0,0 @@
1
- #pragma once
2
-
3
- #include <alpaqa/panoc-alm.hpp>