casadi 3.6.5__cp312-none-manylinux2014_x86_64.whl → 3.6.7__cp312-none-manylinux2014_x86_64.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 (429) hide show
  1. casadi/_casadi.so +0 -0
  2. casadi/casadi.py +739 -308
  3. casadi/cbc +0 -0
  4. casadi/clp +0 -0
  5. casadi/cmake/casadi-config-version.cmake +1 -1
  6. casadi/cmake/highs/highs-config.cmake +6 -13
  7. casadi/cmake/highs/highs-targets-release.cmake +13 -13
  8. casadi/cmake/highs/highs-targets.cmake +13 -10
  9. casadi/highs +0 -0
  10. casadi/include/casadi/casadi.i +3 -0
  11. casadi/include/casadi/casadi_c.h +2 -0
  12. casadi/include/casadi/config.h +8 -8
  13. casadi/include/casadi/core/casadi_common.hpp +1 -0
  14. casadi/include/casadi/core/casadi_misc.hpp +52 -0
  15. casadi/include/casadi/core/casadi_types.hpp +3 -2
  16. casadi/include/casadi/core/code_generator.hpp +30 -1
  17. casadi/include/casadi/core/global_options.hpp +2 -0
  18. casadi/include/casadi/core/mx.hpp +18 -3
  19. casadi/include/casadi/core/optistack.hpp +23 -0
  20. casadi/include/casadi/core/runtime/casadi_nlp.hpp +19 -4
  21. casadi/include/casadi/core/runtime/casadi_ocp_block.hpp +55 -0
  22. casadi/include/casadi/core/runtime/casadi_oracle.hpp +44 -0
  23. casadi/include/casadi/core/runtime/casadi_oracle_callback.hpp +39 -0
  24. casadi/include/casadi/core/runtime/casadi_runtime.hpp +4 -1
  25. casadi/include/casadi/core/runtime/casadi_scaled_copy.hpp +31 -0
  26. casadi/include/casadi/core/serializing_stream.hpp +2 -2
  27. casadi/include/casadi/core/sparsity.hpp +7 -0
  28. casadi/include/casadi/doc.i +1513 -1016
  29. casadi/include/casadi/doc_merged.i +965 -719
  30. casadi/include/casadi/mem.h +1 -0
  31. casadi/include/daqp/api.h +46 -0
  32. casadi/include/daqp/auxiliary.h +29 -0
  33. casadi/include/daqp/bnb.h +32 -0
  34. casadi/include/daqp/codegen.h +18 -0
  35. casadi/include/daqp/constants.h +92 -0
  36. casadi/include/daqp/daqp.h +22 -0
  37. casadi/include/daqp/daqp_prox.h +18 -0
  38. casadi/include/daqp/factorization.h +18 -0
  39. casadi/include/daqp/types.h +161 -0
  40. casadi/include/daqp/utils.h +44 -0
  41. casadi/include/fatrop/auxiliary/Common.hpp +34 -0
  42. casadi/include/fatrop/auxiliary/DynamicLib.hpp +34 -0
  43. casadi/include/fatrop/auxiliary/FatropOptions.hpp +68 -0
  44. casadi/include/fatrop/auxiliary/FatropVector.hpp +143 -0
  45. casadi/include/fatrop/auxiliary/LinearAlgebra.hpp +88 -0
  46. casadi/include/fatrop/auxiliary/VectorUtils.hpp +54 -0
  47. casadi/include/fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp +493 -0
  48. casadi/include/fatrop/fatrop.hpp +39 -0
  49. casadi/include/fatrop/function_evaluation/CasadiCodegen.hpp +104 -0
  50. casadi/include/fatrop/function_evaluation/FunctionEvaluation.hpp +60 -0
  51. casadi/include/fatrop/json/json.h +946 -0
  52. casadi/include/fatrop/ocp/CasadiCApiUserdataWrap.hpp +87 -0
  53. casadi/include/fatrop/ocp/DuInfEvaluator.hpp +38 -0
  54. casadi/include/fatrop/ocp/FatropOCP.hpp +161 -0
  55. casadi/include/fatrop/ocp/FatropOCPBuilder.hpp +52 -0
  56. casadi/include/fatrop/ocp/FatropOCPResto.hpp +299 -0
  57. casadi/include/fatrop/ocp/OCP.hpp +82 -0
  58. casadi/include/fatrop/ocp/OCPAbstract.hpp +254 -0
  59. casadi/include/fatrop/ocp/OCPAdapter.hpp +197 -0
  60. casadi/include/fatrop/ocp/OCPCInterface.h +289 -0
  61. casadi/include/fatrop/ocp/OCPDims.hpp +60 -0
  62. casadi/include/fatrop/ocp/OCPInitializer.hpp +41 -0
  63. casadi/include/fatrop/ocp/OCPKKT.hpp +69 -0
  64. casadi/include/fatrop/ocp/OCPLSRiccati.hpp +198 -0
  65. casadi/include/fatrop/ocp/OCPLSScaler.hpp +66 -0
  66. casadi/include/fatrop/ocp/OCPLinearSolver.hpp +75 -0
  67. casadi/include/fatrop/ocp/OCPNoScaling.hpp +42 -0
  68. casadi/include/fatrop/ocp/OCPScalingMethod.hpp +42 -0
  69. casadi/include/fatrop/ocp/StageOCP.hpp +592 -0
  70. casadi/include/fatrop/ocp/StageOCPApplication.hpp +242 -0
  71. casadi/include/fatrop/ocp/StageOCPExpressions.hpp +182 -0
  72. casadi/include/fatrop/ocp/UStageEvalAbstract.hpp +168 -0
  73. casadi/include/fatrop/ocp/UStageOCPImpl.hpp +152 -0
  74. casadi/include/fatrop/quasi_newton/bfgs.hpp +159 -0
  75. casadi/include/fatrop/solver/AlgBuilder.hpp +76 -0
  76. casadi/include/fatrop/solver/AlgStrategy.hpp +33 -0
  77. casadi/include/fatrop/solver/FatropAlg.hpp +121 -0
  78. casadi/include/fatrop/solver/FatropData.hpp +188 -0
  79. casadi/include/fatrop/solver/FatropOptions.hpp +95 -0
  80. casadi/include/fatrop/solver/FatropPrinter.hpp +65 -0
  81. casadi/include/fatrop/solver/FatropStats.hpp +63 -0
  82. casadi/include/fatrop/solver/Filter.hpp +54 -0
  83. casadi/include/fatrop/solver/IterationData.hpp +56 -0
  84. casadi/include/fatrop/solver/LineSearch.hpp +86 -0
  85. casadi/include/fatrop/solver/NLPL1.hpp +263 -0
  86. casadi/include/fatrop/templates/NLPAlg.hpp +104 -0
  87. casadi/include/highs/HConfig.h +6 -5
  88. casadi/include/highs/Highs.h +93 -23
  89. casadi/include/highs/filereaderlp/def.hpp +19 -0
  90. casadi/include/highs/interfaces/highs_c_api.h +200 -24
  91. casadi/include/highs/io/Filereader.h +1 -1
  92. casadi/include/highs/io/FilereaderEms.h +1 -1
  93. casadi/include/highs/io/FilereaderLp.h +1 -1
  94. casadi/include/highs/io/FilereaderMps.h +1 -1
  95. casadi/include/highs/io/HMPSIO.h +1 -1
  96. casadi/include/highs/io/HMpsFF.h +5 -3
  97. casadi/include/highs/io/HighsIO.h +18 -8
  98. casadi/include/highs/io/LoadOptions.h +1 -1
  99. casadi/include/highs/ipm/IpxSolution.h +35 -0
  100. casadi/include/highs/ipm/IpxWrapper.h +1 -1
  101. casadi/include/highs/ipm/basiclu/basiclu.h +161 -0
  102. casadi/include/highs/ipm/basiclu/basiclu_factorize.h +247 -0
  103. casadi/include/highs/ipm/basiclu/basiclu_get_factors.h +108 -0
  104. casadi/include/highs/ipm/basiclu/basiclu_initialize.h +119 -0
  105. casadi/include/highs/ipm/basiclu/basiclu_obj_factorize.h +34 -0
  106. casadi/include/highs/ipm/basiclu/basiclu_obj_free.h +19 -0
  107. casadi/include/highs/ipm/basiclu/basiclu_obj_get_factors.h +34 -0
  108. casadi/include/highs/ipm/basiclu/basiclu_obj_initialize.h +46 -0
  109. casadi/include/highs/ipm/basiclu/basiclu_obj_solve_dense.h +29 -0
  110. casadi/include/highs/ipm/basiclu/basiclu_obj_solve_for_update.h +42 -0
  111. casadi/include/highs/ipm/basiclu/basiclu_obj_solve_sparse.h +32 -0
  112. casadi/include/highs/ipm/basiclu/basiclu_obj_update.h +31 -0
  113. casadi/include/highs/ipm/basiclu/basiclu_object.h +30 -0
  114. casadi/include/highs/ipm/basiclu/basiclu_solve_dense.h +75 -0
  115. casadi/include/highs/ipm/basiclu/basiclu_solve_for_update.h +169 -0
  116. casadi/include/highs/ipm/basiclu/basiclu_solve_sparse.h +112 -0
  117. casadi/include/highs/ipm/basiclu/basiclu_update.h +125 -0
  118. casadi/include/highs/ipm/basiclu/lu_def.h +39 -0
  119. casadi/include/highs/ipm/basiclu/lu_file.h +21 -0
  120. casadi/include/highs/ipm/basiclu/lu_internal.h +220 -0
  121. casadi/include/highs/ipm/basiclu/lu_list.h +168 -0
  122. casadi/include/highs/ipm/ipx/basiclu_kernel.h +20 -0
  123. casadi/include/highs/ipm/ipx/basiclu_wrapper.h +47 -0
  124. casadi/include/highs/ipm/ipx/basis.h +351 -0
  125. casadi/include/highs/ipm/ipx/conjugate_residuals.h +74 -0
  126. casadi/include/highs/ipm/ipx/control.h +163 -0
  127. casadi/include/highs/ipm/ipx/crossover.h +157 -0
  128. casadi/include/highs/ipm/ipx/diagonal_precond.h +45 -0
  129. casadi/include/highs/ipm/ipx/forrest_tomlin.h +102 -0
  130. casadi/include/highs/ipm/ipx/guess_basis.h +21 -0
  131. casadi/include/highs/ipm/ipx/indexed_vector.h +113 -0
  132. casadi/include/highs/ipm/ipx/info.h +27 -0
  133. casadi/include/highs/ipm/ipx/ipm.h +94 -0
  134. casadi/include/highs/ipm/ipx/ipx_c.h +47 -0
  135. casadi/include/highs/ipm/ipx/ipx_config.h +9 -0
  136. casadi/include/highs/ipm/ipx/ipx_info.h +111 -0
  137. casadi/include/highs/ipm/ipx/ipx_internal.h +88 -0
  138. casadi/include/highs/ipm/ipx/ipx_parameters.h +75 -0
  139. casadi/include/highs/ipm/ipx/ipx_status.h +57 -0
  140. casadi/include/highs/ipm/ipx/iterate.h +328 -0
  141. casadi/include/highs/ipm/ipx/kkt_solver.h +70 -0
  142. casadi/include/highs/ipm/ipx/kkt_solver_basis.h +66 -0
  143. casadi/include/highs/ipm/ipx/kkt_solver_diag.h +48 -0
  144. casadi/include/highs/ipm/ipx/linear_operator.h +26 -0
  145. casadi/include/highs/ipm/ipx/lp_solver.h +201 -0
  146. casadi/include/highs/ipm/ipx/lu_factorization.h +79 -0
  147. casadi/include/highs/ipm/ipx/lu_update.h +129 -0
  148. casadi/include/highs/ipm/ipx/maxvolume.h +54 -0
  149. casadi/include/highs/ipm/ipx/model.h +409 -0
  150. casadi/include/highs/ipm/ipx/multistream.h +52 -0
  151. casadi/include/highs/ipm/ipx/normal_matrix.h +44 -0
  152. casadi/include/highs/ipm/ipx/power_method.h +44 -0
  153. casadi/include/highs/ipm/ipx/sparse_matrix.h +195 -0
  154. casadi/include/highs/ipm/ipx/sparse_utils.h +58 -0
  155. casadi/include/highs/ipm/ipx/splitted_normal_matrix.h +63 -0
  156. casadi/include/highs/ipm/ipx/starting_basis.h +39 -0
  157. casadi/include/highs/ipm/ipx/symbolic_invert.h +29 -0
  158. casadi/include/highs/ipm/ipx/timer.h +24 -0
  159. casadi/include/highs/ipm/ipx/utils.h +39 -0
  160. casadi/include/highs/lp_data/HConst.h +20 -10
  161. casadi/include/highs/lp_data/HStruct.h +23 -1
  162. casadi/include/highs/lp_data/HighsAnalysis.h +1 -1
  163. casadi/include/highs/lp_data/HighsCallback.h +10 -3
  164. casadi/include/highs/lp_data/HighsCallbackStruct.h +31 -5
  165. casadi/include/highs/lp_data/HighsDebug.h +1 -1
  166. casadi/include/highs/lp_data/HighsInfo.h +20 -2
  167. casadi/include/highs/lp_data/HighsInfoDebug.h +1 -1
  168. casadi/include/highs/lp_data/HighsLp.h +17 -1
  169. casadi/include/highs/lp_data/HighsLpSolverObject.h +1 -1
  170. casadi/include/highs/lp_data/HighsLpUtils.h +19 -19
  171. casadi/include/highs/lp_data/HighsModelUtils.h +1 -1
  172. casadi/include/highs/lp_data/HighsOptions.h +237 -10
  173. casadi/include/highs/lp_data/HighsRanging.h +1 -1
  174. casadi/include/highs/lp_data/HighsRuntimeOptions.h +2 -2
  175. casadi/include/highs/lp_data/HighsSolution.h +2 -2
  176. casadi/include/highs/lp_data/HighsSolutionDebug.h +1 -1
  177. casadi/include/highs/lp_data/HighsSolve.h +3 -1
  178. casadi/include/highs/lp_data/HighsStatus.h +1 -1
  179. casadi/include/highs/mip/HighsCliqueTable.h +4 -4
  180. casadi/include/highs/mip/HighsConflictPool.h +1 -1
  181. casadi/include/highs/mip/HighsCutGeneration.h +1 -1
  182. casadi/include/highs/mip/HighsCutPool.h +2 -2
  183. casadi/include/highs/mip/HighsDebugSol.h +22 -29
  184. casadi/include/highs/mip/HighsDomain.h +10 -2
  185. casadi/include/highs/mip/HighsDomainChange.h +1 -1
  186. casadi/include/highs/mip/HighsDynamicRowMatrix.h +5 -3
  187. casadi/include/highs/mip/HighsGFkSolve.h +3 -3
  188. casadi/include/highs/mip/HighsImplications.h +3 -3
  189. casadi/include/highs/mip/HighsLpAggregator.h +1 -1
  190. casadi/include/highs/mip/HighsLpRelaxation.h +6 -1
  191. casadi/include/highs/mip/HighsMipSolver.h +4 -2
  192. casadi/include/highs/mip/HighsMipSolverData.h +47 -4
  193. casadi/include/highs/mip/HighsModkSeparator.h +2 -2
  194. casadi/include/highs/mip/HighsNodeQueue.h +5 -3
  195. casadi/include/highs/mip/HighsObjectiveFunction.h +1 -1
  196. casadi/include/highs/mip/HighsPathSeparator.h +2 -2
  197. casadi/include/highs/mip/HighsPrimalHeuristics.h +1 -1
  198. casadi/include/highs/mip/HighsPseudocost.h +35 -23
  199. casadi/include/highs/mip/HighsRedcostFixing.h +1 -1
  200. casadi/include/highs/mip/HighsSearch.h +2 -1
  201. casadi/include/highs/mip/HighsSeparation.h +1 -1
  202. casadi/include/highs/mip/HighsSeparator.h +1 -1
  203. casadi/include/highs/mip/HighsTableauSeparator.h +1 -1
  204. casadi/include/highs/mip/HighsTransformedLp.h +1 -1
  205. casadi/include/highs/model/HighsHessian.h +5 -0
  206. casadi/include/highs/model/HighsHessianUtils.h +2 -0
  207. casadi/include/highs/model/HighsModel.h +10 -1
  208. casadi/include/highs/parallel/HighsMutex.h +2 -1
  209. casadi/include/highs/parallel/HighsParallel.h +7 -2
  210. casadi/include/highs/parallel/HighsTask.h +1 -2
  211. casadi/include/highs/pdlp/CupdlpWrapper.h +93 -0
  212. casadi/include/highs/pdlp/cupdlp/cupdlp_cs.h +41 -0
  213. casadi/include/highs/pdlp/cupdlp/cupdlp_defs.h +423 -0
  214. casadi/include/highs/pdlp/cupdlp/cupdlp_linalg.h +183 -0
  215. casadi/include/highs/pdlp/cupdlp/cupdlp_proj.h +19 -0
  216. casadi/include/highs/pdlp/cupdlp/cupdlp_restart.h +31 -0
  217. casadi/include/highs/pdlp/cupdlp/cupdlp_scaling_cuda.h +28 -0
  218. casadi/include/highs/pdlp/cupdlp/cupdlp_solver.h +98 -0
  219. casadi/include/highs/pdlp/cupdlp/cupdlp_step.h +33 -0
  220. casadi/include/highs/pdlp/cupdlp/cupdlp_utils.c +1726 -0
  221. casadi/include/highs/pdqsort/pdqsort.h +532 -0
  222. casadi/include/highs/presolve/HPresolve.h +27 -14
  223. casadi/include/highs/presolve/HPresolveAnalysis.h +1 -1
  224. casadi/include/highs/presolve/HighsPostsolveStack.h +92 -68
  225. casadi/include/highs/presolve/HighsSymmetry.h +6 -5
  226. casadi/include/highs/presolve/ICrash.h +8 -2
  227. casadi/include/highs/presolve/ICrashUtil.h +1 -1
  228. casadi/include/highs/presolve/ICrashX.h +1 -1
  229. casadi/include/highs/presolve/PresolveComponent.h +1 -1
  230. casadi/include/highs/qpsolver/a_asm.hpp +23 -12
  231. casadi/include/highs/qpsolver/a_quass.hpp +8 -1
  232. casadi/include/highs/qpsolver/basis.hpp +150 -0
  233. casadi/include/highs/qpsolver/crashsolution.hpp +12 -0
  234. casadi/include/highs/qpsolver/dantzigpricing.hpp +72 -0
  235. casadi/include/highs/qpsolver/devexpricing.hpp +99 -0
  236. casadi/include/highs/qpsolver/eventhandler.hpp +23 -0
  237. casadi/include/highs/qpsolver/factor.hpp +400 -0
  238. casadi/include/highs/qpsolver/feasibility_bounded.hpp +105 -0
  239. casadi/include/highs/qpsolver/feasibility_highs.hpp +270 -0
  240. casadi/include/highs/qpsolver/gradient.hpp +39 -0
  241. casadi/include/highs/qpsolver/instance.hpp +63 -0
  242. casadi/include/highs/qpsolver/matrix.hpp +335 -0
  243. casadi/include/highs/qpsolver/pricing.hpp +15 -0
  244. casadi/include/highs/qpsolver/qpconst.hpp +27 -0
  245. casadi/include/highs/qpsolver/{vector.hpp → qpvector.hpp} +25 -25
  246. casadi/include/highs/qpsolver/quass.hpp +1 -1
  247. casadi/include/highs/qpsolver/ratiotest.hpp +19 -0
  248. casadi/include/highs/qpsolver/runtime.hpp +38 -0
  249. casadi/include/highs/qpsolver/settings.hpp +57 -0
  250. casadi/include/highs/qpsolver/snippets.hpp +29 -0
  251. casadi/include/highs/qpsolver/statistics.hpp +23 -0
  252. casadi/include/highs/qpsolver/steepestedgepricing.hpp +167 -0
  253. casadi/include/highs/simplex/HApp.h +1 -1
  254. casadi/include/highs/simplex/HEkk.h +52 -18
  255. casadi/include/highs/simplex/HEkkDual.h +1 -1
  256. casadi/include/highs/simplex/HEkkDualRHS.h +6 -7
  257. casadi/include/highs/simplex/HEkkDualRow.h +2 -2
  258. casadi/include/highs/simplex/HEkkPrimal.h +6 -1
  259. casadi/include/highs/simplex/HSimplex.h +1 -3
  260. casadi/include/highs/simplex/HSimplexDebug.h +1 -1
  261. casadi/include/highs/simplex/HSimplexNla.h +1 -1
  262. casadi/include/highs/simplex/HSimplexReport.h +1 -1
  263. casadi/include/highs/simplex/HighsSimplexAnalysis.h +228 -100
  264. casadi/include/highs/simplex/SimplexConst.h +1 -1
  265. casadi/include/highs/simplex/SimplexStruct.h +2 -2
  266. casadi/include/highs/simplex/SimplexTimer.h +1 -1
  267. casadi/include/highs/test/DevKkt.h +1 -1
  268. casadi/include/highs/test/KktCh2.h +1 -1
  269. casadi/include/highs/util/FactorTimer.h +1 -1
  270. casadi/include/highs/util/HFactor.h +35 -6
  271. casadi/include/highs/util/HFactorConst.h +1 -1
  272. casadi/include/highs/util/HFactorDebug.h +1 -1
  273. casadi/include/highs/util/HSet.h +1 -1
  274. casadi/include/highs/util/HVector.h +1 -1
  275. casadi/include/highs/util/HVectorBase.h +1 -1
  276. casadi/include/highs/util/HighsCDouble.h +3 -3
  277. casadi/include/highs/util/HighsComponent.h +1 -1
  278. casadi/include/highs/util/HighsDataStack.h +4 -4
  279. casadi/include/highs/util/HighsDisjointSets.h +1 -1
  280. casadi/include/highs/util/HighsHash.h +28 -21
  281. casadi/include/highs/util/HighsHashTree.h +63 -63
  282. casadi/include/highs/util/HighsInt.h +1 -1
  283. casadi/include/highs/util/HighsIntegers.h +8 -9
  284. casadi/include/highs/util/HighsLinearSumBounds.h +1 -1
  285. casadi/include/highs/util/HighsMatrixPic.h +1 -1
  286. casadi/include/highs/util/HighsMatrixSlice.h +9 -6
  287. casadi/include/highs/util/HighsMatrixUtils.h +1 -1
  288. casadi/include/highs/util/HighsMemoryAllocation.h +55 -0
  289. casadi/include/highs/util/HighsRandom.h +27 -15
  290. casadi/include/highs/util/HighsRbTree.h +2 -2
  291. casadi/include/highs/util/HighsSort.h +7 -7
  292. casadi/include/highs/util/HighsSparseMatrix.h +5 -2
  293. casadi/include/highs/util/HighsSparseVectorSum.h +2 -2
  294. casadi/include/highs/util/HighsSplay.h +1 -1
  295. casadi/include/highs/util/HighsTimer.h +18 -9
  296. casadi/include/highs/util/HighsUtils.h +15 -8
  297. casadi/include/highs/util/stringutil.h +9 -4
  298. casadi/include/highs/zstr/strict_fstream.hpp +237 -0
  299. casadi/include/highs/zstr/zstr.hpp +472 -0
  300. casadi/include/highs_export.h +42 -0
  301. casadi/include/licenses/daqp-external/LICENSE +21 -0
  302. casadi/include/licenses/fatrop-external/LICENSE.txt +165 -0
  303. casadi/include/licenses/fatrop-external/external/blasfeo/LICENSE.txt +26 -0
  304. casadi/include/licenses/fatrop-external/external/pybind11/LICENSE +29 -0
  305. casadi/include/licenses/highs-external/{LICENSE → LICENSE.txt} +1 -1
  306. casadi/include/osqp/constants.h +2 -3
  307. casadi/include/osqp/version.h +9 -0
  308. casadi/include/sleqp/defs.h +2 -2
  309. casadi/lib64/libtinyxml2.a +0 -0
  310. casadi/libCbcSolver.so +0 -0
  311. casadi/libCbcSolver.so.3 +0 -0
  312. casadi/libCbcSolver.so.3.10.11 +0 -0
  313. casadi/libClpSolver.so +0 -0
  314. casadi/libClpSolver.so.1 +0 -0
  315. casadi/libClpSolver.so.1.14.9 +0 -0
  316. casadi/libbonmin.so +0 -0
  317. casadi/libbonmin.so.4 +0 -0
  318. casadi/libbonmin.so.4.8.9 +0 -0
  319. casadi/libcasadi.so +0 -0
  320. casadi/libcasadi.so.3.7 +0 -0
  321. casadi/libcasadi_conic_cbc.so +0 -0
  322. casadi/libcasadi_conic_cbc.so.3.7 +0 -0
  323. casadi/libcasadi_conic_clp.so +0 -0
  324. casadi/libcasadi_conic_clp.so.3.7 +0 -0
  325. casadi/libcasadi_conic_cplex.so +0 -0
  326. casadi/libcasadi_conic_cplex.so.3.7 +0 -0
  327. casadi/libcasadi_conic_daqp.so +0 -0
  328. casadi/libcasadi_conic_daqp.so.3.7 +0 -0
  329. casadi/libcasadi_conic_fatrop.so +0 -0
  330. casadi/libcasadi_conic_fatrop.so.3.7 +0 -0
  331. casadi/libcasadi_conic_gurobi.so +0 -0
  332. casadi/libcasadi_conic_gurobi.so.3.7 +0 -0
  333. casadi/libcasadi_conic_highs.so +0 -0
  334. casadi/libcasadi_conic_highs.so.3.7 +0 -0
  335. casadi/libcasadi_conic_hpipm.so +0 -0
  336. casadi/libcasadi_conic_hpipm.so.3.7 +0 -0
  337. casadi/libcasadi_conic_ipqp.so +0 -0
  338. casadi/libcasadi_conic_ipqp.so.3.7 +0 -0
  339. casadi/libcasadi_conic_nlpsol.so +0 -0
  340. casadi/libcasadi_conic_nlpsol.so.3.7 +0 -0
  341. casadi/libcasadi_conic_osqp.so +0 -0
  342. casadi/libcasadi_conic_osqp.so.3.7 +0 -0
  343. casadi/libcasadi_conic_proxqp.so +0 -0
  344. casadi/libcasadi_conic_proxqp.so.3.7 +0 -0
  345. casadi/libcasadi_conic_qpoases.so +0 -0
  346. casadi/libcasadi_conic_qpoases.so.3.7 +0 -0
  347. casadi/libcasadi_conic_qrqp.so +0 -0
  348. casadi/libcasadi_conic_qrqp.so.3.7 +0 -0
  349. casadi/libcasadi_conic_superscs.so +0 -0
  350. casadi/libcasadi_conic_superscs.so.3.7 +0 -0
  351. casadi/libcasadi_integrator_collocation.so +0 -0
  352. casadi/libcasadi_integrator_collocation.so.3.7 +0 -0
  353. casadi/libcasadi_integrator_cvodes.so +0 -0
  354. casadi/libcasadi_integrator_cvodes.so.3.7 +0 -0
  355. casadi/libcasadi_integrator_idas.so +0 -0
  356. casadi/libcasadi_integrator_idas.so.3.7 +0 -0
  357. casadi/libcasadi_integrator_rk.so +0 -0
  358. casadi/libcasadi_integrator_rk.so.3.7 +0 -0
  359. casadi/libcasadi_nlpsol_alpaqa.so +0 -0
  360. casadi/libcasadi_nlpsol_alpaqa.so.3.7 +0 -0
  361. casadi/libcasadi_nlpsol_ampl.so +0 -0
  362. casadi/libcasadi_nlpsol_ampl.so.3.7 +0 -0
  363. casadi/libcasadi_nlpsol_blocksqp.so +0 -0
  364. casadi/libcasadi_nlpsol_blocksqp.so.3.7 +0 -0
  365. casadi/libcasadi_nlpsol_bonmin.so +0 -0
  366. casadi/libcasadi_nlpsol_bonmin.so.3.7 +0 -0
  367. casadi/libcasadi_nlpsol_fatrop.so +0 -0
  368. casadi/libcasadi_nlpsol_fatrop.so.3.7 +0 -0
  369. casadi/libcasadi_nlpsol_feasiblesqpmethod.so +0 -0
  370. casadi/libcasadi_nlpsol_feasiblesqpmethod.so.3.7 +0 -0
  371. casadi/libcasadi_nlpsol_ipopt.so +0 -0
  372. casadi/libcasadi_nlpsol_ipopt.so.3.7 +0 -0
  373. casadi/libcasadi_nlpsol_knitro.so +0 -0
  374. casadi/libcasadi_nlpsol_knitro.so.3.7 +0 -0
  375. casadi/libcasadi_nlpsol_madnlp.so +0 -0
  376. casadi/libcasadi_nlpsol_madnlp.so.3.7 +0 -0
  377. casadi/libcasadi_nlpsol_qrsqp.so +0 -0
  378. casadi/libcasadi_nlpsol_qrsqp.so.3.7 +0 -0
  379. casadi/libcasadi_nlpsol_scpgen.so +0 -0
  380. casadi/libcasadi_nlpsol_scpgen.so.3.7 +0 -0
  381. casadi/libcasadi_nlpsol_sleqp.so +0 -0
  382. casadi/libcasadi_nlpsol_sleqp.so.3.7 +0 -0
  383. casadi/libcasadi_nlpsol_snopt.so +0 -0
  384. casadi/libcasadi_nlpsol_snopt.so.3.7 +0 -0
  385. casadi/libcasadi_nlpsol_sqpmethod.so +0 -0
  386. casadi/libcasadi_nlpsol_sqpmethod.so.3.7 +0 -0
  387. casadi/libcasadi_nlpsol_worhp.so +0 -0
  388. casadi/libcasadi_nlpsol_worhp.so.3.7 +0 -0
  389. casadi/libcasadi_rootfinder_fast_newton.so +0 -0
  390. casadi/libcasadi_rootfinder_fast_newton.so.3.7 +0 -0
  391. casadi/libcasadi_rootfinder_kinsol.so +0 -0
  392. casadi/libcasadi_rootfinder_kinsol.so.3.7 +0 -0
  393. casadi/libcasadi_rootfinder_newton.so +0 -0
  394. casadi/libcasadi_rootfinder_newton.so.3.7 +0 -0
  395. casadi/libcasadi_rootfinder_nlpsol.so +0 -0
  396. casadi/libcasadi_rootfinder_nlpsol.so.3.7 +0 -0
  397. casadi/libcasadi_sundials_common.so +0 -0
  398. casadi/libcasadi_sundials_common.so.3.7 +0 -0
  399. casadi/libcoinmetis.la +1 -1
  400. casadi/libcoinmetis.so +0 -0
  401. casadi/libcoinmetis.so.2 +0 -0
  402. casadi/libcoinmetis.so.2.0.0 +0 -0
  403. casadi/libdaqp.so +0 -0
  404. casadi/libdaqpstat.a +0 -0
  405. casadi/libfatrop.so +0 -0
  406. casadi/libhighs.so +0 -0
  407. casadi/libhighs.so.1 +0 -0
  408. casadi/libhighs.so.1.7.2 +0 -0
  409. casadi/libindirect.a +0 -0
  410. casadi/liblinsys.a +0 -0
  411. casadi/libmatlab_ipc.so +0 -0
  412. casadi/libosqp.a +0 -0
  413. casadi/libosqp.so +0 -0
  414. casadi/libqdldl.a +0 -0
  415. casadi/libsleqp.so +0 -0
  416. casadi/libsleqp.so.1.0.1 +0 -0
  417. casadi/libspral.a +0 -0
  418. casadi/libsuperscs.a +0 -0
  419. casadi/pkgconfig/casadi.pc +1 -1
  420. casadi/pkgconfig/highs.pc +1 -1
  421. casadi/tools/__init__.py +4 -0
  422. casadi/tools/bounds.py +3 -3
  423. {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/METADATA +2 -2
  424. {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/RECORD +425 -255
  425. casadi/include/highs/fortran/highs_fortran_api.mod +0 -0
  426. casadi/libFortranHighs.so +0 -0
  427. casadi/libhighs.so.1.6 +0 -0
  428. casadi/libhighs.so.1.6.0 +0 -0
  429. {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/WHEEL +0 -0
@@ -0,0 +1,493 @@
1
+ /*
2
+ * Fatrop - A fast trajectory optimization solver
3
+ * Copyright (C) 2022 - 2024 Lander Vanroye, KU Leuven. All rights reserved.
4
+ *
5
+ * This file is part of Fatrop.
6
+ *
7
+ * Fatrop is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * Fatrop is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with Fatrop. If not, see <http://www.gnu.org/licenses/>. */
19
+ #ifndef FATROP_BLASFEO_INCLUDED
20
+ #define FATROP_BLASFEO_INCLUDED
21
+
22
+ // macros
23
+ extern "C"
24
+ {
25
+ void blasfeo_ref_drowpe(int kmax, int *ipiv, struct blasfeo_dmat *sA);
26
+ void blasfeo_ref_drowpei(int kmax, int *ipiv, struct blasfeo_dmat *sA);
27
+ }
28
+ #define MAT blasfeo_dmat
29
+ #define VEC blasfeo_dvec
30
+ #define MEMSIZE_MAT blasfeo_memsize_dmat
31
+ #define CREATE_MAT blasfeo_create_dmat
32
+ // #define ROWPE blasfeo_drowpe
33
+ #define ROWPE blasfeo_ref_drowpe
34
+ #define VECPE blasfeo_dvecpe
35
+ #define VECPEI blasfeo_dvecpei
36
+ // #define ROWPEI blasfeo_drowpei
37
+ #define ROWPEI blasfeo_ref_drowpei
38
+ #define COLPE blasfeo_dcolpe
39
+ #define COLPEI blasfeo_dcolpei
40
+ #define CREATE_MAT blasfeo_create_dmat
41
+ #define MATEL BLASFEO_DMATEL
42
+ #define ROWSW blasfeo_drowsw
43
+ #define COLSW blasfeo_dcolsw
44
+ #define GEAD blasfeo_dgead
45
+ #define GECP blasfeo_dgecp
46
+ #define GESC blasfeo_dgesc
47
+ #define VECCP blasfeo_dveccp
48
+ #define VECCPSC blasfeo_dveccpsc
49
+ // #define TRSM_LLNN blasfeo_dtrsm_llnn
50
+ #define TRSM_RLTN blasfeo_dtrsm_rltn
51
+ #define VECEL BLASFEO_DVECEL
52
+ #define MEMSIZE_VEC blasfeo_memsize_dvec
53
+ #define CREATE_VEC blasfeo_create_dvec
54
+ #define GEMM_NT blasfeo_dgemm_nt
55
+ #define GEAD blasfeo_dgead
56
+ #define SYRK_LN_MN blasfeo_dsyrk_ln_mn
57
+ #define SYRK_LN blasfeo_dsyrk_ln
58
+ #define GETR blasfeo_dgetr
59
+ #define TRTR_L blasfeo_dtrtr_l
60
+ #define POTRF_L_MN blasfeo_dpotrf_l_mn
61
+ #define ROWEX blasfeo_drowex
62
+ #define ROWIN blasfeo_drowin
63
+ #define COLIN blasfeo_dcolin
64
+ #define ROWAD fatrop_drowad
65
+ #define TRSV_LTN blasfeo_dtrsv_ltn
66
+ #define TRSV_LNN blasfeo_dtrsv_lnn
67
+ #define TRSV_UTN blasfeo_dtrsv_utn
68
+ #define GEMV_T blasfeo_dgemv_t
69
+ #define GEMV_N blasfeo_dgemv_n
70
+ #define VECSE blasfeo_dvecse
71
+ #define VECSC blasfeo_dvecsc
72
+ #define PACKMAT blasfeo_pack_dmat
73
+ #define UNPACKVEC blasfeo_unpack_dvec
74
+ #define PACKVEC blasfeo_pack_dvec
75
+ #define PMAT PermMat
76
+ #define AXPY blasfeo_daxpy
77
+ #define AXPBY blasfeo_daxpby
78
+ #define DOT blasfeo_ddot
79
+ #define GESE blasfeo_dgese
80
+ #define DIARE blasfeo_ddiare
81
+ #define COLSC blasfeo_dcolsc
82
+ #define VECMUL blasfeo_dvecmul
83
+ #define VECMULACC blasfeo_dvecmulacc
84
+ #define GER blasfeo_dger
85
+
86
+ // functions not implemented by blasfeo_hp
87
+ #define GEADTR fatrop_dgead_transposed
88
+ #define VECCPR fatrop_dveccp_reversed
89
+ #define ROWAD fatrop_drowad
90
+ #define TRSV_UNU fatrop_dtrsv_unu
91
+ #define TRSV_UTU fatrop_dtrsv_utu
92
+
93
+ #if defined(BLASFEO_REF_API)
94
+ #define TRSM_RLNN blasfeo_dtrsm_rlnn
95
+ #else
96
+ void blasfeo_ref_dtrsm_rlnn_copy(int m, int n, double alpha, struct MAT *sA, int ai, int aj, struct MAT *sB, int bi, int bj, struct MAT *sD, int di, int dj);
97
+ #define TRSM_RLNN blasfeo_ref_dtrsm_rlnn_copy
98
+ #endif
99
+
100
+ #ifndef __GNUC__
101
+
102
+ #define MAX(a, b) max(a, b)
103
+ #define MIN(a, b) min(a, b)
104
+
105
+ #else
106
+
107
+ #define MAX(a, b) \
108
+ ( \
109
+ { \
110
+ __typeof__(a) _a = (a); \
111
+ __typeof__(b) _b = (b); \
112
+ _a > _b ? _a : _b; \
113
+ })
114
+ #define MIN(a, b) \
115
+ ( \
116
+ { \
117
+ __typeof__(a) _a = (a); \
118
+ __typeof__(b) _b = (b); \
119
+ _a < _b ? _a : _b; \
120
+ })
121
+
122
+ #endif
123
+
124
+ #include <iostream>
125
+ extern "C"
126
+ {
127
+ #include <blasfeo.h>
128
+ }
129
+ #include "fatrop/auxiliary/LinearAlgebra.hpp"
130
+ #include "fatrop/auxiliary/FatropVector.hpp"
131
+ #include "fatrop/auxiliary/Common.hpp"
132
+ #include <cmath>
133
+ #if DEBUG
134
+ #include <assert.h>
135
+ #endif
136
+ namespace fatrop
137
+ {
138
+ void fatrop_dcolsc(fatrop_int kmax, double alpha, struct blasfeo_dmat *sA, fatrop_int ai, fatrop_int aj);
139
+ // copy elements from sx to sy but in reversed order to avoid aliasing issues in recursion
140
+ void fatrop_dveccp_reversed(fatrop_int m, struct blasfeo_dvec *sx, fatrop_int xi, struct blasfeo_dvec *sy, fatrop_int yi);
141
+ // for debugging purposes
142
+ // void fatrop_potrf_l_mn(fatrop_int m, fatrop_int n, struct blasfeo_dmat *sC, fatrop_int ci, fatrop_int cj, struct blasfeo_dmat *sD, fatrop_int di, fatrop_int dj);
143
+ void test();
144
+ /** \brief D <= alpha * B * A^{-1} , with A lower triangular employing explicit inverse of diagonal, fatrop uses its own (naive) implementation since it not implemented yet in blasfeo */
145
+ void fatrop_dtrsm_rlnn(fatrop_int m, fatrop_int n, double alpha, MAT *sA, fatrop_int offs_ai, fatrop_int offs_aj, MAT *sB, fatrop_int offs_bi, fatrop_int offs_bj, MAT *sD, fatrop_int offs_di, fatrop_int offs_dj);
146
+ /** \brief D <= alpha * B * A^{-1} , with A lower triangular employing explicit inverse of diagonal, fatrop uses its own (naive) implementation since it not implemented yet in blasfeo */
147
+ void fatrop_dtrsm_rlnn_alt(fatrop_int m, fatrop_int n, double alpha, MAT *sA, fatrop_int offs_ai, fatrop_int offs_aj, MAT *sB, fatrop_int offs_bi, fatrop_int offs_bj, MAT *sD, fatrop_int offs_di, fatrop_int offs_dj);
148
+ /** \brief B <= B + alpha*A^T (B is mxn) */
149
+ void fatrop_dgead_transposed(fatrop_int m, fatrop_int n, double alpha, struct blasfeo_dmat *sA, fatrop_int offs_ai, fatrop_int offs_aj, struct blasfeo_dmat *sB, fatrop_int offs_bi, fatrop_int offs_bj);
150
+ void fatrop_identity(const fatrop_int m, MAT *sA, const fatrop_int ai, const fatrop_int aj);
151
+ void fatrop_drowad(fatrop_int kmax, double alpha, struct blasfeo_dvec *sx, fatrop_int xi, struct blasfeo_dmat *sA, fatrop_int ai, fatrop_int aj);
152
+ /** \brief this class is used for blasfeo matrices*/
153
+ class FatropMatBF : public FatropMat
154
+ {
155
+ public:
156
+ /** \brief constructor memory still has to be allocated*/
157
+ FatropMatBF(const fatrop_int nrows, const fatrop_int ncols, const fatrop_int row_offset, const fatrop_int col_offset);
158
+ /** \brief constructor memory already allocated*/
159
+ FatropMatBF(const fatrop_int nrows, const fatrop_int ncols, const fatrop_int row_offset, const fatrop_int col_offset, MAT *matbf);
160
+ /** \brief constructor memory already allocated*/
161
+ FatropMatBF(MAT *matbf);
162
+ /** \brief type conversion to blasfeo matrix pointer*/
163
+ inline explicit operator MAT *() const
164
+ {
165
+ return this->mat_;
166
+ }
167
+ /** \brief acces to element of matrix */
168
+ inline double &at(const fatrop_int ai, const fatrop_int aj) const
169
+ {
170
+ #if DEBUG
171
+ assert(ai < nrows_);
172
+ assert(aj < ncols_);
173
+ #endif
174
+ return MATEL(mat_, ai + row_offset_, aj + col_offset_);
175
+ };
176
+ /** \brief get element of matrix */
177
+ inline double get_el(const fatrop_int ai, const fatrop_int aj) const { return this->at(ai, aj); };
178
+ /** \brief get number of rows */
179
+ inline fatrop_int nrows() const { return nrows_; };
180
+ /** \brief get number of cols */
181
+ inline fatrop_int ncols() const { return ncols_; };
182
+ /** \brief copies all elements from a given fatrop_matrix to this matrix*/
183
+ void operator=(const FatropMat &fm);
184
+ /** \brief set data pointer*/
185
+ void set_datap(MAT *matbf)
186
+ {
187
+ mat_ = matbf;
188
+ }
189
+ /** \brief take a block of size (p,q), starting at (i,j)*/
190
+ FatropMatBF block(const fatrop_int i, const fatrop_int j, const fatrop_int p, const fatrop_int q) const
191
+ {
192
+ return FatropMatBF(p, q, row_offset_ + i, col_offset_ + j, this->mat_);
193
+ }
194
+
195
+ private:
196
+ MAT *mat_ = NULL;
197
+ const fatrop_int row_offset_;
198
+ const fatrop_int col_offset_;
199
+ const fatrop_int nrows_;
200
+ const fatrop_int ncols_;
201
+ };
202
+
203
+ class MATBF
204
+ {
205
+ public:
206
+ MATBF(const int m, const int n) : m_(m), n_(n)
207
+ {
208
+ blasfeo_allocate_dmat(m_, n_, &mat_);
209
+ }
210
+ MATBF(MATBF &&other) : m_(other.m_), n_(other.n_)
211
+ {
212
+ mat_ = other.mat_;
213
+ other.mat_.pA = nullptr;
214
+ other.mat_.mem = nullptr;
215
+ other.mat_.dA = nullptr;
216
+ }
217
+ ~MATBF()
218
+ {
219
+ blasfeo_free_dmat(&mat_);
220
+ }
221
+ operator MAT *()
222
+ {
223
+ return &mat_;
224
+ }
225
+ MAT mat_;
226
+ const int m_;
227
+ const int n_;
228
+ };
229
+
230
+ class VECBF
231
+ {
232
+ public:
233
+ VECBF(const int m) : m_(m)
234
+ {
235
+ blasfeo_allocate_dvec(m_, &vec_);
236
+ // zero out vector
237
+ blasfeo_dvecse(m_, 0.0, &vec_, 0);
238
+ }
239
+ VECBF(VECBF &&other) : m_(other.m_)
240
+ {
241
+ vec_ = other.vec_;
242
+ other.vec_.pa = nullptr;
243
+ other.vec_.mem = nullptr;
244
+ }
245
+ ~VECBF()
246
+ {
247
+ blasfeo_free_dvec(&vec_);
248
+ }
249
+ operator VEC *()
250
+ {
251
+ return &vec_;
252
+ }
253
+ bool has_inf()
254
+ {
255
+ for (int i = 0; i < m_; i++)
256
+ {
257
+ if (std::isinf(VECEL(&vec_, i)))
258
+ {
259
+ return true;
260
+ }
261
+ }
262
+ return false;
263
+ }
264
+ VEC vec_;
265
+ const int m_;
266
+ };
267
+
268
+ /** \brief this class is used for the allocation of a blasfeo matrix, the dimsensions are set from a vector */
269
+ class FatropMemoryMatBF
270
+ {
271
+ public:
272
+ /** \brief constuction for allocation on fatrop_memory_allocator*/
273
+ FatropMemoryMatBF(const FatropVector<fatrop_int> &nrows, const FatropVector<fatrop_int> &ncols, fatrop_int N);
274
+ // TODO: if rvalue-reference is used -> unecessary copy, use move sementics instead.;
275
+ FatropMemoryMatBF(const fatrop_int nrows, const fatrop_int ncols, fatrop_int N);
276
+ /** \brief calculate memory size*/
277
+ fatrop_int memory_size() const;
278
+ /** \brief set up memory element and advance pointer */
279
+ void set_up();
280
+ /** \brief get fatrop matrix bf */
281
+ FatropMatBF operator[](const fatrop_int N) const;
282
+ /** \brief get first blasfeo_xmat* struct */
283
+ explicit operator MAT *() const
284
+ {
285
+ return mat;
286
+ }
287
+ FatropMemoryMatBF(const FatropMemoryMatBF &cpy) = delete;
288
+ FatropMemoryMatBF &operator=(const FatropMemoryMatBF &) = delete;
289
+ ~FatropMemoryMatBF();
290
+
291
+ private:
292
+ void *mem = NULL;
293
+ MAT *mat;
294
+ const fatrop_int N_;
295
+ const FatropVector<fatrop_int> nrows_;
296
+ const FatropVector<fatrop_int> ncols_;
297
+ };
298
+ /** this class is used for blasfeo vectors*/
299
+ class FatropVecBF : public FatropVec
300
+ {
301
+ public:
302
+ /** \brief constructor memory still has to be allocated*/
303
+ FatropVecBF(const fatrop_int nels, const fatrop_int offset);
304
+ /** \brief constructor memory already allocated*/
305
+ FatropVecBF(const fatrop_int nels, const fatrop_int offset, VEC *vecbf);
306
+ /** \brief type conversion to blasfeo vector pointer*/
307
+ explicit operator VEC *() const;
308
+ /** \brief access to element of matrix */
309
+ inline double &at(const fatrop_int ai) const
310
+ {
311
+ #if DEBUG
312
+ assert(ai < nels_);
313
+ #endif
314
+ return VECEL(vec_, ai + offset_);
315
+ };
316
+ /** \brief get element of vector */
317
+ double get_el(const fatrop_int ai) const;
318
+ /** \brief get number of elements */
319
+ fatrop_int nels() const;
320
+ /** \brief get offset */
321
+ fatrop_int offset() const;
322
+ /** \brief copies all elements from a given fatrop_vector to this vector*/
323
+ void operator=(const FatropVec &fm);
324
+ void operator=(const double &val)
325
+ {
326
+ blasfeo_dvecse(nels(), val, vec_, offset());
327
+ }
328
+
329
+ void copy(const FatropVecBF &fm) const;
330
+ void copyto(std::vector<double> &dest) const;
331
+ void operator=(const std::vector<double> &fm);
332
+ /** \brief set data pointer*/
333
+ void set_datap(VEC *vecbf);
334
+ /** \brief take a block of size (p), starting at (i)*/
335
+ FatropVecBF block(const fatrop_int i, const fatrop_int p) const;
336
+ void SwapWith(FatropVecBF &vb);
337
+ void SetConstant(double constant) const;
338
+ friend double sum(const FatropVecBF &va)
339
+ {
340
+ double ret = 0.0;
341
+ for (int i = 0; i < va.nels(); i++)
342
+ {
343
+ ret += va.at(i);
344
+ }
345
+ return ret;
346
+ }
347
+ bool has_inf() const
348
+ {
349
+ for (int i = 0; i < nels(); i++)
350
+ {
351
+ if (std::isinf(VECEL(vec_, i)))
352
+ {
353
+ return true;
354
+ }
355
+ }
356
+ return false;
357
+ }
358
+ bool has_nan() const
359
+ {
360
+ for (int i = 0; i < nels(); i++)
361
+ {
362
+ if (std::isnan(VECEL(vec_, i)))
363
+ {
364
+ return true;
365
+ }
366
+ }
367
+ return false;
368
+ }
369
+
370
+ protected:
371
+ VEC *vec_ = NULL;
372
+ const fatrop_int offset_;
373
+ const fatrop_int nels_;
374
+ };
375
+
376
+ void axpy(const double alpha, const FatropVecBF &va, const FatropVecBF &vb, const FatropVecBF &vc);
377
+ void copy(const FatropVecBF &va, const FatropVecBF &vb);
378
+ void axpby(const double alpha, const FatropVecBF &va, const double beta, const FatropVecBF &vb, const FatropVecBF &vc);
379
+ double dot(const FatropVecBF &va, FatropVecBF &vb);
380
+ double Linf(const FatropVecBF &va);
381
+ double LinfScaled(const FatropVecBF &va, const FatropVecBF &scales);
382
+ double minabs(const FatropVecBF &va);
383
+ double L1(const FatropVecBF &va);
384
+ double sumsqr(const FatropVecBF &va);
385
+
386
+ /** \brief this class is used for the allocation of a blasfeo vector, the dimsensions are set from a vector */
387
+ class FatropMemoryVecBF
388
+ {
389
+ public:
390
+ /** \brief constuction for allocation on MemoryAllocator*/
391
+ FatropMemoryVecBF(const FatropVector<fatrop_int> &nels, fatrop_int N);
392
+ // TODO: if rvalue-reference is used -> unecessary copy, use move sementics instead.;
393
+ FatropMemoryVecBF(const fatrop_int nels, fatrop_int N = 1);
394
+ /** \brief calculate memory size*/
395
+ fatrop_int memory_size() const;
396
+ /** \brief set up memory element and advance pointer */
397
+ void set_up();
398
+ /** \brief get fatrop matrix bf */
399
+ FatropVecBF operator[](const fatrop_int N) const;
400
+ /** \brief get first blasfeo_xmat* struct */
401
+ explicit operator VEC *() const
402
+ {
403
+ return vec;
404
+ }
405
+ FatropMemoryVecBF(const FatropMemoryVecBF &cpy) = delete;
406
+ FatropMemoryVecBF &operator=(const FatropMemoryVecBF &) = delete;
407
+ ~FatropMemoryVecBF();
408
+
409
+ private:
410
+ void *mem = NULL;
411
+ VEC *vec;
412
+ const fatrop_int N_;
413
+ const FatropVector<fatrop_int> nels_;
414
+ };
415
+
416
+ /** \brief this class represents a permutation matrix */
417
+ class PermMat : public FatropMat
418
+ {
419
+ public:
420
+ /** \brief constructor memory still has to be allocated */
421
+ PermMat(const fatrop_int dim);
422
+ ;
423
+ /** \brief constructor memory already allocated */
424
+ PermMat(const fatrop_int dim, fatrop_int *data);
425
+ ;
426
+ /** \brief get number of rows */
427
+ fatrop_int nrows() const { return dim_; };
428
+ /** \brief get number of columns */
429
+ fatrop_int ncols() const { return dim_; };
430
+ /** \brief get element of matrix represented by this permutation matrix - only used for debugging and testing purposes */
431
+ double get_el(const fatrop_int ai, const fatrop_int aj) const;
432
+ void print(const fatrop_int kmax) const;
433
+ /** \brief set data pointer*/
434
+ void set_datap(fatrop_int *data);
435
+ /** \brief set data point*/
436
+ void set_datap(const fatrop_int i, const fatrop_int val);
437
+ /** \brief apply row permutation*/
438
+ void PM(const fatrop_int kmax, MAT *M) const;
439
+ /** \brief apply vec permutation*/
440
+ void PV(const fatrop_int kmax, VEC *V, const fatrop_int offs) const;
441
+ /** \brief apply vec permutation*/
442
+ void PtV(const fatrop_int kmax, VEC *V, const fatrop_int offs) const;
443
+ /** \brief apply row permutation on partial matrix*/
444
+ void PM(const fatrop_int kmax, const fatrop_int n, MAT *M, const fatrop_int ai, const fatrop_int aj) const;
445
+ /** \brief apply inverse row permutation*/
446
+ void
447
+ PtM(const fatrop_int kmax, MAT *M) const;
448
+ /** \brief apply inverse col permutation*/
449
+ void MP(const fatrop_int kmax, MAT *M) const;
450
+ /** \brief apply col permutation*/
451
+ void MPt(const fatrop_int kmax, MAT *M) const;
452
+ /** fatrop_int pointer of permutation vector */
453
+ explicit operator fatrop_int *() { return data_; };
454
+
455
+ // private:
456
+ const fatrop_int dim_;
457
+ fatrop_int *data_ = NULL;
458
+ };
459
+
460
+ /** \brief this class is used for the allocation of a permutation matrix */
461
+ class MemoryPermMat : public PermMat
462
+ {
463
+ public:
464
+ /** \brief constructor */
465
+ MemoryPermMat(const fatrop_int dim, const fatrop_int N);
466
+ /** \brief calculate needed memory size*/
467
+ fatrop_int memory_size() const;
468
+ /** \brief set up memory*/
469
+ void set_up();
470
+ explicit operator PermMat *()
471
+ {
472
+ return perm_p;
473
+ };
474
+ MemoryPermMat(const MemoryPermMat &cpy) = delete;
475
+ MemoryPermMat &operator=(const MemoryPermMat &) = delete;
476
+ ~MemoryPermMat();
477
+
478
+ private:
479
+ void *mem = NULL;
480
+ const fatrop_int dim_;
481
+ const fatrop_int N_;
482
+ PermMat *perm_p;
483
+ };
484
+ MatrixInd max_el(fatrop_int m, fatrop_int n, MAT *matr, fatrop_int ai, fatrop_int aj);
485
+
486
+ /** \brief Function to calculate LU factorization result is saved in A, L is lower unitriangular */
487
+ void LU_FACT(const fatrop_int m, const fatrop_int n, const fatrop_int n_max, fatrop_int &rank, MAT *A, PMAT *Pl_p, PMAT *Pr_p, double tol = 1e-8);
488
+ /** \brief Function to calculate LU factorization but A, and result (L and U) are transposed, all indices refer to the dimensions of the original A matrix (and not the transposed one) */
489
+ void LU_FACT_transposed(const fatrop_int m, const fatrop_int n, const fatrop_int n_max, fatrop_int &rank, MAT *At, PMAT *Pl_p, PMAT *Pr_p, double tol = 1e-5);
490
+ void fatrop_dtrsv_unu(const fatrop_int m, const fatrop_int n, blasfeo_dmat *sA, const fatrop_int ai, const fatrop_int aj, blasfeo_dvec *sx, const fatrop_int xi, blasfeo_dvec *sz, const fatrop_int zi);
491
+ void fatrop_dtrsv_utu(const fatrop_int m, blasfeo_dmat *sA, const fatrop_int ai, const fatrop_int aj, blasfeo_dvec *sx, const fatrop_int xi, blasfeo_dvec *sz, const fatrop_int zi);
492
+ } // namespace fatrop
493
+ #endif // FATROP_BLASFEO_INCLUDED
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Fatrop - A fast trajectory optimization solver
3
+ * Copyright (C) 2022 - 2024 Lander Vanroye, KU Leuven. All rights reserved.
4
+ *
5
+ * This file is part of Fatrop.
6
+ *
7
+ * Fatrop is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * Fatrop is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with Fatrop. If not, see <http://www.gnu.org/licenses/>. */
19
+ #ifndef FATROP_INCLUDED
20
+ #define FATROP_INCLUDED
21
+ #include "fatrop/ocp/StageOCPApplication.hpp"
22
+ // #include "fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp"
23
+ // #include "fatrop/ocp/OCPKKT.hpp"
24
+ // #include "fatrop/ocp/OCPAdapter.hpp"
25
+ // #include "fatrop/ocp/OCPAbstact.hpp"
26
+ // #include "fatrop/auxiliary/FatropVector.hpp"
27
+ // #include "fatrop/solver/FatropAlg.hpp"
28
+ // #include "fatrop/solver/FatropData.hpp"
29
+ // #include "fatrop/ocp/OCPScalingMethod.hpp"
30
+ // #include "fatrop/ocp/OCPNoScaling.hpp"
31
+ // #include "fatrop/solver/AlgStrategy.hpp"
32
+ // #include "fatrop/solver/FatropOptions.hpp"
33
+ // #include "fatrop/function_evaluation/CasadiCodegen.hpp"
34
+ // #include "fatrop/solver/AlgBuilder.hpp"
35
+ // #include "fatrop/ocp/StageOCPApplication.hpp"
36
+ // #include "fatrop/ocp/FatropOCPBuilder.hpp"
37
+
38
+ // #include "SparseSolvers/InterfaceMUMPS.hpp"
39
+ #endif //FATROP_INCLUDED
@@ -0,0 +1,104 @@
1
+ /*
2
+ * Fatrop - A fast trajectory optimization solver
3
+ * Copyright (C) 2022 - 2024 Lander Vanroye, KU Leuven. All rights reserved.
4
+ *
5
+ * This file is part of Fatrop.
6
+ *
7
+ * Fatrop is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * Fatrop is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with Fatrop. If not, see <http://www.gnu.org/licenses/>. */
19
+ #ifndef CASADICODEGENINCLUDED
20
+ #define CASADICODEGENINCLUDED
21
+ #include <vector>
22
+ #include <string>
23
+ #include <memory>
24
+ #include "FunctionEvaluation.hpp"
25
+ #include "fatrop/auxiliary/DynamicLib.hpp"
26
+
27
+ #ifdef ENABLE_MULTITHREADING
28
+ #include <omp.h>
29
+ #endif
30
+
31
+ /* Typedefs */
32
+ typedef long long int casadi_int;
33
+ typedef void (*signal_t)(void);
34
+ typedef casadi_int (*getint_t)(void);
35
+ typedef int (*work_t)(casadi_int *sz_arg, casadi_int *sz_res, casadi_int *sz_iw, casadi_int *sz_w);
36
+ typedef const casadi_int *(*sparsity_t)(casadi_int ind);
37
+ typedef int (*eval_t)(const double **arg, double **res, casadi_int *iw, double *w, int mem);
38
+ typedef int (*casadi_checkout_t)(void);
39
+ typedef void (*casadi_release_t)(int);
40
+ namespace fatrop
41
+ {
42
+ class EvalCasGen : public EvalBase
43
+ {
44
+ public:
45
+ EvalCasGen();
46
+ /// constructor from file
47
+ EvalCasGen(const std::shared_ptr<DLHandler> &handle, const std::string &function_name);
48
+ EvalCasGen(
49
+ const signal_t incref,
50
+ const signal_t decref,
51
+ const casadi_checkout_t checkout,
52
+ const casadi_release_t release,
53
+ const getint_t n_in_fcn,
54
+ const getint_t n_out_fcn,
55
+ const sparsity_t sp_in,
56
+ const sparsity_t sp_out,
57
+ const work_t work,
58
+ const eval_t eval);
59
+ /// pointer to result_buffer
60
+ #ifndef ENABLE_MULTITHREADING
61
+ // double *output_buffer_p;
62
+ #else
63
+ // std::vector<double *> output_buffer_p = std::vector<double *>(omp_get_max_threads());
64
+ #endif
65
+ /// pointer to casadi codegen evalutation function
66
+ eval_t eval; // !! multhithreading of this function not yet supported
67
+ /// casadi int work vector
68
+ casadi_int *iw;
69
+ /// casadi double work vector
70
+ double *w;
71
+ /// increase reference counter
72
+ signal_t incref;
73
+ /// decrease reference counter
74
+ signal_t decref;
75
+ /// input size
76
+ int *input_size;
77
+ /// release casadi memory
78
+ casadi_release_t release;
79
+ /// thread local mem id
80
+ int mem;
81
+ /// double work vector
82
+ #ifndef ENABLE_MULTITHREADING
83
+ std::vector<double> work_vector_d;
84
+ std::vector<double*> res_vec;
85
+ std::vector<const double*> arg_vec;
86
+ /// int work vector
87
+ std::vector<casadi_int> work_vector_i;
88
+ #else
89
+ std::vector<std::vector<double>> work_vector_d;
90
+ std::vector<std::vector<double*>> res_vec;
91
+ std::vector<std::vector<const double*>> arg_vec;
92
+ std::vector<std::vector<casadi_int>> work_vector_i;
93
+ #endif
94
+ /// evaluate function and save res in "ccs format with lda==out_m"
95
+ int eval_buffer(const double **arg);
96
+ /// for reference counting of handle pointer
97
+ std::shared_ptr<DLHandler> handle;
98
+ ~EvalCasGen();
99
+ };
100
+ // define a macro that instantiates an EvalCasGen object with a given name
101
+
102
+ } // fatrop
103
+
104
+ #endif // CASADICODEGENINCLUDED
@@ -0,0 +1,60 @@
1
+ /*
2
+ * Fatrop - A fast trajectory optimization solver
3
+ * Copyright (C) 2022 - 2024 Lander Vanroye, KU Leuven. All rights reserved.
4
+ *
5
+ * This file is part of Fatrop.
6
+ *
7
+ * Fatrop is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * Fatrop is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with Fatrop. If not, see <http://www.gnu.org/licenses/>. */
19
+ #ifndef FUNCTIONEVALUATIONINCLUDED
20
+ #define FUNCTIONEVALUATIONINCLUDED
21
+ #include <vector>
22
+ #include <cstring>
23
+ #include "fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp"
24
+ #include "fatrop/auxiliary/Common.hpp"
25
+
26
+ #ifdef ENABLE_MULTITHREADING
27
+ #include <omp.h>
28
+ #endif
29
+
30
+ namespace fatrop
31
+ {
32
+ /// Class used to evaluate a numerical functions. Functions can be implemented by hand or casadi codegen API or by plain casadi.
33
+ class EvalBase
34
+ {
35
+ public:
36
+ /// number of input vectors of the function
37
+ fatrop_int n_in;
38
+ /// number of columns in output matrix
39
+ fatrop_int out_m;
40
+ /// number of rows in output matrix
41
+ fatrop_int out_n;
42
+ /// number of nonzeros in output matrix
43
+ fatrop_int out_nnz;
44
+ /// sparsity pattern of output matrix sparsity pattern [m,n|0,ncol0, ncol0:1 , ..., | nnz | row_el0, row_el1, ...]
45
+ std::vector<fatrop_int> sparsity_out;
46
+ /// buffer to safe evaluation result, in a buffer we always save a matrix in CCS format with lda==out_m
47
+ #ifndef ENABLE_MULTITHREADING
48
+ std::vector<double> buffer;
49
+ #else
50
+ std::vector<std::vector<double>> buffer = std::vector<std::vector<double>>(omp_get_max_threads());
51
+ #endif
52
+ /// evaluate function and save res in "ccs format with lda==out_m"
53
+ virtual fatrop_int eval_buffer(const double **arg) = 0;
54
+ /// evaluate function and save res in "blasfeo format"
55
+ fatrop_int eval_bf(const double **arg, MAT *bf_mat);
56
+ fatrop_int eval_array(const double **arg, double *array);
57
+ ~EvalBase(){};
58
+ };
59
+ }; // namespace fatrop
60
+ #endif // FUNCTIONEVALUATIONINCLUDED