casadi 3.6.7__cp313-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 (2345) hide show
  1. casadi/__init__.py +92 -0
  2. casadi/_casadi.so +0 -0
  3. casadi/casadi-cli +0 -0
  4. casadi/casadi.py +50976 -0
  5. casadi/cbc +0 -0
  6. casadi/clp +0 -0
  7. casadi/cmake/alpaqa/alpaqaConfig.cmake +24 -0
  8. casadi/cmake/alpaqa/alpaqaConfigVersion.cmake +70 -0
  9. casadi/cmake/alpaqa/alpaqaTargets-release.cmake +29 -0
  10. casadi/cmake/alpaqa/alpaqaTargets.cmake +131 -0
  11. casadi/cmake/casadi-config-version.cmake +11 -0
  12. casadi/cmake/casadi-config.cmake +8 -0
  13. casadi/cmake/casadi-targets-release.cmake +19 -0
  14. casadi/cmake/casadi-targets.cmake +107 -0
  15. casadi/cmake/highs/highs-config.cmake +17 -0
  16. casadi/cmake/highs/highs-targets-release.cmake +28 -0
  17. casadi/cmake/highs/highs-targets.cmake +117 -0
  18. casadi/cmake/osqp/osqp-config.cmake +1 -0
  19. casadi/cmake/osqp/osqp-targets-noconfig.cmake +29 -0
  20. casadi/cmake/osqp/osqp-targets.cmake +109 -0
  21. casadi/cmake/proxsuite/find-external/Simde/FindSimde.cmake +39 -0
  22. casadi/cmake/proxsuite/proxsuiteConfig.cmake +177 -0
  23. casadi/cmake/proxsuite/proxsuiteConfigVersion.cmake +70 -0
  24. casadi/cmake/proxsuite/proxsuiteTargets.cmake +115 -0
  25. casadi/cmake/qdldl/qdldl-config.cmake +1 -0
  26. casadi/cmake/qdldl/qdldl-targets-noconfig.cmake +29 -0
  27. casadi/cmake/qdldl/qdldl-targets.cmake +109 -0
  28. casadi/cmake/sleqp/sleqp-config-version.cmake +70 -0
  29. casadi/cmake/sleqp/sleqp-config.cmake +1 -0
  30. casadi/cmake/sleqp/sleqp-targets-release.cmake +20 -0
  31. casadi/cmake/sleqp/sleqp-targets.cmake +102 -0
  32. casadi/cmake/trlib/trlib-config-release.cmake +19 -0
  33. casadi/cmake/trlib/trlib-config-version.cmake +88 -0
  34. casadi/cmake/trlib/trlib-config.cmake +107 -0
  35. casadi/highs +0 -0
  36. casadi/include/alpaqa/accelerators/anderson.hpp +133 -0
  37. casadi/include/alpaqa/accelerators/internal/anderson-helpers.hpp +92 -0
  38. casadi/include/alpaqa/accelerators/internal/limited-memory-qr.hpp +295 -0
  39. casadi/include/alpaqa/accelerators/lbfgs.hpp +244 -0
  40. casadi/include/alpaqa/accelerators/steihaugcg.hpp +143 -0
  41. casadi/include/alpaqa/alpaqa.hpp +3 -0
  42. casadi/include/alpaqa/casadi/CasADiControlProblem.hpp +185 -0
  43. casadi/include/alpaqa/casadi/CasADiFunctionWrapper.hpp +104 -0
  44. casadi/include/alpaqa/casadi/CasADiProblem.hpp +102 -0
  45. casadi/include/alpaqa/casadi-loader-export.hpp +15 -0
  46. casadi/include/alpaqa/casadi-ocp-loader-export.hpp +15 -0
  47. casadi/include/alpaqa/config/config.hpp +165 -0
  48. casadi/include/alpaqa/dl/dl-problem.h +476 -0
  49. casadi/include/alpaqa/dl/dl-problem.hpp +301 -0
  50. casadi/include/alpaqa/export.h +42 -0
  51. casadi/include/alpaqa/export.hpp +30 -0
  52. casadi/include/alpaqa/implementation/accelerators/lbfgs.tpp +240 -0
  53. casadi/include/alpaqa/implementation/casadi/CasADiControlProblem.tpp +594 -0
  54. casadi/include/alpaqa/implementation/casadi/CasADiLoader-util.hpp +50 -0
  55. casadi/include/alpaqa/implementation/casadi/CasADiProblem.tpp +425 -0
  56. casadi/include/alpaqa/implementation/inner/directions/panoc/structured-lbfgs.tpp +164 -0
  57. casadi/include/alpaqa/implementation/inner/panoc-helpers.tpp +389 -0
  58. casadi/include/alpaqa/implementation/inner/panoc-ocp.tpp +798 -0
  59. casadi/include/alpaqa/implementation/inner/panoc.tpp +448 -0
  60. casadi/include/alpaqa/implementation/inner/pantr.tpp +474 -0
  61. casadi/include/alpaqa/implementation/inner/zerofpr.tpp +482 -0
  62. casadi/include/alpaqa/implementation/outer/alm.tpp +228 -0
  63. casadi/include/alpaqa/implementation/outer/internal/alm-helpers.tpp +80 -0
  64. casadi/include/alpaqa/implementation/params/params.tpp +158 -0
  65. casadi/include/alpaqa/implementation/problem/ocproblem.tpp +56 -0
  66. casadi/include/alpaqa/implementation/problem/type-erased-problem.tpp +211 -0
  67. casadi/include/alpaqa/implementation/util/io/csv.tpp +120 -0
  68. casadi/include/alpaqa/implementation/util/print.tpp +151 -0
  69. casadi/include/alpaqa/inner/directions/panoc/anderson.hpp +98 -0
  70. casadi/include/alpaqa/inner/directions/panoc/lbfgs.hpp +94 -0
  71. casadi/include/alpaqa/inner/directions/panoc/structured-lbfgs.hpp +146 -0
  72. casadi/include/alpaqa/inner/directions/panoc/structured-newton.hpp +264 -0
  73. casadi/include/alpaqa/inner/directions/panoc-direction-update.hpp +96 -0
  74. casadi/include/alpaqa/inner/directions/panoc-ocp/lqr.hpp +181 -0
  75. casadi/include/alpaqa/inner/directions/panoc-ocp/ocp-vars.hpp +492 -0
  76. casadi/include/alpaqa/inner/directions/pantr/newton-tr.hpp +192 -0
  77. casadi/include/alpaqa/inner/directions/pantr/pantr-direction.hpp +99 -0
  78. casadi/include/alpaqa/inner/inner-solve-options.hpp +30 -0
  79. casadi/include/alpaqa/inner/internal/lipschitz.hpp +27 -0
  80. casadi/include/alpaqa/inner/internal/panoc-helpers.hpp +10 -0
  81. casadi/include/alpaqa/inner/internal/panoc-stop-crit.hpp +124 -0
  82. casadi/include/alpaqa/inner/internal/solverstatus.hpp +42 -0
  83. casadi/include/alpaqa/inner/panoc-ocp.hpp +302 -0
  84. casadi/include/alpaqa/inner/panoc.hpp +274 -0
  85. casadi/include/alpaqa/inner/pantr.hpp +284 -0
  86. casadi/include/alpaqa/inner/zerofpr.hpp +274 -0
  87. casadi/include/alpaqa/ipopt/ipopt-adapter.hpp +81 -0
  88. casadi/include/alpaqa/ipopt/ipopt-enums.hpp +35 -0
  89. casadi/include/alpaqa/lbfgsb/lbfgsb-adapter.hpp +111 -0
  90. casadi/include/alpaqa/newton-tr-pantr-alm.hpp +27 -0
  91. casadi/include/alpaqa/outer/alm.hpp +190 -0
  92. casadi/include/alpaqa/outer/internal/alm-helpers.hpp +10 -0
  93. casadi/include/alpaqa/panoc-alm.hpp +27 -0
  94. casadi/include/alpaqa/panoc-anderson-alm.hpp +27 -0
  95. casadi/include/alpaqa/params/params.hpp +60 -0
  96. casadi/include/alpaqa/problem/box-constr-problem.hpp +220 -0
  97. casadi/include/alpaqa/problem/box.hpp +82 -0
  98. casadi/include/alpaqa/problem/functional-problem.hpp +73 -0
  99. casadi/include/alpaqa/problem/kkt-error.hpp +43 -0
  100. casadi/include/alpaqa/problem/ocproblem-counters.hpp +116 -0
  101. casadi/include/alpaqa/problem/ocproblem.hpp +662 -0
  102. casadi/include/alpaqa/problem/problem-counters.hpp +116 -0
  103. casadi/include/alpaqa/problem/problem-with-counters.hpp +141 -0
  104. casadi/include/alpaqa/problem/type-erased-problem.hpp +874 -0
  105. casadi/include/alpaqa/problem/unconstr-problem.hpp +37 -0
  106. casadi/include/alpaqa/structured-panoc-alm.hpp +27 -0
  107. casadi/include/alpaqa/structured-zerofpr-alm.hpp +27 -0
  108. casadi/include/alpaqa/util/alloc-check.hpp +23 -0
  109. casadi/include/alpaqa/util/atomic-stop-signal.hpp +24 -0
  110. casadi/include/alpaqa/util/check-dim.hpp +64 -0
  111. casadi/include/alpaqa/util/copyable_unique_ptr.hpp +32 -0
  112. casadi/include/alpaqa/util/demangled-typename.hpp +9 -0
  113. casadi/include/alpaqa/util/enumerate.hpp +70 -0
  114. casadi/include/alpaqa/util/float.hpp +25 -0
  115. casadi/include/alpaqa/util/index-set.hpp +97 -0
  116. casadi/include/alpaqa/util/io/csv.hpp +43 -0
  117. casadi/include/alpaqa/util/iter-adapter.hpp +68 -0
  118. casadi/include/alpaqa/util/max-history.hpp +47 -0
  119. casadi/include/alpaqa/util/noop-delete.hpp +15 -0
  120. casadi/include/alpaqa/util/not-implemented.hpp +12 -0
  121. casadi/include/alpaqa/util/print.hpp +78 -0
  122. casadi/include/alpaqa/util/quadmath/quadmath-print.hpp +20 -0
  123. casadi/include/alpaqa/util/quadmath/quadmath.hpp +137 -0
  124. casadi/include/alpaqa/util/required-method.hpp +29 -0
  125. casadi/include/alpaqa/util/ringbuffer.hpp +212 -0
  126. casadi/include/alpaqa/util/set-intersection.hpp +129 -0
  127. casadi/include/alpaqa/util/sparse-ops.hpp +164 -0
  128. casadi/include/alpaqa/util/timed.hpp +22 -0
  129. casadi/include/alpaqa/util/type-erasure.hpp +568 -0
  130. casadi/include/alpaqa/util/type-traits.hpp +58 -0
  131. casadi/include/alpaqa/zerofpr-alm.hpp +27 -0
  132. casadi/include/alpaqa/zerofpr-anderson-alm.hpp +27 -0
  133. casadi/include/alpaqa-version.h +8 -0
  134. casadi/include/blasfeo.h +52 -0
  135. casadi/include/blasfeo_block_size.h +447 -0
  136. casadi/include/blasfeo_common.h +274 -0
  137. casadi/include/blasfeo_d_aux.h +255 -0
  138. casadi/include/blasfeo_d_aux_ext_dep.h +145 -0
  139. casadi/include/blasfeo_d_aux_ext_dep_ref.h +84 -0
  140. casadi/include/blasfeo_d_aux_old.h +75 -0
  141. casadi/include/blasfeo_d_aux_ref.h +208 -0
  142. casadi/include/blasfeo_d_aux_test.h +226 -0
  143. casadi/include/blasfeo_d_blas.h +46 -0
  144. casadi/include/blasfeo_d_blas_api.h +281 -0
  145. casadi/include/blasfeo_d_blasfeo_api.h +364 -0
  146. casadi/include/blasfeo_d_blasfeo_api_ref.h +147 -0
  147. casadi/include/blasfeo_d_blasfeo_hp_api.h +84 -0
  148. casadi/include/blasfeo_d_blasfeo_ref_api.h +283 -0
  149. casadi/include/blasfeo_d_kernel.h +1321 -0
  150. casadi/include/blasfeo_i_aux_ext_dep.h +69 -0
  151. casadi/include/blasfeo_m_aux.h +57 -0
  152. casadi/include/blasfeo_memory.h +62 -0
  153. casadi/include/blasfeo_naming.h +77 -0
  154. casadi/include/blasfeo_processor_features.h +88 -0
  155. casadi/include/blasfeo_s_aux.h +168 -0
  156. casadi/include/blasfeo_s_aux_ext_dep.h +141 -0
  157. casadi/include/blasfeo_s_aux_ext_dep_ref.h +82 -0
  158. casadi/include/blasfeo_s_aux_old.h +64 -0
  159. casadi/include/blasfeo_s_aux_ref.h +147 -0
  160. casadi/include/blasfeo_s_aux_test.h +177 -0
  161. casadi/include/blasfeo_s_blas.h +46 -0
  162. casadi/include/blasfeo_s_blas_api.h +182 -0
  163. casadi/include/blasfeo_s_blasfeo_api.h +284 -0
  164. casadi/include/blasfeo_s_blasfeo_api_ref.h +135 -0
  165. casadi/include/blasfeo_s_blasfeo_ref_api.h +252 -0
  166. casadi/include/blasfeo_s_kernel.h +692 -0
  167. casadi/include/blasfeo_stdlib.h +62 -0
  168. casadi/include/blasfeo_target.h +73 -0
  169. casadi/include/blasfeo_timing.h +114 -0
  170. casadi/include/blasfeo_v_aux_ext_dep.h +83 -0
  171. casadi/include/casadi/casadi.hpp +31 -0
  172. casadi/include/casadi/casadi.i +4691 -0
  173. casadi/include/casadi/casadi_c.h +138 -0
  174. casadi/include/casadi/casadi_numpy.hpp +97 -0
  175. casadi/include/casadi/config.h +46 -0
  176. casadi/include/casadi/core/calculus.hpp +1750 -0
  177. casadi/include/casadi/core/callback.hpp +226 -0
  178. casadi/include/casadi/core/casadi_common.hpp +318 -0
  179. casadi/include/casadi/core/casadi_enum.hpp +90 -0
  180. casadi/include/casadi/core/casadi_export.h +42 -0
  181. casadi/include/casadi/core/casadi_interrupt.hpp +83 -0
  182. casadi/include/casadi/core/casadi_limits.hpp +104 -0
  183. casadi/include/casadi/core/casadi_logger.hpp +134 -0
  184. casadi/include/casadi/core/casadi_meta.hpp +107 -0
  185. casadi/include/casadi/core/casadi_misc.hpp +1001 -0
  186. casadi/include/casadi/core/casadi_types.hpp +66 -0
  187. casadi/include/casadi/core/code_generator.hpp +975 -0
  188. casadi/include/casadi/core/conic.hpp +213 -0
  189. casadi/include/casadi/core/core.hpp +70 -0
  190. casadi/include/casadi/core/dae_builder.hpp +723 -0
  191. casadi/include/casadi/core/dm.hpp +87 -0
  192. casadi/include/casadi/core/dm_fwd.hpp +39 -0
  193. casadi/include/casadi/core/dple.hpp +138 -0
  194. casadi/include/casadi/core/exception.hpp +167 -0
  195. casadi/include/casadi/core/expm.hpp +84 -0
  196. casadi/include/casadi/core/external.hpp +70 -0
  197. casadi/include/casadi/core/fmu.hpp +224 -0
  198. casadi/include/casadi/core/function.hpp +1347 -0
  199. casadi/include/casadi/core/generic_expression.hpp +760 -0
  200. casadi/include/casadi/core/generic_matrix.hpp +1598 -0
  201. casadi/include/casadi/core/generic_type.hpp +311 -0
  202. casadi/include/casadi/core/global_options.hpp +97 -0
  203. casadi/include/casadi/core/im.hpp +52 -0
  204. casadi/include/casadi/core/im_fwd.hpp +35 -0
  205. casadi/include/casadi/core/importer.hpp +221 -0
  206. casadi/include/casadi/core/integration_tools.hpp +292 -0
  207. casadi/include/casadi/core/integrator.hpp +256 -0
  208. casadi/include/casadi/core/interpolant.hpp +163 -0
  209. casadi/include/casadi/core/linsol.hpp +171 -0
  210. casadi/include/casadi/core/matrix_decl.hpp +1352 -0
  211. casadi/include/casadi/core/matrix_fwd.hpp +37 -0
  212. casadi/include/casadi/core/mx.hpp +953 -0
  213. casadi/include/casadi/core/nlp_builder.hpp +162 -0
  214. casadi/include/casadi/core/nlp_tools.hpp +124 -0
  215. casadi/include/casadi/core/nlpsol.hpp +234 -0
  216. casadi/include/casadi/core/nonzeros.hpp +111 -0
  217. casadi/include/casadi/core/options.hpp +119 -0
  218. casadi/include/casadi/core/optistack.hpp +670 -0
  219. casadi/include/casadi/core/polynomial.hpp +126 -0
  220. casadi/include/casadi/core/printable.hpp +73 -0
  221. casadi/include/casadi/core/rootfinder.hpp +176 -0
  222. casadi/include/casadi/core/runtime/casadi_axpy.hpp +8 -0
  223. casadi/include/casadi/core/runtime/casadi_bfgs.hpp +49 -0
  224. casadi/include/casadi/core/runtime/casadi_bilin.hpp +42 -0
  225. casadi/include/casadi/core/runtime/casadi_bound_consistency.hpp +51 -0
  226. casadi/include/casadi/core/runtime/casadi_cache.hpp +59 -0
  227. casadi/include/casadi/core/runtime/casadi_clear.hpp +27 -0
  228. casadi/include/casadi/core/runtime/casadi_clip_max.hpp +33 -0
  229. casadi/include/casadi/core/runtime/casadi_clip_min.hpp +33 -0
  230. casadi/include/casadi/core/runtime/casadi_convexify.hpp +182 -0
  231. casadi/include/casadi/core/runtime/casadi_copy.hpp +31 -0
  232. casadi/include/casadi/core/runtime/casadi_cvx.hpp +463 -0
  233. casadi/include/casadi/core/runtime/casadi_de_boor.hpp +36 -0
  234. casadi/include/casadi/core/runtime/casadi_dense_lsqr.hpp +247 -0
  235. casadi/include/casadi/core/runtime/casadi_densify.hpp +48 -0
  236. casadi/include/casadi/core/runtime/casadi_dot.hpp +27 -0
  237. casadi/include/casadi/core/runtime/casadi_feasiblesqpmethod.hpp +208 -0
  238. casadi/include/casadi/core/runtime/casadi_file_slurp.hpp +32 -0
  239. casadi/include/casadi/core/runtime/casadi_fill.hpp +27 -0
  240. casadi/include/casadi/core/runtime/casadi_finite_diff.hpp +345 -0
  241. casadi/include/casadi/core/runtime/casadi_flip.hpp +33 -0
  242. casadi/include/casadi/core/runtime/casadi_getu.hpp +35 -0
  243. casadi/include/casadi/core/runtime/casadi_iamax.hpp +36 -0
  244. casadi/include/casadi/core/runtime/casadi_interpn.hpp +39 -0
  245. casadi/include/casadi/core/runtime/casadi_interpn_grad.hpp +72 -0
  246. casadi/include/casadi/core/runtime/casadi_interpn_interpolate.hpp +43 -0
  247. casadi/include/casadi/core/runtime/casadi_interpn_weights.hpp +39 -0
  248. casadi/include/casadi/core/runtime/casadi_ipqp.hpp +868 -0
  249. casadi/include/casadi/core/runtime/casadi_jac.hpp +186 -0
  250. casadi/include/casadi/core/runtime/casadi_kkt.hpp +67 -0
  251. casadi/include/casadi/core/runtime/casadi_kron.hpp +50 -0
  252. casadi/include/casadi/core/runtime/casadi_ldl.hpp +109 -0
  253. casadi/include/casadi/core/runtime/casadi_logsumexp.hpp +41 -0
  254. casadi/include/casadi/core/runtime/casadi_low.hpp +65 -0
  255. casadi/include/casadi/core/runtime/casadi_lsqr.hpp +247 -0
  256. casadi/include/casadi/core/runtime/casadi_masked_norm_inf.hpp +33 -0
  257. casadi/include/casadi/core/runtime/casadi_max_viol.hpp +37 -0
  258. casadi/include/casadi/core/runtime/casadi_mmax.hpp +28 -0
  259. casadi/include/casadi/core/runtime/casadi_mmin.hpp +29 -0
  260. casadi/include/casadi/core/runtime/casadi_mtimes.hpp +75 -0
  261. casadi/include/casadi/core/runtime/casadi_mv.hpp +46 -0
  262. casadi/include/casadi/core/runtime/casadi_mv_dense.hpp +39 -0
  263. casadi/include/casadi/core/runtime/casadi_nd_boor_dual_eval.hpp +127 -0
  264. casadi/include/casadi/core/runtime/casadi_nd_boor_eval.hpp +120 -0
  265. casadi/include/casadi/core/runtime/casadi_newton.hpp +66 -0
  266. casadi/include/casadi/core/runtime/casadi_nlp.hpp +289 -0
  267. casadi/include/casadi/core/runtime/casadi_norm_1.hpp +29 -0
  268. casadi/include/casadi/core/runtime/casadi_norm_2.hpp +24 -0
  269. casadi/include/casadi/core/runtime/casadi_norm_inf.hpp +28 -0
  270. casadi/include/casadi/core/runtime/casadi_norm_inf_mul.hpp +105 -0
  271. casadi/include/casadi/core/runtime/casadi_ocp_block.hpp +55 -0
  272. casadi/include/casadi/core/runtime/casadi_oracle.hpp +44 -0
  273. casadi/include/casadi/core/runtime/casadi_oracle_callback.hpp +39 -0
  274. casadi/include/casadi/core/runtime/casadi_polyval.hpp +29 -0
  275. casadi/include/casadi/core/runtime/casadi_project.hpp +39 -0
  276. casadi/include/casadi/core/runtime/casadi_qp.hpp +86 -0
  277. casadi/include/casadi/core/runtime/casadi_qr.hpp +272 -0
  278. casadi/include/casadi/core/runtime/casadi_qrqp.hpp +1239 -0
  279. casadi/include/casadi/core/runtime/casadi_rank1.hpp +40 -0
  280. casadi/include/casadi/core/runtime/casadi_regularize.hpp +73 -0
  281. casadi/include/casadi/core/runtime/casadi_runtime.hpp +318 -0
  282. casadi/include/casadi/core/runtime/casadi_scal.hpp +26 -0
  283. casadi/include/casadi/core/runtime/casadi_scaled_copy.hpp +31 -0
  284. casadi/include/casadi/core/runtime/casadi_sparsify.hpp +42 -0
  285. casadi/include/casadi/core/runtime/casadi_sparsity.hpp +24 -0
  286. casadi/include/casadi/core/runtime/casadi_sqpmethod.hpp +178 -0
  287. casadi/include/casadi/core/runtime/casadi_sum.hpp +31 -0
  288. casadi/include/casadi/core/runtime/casadi_sum_viol.hpp +37 -0
  289. casadi/include/casadi/core/runtime/casadi_swap.hpp +32 -0
  290. casadi/include/casadi/core/runtime/casadi_trans.hpp +35 -0
  291. casadi/include/casadi/core/runtime/casadi_tri_project.hpp +37 -0
  292. casadi/include/casadi/core/runtime/casadi_trilsolve.hpp +81 -0
  293. casadi/include/casadi/core/runtime/casadi_triusolve.hpp +81 -0
  294. casadi/include/casadi/core/runtime/casadi_vector_fmax.hpp +28 -0
  295. casadi/include/casadi/core/runtime/casadi_vector_fmin.hpp +28 -0
  296. casadi/include/casadi/core/runtime/casadi_vfmax.hpp +28 -0
  297. casadi/include/casadi/core/runtime/casadi_vfmin.hpp +28 -0
  298. casadi/include/casadi/core/runtime/shared.hpp +261 -0
  299. casadi/include/casadi/core/serializer.hpp +256 -0
  300. casadi/include/casadi/core/serializing_stream.hpp +329 -0
  301. casadi/include/casadi/core/shared_object.hpp +270 -0
  302. casadi/include/casadi/core/slice.hpp +149 -0
  303. casadi/include/casadi/core/sparsity.hpp +1495 -0
  304. casadi/include/casadi/core/sparsity_interface.hpp +745 -0
  305. casadi/include/casadi/core/submatrix.hpp +156 -0
  306. casadi/include/casadi/core/sx.hpp +203 -0
  307. casadi/include/casadi/core/sx_elem.hpp +351 -0
  308. casadi/include/casadi/core/sx_fwd.hpp +45 -0
  309. casadi/include/casadi/core/timing.hpp +98 -0
  310. casadi/include/casadi/core/tools.hpp +67 -0
  311. casadi/include/casadi/core/xml_file.hpp +93 -0
  312. casadi/include/casadi/core/xml_node.hpp +207 -0
  313. casadi/include/casadi/doc.i +58615 -0
  314. casadi/include/casadi/doc_merged.i +36123 -0
  315. casadi/include/casadi/mem.h +311 -0
  316. casadi/include/casadi/valgrind-casadi.supp +511 -0
  317. casadi/include/casadi/valgrind-python.supp +1416 -0
  318. casadi/include/coin/BonArraysHelpers.hpp +52 -0
  319. casadi/include/coin/BonAuxInfos.hpp +110 -0
  320. casadi/include/coin/BonBabInfos.hpp +57 -0
  321. casadi/include/coin/BonBabSetupBase.hpp +386 -0
  322. casadi/include/coin/BonBonminSetup.hpp +95 -0
  323. casadi/include/coin/BonBranchingTQP.hpp +197 -0
  324. casadi/include/coin/BonCbc.hpp +127 -0
  325. casadi/include/coin/BonCbcLpStrategy.hpp +45 -0
  326. casadi/include/coin/BonCbcNlpStrategy.hpp +98 -0
  327. casadi/include/coin/BonCbcNode.hpp +133 -0
  328. casadi/include/coin/BonChooseVariable.hpp +345 -0
  329. casadi/include/coin/BonCurvBranchingSolver.hpp +77 -0
  330. casadi/include/coin/BonCutStrengthener.hpp +244 -0
  331. casadi/include/coin/BonDiver.hpp +424 -0
  332. casadi/include/coin/BonDummyHeuristic.hpp +53 -0
  333. casadi/include/coin/BonDummyPump.hpp +43 -0
  334. casadi/include/coin/BonEcpCuts.hpp +97 -0
  335. casadi/include/coin/BonExitCodes.hpp +12 -0
  336. casadi/include/coin/BonFixAndSolveHeuristic.hpp +43 -0
  337. casadi/include/coin/BonGuessHeuristic.hpp +46 -0
  338. casadi/include/coin/BonHeuristicDive.hpp +88 -0
  339. casadi/include/coin/BonHeuristicDiveFractional.hpp +67 -0
  340. casadi/include/coin/BonHeuristicDiveMIP.hpp +83 -0
  341. casadi/include/coin/BonHeuristicDiveMIPFractional.hpp +67 -0
  342. casadi/include/coin/BonHeuristicDiveMIPVectorLength.hpp +74 -0
  343. casadi/include/coin/BonHeuristicDiveVectorLength.hpp +74 -0
  344. casadi/include/coin/BonHeuristicFPump.hpp +111 -0
  345. casadi/include/coin/BonHeuristicLocalBranching.hpp +59 -0
  346. casadi/include/coin/BonHeuristicRINS.hpp +55 -0
  347. casadi/include/coin/BonIpoptInteriorWarmStarter.hpp +103 -0
  348. casadi/include/coin/BonIpoptSolver.hpp +188 -0
  349. casadi/include/coin/BonIpoptWarmStart.hpp +148 -0
  350. casadi/include/coin/BonLinearCutsGenerator.hpp +75 -0
  351. casadi/include/coin/BonLocalSolverBasedHeuristic.hpp +102 -0
  352. casadi/include/coin/BonLpBranchingSolver.hpp +80 -0
  353. casadi/include/coin/BonMilpRounding.hpp +74 -0
  354. casadi/include/coin/BonOACutGenerator2.hpp +56 -0
  355. casadi/include/coin/BonOAMessages.hpp +44 -0
  356. casadi/include/coin/BonOaDecBase.hpp +297 -0
  357. casadi/include/coin/BonOaFeasChecker.hpp +73 -0
  358. casadi/include/coin/BonOaNlpOptim.hpp +116 -0
  359. casadi/include/coin/BonOsiTMINLPInterface.hpp +1342 -0
  360. casadi/include/coin/BonOuterApprox.hpp +123 -0
  361. casadi/include/coin/BonPseudoCosts.hpp +91 -0
  362. casadi/include/coin/BonPumpForMinlp.hpp +45 -0
  363. casadi/include/coin/BonQuadCut.hpp +217 -0
  364. casadi/include/coin/BonQuadRow.hpp +122 -0
  365. casadi/include/coin/BonRegisteredOptions.hpp +225 -0
  366. casadi/include/coin/BonStrongBranchingSolver.hpp +69 -0
  367. casadi/include/coin/BonSubMipSolver.hpp +143 -0
  368. casadi/include/coin/BonTMINLP.hpp +420 -0
  369. casadi/include/coin/BonTMINLP2OsiLP.hpp +164 -0
  370. casadi/include/coin/BonTMINLP2Quad.hpp +191 -0
  371. casadi/include/coin/BonTMINLP2TNLP.hpp +509 -0
  372. casadi/include/coin/BonTMINLPLinObj.hpp +216 -0
  373. casadi/include/coin/BonTMatrix.hpp +167 -0
  374. casadi/include/coin/BonTNLP2FPNLP.hpp +264 -0
  375. casadi/include/coin/BonTNLPSolver.hpp +241 -0
  376. casadi/include/coin/BonTypes.hpp +95 -0
  377. casadi/include/coin/BonminConfig.h +19 -0
  378. casadi/include/coin/CbcBranchActual.hpp +26 -0
  379. casadi/include/coin/CbcBranchAllDifferent.hpp +61 -0
  380. casadi/include/coin/CbcBranchBase.hpp +79 -0
  381. casadi/include/coin/CbcBranchCut.hpp +182 -0
  382. casadi/include/coin/CbcBranchDecision.hpp +135 -0
  383. casadi/include/coin/CbcBranchDefaultDecision.hpp +101 -0
  384. casadi/include/coin/CbcBranchDynamic.hpp +210 -0
  385. casadi/include/coin/CbcBranchLotsize.hpp +249 -0
  386. casadi/include/coin/CbcBranchToFixLots.hpp +94 -0
  387. casadi/include/coin/CbcBranchingObject.hpp +245 -0
  388. casadi/include/coin/CbcClique.hpp +309 -0
  389. casadi/include/coin/CbcCompare.hpp +46 -0
  390. casadi/include/coin/CbcCompareActual.hpp +16 -0
  391. casadi/include/coin/CbcCompareBase.hpp +155 -0
  392. casadi/include/coin/CbcCompareDefault.hpp +129 -0
  393. casadi/include/coin/CbcCompareDepth.hpp +48 -0
  394. casadi/include/coin/CbcCompareEstimate.hpp +48 -0
  395. casadi/include/coin/CbcCompareObjective.hpp +50 -0
  396. casadi/include/coin/CbcConfig.h +18 -0
  397. casadi/include/coin/CbcConsequence.hpp +50 -0
  398. casadi/include/coin/CbcCountRowCut.hpp +176 -0
  399. casadi/include/coin/CbcCutGenerator.hpp +550 -0
  400. casadi/include/coin/CbcCutModifier.hpp +59 -0
  401. casadi/include/coin/CbcCutSubsetModifier.hpp +69 -0
  402. casadi/include/coin/CbcDummyBranchingObject.hpp +83 -0
  403. casadi/include/coin/CbcEventHandler.hpp +250 -0
  404. casadi/include/coin/CbcFathom.hpp +136 -0
  405. casadi/include/coin/CbcFathomDynamicProgramming.hpp +177 -0
  406. casadi/include/coin/CbcFeasibilityBase.hpp +60 -0
  407. casadi/include/coin/CbcFixVariable.hpp +68 -0
  408. casadi/include/coin/CbcFollowOn.hpp +207 -0
  409. casadi/include/coin/CbcFullNodeInfo.hpp +171 -0
  410. casadi/include/coin/CbcGeneral.hpp +60 -0
  411. casadi/include/coin/CbcGeneralDepth.hpp +289 -0
  412. casadi/include/coin/CbcHeuristic.hpp +735 -0
  413. casadi/include/coin/CbcHeuristicDINS.hpp +98 -0
  414. casadi/include/coin/CbcHeuristicDW.hpp +374 -0
  415. casadi/include/coin/CbcHeuristicDive.hpp +198 -0
  416. casadi/include/coin/CbcHeuristicDiveCoefficient.hpp +52 -0
  417. casadi/include/coin/CbcHeuristicDiveFractional.hpp +52 -0
  418. casadi/include/coin/CbcHeuristicDiveGuided.hpp +55 -0
  419. casadi/include/coin/CbcHeuristicDiveLineSearch.hpp +52 -0
  420. casadi/include/coin/CbcHeuristicDivePseudoCost.hpp +60 -0
  421. casadi/include/coin/CbcHeuristicDiveVectorLength.hpp +52 -0
  422. casadi/include/coin/CbcHeuristicFPump.hpp +375 -0
  423. casadi/include/coin/CbcHeuristicGreedy.hpp +289 -0
  424. casadi/include/coin/CbcHeuristicLocal.hpp +276 -0
  425. casadi/include/coin/CbcHeuristicPivotAndFix.hpp +58 -0
  426. casadi/include/coin/CbcHeuristicRENS.hpp +79 -0
  427. casadi/include/coin/CbcHeuristicRINS.hpp +106 -0
  428. casadi/include/coin/CbcHeuristicRandRound.hpp +58 -0
  429. casadi/include/coin/CbcHeuristicVND.hpp +95 -0
  430. casadi/include/coin/CbcLinked.hpp +1443 -0
  431. casadi/include/coin/CbcMessage.hpp +94 -0
  432. casadi/include/coin/CbcMipStartIO.hpp +29 -0
  433. casadi/include/coin/CbcModel.hpp +3296 -0
  434. casadi/include/coin/CbcNWay.hpp +171 -0
  435. casadi/include/coin/CbcNode.hpp +380 -0
  436. casadi/include/coin/CbcNodeInfo.hpp +377 -0
  437. casadi/include/coin/CbcObject.hpp +288 -0
  438. casadi/include/coin/CbcObjectUpdateData.hpp +63 -0
  439. casadi/include/coin/CbcOrClpParam.cpp +4321 -0
  440. casadi/include/coin/CbcOrClpParam.hpp +585 -0
  441. casadi/include/coin/CbcParam.hpp +338 -0
  442. casadi/include/coin/CbcPartialNodeInfo.hpp +116 -0
  443. casadi/include/coin/CbcSOS.hpp +290 -0
  444. casadi/include/coin/CbcSimpleInteger.hpp +299 -0
  445. casadi/include/coin/CbcSimpleIntegerDynamicPseudoCost.hpp +619 -0
  446. casadi/include/coin/CbcSimpleIntegerPseudoCost.hpp +122 -0
  447. casadi/include/coin/CbcSolver.hpp +460 -0
  448. casadi/include/coin/CbcStrategy.hpp +269 -0
  449. casadi/include/coin/CbcSubProblem.hpp +84 -0
  450. casadi/include/coin/CbcTree.hpp +493 -0
  451. casadi/include/coin/CbcTreeLocal.hpp +393 -0
  452. casadi/include/coin/Cbc_C_Interface.h +904 -0
  453. casadi/include/coin/Cgl012cut.hpp +464 -0
  454. casadi/include/coin/CglAllDifferent.hpp +115 -0
  455. casadi/include/coin/CglClique.hpp +312 -0
  456. casadi/include/coin/CglConfig.h +19 -0
  457. casadi/include/coin/CglCutGenerator.hpp +133 -0
  458. casadi/include/coin/CglDuplicateRow.hpp +189 -0
  459. casadi/include/coin/CglFlowCover.hpp +371 -0
  460. casadi/include/coin/CglGMI.hpp +364 -0
  461. casadi/include/coin/CglGMIParam.hpp +313 -0
  462. casadi/include/coin/CglGomory.hpp +204 -0
  463. casadi/include/coin/CglKnapsackCover.hpp +310 -0
  464. casadi/include/coin/CglLandP.hpp +306 -0
  465. casadi/include/coin/CglLandPValidator.hpp +130 -0
  466. casadi/include/coin/CglLiftAndProject.hpp +104 -0
  467. casadi/include/coin/CglMessage.hpp +49 -0
  468. casadi/include/coin/CglMixedIntegerRounding.hpp +429 -0
  469. casadi/include/coin/CglMixedIntegerRounding2.hpp +427 -0
  470. casadi/include/coin/CglOddHole.hpp +160 -0
  471. casadi/include/coin/CglParam.hpp +93 -0
  472. casadi/include/coin/CglPreProcess.hpp +600 -0
  473. casadi/include/coin/CglProbing.hpp +543 -0
  474. casadi/include/coin/CglRedSplit.hpp +448 -0
  475. casadi/include/coin/CglRedSplit2.hpp +494 -0
  476. casadi/include/coin/CglRedSplit2Param.hpp +495 -0
  477. casadi/include/coin/CglRedSplitParam.hpp +272 -0
  478. casadi/include/coin/CglResidualCapacity.hpp +240 -0
  479. casadi/include/coin/CglSimpleRounding.hpp +174 -0
  480. casadi/include/coin/CglStored.hpp +140 -0
  481. casadi/include/coin/CglTreeInfo.hpp +216 -0
  482. casadi/include/coin/CglTwomir.hpp +562 -0
  483. casadi/include/coin/CglZeroHalf.hpp +133 -0
  484. casadi/include/coin/ClpAmplObjective.hpp +113 -0
  485. casadi/include/coin/ClpCholeskyBase.hpp +321 -0
  486. casadi/include/coin/ClpCholeskyDense.hpp +157 -0
  487. casadi/include/coin/ClpCholeskyMumps.hpp +65 -0
  488. casadi/include/coin/ClpCholeskyPardiso.hpp +67 -0
  489. casadi/include/coin/ClpConfig.h +17 -0
  490. casadi/include/coin/ClpConstraint.hpp +129 -0
  491. casadi/include/coin/ClpConstraintAmpl.hpp +109 -0
  492. casadi/include/coin/ClpConstraintLinear.hpp +113 -0
  493. casadi/include/coin/ClpConstraintQuadratic.hpp +123 -0
  494. casadi/include/coin/ClpDualRowDantzig.hpp +72 -0
  495. casadi/include/coin/ClpDualRowPivot.hpp +136 -0
  496. casadi/include/coin/ClpDualRowSteepest.hpp +160 -0
  497. casadi/include/coin/ClpDummyMatrix.hpp +186 -0
  498. casadi/include/coin/ClpDynamicExampleMatrix.hpp +199 -0
  499. casadi/include/coin/ClpDynamicMatrix.hpp +420 -0
  500. casadi/include/coin/ClpEventHandler.hpp +193 -0
  501. casadi/include/coin/ClpFactorization.hpp +556 -0
  502. casadi/include/coin/ClpGubDynamicMatrix.hpp +270 -0
  503. casadi/include/coin/ClpGubMatrix.hpp +373 -0
  504. casadi/include/coin/ClpInterior.hpp +622 -0
  505. casadi/include/coin/ClpLinearObjective.hpp +104 -0
  506. casadi/include/coin/ClpMatrixBase.hpp +561 -0
  507. casadi/include/coin/ClpMessage.hpp +131 -0
  508. casadi/include/coin/ClpModel.hpp +1442 -0
  509. casadi/include/coin/ClpNetworkMatrix.hpp +235 -0
  510. casadi/include/coin/ClpNode.hpp +364 -0
  511. casadi/include/coin/ClpNonLinearCost.hpp +432 -0
  512. casadi/include/coin/ClpObjective.hpp +142 -0
  513. casadi/include/coin/ClpPEDualRowDantzig.hpp +84 -0
  514. casadi/include/coin/ClpPEDualRowSteepest.hpp +100 -0
  515. casadi/include/coin/ClpPEPrimalColumnDantzig.hpp +71 -0
  516. casadi/include/coin/ClpPEPrimalColumnSteepest.hpp +107 -0
  517. casadi/include/coin/ClpPESimplex.hpp +231 -0
  518. casadi/include/coin/ClpPackedMatrix.hpp +778 -0
  519. casadi/include/coin/ClpParameters.hpp +132 -0
  520. casadi/include/coin/ClpPdcoBase.hpp +110 -0
  521. casadi/include/coin/ClpPlusMinusOneMatrix.hpp +565 -0
  522. casadi/include/coin/ClpPresolve.hpp +379 -0
  523. casadi/include/coin/ClpPrimalColumnDantzig.hpp +74 -0
  524. casadi/include/coin/ClpPrimalColumnPivot.hpp +163 -0
  525. casadi/include/coin/ClpPrimalColumnSteepest.hpp +281 -0
  526. casadi/include/coin/ClpQuadraticObjective.hpp +161 -0
  527. casadi/include/coin/ClpSimplex.hpp +2137 -0
  528. casadi/include/coin/ClpSimplexDual.hpp +304 -0
  529. casadi/include/coin/ClpSimplexNonlinear.hpp +117 -0
  530. casadi/include/coin/ClpSimplexOther.hpp +282 -0
  531. casadi/include/coin/ClpSimplexPrimal.hpp +244 -0
  532. casadi/include/coin/ClpSolve.hpp +505 -0
  533. casadi/include/coin/Clp_C_Interface.h +554 -0
  534. casadi/include/coin/CoinAlloc.hpp +179 -0
  535. casadi/include/coin/CoinBuild.hpp +159 -0
  536. casadi/include/coin/CoinDenseFactorization.hpp +452 -0
  537. casadi/include/coin/CoinDenseVector.hpp +401 -0
  538. casadi/include/coin/CoinDistance.hpp +51 -0
  539. casadi/include/coin/CoinError.hpp +274 -0
  540. casadi/include/coin/CoinFactorization.hpp +2178 -0
  541. casadi/include/coin/CoinFileIO.hpp +185 -0
  542. casadi/include/coin/CoinFinite.hpp +37 -0
  543. casadi/include/coin/CoinFloatEqual.hpp +204 -0
  544. casadi/include/coin/CoinHelperFunctions.hpp +1270 -0
  545. casadi/include/coin/CoinIndexedVector.hpp +1437 -0
  546. casadi/include/coin/CoinLpIO.hpp +836 -0
  547. casadi/include/coin/CoinMessage.hpp +95 -0
  548. casadi/include/coin/CoinMessageHandler.hpp +717 -0
  549. casadi/include/coin/CoinModel.hpp +1214 -0
  550. casadi/include/coin/CoinModelUseful.hpp +518 -0
  551. casadi/include/coin/CoinMpsIO.hpp +1142 -0
  552. casadi/include/coin/CoinOslFactorization.hpp +287 -0
  553. casadi/include/coin/CoinPackedMatrix.hpp +956 -0
  554. casadi/include/coin/CoinPackedVector.hpp +670 -0
  555. casadi/include/coin/CoinPackedVectorBase.hpp +274 -0
  556. casadi/include/coin/CoinParam.hpp +644 -0
  557. casadi/include/coin/CoinPragma.hpp +29 -0
  558. casadi/include/coin/CoinPresolveDoubleton.hpp +76 -0
  559. casadi/include/coin/CoinPresolveDual.hpp +84 -0
  560. casadi/include/coin/CoinPresolveDupcol.hpp +259 -0
  561. casadi/include/coin/CoinPresolveEmpty.hpp +120 -0
  562. casadi/include/coin/CoinPresolveFixed.hpp +185 -0
  563. casadi/include/coin/CoinPresolveForcing.hpp +69 -0
  564. casadi/include/coin/CoinPresolveImpliedFree.hpp +66 -0
  565. casadi/include/coin/CoinPresolveIsolated.hpp +59 -0
  566. casadi/include/coin/CoinPresolveMatrix.hpp +1996 -0
  567. casadi/include/coin/CoinPresolveMonitor.hpp +105 -0
  568. casadi/include/coin/CoinPresolvePsdebug.hpp +169 -0
  569. casadi/include/coin/CoinPresolveSingleton.hpp +115 -0
  570. casadi/include/coin/CoinPresolveSubst.hpp +103 -0
  571. casadi/include/coin/CoinPresolveTighten.hpp +58 -0
  572. casadi/include/coin/CoinPresolveTripleton.hpp +69 -0
  573. casadi/include/coin/CoinPresolveUseless.hpp +63 -0
  574. casadi/include/coin/CoinPresolveZeros.hpp +65 -0
  575. casadi/include/coin/CoinRational.hpp +43 -0
  576. casadi/include/coin/CoinSearchTree.hpp +523 -0
  577. casadi/include/coin/CoinShallowPackedVector.hpp +149 -0
  578. casadi/include/coin/CoinSignal.hpp +127 -0
  579. casadi/include/coin/CoinSimpFactorization.hpp +432 -0
  580. casadi/include/coin/CoinSmartPtr.hpp +548 -0
  581. casadi/include/coin/CoinSnapshot.hpp +572 -0
  582. casadi/include/coin/CoinSort.hpp +753 -0
  583. casadi/include/coin/CoinStructuredModel.hpp +270 -0
  584. casadi/include/coin/CoinTime.hpp +350 -0
  585. casadi/include/coin/CoinTypes.hpp +67 -0
  586. casadi/include/coin/CoinUtility.hpp +26 -0
  587. casadi/include/coin/CoinUtilsConfig.h +34 -0
  588. casadi/include/coin/CoinWarmStart.hpp +56 -0
  589. casadi/include/coin/CoinWarmStartBasis.hpp +468 -0
  590. casadi/include/coin/CoinWarmStartDual.hpp +180 -0
  591. casadi/include/coin/CoinWarmStartPrimalDual.hpp +233 -0
  592. casadi/include/coin/CoinWarmStartVector.hpp +523 -0
  593. casadi/include/coin/Coin_C_defines.h +149 -0
  594. casadi/include/coin/Idiot.hpp +327 -0
  595. casadi/include/coin/OsiAuxInfo.hpp +261 -0
  596. casadi/include/coin/OsiBranchingObject.hpp +1097 -0
  597. casadi/include/coin/OsiCbcSolverInterface.hpp +791 -0
  598. casadi/include/coin/OsiChooseVariable.hpp +645 -0
  599. casadi/include/coin/OsiClpSolverInterface.hpp +1604 -0
  600. casadi/include/coin/OsiColCut.hpp +322 -0
  601. casadi/include/coin/OsiCollections.hpp +34 -0
  602. casadi/include/coin/OsiConfig.h +19 -0
  603. casadi/include/coin/OsiCut.hpp +251 -0
  604. casadi/include/coin/OsiCuts.hpp +505 -0
  605. casadi/include/coin/OsiPresolve.hpp +272 -0
  606. casadi/include/coin/OsiRowCut.hpp +345 -0
  607. casadi/include/coin/OsiRowCutDebugger.hpp +190 -0
  608. casadi/include/coin/OsiSolverBranch.hpp +169 -0
  609. casadi/include/coin/OsiSolverInterface.hpp +2221 -0
  610. casadi/include/coin/OsiSolverParameters.hpp +144 -0
  611. casadi/include/coin/OsiUnitTests.hpp +390 -0
  612. casadi/include/coin-or/IpAlgBuilder.hpp +417 -0
  613. casadi/include/coin-or/IpAlgStrategy.hpp +201 -0
  614. casadi/include/coin-or/IpAlgTypes.hpp +64 -0
  615. casadi/include/coin-or/IpAugSystemSolver.hpp +212 -0
  616. casadi/include/coin-or/IpBlas.hpp +426 -0
  617. casadi/include/coin-or/IpCachedResults.hpp +897 -0
  618. casadi/include/coin-or/IpCompoundMatrix.hpp +423 -0
  619. casadi/include/coin-or/IpCompoundSymMatrix.hpp +348 -0
  620. casadi/include/coin-or/IpCompoundVector.hpp +395 -0
  621. casadi/include/coin-or/IpConvCheck.hpp +97 -0
  622. casadi/include/coin-or/IpDebug.hpp +167 -0
  623. casadi/include/coin-or/IpDenseVector.hpp +626 -0
  624. casadi/include/coin-or/IpDiagMatrix.hpp +158 -0
  625. casadi/include/coin-or/IpEqMultCalculator.hpp +76 -0
  626. casadi/include/coin-or/IpException.hpp +156 -0
  627. casadi/include/coin-or/IpExpansionMatrix.hpp +245 -0
  628. casadi/include/coin-or/IpGenTMatrix.hpp +290 -0
  629. casadi/include/coin-or/IpHessianUpdater.hpp +73 -0
  630. casadi/include/coin-or/IpIdentityMatrix.hpp +167 -0
  631. casadi/include/coin-or/IpIpoptAlg.hpp +257 -0
  632. casadi/include/coin-or/IpIpoptApplication.hpp +367 -0
  633. casadi/include/coin-or/IpIpoptCalculatedQuantities.hpp +1009 -0
  634. casadi/include/coin-or/IpIpoptData.hpp +966 -0
  635. casadi/include/coin-or/IpIpoptNLP.hpp +328 -0
  636. casadi/include/coin-or/IpIterateInitializer.hpp +68 -0
  637. casadi/include/coin-or/IpIteratesVector.hpp +840 -0
  638. casadi/include/coin-or/IpIterationOutput.hpp +78 -0
  639. casadi/include/coin-or/IpJournalist.hpp +573 -0
  640. casadi/include/coin-or/IpLapack.hpp +227 -0
  641. casadi/include/coin-or/IpLibraryLoader.hpp +76 -0
  642. casadi/include/coin-or/IpLineSearch.hpp +106 -0
  643. casadi/include/coin-or/IpLinearSolvers.h +46 -0
  644. casadi/include/coin-or/IpMatrix.hpp +434 -0
  645. casadi/include/coin-or/IpMuUpdate.hpp +77 -0
  646. casadi/include/coin-or/IpNLP.hpp +306 -0
  647. casadi/include/coin-or/IpNLPScaling.hpp +582 -0
  648. casadi/include/coin-or/IpObserver.hpp +422 -0
  649. casadi/include/coin-or/IpOptionsList.hpp +412 -0
  650. casadi/include/coin-or/IpOrigIpoptNLP.hpp +603 -0
  651. casadi/include/coin-or/IpPDSystemSolver.hpp +137 -0
  652. casadi/include/coin-or/IpReferenced.hpp +262 -0
  653. casadi/include/coin-or/IpRegOptions.hpp +1152 -0
  654. casadi/include/coin-or/IpReturnCodes.h +23 -0
  655. casadi/include/coin-or/IpReturnCodes.hpp +18 -0
  656. casadi/include/coin-or/IpReturnCodes.inc +71 -0
  657. casadi/include/coin-or/IpReturnCodes_inc.h +45 -0
  658. casadi/include/coin-or/IpScaledMatrix.hpp +291 -0
  659. casadi/include/coin-or/IpSearchDirCalculator.hpp +72 -0
  660. casadi/include/coin-or/IpSmartPtr.hpp +865 -0
  661. casadi/include/coin-or/IpSolveStatistics.hpp +210 -0
  662. casadi/include/coin-or/IpSparseSymLinearSolverInterface.hpp +260 -0
  663. casadi/include/coin-or/IpStdAugSystemSolver.cpp +555 -0
  664. casadi/include/coin-or/IpStdCInterface.h +428 -0
  665. casadi/include/coin-or/IpSumSymMatrix.hpp +186 -0
  666. casadi/include/coin-or/IpSymLinearSolver.hpp +141 -0
  667. casadi/include/coin-or/IpSymMatrix.hpp +167 -0
  668. casadi/include/coin-or/IpSymScaledMatrix.hpp +255 -0
  669. casadi/include/coin-or/IpSymTMatrix.hpp +275 -0
  670. casadi/include/coin-or/IpTNLP.hpp +820 -0
  671. casadi/include/coin-or/IpTNLPAdapter.hpp +648 -0
  672. casadi/include/coin-or/IpTNLPReducer.hpp +274 -0
  673. casadi/include/coin-or/IpTaggedObject.hpp +128 -0
  674. casadi/include/coin-or/IpTimedTask.hpp +218 -0
  675. casadi/include/coin-or/IpTimingStatistics.hpp +323 -0
  676. casadi/include/coin-or/IpTripletHelper.hpp +308 -0
  677. casadi/include/coin-or/IpTypes.h +81 -0
  678. casadi/include/coin-or/IpTypes.hpp +30 -0
  679. casadi/include/coin-or/IpUtils.hpp +166 -0
  680. casadi/include/coin-or/IpVector.hpp +892 -0
  681. casadi/include/coin-or/IpZeroSymMatrix.hpp +155 -0
  682. casadi/include/coin-or/IpoptConfig.h +45 -0
  683. casadi/include/coin-or/SensAlgorithm.hpp +114 -0
  684. casadi/include/coin-or/SensApplication.hpp +188 -0
  685. casadi/include/coin-or/SensBacksolver.hpp +36 -0
  686. casadi/include/coin-or/SensMeasurement.hpp +56 -0
  687. casadi/include/coin-or/SensPCalculator.hpp +137 -0
  688. casadi/include/coin-or/SensRegOp.hpp +21 -0
  689. casadi/include/coin-or/SensSchurData.hpp +182 -0
  690. casadi/include/coin-or/SensSchurDriver.hpp +118 -0
  691. casadi/include/coin-or/SensSimpleBacksolver.hpp +49 -0
  692. casadi/include/coin-or/SensStepCalc.hpp +85 -0
  693. casadi/include/coin-or/SensUtils.hpp +63 -0
  694. casadi/include/coin-or/metis/defs.h +161 -0
  695. casadi/include/coin-or/metis/macros.h +143 -0
  696. casadi/include/coin-or/metis/metis.h +37 -0
  697. casadi/include/coin-or/metis/proto.h +505 -0
  698. casadi/include/coin-or/metis/rename.h +418 -0
  699. casadi/include/coin-or/metis/struct.h +251 -0
  700. casadi/include/coin-or/mumps/dmumps_c.h +142 -0
  701. casadi/include/coin-or/mumps/mumps_c_types.h +72 -0
  702. casadi/include/coin-or/mumps/mumps_compat.h +27 -0
  703. casadi/include/coin-or/mumps/mumps_int_def.h +11 -0
  704. casadi/include/coin-or/mumps/mumps_mpi.h +67 -0
  705. casadi/include/d_blas.h +78 -0
  706. casadi/include/d_blas_64.h +73 -0
  707. casadi/include/daqp/api.h +46 -0
  708. casadi/include/daqp/auxiliary.h +29 -0
  709. casadi/include/daqp/bnb.h +32 -0
  710. casadi/include/daqp/codegen.h +18 -0
  711. casadi/include/daqp/constants.h +92 -0
  712. casadi/include/daqp/daqp.h +22 -0
  713. casadi/include/daqp/daqp_prox.h +18 -0
  714. casadi/include/daqp/factorization.h +18 -0
  715. casadi/include/daqp/types.h +161 -0
  716. casadi/include/daqp/utils.h +44 -0
  717. casadi/include/eigen3/Eigen/Cholesky +45 -0
  718. casadi/include/eigen3/Eigen/CholmodSupport +48 -0
  719. casadi/include/eigen3/Eigen/Core +384 -0
  720. casadi/include/eigen3/Eigen/Dense +7 -0
  721. casadi/include/eigen3/Eigen/Eigen +2 -0
  722. casadi/include/eigen3/Eigen/Eigenvalues +60 -0
  723. casadi/include/eigen3/Eigen/Geometry +59 -0
  724. casadi/include/eigen3/Eigen/Householder +29 -0
  725. casadi/include/eigen3/Eigen/IterativeLinearSolvers +48 -0
  726. casadi/include/eigen3/Eigen/Jacobi +32 -0
  727. casadi/include/eigen3/Eigen/KLUSupport +41 -0
  728. casadi/include/eigen3/Eigen/LU +47 -0
  729. casadi/include/eigen3/Eigen/MetisSupport +35 -0
  730. casadi/include/eigen3/Eigen/OrderingMethods +70 -0
  731. casadi/include/eigen3/Eigen/PaStiXSupport +49 -0
  732. casadi/include/eigen3/Eigen/PardisoSupport +35 -0
  733. casadi/include/eigen3/Eigen/QR +50 -0
  734. casadi/include/eigen3/Eigen/QtAlignedMalloc +39 -0
  735. casadi/include/eigen3/Eigen/SPQRSupport +34 -0
  736. casadi/include/eigen3/Eigen/SVD +50 -0
  737. casadi/include/eigen3/Eigen/Sparse +34 -0
  738. casadi/include/eigen3/Eigen/SparseCholesky +37 -0
  739. casadi/include/eigen3/Eigen/SparseCore +69 -0
  740. casadi/include/eigen3/Eigen/SparseLU +50 -0
  741. casadi/include/eigen3/Eigen/SparseQR +36 -0
  742. casadi/include/eigen3/Eigen/StdDeque +27 -0
  743. casadi/include/eigen3/Eigen/StdList +26 -0
  744. casadi/include/eigen3/Eigen/StdVector +27 -0
  745. casadi/include/eigen3/Eigen/SuperLUSupport +64 -0
  746. casadi/include/eigen3/Eigen/UmfPackSupport +40 -0
  747. casadi/include/eigen3/Eigen/src/Cholesky/LDLT.h +688 -0
  748. casadi/include/eigen3/Eigen/src/Cholesky/LLT.h +558 -0
  749. casadi/include/eigen3/Eigen/src/Cholesky/LLT_LAPACKE.h +99 -0
  750. casadi/include/eigen3/Eigen/src/CholmodSupport/CholmodSupport.h +682 -0
  751. casadi/include/eigen3/Eigen/src/Core/ArithmeticSequence.h +413 -0
  752. casadi/include/eigen3/Eigen/src/Core/Array.h +417 -0
  753. casadi/include/eigen3/Eigen/src/Core/ArrayBase.h +226 -0
  754. casadi/include/eigen3/Eigen/src/Core/ArrayWrapper.h +209 -0
  755. casadi/include/eigen3/Eigen/src/Core/Assign.h +90 -0
  756. casadi/include/eigen3/Eigen/src/Core/AssignEvaluator.h +1010 -0
  757. casadi/include/eigen3/Eigen/src/Core/Assign_MKL.h +178 -0
  758. casadi/include/eigen3/Eigen/src/Core/BandMatrix.h +353 -0
  759. casadi/include/eigen3/Eigen/src/Core/Block.h +448 -0
  760. casadi/include/eigen3/Eigen/src/Core/BooleanRedux.h +162 -0
  761. casadi/include/eigen3/Eigen/src/Core/CommaInitializer.h +164 -0
  762. casadi/include/eigen3/Eigen/src/Core/ConditionEstimator.h +175 -0
  763. casadi/include/eigen3/Eigen/src/Core/CoreEvaluators.h +1741 -0
  764. casadi/include/eigen3/Eigen/src/Core/CoreIterators.h +132 -0
  765. casadi/include/eigen3/Eigen/src/Core/CwiseBinaryOp.h +183 -0
  766. casadi/include/eigen3/Eigen/src/Core/CwiseNullaryOp.h +1001 -0
  767. casadi/include/eigen3/Eigen/src/Core/CwiseTernaryOp.h +197 -0
  768. casadi/include/eigen3/Eigen/src/Core/CwiseUnaryOp.h +103 -0
  769. casadi/include/eigen3/Eigen/src/Core/CwiseUnaryView.h +132 -0
  770. casadi/include/eigen3/Eigen/src/Core/DenseBase.h +701 -0
  771. casadi/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h +685 -0
  772. casadi/include/eigen3/Eigen/src/Core/DenseStorage.h +652 -0
  773. casadi/include/eigen3/Eigen/src/Core/Diagonal.h +258 -0
  774. casadi/include/eigen3/Eigen/src/Core/DiagonalMatrix.h +391 -0
  775. casadi/include/eigen3/Eigen/src/Core/DiagonalProduct.h +28 -0
  776. casadi/include/eigen3/Eigen/src/Core/Dot.h +318 -0
  777. casadi/include/eigen3/Eigen/src/Core/EigenBase.h +160 -0
  778. casadi/include/eigen3/Eigen/src/Core/ForceAlignedAccess.h +150 -0
  779. casadi/include/eigen3/Eigen/src/Core/Fuzzy.h +155 -0
  780. casadi/include/eigen3/Eigen/src/Core/GeneralProduct.h +465 -0
  781. casadi/include/eigen3/Eigen/src/Core/GenericPacketMath.h +1040 -0
  782. casadi/include/eigen3/Eigen/src/Core/GlobalFunctions.h +194 -0
  783. casadi/include/eigen3/Eigen/src/Core/IO.h +258 -0
  784. casadi/include/eigen3/Eigen/src/Core/IndexedView.h +237 -0
  785. casadi/include/eigen3/Eigen/src/Core/Inverse.h +117 -0
  786. casadi/include/eigen3/Eigen/src/Core/Map.h +171 -0
  787. casadi/include/eigen3/Eigen/src/Core/MapBase.h +310 -0
  788. casadi/include/eigen3/Eigen/src/Core/MathFunctions.h +2057 -0
  789. casadi/include/eigen3/Eigen/src/Core/MathFunctionsImpl.h +200 -0
  790. casadi/include/eigen3/Eigen/src/Core/Matrix.h +565 -0
  791. casadi/include/eigen3/Eigen/src/Core/MatrixBase.h +547 -0
  792. casadi/include/eigen3/Eigen/src/Core/NestByValue.h +85 -0
  793. casadi/include/eigen3/Eigen/src/Core/NoAlias.h +109 -0
  794. casadi/include/eigen3/Eigen/src/Core/NumTraits.h +335 -0
  795. casadi/include/eigen3/Eigen/src/Core/PartialReduxEvaluator.h +232 -0
  796. casadi/include/eigen3/Eigen/src/Core/PermutationMatrix.h +605 -0
  797. casadi/include/eigen3/Eigen/src/Core/PlainObjectBase.h +1128 -0
  798. casadi/include/eigen3/Eigen/src/Core/Product.h +191 -0
  799. casadi/include/eigen3/Eigen/src/Core/ProductEvaluators.h +1179 -0
  800. casadi/include/eigen3/Eigen/src/Core/Random.h +218 -0
  801. casadi/include/eigen3/Eigen/src/Core/Redux.h +515 -0
  802. casadi/include/eigen3/Eigen/src/Core/Ref.h +381 -0
  803. casadi/include/eigen3/Eigen/src/Core/Replicate.h +142 -0
  804. casadi/include/eigen3/Eigen/src/Core/Reshaped.h +454 -0
  805. casadi/include/eigen3/Eigen/src/Core/ReturnByValue.h +119 -0
  806. casadi/include/eigen3/Eigen/src/Core/Reverse.h +217 -0
  807. casadi/include/eigen3/Eigen/src/Core/Select.h +164 -0
  808. casadi/include/eigen3/Eigen/src/Core/SelfAdjointView.h +365 -0
  809. casadi/include/eigen3/Eigen/src/Core/SelfCwiseBinaryOp.h +47 -0
  810. casadi/include/eigen3/Eigen/src/Core/Solve.h +188 -0
  811. casadi/include/eigen3/Eigen/src/Core/SolveTriangular.h +235 -0
  812. casadi/include/eigen3/Eigen/src/Core/SolverBase.h +168 -0
  813. casadi/include/eigen3/Eigen/src/Core/StableNorm.h +251 -0
  814. casadi/include/eigen3/Eigen/src/Core/StlIterators.h +463 -0
  815. casadi/include/eigen3/Eigen/src/Core/Stride.h +116 -0
  816. casadi/include/eigen3/Eigen/src/Core/Swap.h +68 -0
  817. casadi/include/eigen3/Eigen/src/Core/Transpose.h +464 -0
  818. casadi/include/eigen3/Eigen/src/Core/Transpositions.h +386 -0
  819. casadi/include/eigen3/Eigen/src/Core/TriangularMatrix.h +1001 -0
  820. casadi/include/eigen3/Eigen/src/Core/VectorBlock.h +96 -0
  821. casadi/include/eigen3/Eigen/src/Core/VectorwiseOp.h +784 -0
  822. casadi/include/eigen3/Eigen/src/Core/Visitor.h +381 -0
  823. casadi/include/eigen3/Eigen/src/Core/arch/AVX/Complex.h +372 -0
  824. casadi/include/eigen3/Eigen/src/Core/arch/AVX/MathFunctions.h +228 -0
  825. casadi/include/eigen3/Eigen/src/Core/arch/AVX/PacketMath.h +1574 -0
  826. casadi/include/eigen3/Eigen/src/Core/arch/AVX/TypeCasting.h +115 -0
  827. casadi/include/eigen3/Eigen/src/Core/arch/AVX512/Complex.h +422 -0
  828. casadi/include/eigen3/Eigen/src/Core/arch/AVX512/MathFunctions.h +362 -0
  829. casadi/include/eigen3/Eigen/src/Core/arch/AVX512/PacketMath.h +2303 -0
  830. casadi/include/eigen3/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
  831. casadi/include/eigen3/Eigen/src/Core/arch/AltiVec/Complex.h +417 -0
  832. casadi/include/eigen3/Eigen/src/Core/arch/AltiVec/MathFunctions.h +90 -0
  833. casadi/include/eigen3/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2937 -0
  834. casadi/include/eigen3/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +221 -0
  835. casadi/include/eigen3/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +629 -0
  836. casadi/include/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h +2711 -0
  837. casadi/include/eigen3/Eigen/src/Core/arch/CUDA/Complex.h +258 -0
  838. casadi/include/eigen3/Eigen/src/Core/arch/Default/BFloat16.h +700 -0
  839. casadi/include/eigen3/Eigen/src/Core/arch/Default/ConjHelper.h +117 -0
  840. casadi/include/eigen3/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1649 -0
  841. casadi/include/eigen3/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +110 -0
  842. casadi/include/eigen3/Eigen/src/Core/arch/Default/Half.h +942 -0
  843. casadi/include/eigen3/Eigen/src/Core/arch/Default/Settings.h +49 -0
  844. casadi/include/eigen3/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
  845. casadi/include/eigen3/Eigen/src/Core/arch/GPU/MathFunctions.h +103 -0
  846. casadi/include/eigen3/Eigen/src/Core/arch/GPU/PacketMath.h +1685 -0
  847. casadi/include/eigen3/Eigen/src/Core/arch/GPU/TypeCasting.h +80 -0
  848. casadi/include/eigen3/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
  849. casadi/include/eigen3/Eigen/src/Core/arch/MSA/Complex.h +648 -0
  850. casadi/include/eigen3/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
  851. casadi/include/eigen3/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
  852. casadi/include/eigen3/Eigen/src/Core/arch/NEON/Complex.h +584 -0
  853. casadi/include/eigen3/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
  854. casadi/include/eigen3/Eigen/src/Core/arch/NEON/MathFunctions.h +75 -0
  855. casadi/include/eigen3/Eigen/src/Core/arch/NEON/PacketMath.h +4587 -0
  856. casadi/include/eigen3/Eigen/src/Core/arch/NEON/TypeCasting.h +1419 -0
  857. casadi/include/eigen3/Eigen/src/Core/arch/SSE/Complex.h +351 -0
  858. casadi/include/eigen3/Eigen/src/Core/arch/SSE/MathFunctions.h +199 -0
  859. casadi/include/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h +1505 -0
  860. casadi/include/eigen3/Eigen/src/Core/arch/SSE/TypeCasting.h +142 -0
  861. casadi/include/eigen3/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
  862. casadi/include/eigen3/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
  863. casadi/include/eigen3/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
  864. casadi/include/eigen3/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
  865. casadi/include/eigen3/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
  866. casadi/include/eigen3/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
  867. casadi/include/eigen3/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
  868. casadi/include/eigen3/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
  869. casadi/include/eigen3/Eigen/src/Core/arch/ZVector/Complex.h +426 -0
  870. casadi/include/eigen3/Eigen/src/Core/arch/ZVector/MathFunctions.h +233 -0
  871. casadi/include/eigen3/Eigen/src/Core/arch/ZVector/PacketMath.h +1060 -0
  872. casadi/include/eigen3/Eigen/src/Core/functors/AssignmentFunctors.h +177 -0
  873. casadi/include/eigen3/Eigen/src/Core/functors/BinaryFunctors.h +541 -0
  874. casadi/include/eigen3/Eigen/src/Core/functors/NullaryFunctors.h +189 -0
  875. casadi/include/eigen3/Eigen/src/Core/functors/StlFunctors.h +166 -0
  876. casadi/include/eigen3/Eigen/src/Core/functors/TernaryFunctors.h +25 -0
  877. casadi/include/eigen3/Eigen/src/Core/functors/UnaryFunctors.h +1131 -0
  878. casadi/include/eigen3/Eigen/src/Core/products/GeneralBlockPanelKernel.h +2645 -0
  879. casadi/include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix.h +517 -0
  880. casadi/include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +317 -0
  881. casadi/include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +145 -0
  882. casadi/include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +124 -0
  883. casadi/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h +518 -0
  884. casadi/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +136 -0
  885. casadi/include/eigen3/Eigen/src/Core/products/Parallelizer.h +180 -0
  886. casadi/include/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +544 -0
  887. casadi/include/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +295 -0
  888. casadi/include/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector.h +262 -0
  889. casadi/include/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +118 -0
  890. casadi/include/eigen3/Eigen/src/Core/products/SelfadjointProduct.h +133 -0
  891. casadi/include/eigen3/Eigen/src/Core/products/SelfadjointRank2Update.h +94 -0
  892. casadi/include/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix.h +472 -0
  893. casadi/include/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +317 -0
  894. casadi/include/eigen3/Eigen/src/Core/products/TriangularMatrixVector.h +350 -0
  895. casadi/include/eigen3/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +255 -0
  896. casadi/include/eigen3/Eigen/src/Core/products/TriangularSolverMatrix.h +337 -0
  897. casadi/include/eigen3/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +167 -0
  898. casadi/include/eigen3/Eigen/src/Core/products/TriangularSolverVector.h +148 -0
  899. casadi/include/eigen3/Eigen/src/Core/util/BlasUtil.h +583 -0
  900. casadi/include/eigen3/Eigen/src/Core/util/ConfigureVectorization.h +512 -0
  901. casadi/include/eigen3/Eigen/src/Core/util/Constants.h +563 -0
  902. casadi/include/eigen3/Eigen/src/Core/util/DisableStupidWarnings.h +106 -0
  903. casadi/include/eigen3/Eigen/src/Core/util/ForwardDeclarations.h +322 -0
  904. casadi/include/eigen3/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
  905. casadi/include/eigen3/Eigen/src/Core/util/IntegralConstant.h +272 -0
  906. casadi/include/eigen3/Eigen/src/Core/util/MKL_support.h +137 -0
  907. casadi/include/eigen3/Eigen/src/Core/util/Macros.h +1464 -0
  908. casadi/include/eigen3/Eigen/src/Core/util/Memory.h +1163 -0
  909. casadi/include/eigen3/Eigen/src/Core/util/Meta.h +812 -0
  910. casadi/include/eigen3/Eigen/src/Core/util/NonMPL2.h +3 -0
  911. casadi/include/eigen3/Eigen/src/Core/util/ReenableStupidWarnings.h +31 -0
  912. casadi/include/eigen3/Eigen/src/Core/util/ReshapedHelper.h +51 -0
  913. casadi/include/eigen3/Eigen/src/Core/util/StaticAssert.h +221 -0
  914. casadi/include/eigen3/Eigen/src/Core/util/SymbolicIndex.h +293 -0
  915. casadi/include/eigen3/Eigen/src/Core/util/XprHelper.h +856 -0
  916. casadi/include/eigen3/Eigen/src/Eigenvalues/ComplexEigenSolver.h +346 -0
  917. casadi/include/eigen3/Eigen/src/Eigenvalues/ComplexSchur.h +462 -0
  918. casadi/include/eigen3/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +91 -0
  919. casadi/include/eigen3/Eigen/src/Eigenvalues/EigenSolver.h +622 -0
  920. casadi/include/eigen3/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +418 -0
  921. casadi/include/eigen3/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +226 -0
  922. casadi/include/eigen3/Eigen/src/Eigenvalues/HessenbergDecomposition.h +374 -0
  923. casadi/include/eigen3/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +158 -0
  924. casadi/include/eigen3/Eigen/src/Eigenvalues/RealQZ.h +657 -0
  925. casadi/include/eigen3/Eigen/src/Eigenvalues/RealSchur.h +558 -0
  926. casadi/include/eigen3/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +77 -0
  927. casadi/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +904 -0
  928. casadi/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +87 -0
  929. casadi/include/eigen3/Eigen/src/Eigenvalues/Tridiagonalization.h +561 -0
  930. casadi/include/eigen3/Eigen/src/Geometry/AlignedBox.h +486 -0
  931. casadi/include/eigen3/Eigen/src/Geometry/AngleAxis.h +247 -0
  932. casadi/include/eigen3/Eigen/src/Geometry/EulerAngles.h +114 -0
  933. casadi/include/eigen3/Eigen/src/Geometry/Homogeneous.h +501 -0
  934. casadi/include/eigen3/Eigen/src/Geometry/Hyperplane.h +282 -0
  935. casadi/include/eigen3/Eigen/src/Geometry/OrthoMethods.h +235 -0
  936. casadi/include/eigen3/Eigen/src/Geometry/ParametrizedLine.h +232 -0
  937. casadi/include/eigen3/Eigen/src/Geometry/Quaternion.h +870 -0
  938. casadi/include/eigen3/Eigen/src/Geometry/Rotation2D.h +199 -0
  939. casadi/include/eigen3/Eigen/src/Geometry/RotationBase.h +206 -0
  940. casadi/include/eigen3/Eigen/src/Geometry/Scaling.h +188 -0
  941. casadi/include/eigen3/Eigen/src/Geometry/Transform.h +1563 -0
  942. casadi/include/eigen3/Eigen/src/Geometry/Translation.h +202 -0
  943. casadi/include/eigen3/Eigen/src/Geometry/Umeyama.h +166 -0
  944. casadi/include/eigen3/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
  945. casadi/include/eigen3/Eigen/src/Householder/BlockHouseholder.h +110 -0
  946. casadi/include/eigen3/Eigen/src/Householder/Householder.h +176 -0
  947. casadi/include/eigen3/Eigen/src/Householder/HouseholderSequence.h +545 -0
  948. casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +226 -0
  949. casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +212 -0
  950. casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +229 -0
  951. casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +394 -0
  952. casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +453 -0
  953. casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +444 -0
  954. casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +198 -0
  955. casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +117 -0
  956. casadi/include/eigen3/Eigen/src/Jacobi/Jacobi.h +483 -0
  957. casadi/include/eigen3/Eigen/src/KLUSupport/KLUSupport.h +358 -0
  958. casadi/include/eigen3/Eigen/src/LU/Determinant.h +117 -0
  959. casadi/include/eigen3/Eigen/src/LU/FullPivLU.h +877 -0
  960. casadi/include/eigen3/Eigen/src/LU/InverseImpl.h +432 -0
  961. casadi/include/eigen3/Eigen/src/LU/PartialPivLU.h +624 -0
  962. casadi/include/eigen3/Eigen/src/LU/PartialPivLU_LAPACKE.h +83 -0
  963. casadi/include/eigen3/Eigen/src/LU/arch/InverseSize4.h +351 -0
  964. casadi/include/eigen3/Eigen/src/MetisSupport/MetisSupport.h +137 -0
  965. casadi/include/eigen3/Eigen/src/OrderingMethods/Amd.h +435 -0
  966. casadi/include/eigen3/Eigen/src/OrderingMethods/Eigen_Colamd.h +1863 -0
  967. casadi/include/eigen3/Eigen/src/OrderingMethods/Ordering.h +153 -0
  968. casadi/include/eigen3/Eigen/src/PaStiXSupport/PaStiXSupport.h +678 -0
  969. casadi/include/eigen3/Eigen/src/PardisoSupport/PardisoSupport.h +545 -0
  970. casadi/include/eigen3/Eigen/src/QR/ColPivHouseholderQR.h +674 -0
  971. casadi/include/eigen3/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +97 -0
  972. casadi/include/eigen3/Eigen/src/QR/CompleteOrthogonalDecomposition.h +635 -0
  973. casadi/include/eigen3/Eigen/src/QR/FullPivHouseholderQR.h +713 -0
  974. casadi/include/eigen3/Eigen/src/QR/HouseholderQR.h +434 -0
  975. casadi/include/eigen3/Eigen/src/QR/HouseholderQR_LAPACKE.h +68 -0
  976. casadi/include/eigen3/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +335 -0
  977. casadi/include/eigen3/Eigen/src/SVD/BDCSVD.h +1366 -0
  978. casadi/include/eigen3/Eigen/src/SVD/JacobiSVD.h +812 -0
  979. casadi/include/eigen3/Eigen/src/SVD/JacobiSVD_LAPACKE.h +91 -0
  980. casadi/include/eigen3/Eigen/src/SVD/SVDBase.h +376 -0
  981. casadi/include/eigen3/Eigen/src/SVD/UpperBidiagonalization.h +414 -0
  982. casadi/include/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky.h +697 -0
  983. casadi/include/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +174 -0
  984. casadi/include/eigen3/Eigen/src/SparseCore/AmbiVector.h +378 -0
  985. casadi/include/eigen3/Eigen/src/SparseCore/CompressedStorage.h +274 -0
  986. casadi/include/eigen3/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +352 -0
  987. casadi/include/eigen3/Eigen/src/SparseCore/MappedSparseMatrix.h +67 -0
  988. casadi/include/eigen3/Eigen/src/SparseCore/SparseAssign.h +270 -0
  989. casadi/include/eigen3/Eigen/src/SparseCore/SparseBlock.h +571 -0
  990. casadi/include/eigen3/Eigen/src/SparseCore/SparseColEtree.h +206 -0
  991. casadi/include/eigen3/Eigen/src/SparseCore/SparseCompressedBase.h +370 -0
  992. casadi/include/eigen3/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +722 -0
  993. casadi/include/eigen3/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +150 -0
  994. casadi/include/eigen3/Eigen/src/SparseCore/SparseDenseProduct.h +342 -0
  995. casadi/include/eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h +138 -0
  996. casadi/include/eigen3/Eigen/src/SparseCore/SparseDot.h +98 -0
  997. casadi/include/eigen3/Eigen/src/SparseCore/SparseFuzzy.h +29 -0
  998. casadi/include/eigen3/Eigen/src/SparseCore/SparseMap.h +305 -0
  999. casadi/include/eigen3/Eigen/src/SparseCore/SparseMatrix.h +1518 -0
  1000. casadi/include/eigen3/Eigen/src/SparseCore/SparseMatrixBase.h +398 -0
  1001. casadi/include/eigen3/Eigen/src/SparseCore/SparsePermutation.h +178 -0
  1002. casadi/include/eigen3/Eigen/src/SparseCore/SparseProduct.h +181 -0
  1003. casadi/include/eigen3/Eigen/src/SparseCore/SparseRedux.h +49 -0
  1004. casadi/include/eigen3/Eigen/src/SparseCore/SparseRef.h +397 -0
  1005. casadi/include/eigen3/Eigen/src/SparseCore/SparseSelfAdjointView.h +659 -0
  1006. casadi/include/eigen3/Eigen/src/SparseCore/SparseSolverBase.h +124 -0
  1007. casadi/include/eigen3/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +198 -0
  1008. casadi/include/eigen3/Eigen/src/SparseCore/SparseTranspose.h +92 -0
  1009. casadi/include/eigen3/Eigen/src/SparseCore/SparseTriangularView.h +189 -0
  1010. casadi/include/eigen3/Eigen/src/SparseCore/SparseUtil.h +186 -0
  1011. casadi/include/eigen3/Eigen/src/SparseCore/SparseVector.h +478 -0
  1012. casadi/include/eigen3/Eigen/src/SparseCore/SparseView.h +254 -0
  1013. casadi/include/eigen3/Eigen/src/SparseCore/TriangularSolver.h +315 -0
  1014. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU.h +923 -0
  1015. casadi/include/eigen3/Eigen/src/SparseLU/SparseLUImpl.h +66 -0
  1016. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_Memory.h +226 -0
  1017. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_Structs.h +110 -0
  1018. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +375 -0
  1019. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_Utils.h +80 -0
  1020. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_column_bmod.h +181 -0
  1021. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_column_dfs.h +179 -0
  1022. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +107 -0
  1023. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +280 -0
  1024. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +126 -0
  1025. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +130 -0
  1026. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_panel_bmod.h +223 -0
  1027. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_panel_dfs.h +258 -0
  1028. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_pivotL.h +137 -0
  1029. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_pruneL.h +136 -0
  1030. casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_relax_snode.h +83 -0
  1031. casadi/include/eigen3/Eigen/src/SparseQR/SparseQR.h +758 -0
  1032. casadi/include/eigen3/Eigen/src/StlSupport/StdDeque.h +116 -0
  1033. casadi/include/eigen3/Eigen/src/StlSupport/StdList.h +106 -0
  1034. casadi/include/eigen3/Eigen/src/StlSupport/StdVector.h +131 -0
  1035. casadi/include/eigen3/Eigen/src/StlSupport/details.h +84 -0
  1036. casadi/include/eigen3/Eigen/src/SuperLUSupport/SuperLUSupport.h +1025 -0
  1037. casadi/include/eigen3/Eigen/src/UmfPackSupport/UmfPackSupport.h +642 -0
  1038. casadi/include/eigen3/Eigen/src/misc/Image.h +82 -0
  1039. casadi/include/eigen3/Eigen/src/misc/Kernel.h +79 -0
  1040. casadi/include/eigen3/Eigen/src/misc/RealSvd2x2.h +55 -0
  1041. casadi/include/eigen3/Eigen/src/misc/blas.h +440 -0
  1042. casadi/include/eigen3/Eigen/src/misc/lapack.h +152 -0
  1043. casadi/include/eigen3/Eigen/src/misc/lapacke.h +16292 -0
  1044. casadi/include/eigen3/Eigen/src/misc/lapacke_mangling.h +17 -0
  1045. casadi/include/eigen3/Eigen/src/plugins/ArrayCwiseBinaryOps.h +358 -0
  1046. casadi/include/eigen3/Eigen/src/plugins/ArrayCwiseUnaryOps.h +696 -0
  1047. casadi/include/eigen3/Eigen/src/plugins/BlockMethods.h +1442 -0
  1048. casadi/include/eigen3/Eigen/src/plugins/CommonCwiseBinaryOps.h +115 -0
  1049. casadi/include/eigen3/Eigen/src/plugins/CommonCwiseUnaryOps.h +177 -0
  1050. casadi/include/eigen3/Eigen/src/plugins/IndexedViewMethods.h +262 -0
  1051. casadi/include/eigen3/Eigen/src/plugins/MatrixCwiseBinaryOps.h +152 -0
  1052. casadi/include/eigen3/Eigen/src/plugins/MatrixCwiseUnaryOps.h +95 -0
  1053. casadi/include/eigen3/Eigen/src/plugins/ReshapedMethods.h +149 -0
  1054. casadi/include/eigen3/signature_of_eigen3_matrix_library +1 -0
  1055. casadi/include/eigen3/unsupported/Eigen/AdolcForward +159 -0
  1056. casadi/include/eigen3/unsupported/Eigen/AlignedVector3 +234 -0
  1057. casadi/include/eigen3/unsupported/Eigen/ArpackSupport +30 -0
  1058. casadi/include/eigen3/unsupported/Eigen/AutoDiff +46 -0
  1059. casadi/include/eigen3/unsupported/Eigen/BVH +95 -0
  1060. casadi/include/eigen3/unsupported/Eigen/CXX11/Tensor +137 -0
  1061. casadi/include/eigen3/unsupported/Eigen/CXX11/TensorSymmetry +42 -0
  1062. casadi/include/eigen3/unsupported/Eigen/CXX11/ThreadPool +74 -0
  1063. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/Tensor.h +554 -0
  1064. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h +329 -0
  1065. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h +247 -0
  1066. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h +1176 -0
  1067. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h +1559 -0
  1068. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h +1093 -0
  1069. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h +518 -0
  1070. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h +377 -0
  1071. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h +1023 -0
  1072. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionBlocking.h +73 -0
  1073. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionCuda.h +6 -0
  1074. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionGpu.h +1413 -0
  1075. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h +575 -0
  1076. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionSycl.h +1650 -0
  1077. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +1679 -0
  1078. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h +456 -0
  1079. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h +1132 -0
  1080. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConvolutionSycl.h +544 -0
  1081. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h +214 -0
  1082. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorCustomOp.h +347 -0
  1083. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDevice.h +137 -0
  1084. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h +6 -0
  1085. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceDefault.h +104 -0
  1086. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceGpu.h +389 -0
  1087. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h +1048 -0
  1088. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +409 -0
  1089. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDimensionList.h +236 -0
  1090. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h +490 -0
  1091. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h +236 -0
  1092. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h +983 -0
  1093. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h +703 -0
  1094. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h +388 -0
  1095. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h +669 -0
  1096. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h +379 -0
  1097. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h +237 -0
  1098. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorForwardDeclarations.h +191 -0
  1099. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h +488 -0
  1100. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h +302 -0
  1101. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGlobalFunctions.h +33 -0
  1102. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h +99 -0
  1103. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaUndefines.h +44 -0
  1104. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorIO.h +79 -0
  1105. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h +603 -0
  1106. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h +738 -0
  1107. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h +247 -0
  1108. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorInitializer.h +82 -0
  1109. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h +263 -0
  1110. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorLayoutSwap.h +216 -0
  1111. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h +98 -0
  1112. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h +327 -0
  1113. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h +311 -0
  1114. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h +1102 -0
  1115. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h +708 -0
  1116. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h +291 -0
  1117. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorRandom.h +322 -0
  1118. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h +998 -0
  1119. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h +6 -0
  1120. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReductionGpu.h +966 -0
  1121. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReductionSycl.h +582 -0
  1122. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h +454 -0
  1123. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h +465 -0
  1124. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h +528 -0
  1125. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorScanSycl.h +513 -0
  1126. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +471 -0
  1127. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h +161 -0
  1128. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h +346 -0
  1129. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorTrace.h +303 -0
  1130. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h +264 -0
  1131. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorUInt128.h +249 -0
  1132. casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h +629 -0
  1133. casadi/include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/DynamicSymmetry.h +293 -0
  1134. casadi/include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/StaticSymmetry.h +236 -0
  1135. casadi/include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/Symmetry.h +338 -0
  1136. casadi/include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/util/TemplateGroupTheory.h +669 -0
  1137. casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/Barrier.h +67 -0
  1138. casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/EventCount.h +249 -0
  1139. casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h +486 -0
  1140. casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h +236 -0
  1141. casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadCancel.h +23 -0
  1142. casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadEnvironment.h +40 -0
  1143. casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadLocal.h +301 -0
  1144. casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadPoolInterface.h +48 -0
  1145. casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadYield.h +20 -0
  1146. casadi/include/eigen3/unsupported/Eigen/CXX11/src/util/CXX11Meta.h +537 -0
  1147. casadi/include/eigen3/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h +88 -0
  1148. casadi/include/eigen3/unsupported/Eigen/CXX11/src/util/EmulateArray.h +261 -0
  1149. casadi/include/eigen3/unsupported/Eigen/CXX11/src/util/MaxSizeVector.h +158 -0
  1150. casadi/include/eigen3/unsupported/Eigen/EulerAngles +43 -0
  1151. casadi/include/eigen3/unsupported/Eigen/FFT +419 -0
  1152. casadi/include/eigen3/unsupported/Eigen/IterativeSolvers +51 -0
  1153. casadi/include/eigen3/unsupported/Eigen/KroneckerProduct +36 -0
  1154. casadi/include/eigen3/unsupported/Eigen/LevenbergMarquardt +49 -0
  1155. casadi/include/eigen3/unsupported/Eigen/MPRealSupport +213 -0
  1156. casadi/include/eigen3/unsupported/Eigen/MatrixFunctions +504 -0
  1157. casadi/include/eigen3/unsupported/Eigen/MoreVectorization +24 -0
  1158. casadi/include/eigen3/unsupported/Eigen/NonLinearOptimization +140 -0
  1159. casadi/include/eigen3/unsupported/Eigen/NumericalDiff +56 -0
  1160. casadi/include/eigen3/unsupported/Eigen/OpenGLSupport +322 -0
  1161. casadi/include/eigen3/unsupported/Eigen/Polynomials +137 -0
  1162. casadi/include/eigen3/unsupported/Eigen/Skyline +39 -0
  1163. casadi/include/eigen3/unsupported/Eigen/SparseExtra +54 -0
  1164. casadi/include/eigen3/unsupported/Eigen/SpecialFunctions +103 -0
  1165. casadi/include/eigen3/unsupported/Eigen/Splines +35 -0
  1166. casadi/include/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffJacobian.h +108 -0
  1167. casadi/include/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +730 -0
  1168. casadi/include/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffVector.h +220 -0
  1169. casadi/include/eigen3/unsupported/Eigen/src/BVH/BVAlgorithms.h +293 -0
  1170. casadi/include/eigen3/unsupported/Eigen/src/BVH/KdBVH.h +223 -0
  1171. casadi/include/eigen3/unsupported/Eigen/src/Eigenvalues/ArpackSelfAdjointEigenSolver.h +790 -0
  1172. casadi/include/eigen3/unsupported/Eigen/src/EulerAngles/EulerAngles.h +355 -0
  1173. casadi/include/eigen3/unsupported/Eigen/src/EulerAngles/EulerSystem.h +305 -0
  1174. casadi/include/eigen3/unsupported/Eigen/src/FFT/ei_fftw_impl.h +261 -0
  1175. casadi/include/eigen3/unsupported/Eigen/src/FFT/ei_kissfft_impl.h +449 -0
  1176. casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h +187 -0
  1177. casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/DGMRES.h +511 -0
  1178. casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/GMRES.h +335 -0
  1179. casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/IDRS.h +436 -0
  1180. casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/IncompleteLU.h +90 -0
  1181. casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/IterationController.h +154 -0
  1182. casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/MINRES.h +267 -0
  1183. casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/Scaling.h +193 -0
  1184. casadi/include/eigen3/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h +305 -0
  1185. casadi/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMcovar.h +84 -0
  1186. casadi/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMonestep.h +202 -0
  1187. casadi/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMpar.h +160 -0
  1188. casadi/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMqrsolv.h +188 -0
  1189. casadi/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LevenbergMarquardt.h +396 -0
  1190. casadi/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h +441 -0
  1191. casadi/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h +569 -0
  1192. casadi/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h +373 -0
  1193. casadi/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h +705 -0
  1194. casadi/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h +368 -0
  1195. casadi/include/eigen3/unsupported/Eigen/src/MatrixFunctions/StemFunction.h +117 -0
  1196. casadi/include/eigen3/unsupported/Eigen/src/MoreVectorization/MathFunctions.h +95 -0
  1197. casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h +601 -0
  1198. casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/LevenbergMarquardt.h +657 -0
  1199. casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/chkder.h +66 -0
  1200. casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/covar.h +70 -0
  1201. casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/dogleg.h +107 -0
  1202. casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/fdjac1.h +79 -0
  1203. casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/lmpar.h +298 -0
  1204. casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/qrsolv.h +91 -0
  1205. casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h +30 -0
  1206. casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/r1updt.h +99 -0
  1207. casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/rwupdt.h +49 -0
  1208. casadi/include/eigen3/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h +130 -0
  1209. casadi/include/eigen3/unsupported/Eigen/src/Polynomials/Companion.h +280 -0
  1210. casadi/include/eigen3/unsupported/Eigen/src/Polynomials/PolynomialSolver.h +428 -0
  1211. casadi/include/eigen3/unsupported/Eigen/src/Polynomials/PolynomialUtils.h +143 -0
  1212. casadi/include/eigen3/unsupported/Eigen/src/Skyline/SkylineInplaceLU.h +352 -0
  1213. casadi/include/eigen3/unsupported/Eigen/src/Skyline/SkylineMatrix.h +862 -0
  1214. casadi/include/eigen3/unsupported/Eigen/src/Skyline/SkylineMatrixBase.h +212 -0
  1215. casadi/include/eigen3/unsupported/Eigen/src/Skyline/SkylineProduct.h +295 -0
  1216. casadi/include/eigen3/unsupported/Eigen/src/Skyline/SkylineStorage.h +259 -0
  1217. casadi/include/eigen3/unsupported/Eigen/src/Skyline/SkylineUtil.h +89 -0
  1218. casadi/include/eigen3/unsupported/Eigen/src/SparseExtra/BlockOfDynamicSparseMatrix.h +122 -0
  1219. casadi/include/eigen3/unsupported/Eigen/src/SparseExtra/BlockSparseMatrix.h +1079 -0
  1220. casadi/include/eigen3/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h +404 -0
  1221. casadi/include/eigen3/unsupported/Eigen/src/SparseExtra/MarketIO.h +282 -0
  1222. casadi/include/eigen3/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h +247 -0
  1223. casadi/include/eigen3/unsupported/Eigen/src/SparseExtra/RandomSetter.h +349 -0
  1224. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsArrayAPI.h +286 -0
  1225. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsBFloat16.h +68 -0
  1226. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsFunctors.h +357 -0
  1227. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsHalf.h +66 -0
  1228. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsImpl.h +1959 -0
  1229. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsPacketMath.h +118 -0
  1230. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/HipVectorCompatibility.h +67 -0
  1231. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsArrayAPI.h +167 -0
  1232. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsBFloat16.h +58 -0
  1233. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsFunctors.h +330 -0
  1234. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsHalf.h +58 -0
  1235. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsImpl.h +2045 -0
  1236. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsPacketMath.h +79 -0
  1237. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX/BesselFunctions.h +46 -0
  1238. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX/SpecialFunctions.h +16 -0
  1239. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX512/BesselFunctions.h +46 -0
  1240. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX512/SpecialFunctions.h +16 -0
  1241. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/GPU/SpecialFunctions.h +369 -0
  1242. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/NEON/BesselFunctions.h +54 -0
  1243. casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/NEON/SpecialFunctions.h +34 -0
  1244. casadi/include/eigen3/unsupported/Eigen/src/Splines/Spline.h +507 -0
  1245. casadi/include/eigen3/unsupported/Eigen/src/Splines/SplineFitting.h +431 -0
  1246. casadi/include/eigen3/unsupported/Eigen/src/Splines/SplineFwd.h +93 -0
  1247. casadi/include/fatrop/auxiliary/Common.hpp +34 -0
  1248. casadi/include/fatrop/auxiliary/DynamicLib.hpp +34 -0
  1249. casadi/include/fatrop/auxiliary/FatropOptions.hpp +68 -0
  1250. casadi/include/fatrop/auxiliary/FatropVector.hpp +143 -0
  1251. casadi/include/fatrop/auxiliary/LinearAlgebra.hpp +88 -0
  1252. casadi/include/fatrop/auxiliary/VectorUtils.hpp +54 -0
  1253. casadi/include/fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp +493 -0
  1254. casadi/include/fatrop/fatrop.hpp +39 -0
  1255. casadi/include/fatrop/function_evaluation/CasadiCodegen.hpp +104 -0
  1256. casadi/include/fatrop/function_evaluation/FunctionEvaluation.hpp +60 -0
  1257. casadi/include/fatrop/json/json.h +946 -0
  1258. casadi/include/fatrop/ocp/CasadiCApiUserdataWrap.hpp +87 -0
  1259. casadi/include/fatrop/ocp/DuInfEvaluator.hpp +38 -0
  1260. casadi/include/fatrop/ocp/FatropOCP.hpp +161 -0
  1261. casadi/include/fatrop/ocp/FatropOCPBuilder.hpp +52 -0
  1262. casadi/include/fatrop/ocp/FatropOCPResto.hpp +299 -0
  1263. casadi/include/fatrop/ocp/OCP.hpp +82 -0
  1264. casadi/include/fatrop/ocp/OCPAbstract.hpp +254 -0
  1265. casadi/include/fatrop/ocp/OCPAdapter.hpp +197 -0
  1266. casadi/include/fatrop/ocp/OCPCInterface.h +289 -0
  1267. casadi/include/fatrop/ocp/OCPDims.hpp +60 -0
  1268. casadi/include/fatrop/ocp/OCPInitializer.hpp +41 -0
  1269. casadi/include/fatrop/ocp/OCPKKT.hpp +69 -0
  1270. casadi/include/fatrop/ocp/OCPLSRiccati.hpp +198 -0
  1271. casadi/include/fatrop/ocp/OCPLSScaler.hpp +66 -0
  1272. casadi/include/fatrop/ocp/OCPLinearSolver.hpp +75 -0
  1273. casadi/include/fatrop/ocp/OCPNoScaling.hpp +42 -0
  1274. casadi/include/fatrop/ocp/OCPScalingMethod.hpp +42 -0
  1275. casadi/include/fatrop/ocp/StageOCP.hpp +592 -0
  1276. casadi/include/fatrop/ocp/StageOCPApplication.hpp +242 -0
  1277. casadi/include/fatrop/ocp/StageOCPExpressions.hpp +182 -0
  1278. casadi/include/fatrop/ocp/UStageEvalAbstract.hpp +168 -0
  1279. casadi/include/fatrop/ocp/UStageOCPImpl.hpp +152 -0
  1280. casadi/include/fatrop/quasi_newton/bfgs.hpp +159 -0
  1281. casadi/include/fatrop/solver/AlgBuilder.hpp +76 -0
  1282. casadi/include/fatrop/solver/AlgStrategy.hpp +33 -0
  1283. casadi/include/fatrop/solver/FatropAlg.hpp +121 -0
  1284. casadi/include/fatrop/solver/FatropData.hpp +188 -0
  1285. casadi/include/fatrop/solver/FatropOptions.hpp +95 -0
  1286. casadi/include/fatrop/solver/FatropPrinter.hpp +65 -0
  1287. casadi/include/fatrop/solver/FatropStats.hpp +63 -0
  1288. casadi/include/fatrop/solver/Filter.hpp +54 -0
  1289. casadi/include/fatrop/solver/IterationData.hpp +56 -0
  1290. casadi/include/fatrop/solver/LineSearch.hpp +86 -0
  1291. casadi/include/fatrop/solver/NLPL1.hpp +263 -0
  1292. casadi/include/fatrop/templates/NLPAlg.hpp +104 -0
  1293. casadi/include/highs/HConfig.h +21 -0
  1294. casadi/include/highs/Highs.h +1529 -0
  1295. casadi/include/highs/filereaderlp/builder.hpp +25 -0
  1296. casadi/include/highs/filereaderlp/def.hpp +19 -0
  1297. casadi/include/highs/filereaderlp/model.hpp +68 -0
  1298. casadi/include/highs/filereaderlp/reader.hpp +10 -0
  1299. casadi/include/highs/interfaces/highs_c_api.h +2283 -0
  1300. casadi/include/highs/io/Filereader.h +47 -0
  1301. casadi/include/highs/io/FilereaderEms.h +33 -0
  1302. casadi/include/highs/io/FilereaderLp.h +54 -0
  1303. casadi/include/highs/io/FilereaderMps.h +30 -0
  1304. casadi/include/highs/io/HMPSIO.h +81 -0
  1305. casadi/include/highs/io/HMpsFF.h +235 -0
  1306. casadi/include/highs/io/HighsIO.h +109 -0
  1307. casadi/include/highs/io/LoadOptions.h +27 -0
  1308. casadi/include/highs/ipm/IpxSolution.h +35 -0
  1309. casadi/include/highs/ipm/IpxWrapper.h +73 -0
  1310. casadi/include/highs/ipm/basiclu/basiclu.h +161 -0
  1311. casadi/include/highs/ipm/basiclu/basiclu_factorize.h +247 -0
  1312. casadi/include/highs/ipm/basiclu/basiclu_get_factors.h +108 -0
  1313. casadi/include/highs/ipm/basiclu/basiclu_initialize.h +119 -0
  1314. casadi/include/highs/ipm/basiclu/basiclu_obj_factorize.h +34 -0
  1315. casadi/include/highs/ipm/basiclu/basiclu_obj_free.h +19 -0
  1316. casadi/include/highs/ipm/basiclu/basiclu_obj_get_factors.h +34 -0
  1317. casadi/include/highs/ipm/basiclu/basiclu_obj_initialize.h +46 -0
  1318. casadi/include/highs/ipm/basiclu/basiclu_obj_solve_dense.h +29 -0
  1319. casadi/include/highs/ipm/basiclu/basiclu_obj_solve_for_update.h +42 -0
  1320. casadi/include/highs/ipm/basiclu/basiclu_obj_solve_sparse.h +32 -0
  1321. casadi/include/highs/ipm/basiclu/basiclu_obj_update.h +31 -0
  1322. casadi/include/highs/ipm/basiclu/basiclu_object.h +30 -0
  1323. casadi/include/highs/ipm/basiclu/basiclu_solve_dense.h +75 -0
  1324. casadi/include/highs/ipm/basiclu/basiclu_solve_for_update.h +169 -0
  1325. casadi/include/highs/ipm/basiclu/basiclu_solve_sparse.h +112 -0
  1326. casadi/include/highs/ipm/basiclu/basiclu_update.h +125 -0
  1327. casadi/include/highs/ipm/basiclu/lu_def.h +39 -0
  1328. casadi/include/highs/ipm/basiclu/lu_file.h +21 -0
  1329. casadi/include/highs/ipm/basiclu/lu_internal.h +220 -0
  1330. casadi/include/highs/ipm/basiclu/lu_list.h +168 -0
  1331. casadi/include/highs/ipm/ipx/basiclu_kernel.h +20 -0
  1332. casadi/include/highs/ipm/ipx/basiclu_wrapper.h +47 -0
  1333. casadi/include/highs/ipm/ipx/basis.h +351 -0
  1334. casadi/include/highs/ipm/ipx/conjugate_residuals.h +74 -0
  1335. casadi/include/highs/ipm/ipx/control.h +163 -0
  1336. casadi/include/highs/ipm/ipx/crossover.h +157 -0
  1337. casadi/include/highs/ipm/ipx/diagonal_precond.h +45 -0
  1338. casadi/include/highs/ipm/ipx/forrest_tomlin.h +102 -0
  1339. casadi/include/highs/ipm/ipx/guess_basis.h +21 -0
  1340. casadi/include/highs/ipm/ipx/indexed_vector.h +113 -0
  1341. casadi/include/highs/ipm/ipx/info.h +27 -0
  1342. casadi/include/highs/ipm/ipx/ipm.h +94 -0
  1343. casadi/include/highs/ipm/ipx/ipx_c.h +47 -0
  1344. casadi/include/highs/ipm/ipx/ipx_config.h +9 -0
  1345. casadi/include/highs/ipm/ipx/ipx_info.h +111 -0
  1346. casadi/include/highs/ipm/ipx/ipx_internal.h +88 -0
  1347. casadi/include/highs/ipm/ipx/ipx_parameters.h +75 -0
  1348. casadi/include/highs/ipm/ipx/ipx_status.h +57 -0
  1349. casadi/include/highs/ipm/ipx/iterate.h +328 -0
  1350. casadi/include/highs/ipm/ipx/kkt_solver.h +70 -0
  1351. casadi/include/highs/ipm/ipx/kkt_solver_basis.h +66 -0
  1352. casadi/include/highs/ipm/ipx/kkt_solver_diag.h +48 -0
  1353. casadi/include/highs/ipm/ipx/linear_operator.h +26 -0
  1354. casadi/include/highs/ipm/ipx/lp_solver.h +201 -0
  1355. casadi/include/highs/ipm/ipx/lu_factorization.h +79 -0
  1356. casadi/include/highs/ipm/ipx/lu_update.h +129 -0
  1357. casadi/include/highs/ipm/ipx/maxvolume.h +54 -0
  1358. casadi/include/highs/ipm/ipx/model.h +409 -0
  1359. casadi/include/highs/ipm/ipx/multistream.h +52 -0
  1360. casadi/include/highs/ipm/ipx/normal_matrix.h +44 -0
  1361. casadi/include/highs/ipm/ipx/power_method.h +44 -0
  1362. casadi/include/highs/ipm/ipx/sparse_matrix.h +195 -0
  1363. casadi/include/highs/ipm/ipx/sparse_utils.h +58 -0
  1364. casadi/include/highs/ipm/ipx/splitted_normal_matrix.h +63 -0
  1365. casadi/include/highs/ipm/ipx/starting_basis.h +39 -0
  1366. casadi/include/highs/ipm/ipx/symbolic_invert.h +29 -0
  1367. casadi/include/highs/ipm/ipx/timer.h +24 -0
  1368. casadi/include/highs/ipm/ipx/utils.h +39 -0
  1369. casadi/include/highs/lp_data/HConst.h +305 -0
  1370. casadi/include/highs/lp_data/HStruct.h +146 -0
  1371. casadi/include/highs/lp_data/HighsAnalysis.h +26 -0
  1372. casadi/include/highs/lp_data/HighsCallback.h +40 -0
  1373. casadi/include/highs/lp_data/HighsCallbackStruct.h +62 -0
  1374. casadi/include/highs/lp_data/HighsDebug.h +37 -0
  1375. casadi/include/highs/lp_data/HighsInfo.h +322 -0
  1376. casadi/include/highs/lp_data/HighsInfoDebug.h +30 -0
  1377. casadi/include/highs/lp_data/HighsLp.h +101 -0
  1378. casadi/include/highs/lp_data/HighsLpSolverObject.h +48 -0
  1379. casadi/include/highs/lp_data/HighsLpUtils.h +266 -0
  1380. casadi/include/highs/lp_data/HighsModelUtils.h +109 -0
  1381. casadi/include/highs/lp_data/HighsOptions.h +1357 -0
  1382. casadi/include/highs/lp_data/HighsRanging.h +46 -0
  1383. casadi/include/highs/lp_data/HighsRuntimeOptions.h +276 -0
  1384. casadi/include/highs/lp_data/HighsSolution.h +137 -0
  1385. casadi/include/highs/lp_data/HighsSolutionDebug.h +90 -0
  1386. casadi/include/highs/lp_data/HighsSolve.h +26 -0
  1387. casadi/include/highs/lp_data/HighsStatus.h +32 -0
  1388. casadi/include/highs/mip/HighsCliqueTable.h +318 -0
  1389. casadi/include/highs/mip/HighsConflictPool.h +112 -0
  1390. casadi/include/highs/mip/HighsCutGeneration.h +96 -0
  1391. casadi/include/highs/mip/HighsCutPool.h +171 -0
  1392. casadi/include/highs/mip/HighsDebugSol.h +135 -0
  1393. casadi/include/highs/mip/HighsDomain.h +641 -0
  1394. casadi/include/highs/mip/HighsDomainChange.h +51 -0
  1395. casadi/include/highs/mip/HighsDynamicRowMatrix.h +107 -0
  1396. casadi/include/highs/mip/HighsGFkSolve.h +441 -0
  1397. casadi/include/highs/mip/HighsImplications.h +146 -0
  1398. casadi/include/highs/mip/HighsLpAggregator.h +53 -0
  1399. casadi/include/highs/mip/HighsLpRelaxation.h +360 -0
  1400. casadi/include/highs/mip/HighsMipSolver.h +105 -0
  1401. casadi/include/highs/mip/HighsMipSolverData.h +236 -0
  1402. casadi/include/highs/mip/HighsModkSeparator.h +63 -0
  1403. casadi/include/highs/mip/HighsNodeQueue.h +314 -0
  1404. casadi/include/highs/mip/HighsObjectiveFunction.h +74 -0
  1405. casadi/include/highs/mip/HighsPathSeparator.h +42 -0
  1406. casadi/include/highs/mip/HighsPrimalHeuristics.h +68 -0
  1407. casadi/include/highs/mip/HighsPseudocost.h +363 -0
  1408. casadi/include/highs/mip/HighsRedcostFixing.h +45 -0
  1409. casadi/include/highs/mip/HighsSearch.h +244 -0
  1410. casadi/include/highs/mip/HighsSeparation.h +44 -0
  1411. casadi/include/highs/mip/HighsSeparator.h +56 -0
  1412. casadi/include/highs/mip/HighsTableauSeparator.h +37 -0
  1413. casadi/include/highs/mip/HighsTransformedLp.h +66 -0
  1414. casadi/include/highs/model/HighsHessian.h +54 -0
  1415. casadi/include/highs/model/HighsHessianUtils.h +49 -0
  1416. casadi/include/highs/model/HighsModel.h +52 -0
  1417. casadi/include/highs/parallel/HighsBinarySemaphore.h +113 -0
  1418. casadi/include/highs/parallel/HighsCacheAlign.h +87 -0
  1419. casadi/include/highs/parallel/HighsCombinable.h +121 -0
  1420. casadi/include/highs/parallel/HighsMutex.h +129 -0
  1421. casadi/include/highs/parallel/HighsParallel.h +133 -0
  1422. casadi/include/highs/parallel/HighsRaceTimer.h +43 -0
  1423. casadi/include/highs/parallel/HighsSchedulerConstants.h +24 -0
  1424. casadi/include/highs/parallel/HighsSpinMutex.h +53 -0
  1425. casadi/include/highs/parallel/HighsSplitDeque.h +583 -0
  1426. casadi/include/highs/parallel/HighsTask.h +175 -0
  1427. casadi/include/highs/parallel/HighsTaskExecutor.h +209 -0
  1428. casadi/include/highs/pdlp/CupdlpWrapper.h +93 -0
  1429. casadi/include/highs/pdlp/cupdlp/cupdlp_cs.h +41 -0
  1430. casadi/include/highs/pdlp/cupdlp/cupdlp_defs.h +423 -0
  1431. casadi/include/highs/pdlp/cupdlp/cupdlp_linalg.h +183 -0
  1432. casadi/include/highs/pdlp/cupdlp/cupdlp_proj.h +19 -0
  1433. casadi/include/highs/pdlp/cupdlp/cupdlp_restart.h +31 -0
  1434. casadi/include/highs/pdlp/cupdlp/cupdlp_scaling_cuda.h +28 -0
  1435. casadi/include/highs/pdlp/cupdlp/cupdlp_solver.h +98 -0
  1436. casadi/include/highs/pdlp/cupdlp/cupdlp_step.h +33 -0
  1437. casadi/include/highs/pdlp/cupdlp/cupdlp_utils.c +1726 -0
  1438. casadi/include/highs/pdqsort/pdqsort.h +532 -0
  1439. casadi/include/highs/presolve/HPresolve.h +365 -0
  1440. casadi/include/highs/presolve/HPresolveAnalysis.h +54 -0
  1441. casadi/include/highs/presolve/HighsPostsolveStack.h +907 -0
  1442. casadi/include/highs/presolve/HighsSymmetry.h +284 -0
  1443. casadi/include/highs/presolve/ICrash.h +127 -0
  1444. casadi/include/highs/presolve/ICrashUtil.h +65 -0
  1445. casadi/include/highs/presolve/ICrashX.h +26 -0
  1446. casadi/include/highs/presolve/PresolveComponent.h +93 -0
  1447. casadi/include/highs/qpsolver/a_asm.hpp +67 -0
  1448. casadi/include/highs/qpsolver/a_quass.hpp +19 -0
  1449. casadi/include/highs/qpsolver/basis.hpp +150 -0
  1450. casadi/include/highs/qpsolver/crashsolution.hpp +12 -0
  1451. casadi/include/highs/qpsolver/dantzigpricing.hpp +72 -0
  1452. casadi/include/highs/qpsolver/devexpricing.hpp +99 -0
  1453. casadi/include/highs/qpsolver/eventhandler.hpp +23 -0
  1454. casadi/include/highs/qpsolver/factor.hpp +400 -0
  1455. casadi/include/highs/qpsolver/feasibility_bounded.hpp +105 -0
  1456. casadi/include/highs/qpsolver/feasibility_highs.hpp +270 -0
  1457. casadi/include/highs/qpsolver/gradient.hpp +39 -0
  1458. casadi/include/highs/qpsolver/instance.hpp +63 -0
  1459. casadi/include/highs/qpsolver/matrix.hpp +335 -0
  1460. casadi/include/highs/qpsolver/perturbation.hpp +8 -0
  1461. casadi/include/highs/qpsolver/pricing.hpp +15 -0
  1462. casadi/include/highs/qpsolver/qpconst.hpp +27 -0
  1463. casadi/include/highs/qpsolver/qpvector.hpp +235 -0
  1464. casadi/include/highs/qpsolver/quass.hpp +20 -0
  1465. casadi/include/highs/qpsolver/ratiotest.hpp +19 -0
  1466. casadi/include/highs/qpsolver/runtime.hpp +38 -0
  1467. casadi/include/highs/qpsolver/scaling.hpp +8 -0
  1468. casadi/include/highs/qpsolver/settings.hpp +57 -0
  1469. casadi/include/highs/qpsolver/snippets.hpp +29 -0
  1470. casadi/include/highs/qpsolver/statistics.hpp +23 -0
  1471. casadi/include/highs/qpsolver/steepestedgepricing.hpp +167 -0
  1472. casadi/include/highs/simplex/HApp.h +422 -0
  1473. casadi/include/highs/simplex/HEkk.h +403 -0
  1474. casadi/include/highs/simplex/HEkkDual.h +515 -0
  1475. casadi/include/highs/simplex/HEkkDualRHS.h +137 -0
  1476. casadi/include/highs/simplex/HEkkDualRow.h +204 -0
  1477. casadi/include/highs/simplex/HEkkPrimal.h +195 -0
  1478. casadi/include/highs/simplex/HSimplex.h +45 -0
  1479. casadi/include/highs/simplex/HSimplexDebug.h +51 -0
  1480. casadi/include/highs/simplex/HSimplexNla.h +184 -0
  1481. casadi/include/highs/simplex/HSimplexReport.h +24 -0
  1482. casadi/include/highs/simplex/HighsSimplexAnalysis.h +503 -0
  1483. casadi/include/highs/simplex/SimplexConst.h +274 -0
  1484. casadi/include/highs/simplex/SimplexStruct.h +264 -0
  1485. casadi/include/highs/simplex/SimplexTimer.h +427 -0
  1486. casadi/include/highs/test/DevKkt.h +146 -0
  1487. casadi/include/highs/test/KktCh2.h +82 -0
  1488. casadi/include/highs/util/FactorTimer.h +224 -0
  1489. casadi/include/highs/util/HFactor.h +587 -0
  1490. casadi/include/highs/util/HFactorConst.h +84 -0
  1491. casadi/include/highs/util/HFactorDebug.h +58 -0
  1492. casadi/include/highs/util/HSet.h +92 -0
  1493. casadi/include/highs/util/HVector.h +25 -0
  1494. casadi/include/highs/util/HVectorBase.h +105 -0
  1495. casadi/include/highs/util/HighsCDouble.h +310 -0
  1496. casadi/include/highs/util/HighsComponent.h +56 -0
  1497. casadi/include/highs/util/HighsDataStack.h +86 -0
  1498. casadi/include/highs/util/HighsDisjointSets.h +110 -0
  1499. casadi/include/highs/util/HighsHash.h +1277 -0
  1500. casadi/include/highs/util/HighsHashTree.h +1443 -0
  1501. casadi/include/highs/util/HighsInt.h +39 -0
  1502. casadi/include/highs/util/HighsIntegers.h +215 -0
  1503. casadi/include/highs/util/HighsLinearSumBounds.h +160 -0
  1504. casadi/include/highs/util/HighsMatrixPic.h +40 -0
  1505. casadi/include/highs/util/HighsMatrixSlice.h +564 -0
  1506. casadi/include/highs/util/HighsMatrixUtils.h +57 -0
  1507. casadi/include/highs/util/HighsMemoryAllocation.h +55 -0
  1508. casadi/include/highs/util/HighsRandom.h +245 -0
  1509. casadi/include/highs/util/HighsRbTree.h +455 -0
  1510. casadi/include/highs/util/HighsSort.h +134 -0
  1511. casadi/include/highs/util/HighsSparseMatrix.h +147 -0
  1512. casadi/include/highs/util/HighsSparseVectorSum.h +98 -0
  1513. casadi/include/highs/util/HighsSplay.h +138 -0
  1514. casadi/include/highs/util/HighsTimer.h +343 -0
  1515. casadi/include/highs/util/HighsUtils.h +210 -0
  1516. casadi/include/highs/util/stringutil.h +44 -0
  1517. casadi/include/highs/zstr/strict_fstream.hpp +237 -0
  1518. casadi/include/highs/zstr/zstr.hpp +472 -0
  1519. casadi/include/highs_export.h +42 -0
  1520. casadi/include/hpipm_aux_mem.h +52 -0
  1521. casadi/include/hpipm_aux_string.h +50 -0
  1522. casadi/include/hpipm_common.h +76 -0
  1523. casadi/include/hpipm_d_cast_qcqp.h +71 -0
  1524. casadi/include/hpipm_d_cond.h +135 -0
  1525. casadi/include/hpipm_d_cond_aux.h +92 -0
  1526. casadi/include/hpipm_d_cond_qcqp.h +129 -0
  1527. casadi/include/hpipm_d_core_qp_ipm.h +101 -0
  1528. casadi/include/hpipm_d_core_qp_ipm_aux.h +68 -0
  1529. casadi/include/hpipm_d_dense_qcqp.h +199 -0
  1530. casadi/include/hpipm_d_dense_qcqp_dim.h +98 -0
  1531. casadi/include/hpipm_d_dense_qcqp_ipm.h +193 -0
  1532. casadi/include/hpipm_d_dense_qcqp_res.h +108 -0
  1533. casadi/include/hpipm_d_dense_qcqp_sol.h +85 -0
  1534. casadi/include/hpipm_d_dense_qcqp_utils.h +82 -0
  1535. casadi/include/hpipm_d_dense_qp.h +207 -0
  1536. casadi/include/hpipm_d_dense_qp_dim.h +92 -0
  1537. casadi/include/hpipm_d_dense_qp_ipm.h +260 -0
  1538. casadi/include/hpipm_d_dense_qp_kkt.h +72 -0
  1539. casadi/include/hpipm_d_dense_qp_res.h +106 -0
  1540. casadi/include/hpipm_d_dense_qp_sol.h +94 -0
  1541. casadi/include/hpipm_d_dense_qp_utils.h +83 -0
  1542. casadi/include/hpipm_d_ocp_qcqp.h +322 -0
  1543. casadi/include/hpipm_d_ocp_qcqp_dim.h +130 -0
  1544. casadi/include/hpipm_d_ocp_qcqp_ipm.h +192 -0
  1545. casadi/include/hpipm_d_ocp_qcqp_red.h +118 -0
  1546. casadi/include/hpipm_d_ocp_qcqp_res.h +115 -0
  1547. casadi/include/hpipm_d_ocp_qcqp_sol.h +114 -0
  1548. casadi/include/hpipm_d_ocp_qcqp_utils.h +81 -0
  1549. casadi/include/hpipm_d_ocp_qp.h +306 -0
  1550. casadi/include/hpipm_d_ocp_qp_dim.h +142 -0
  1551. casadi/include/hpipm_d_ocp_qp_ipm.h +252 -0
  1552. casadi/include/hpipm_d_ocp_qp_kkt.h +66 -0
  1553. casadi/include/hpipm_d_ocp_qp_red.h +117 -0
  1554. casadi/include/hpipm_d_ocp_qp_res.h +113 -0
  1555. casadi/include/hpipm_d_ocp_qp_sol.h +128 -0
  1556. casadi/include/hpipm_d_ocp_qp_utils.h +82 -0
  1557. casadi/include/hpipm_d_part_cond.h +115 -0
  1558. casadi/include/hpipm_d_part_cond_qcqp.h +106 -0
  1559. casadi/include/hpipm_d_sim_erk.h +122 -0
  1560. casadi/include/hpipm_d_sim_rk.h +71 -0
  1561. casadi/include/hpipm_d_tree_ocp_qcqp.h +213 -0
  1562. casadi/include/hpipm_d_tree_ocp_qcqp_dim.h +117 -0
  1563. casadi/include/hpipm_d_tree_ocp_qcqp_ipm.h +191 -0
  1564. casadi/include/hpipm_d_tree_ocp_qcqp_res.h +109 -0
  1565. casadi/include/hpipm_d_tree_ocp_qcqp_sol.h +99 -0
  1566. casadi/include/hpipm_d_tree_ocp_qcqp_utils.h +84 -0
  1567. casadi/include/hpipm_d_tree_ocp_qp.h +195 -0
  1568. casadi/include/hpipm_d_tree_ocp_qp_dim.h +111 -0
  1569. casadi/include/hpipm_d_tree_ocp_qp_ipm.h +209 -0
  1570. casadi/include/hpipm_d_tree_ocp_qp_kkt.h +52 -0
  1571. casadi/include/hpipm_d_tree_ocp_qp_res.h +107 -0
  1572. casadi/include/hpipm_d_tree_ocp_qp_sol.h +100 -0
  1573. casadi/include/hpipm_d_tree_ocp_qp_utils.h +83 -0
  1574. casadi/include/hpipm_m_dense_qp.h +68 -0
  1575. casadi/include/hpipm_m_dense_qp_dim.h +68 -0
  1576. casadi/include/hpipm_m_ocp_qp.h +49 -0
  1577. casadi/include/hpipm_m_ocp_qp_ipm_hard.h +115 -0
  1578. casadi/include/hpipm_m_ocp_qp_kkt.h +45 -0
  1579. casadi/include/hpipm_s_cast_qcqp.h +72 -0
  1580. casadi/include/hpipm_s_cond.h +137 -0
  1581. casadi/include/hpipm_s_cond_aux.h +92 -0
  1582. casadi/include/hpipm_s_cond_qcqp.h +130 -0
  1583. casadi/include/hpipm_s_core_qp_ipm.h +101 -0
  1584. casadi/include/hpipm_s_core_qp_ipm_aux.h +68 -0
  1585. casadi/include/hpipm_s_dense_qcqp.h +200 -0
  1586. casadi/include/hpipm_s_dense_qcqp_dim.h +99 -0
  1587. casadi/include/hpipm_s_dense_qcqp_ipm.h +204 -0
  1588. casadi/include/hpipm_s_dense_qcqp_res.h +109 -0
  1589. casadi/include/hpipm_s_dense_qcqp_sol.h +86 -0
  1590. casadi/include/hpipm_s_dense_qcqp_utils.h +83 -0
  1591. casadi/include/hpipm_s_dense_qp.h +207 -0
  1592. casadi/include/hpipm_s_dense_qp_dim.h +94 -0
  1593. casadi/include/hpipm_s_dense_qp_ipm.h +260 -0
  1594. casadi/include/hpipm_s_dense_qp_kkt.h +72 -0
  1595. casadi/include/hpipm_s_dense_qp_res.h +107 -0
  1596. casadi/include/hpipm_s_dense_qp_sol.h +94 -0
  1597. casadi/include/hpipm_s_dense_qp_utils.h +84 -0
  1598. casadi/include/hpipm_s_ocp_qcqp.h +322 -0
  1599. casadi/include/hpipm_s_ocp_qcqp_dim.h +131 -0
  1600. casadi/include/hpipm_s_ocp_qcqp_ipm.h +193 -0
  1601. casadi/include/hpipm_s_ocp_qcqp_red.h +119 -0
  1602. casadi/include/hpipm_s_ocp_qcqp_res.h +116 -0
  1603. casadi/include/hpipm_s_ocp_qcqp_sol.h +115 -0
  1604. casadi/include/hpipm_s_ocp_qcqp_utils.h +82 -0
  1605. casadi/include/hpipm_s_ocp_qp.h +306 -0
  1606. casadi/include/hpipm_s_ocp_qp_dim.h +141 -0
  1607. casadi/include/hpipm_s_ocp_qp_ipm.h +252 -0
  1608. casadi/include/hpipm_s_ocp_qp_kkt.h +66 -0
  1609. casadi/include/hpipm_s_ocp_qp_red.h +118 -0
  1610. casadi/include/hpipm_s_ocp_qp_res.h +115 -0
  1611. casadi/include/hpipm_s_ocp_qp_sol.h +128 -0
  1612. casadi/include/hpipm_s_ocp_qp_utils.h +83 -0
  1613. casadi/include/hpipm_s_part_cond.h +115 -0
  1614. casadi/include/hpipm_s_part_cond_qcqp.h +107 -0
  1615. casadi/include/hpipm_s_sim_erk.h +121 -0
  1616. casadi/include/hpipm_s_sim_rk.h +72 -0
  1617. casadi/include/hpipm_s_tree_ocp_qcqp.h +213 -0
  1618. casadi/include/hpipm_s_tree_ocp_qcqp_dim.h +118 -0
  1619. casadi/include/hpipm_s_tree_ocp_qcqp_ipm.h +192 -0
  1620. casadi/include/hpipm_s_tree_ocp_qcqp_res.h +110 -0
  1621. casadi/include/hpipm_s_tree_ocp_qcqp_sol.h +97 -0
  1622. casadi/include/hpipm_s_tree_ocp_qcqp_utils.h +85 -0
  1623. casadi/include/hpipm_s_tree_ocp_qp.h +196 -0
  1624. casadi/include/hpipm_s_tree_ocp_qp_dim.h +111 -0
  1625. casadi/include/hpipm_s_tree_ocp_qp_ipm.h +208 -0
  1626. casadi/include/hpipm_s_tree_ocp_qp_kkt.h +54 -0
  1627. casadi/include/hpipm_s_tree_ocp_qp_res.h +108 -0
  1628. casadi/include/hpipm_s_tree_ocp_qp_sol.h +98 -0
  1629. casadi/include/hpipm_s_tree_ocp_qp_utils.h +84 -0
  1630. casadi/include/hpipm_scenario_tree.h +70 -0
  1631. casadi/include/hpipm_timing.h +67 -0
  1632. casadi/include/hpipm_tree.h +76 -0
  1633. casadi/include/licenses/FMI-Standard-2.0.2/LICENSE.txt +473 -0
  1634. casadi/include/licenses/FMI-Standard-3.0/LICENSE.txt +464 -0
  1635. casadi/include/licenses/alpaqa-external/LICENSE +165 -0
  1636. casadi/include/licenses/blasfeo-external/LICENSE.txt +26 -0
  1637. casadi/include/licenses/bonmin-external/Bonmin/LICENSE +87 -0
  1638. casadi/include/licenses/bonmin-external/LICENSE +3 -0
  1639. casadi/include/licenses/casadi/LICENSE/LICENSE.txt +165 -0
  1640. casadi/include/licenses/casadi-sundials/LICENSE +64 -0
  1641. casadi/include/licenses/casadi-sundials/cvodes/LICENSE +60 -0
  1642. casadi/include/licenses/casadi-sundials/idas/LICENSE +59 -0
  1643. casadi/include/licenses/casadi-sundials/kinsol/LICENSE +59 -0
  1644. casadi/include/licenses/casadi-sundials/sundials/LICENSE +67 -0
  1645. casadi/include/licenses/cbc-external/Cbc/LICENSE +239 -0
  1646. casadi/include/licenses/cbc-external/LICENSE +245 -0
  1647. casadi/include/licenses/cgl-external/Cgl/LICENSE +239 -0
  1648. casadi/include/licenses/cgl-external/LICENSE +245 -0
  1649. casadi/include/licenses/clp-external/Clp/LICENSE +239 -0
  1650. casadi/include/licenses/clp-external/LICENSE +245 -0
  1651. casadi/include/licenses/coinutils-external/CoinUtils/LICENSE +239 -0
  1652. casadi/include/licenses/coinutils-external/LICENSE +245 -0
  1653. casadi/include/licenses/daqp-external/LICENSE +21 -0
  1654. casadi/include/licenses/fatrop-external/LICENSE.txt +165 -0
  1655. casadi/include/licenses/fatrop-external/external/blasfeo/LICENSE.txt +26 -0
  1656. casadi/include/licenses/fatrop-external/external/pybind11/LICENSE +29 -0
  1657. casadi/include/licenses/highs-external/LICENSE.txt +21 -0
  1658. casadi/include/licenses/highs-external/extern/filereaderlp/LICENSE +19 -0
  1659. casadi/include/licenses/hpipm-external/LICENSE.txt +26 -0
  1660. casadi/include/licenses/ipopt-external/LICENSE +260 -0
  1661. casadi/include/licenses/metis-external/LICENSE +87 -0
  1662. casadi/include/licenses/metis-external/metis-4.0/LICENSE +18 -0
  1663. casadi/include/licenses/mockups-external/LICENSE +21 -0
  1664. casadi/include/licenses/mumps-external/LICENSE +87 -0
  1665. casadi/include/licenses/mumps-external/MUMPS/LICENSE +50 -0
  1666. casadi/include/licenses/openblas-external/LICENSE +29 -0
  1667. casadi/include/licenses/openblas-external/ctest/LICENSE +23 -0
  1668. casadi/include/licenses/openblas-external/lapack-netlib/LAPACKE/LICENSE +26 -0
  1669. casadi/include/licenses/openblas-external/lapack-netlib/LICENSE +48 -0
  1670. casadi/include/licenses/openblas-external/reference/LICENSE +23 -0
  1671. casadi/include/licenses/openblas-external/relapack/LICENSE +22 -0
  1672. casadi/include/licenses/openblas-external/test/LICENSE +23 -0
  1673. casadi/include/licenses/osi-external/LICENSE +245 -0
  1674. casadi/include/licenses/osi-external/Osi/LICENSE +239 -0
  1675. casadi/include/licenses/osqp-external/LICENSE +201 -0
  1676. casadi/include/licenses/osqp-external/lin_sys/direct/qdldl/amd/LICENSE +36 -0
  1677. casadi/include/licenses/osqp-external/lin_sys/direct/qdldl/qdldl_sources/LICENSE +201 -0
  1678. casadi/include/licenses/proxqp-external/LICENSE +25 -0
  1679. casadi/include/licenses/proxqp-external/bindings/python/external/pybind11/LICENSE +29 -0
  1680. casadi/include/licenses/proxqp-external/cmake-module/LICENSE +4 -0
  1681. casadi/include/licenses/proxqp-external/cmake-module/doxygen/MathJax/LICENSE +202 -0
  1682. casadi/include/licenses/proxqp-external/external/cereal/LICENSE +24 -0
  1683. casadi/include/licenses/proxqp-external/external/cereal/include/cereal/external/LICENSE +21 -0
  1684. casadi/include/licenses/proxqp-external/external/cereal/include/cereal/external/rapidjson/LICENSE +13 -0
  1685. casadi/include/licenses/proxqp-external/external/cereal/include/cereal/external/rapidjson/msinttypes/LICENSE +29 -0
  1686. casadi/include/licenses/qpOASES/LICENSE.txt +503 -0
  1687. casadi/include/licenses/sleqp-external/LICENSE +165 -0
  1688. casadi/include/licenses/superscs-external/LICENSE.txt +24 -0
  1689. casadi/include/licenses/tinyxml2-9.0.0/LICENSE.txt +18 -0
  1690. casadi/include/licenses/trlib-external/LICENSE +21 -0
  1691. casadi/include/openblas/cblas.h +411 -0
  1692. casadi/include/openblas/f77blas.h +796 -0
  1693. casadi/include/openblas/lapack.h +22997 -0
  1694. casadi/include/openblas/lapacke.h +12665 -0
  1695. casadi/include/openblas/lapacke_config.h +119 -0
  1696. casadi/include/openblas/lapacke_example_aux.h +9 -0
  1697. casadi/include/openblas/lapacke_mangling.h +17 -0
  1698. casadi/include/openblas/lapacke_utils.h +582 -0
  1699. casadi/include/openblas/openblas/lapacke_mangling.h +17 -0
  1700. casadi/include/openblas/openblas_config.h +139 -0
  1701. casadi/include/osqp/auxil.h +181 -0
  1702. casadi/include/osqp/constants.h +128 -0
  1703. casadi/include/osqp/cs.h +180 -0
  1704. casadi/include/osqp/ctrlc.h +56 -0
  1705. casadi/include/osqp/error.h +38 -0
  1706. casadi/include/osqp/glob_opts.h +167 -0
  1707. casadi/include/osqp/lin_alg.h +216 -0
  1708. casadi/include/osqp/lin_sys.h +54 -0
  1709. casadi/include/osqp/osqp.h +430 -0
  1710. casadi/include/osqp/osqp_configure.h +49 -0
  1711. casadi/include/osqp/polish.h +25 -0
  1712. casadi/include/osqp/proj.h +37 -0
  1713. casadi/include/osqp/scaling.h +44 -0
  1714. casadi/include/osqp/types.h +326 -0
  1715. casadi/include/osqp/util.h +222 -0
  1716. casadi/include/osqp/version.h +9 -0
  1717. casadi/include/proxsuite/config.hpp +68 -0
  1718. casadi/include/proxsuite/deprecated.hpp +56 -0
  1719. casadi/include/proxsuite/fwd.hpp +52 -0
  1720. casadi/include/proxsuite/helpers/common.hpp +70 -0
  1721. casadi/include/proxsuite/helpers/instruction-set.hpp +275 -0
  1722. casadi/include/proxsuite/helpers/optional.hpp +46 -0
  1723. casadi/include/proxsuite/helpers/tl-optional.hpp +2472 -0
  1724. casadi/include/proxsuite/helpers/version.hpp +39 -0
  1725. casadi/include/proxsuite/linalg/dense/core.hpp +863 -0
  1726. casadi/include/proxsuite/linalg/dense/factorize.hpp +375 -0
  1727. casadi/include/proxsuite/linalg/dense/ldlt.hpp +817 -0
  1728. casadi/include/proxsuite/linalg/dense/modify.hpp +333 -0
  1729. casadi/include/proxsuite/linalg/dense/solve.hpp +38 -0
  1730. casadi/include/proxsuite/linalg/dense/update.hpp +330 -0
  1731. casadi/include/proxsuite/linalg/sparse/core.hpp +531 -0
  1732. casadi/include/proxsuite/linalg/sparse/factorize.hpp +1303 -0
  1733. casadi/include/proxsuite/linalg/sparse/rowmod.hpp +443 -0
  1734. casadi/include/proxsuite/linalg/sparse/update.hpp +348 -0
  1735. casadi/include/proxsuite/linalg/veg/internal/assert_impl.hpp +20 -0
  1736. casadi/include/proxsuite/linalg/veg/internal/collection_algo.hpp +93 -0
  1737. casadi/include/proxsuite/linalg/veg/internal/dbg.hpp +15 -0
  1738. casadi/include/proxsuite/linalg/veg/internal/delete_special_members.hpp +77 -0
  1739. casadi/include/proxsuite/linalg/veg/internal/dyn_index.hpp +292 -0
  1740. casadi/include/proxsuite/linalg/veg/internal/epilogue.hpp +31 -0
  1741. casadi/include/proxsuite/linalg/veg/internal/external/hedley.ext.hpp +2074 -0
  1742. casadi/include/proxsuite/linalg/veg/internal/external/unhedley.ext.hpp +148 -0
  1743. casadi/include/proxsuite/linalg/veg/internal/fix_index.hpp +339 -0
  1744. casadi/include/proxsuite/linalg/veg/internal/has_asan.hpp +17 -0
  1745. casadi/include/proxsuite/linalg/veg/internal/integer_seq.hpp +248 -0
  1746. casadi/include/proxsuite/linalg/veg/internal/macros.hpp +1312 -0
  1747. casadi/include/proxsuite/linalg/veg/internal/narrow.hpp +46 -0
  1748. casadi/include/proxsuite/linalg/veg/internal/preprocessor.hpp +434 -0
  1749. casadi/include/proxsuite/linalg/veg/internal/prologue.hpp +157 -0
  1750. casadi/include/proxsuite/linalg/veg/internal/std.hpp +13 -0
  1751. casadi/include/proxsuite/linalg/veg/internal/terminate.hpp +22 -0
  1752. casadi/include/proxsuite/linalg/veg/internal/typedefs.hpp +58 -0
  1753. casadi/include/proxsuite/linalg/veg/memory/address.hpp +97 -0
  1754. casadi/include/proxsuite/linalg/veg/memory/alloc.hpp +352 -0
  1755. casadi/include/proxsuite/linalg/veg/memory/dynamic_stack.hpp +504 -0
  1756. casadi/include/proxsuite/linalg/veg/memory/placement.hpp +202 -0
  1757. casadi/include/proxsuite/linalg/veg/memory/stack_alloc.hpp +239 -0
  1758. casadi/include/proxsuite/linalg/veg/ref.hpp +148 -0
  1759. casadi/include/proxsuite/linalg/veg/slice.hpp +240 -0
  1760. casadi/include/proxsuite/linalg/veg/tuple.hpp +876 -0
  1761. casadi/include/proxsuite/linalg/veg/type_traits/alloc.hpp +169 -0
  1762. casadi/include/proxsuite/linalg/veg/type_traits/assignable.hpp +53 -0
  1763. casadi/include/proxsuite/linalg/veg/type_traits/constructible.hpp +217 -0
  1764. casadi/include/proxsuite/linalg/veg/type_traits/core.hpp +298 -0
  1765. casadi/include/proxsuite/linalg/veg/type_traits/invocable.hpp +47 -0
  1766. casadi/include/proxsuite/linalg/veg/type_traits/primitives.hpp +43 -0
  1767. casadi/include/proxsuite/linalg/veg/type_traits/tags.hpp +47 -0
  1768. casadi/include/proxsuite/linalg/veg/util/assert.hpp +48 -0
  1769. casadi/include/proxsuite/linalg/veg/util/dbg.hpp +6 -0
  1770. casadi/include/proxsuite/linalg/veg/util/defer.hpp +57 -0
  1771. casadi/include/proxsuite/linalg/veg/util/dynstack_alloc.hpp +19 -0
  1772. casadi/include/proxsuite/linalg/veg/util/get.hpp +153 -0
  1773. casadi/include/proxsuite/linalg/veg/util/index.hpp +6 -0
  1774. casadi/include/proxsuite/linalg/veg/util/unreachable.hpp +41 -0
  1775. casadi/include/proxsuite/linalg/veg/vec.hpp +1034 -0
  1776. casadi/include/proxsuite/proxqp/dense/dense.hpp +10 -0
  1777. casadi/include/proxsuite/proxqp/dense/fwd.hpp +55 -0
  1778. casadi/include/proxsuite/proxqp/dense/helpers.hpp +520 -0
  1779. casadi/include/proxsuite/proxqp/dense/linesearch.hpp +517 -0
  1780. casadi/include/proxsuite/proxqp/dense/model.hpp +147 -0
  1781. casadi/include/proxsuite/proxqp/dense/preconditioner/identity.hpp +113 -0
  1782. casadi/include/proxsuite/proxqp/dense/preconditioner/ruiz.hpp +571 -0
  1783. casadi/include/proxsuite/proxqp/dense/solver.hpp +1330 -0
  1784. casadi/include/proxsuite/proxqp/dense/utils.hpp +415 -0
  1785. casadi/include/proxsuite/proxqp/dense/views.hpp +1466 -0
  1786. casadi/include/proxsuite/proxqp/dense/workspace.hpp +264 -0
  1787. casadi/include/proxsuite/proxqp/dense/wrapper.hpp +491 -0
  1788. casadi/include/proxsuite/proxqp/results.hpp +212 -0
  1789. casadi/include/proxsuite/proxqp/settings.hpp +302 -0
  1790. casadi/include/proxsuite/proxqp/sparse/fwd.hpp +58 -0
  1791. casadi/include/proxsuite/proxqp/sparse/helpers.hpp +309 -0
  1792. casadi/include/proxsuite/proxqp/sparse/model.hpp +228 -0
  1793. casadi/include/proxsuite/proxqp/sparse/preconditioner/identity.hpp +64 -0
  1794. casadi/include/proxsuite/proxqp/sparse/preconditioner/ruiz.hpp +569 -0
  1795. casadi/include/proxsuite/proxqp/sparse/solver.hpp +1441 -0
  1796. casadi/include/proxsuite/proxqp/sparse/sparse.hpp +10 -0
  1797. casadi/include/proxsuite/proxqp/sparse/utils.hpp +815 -0
  1798. casadi/include/proxsuite/proxqp/sparse/views.hpp +63 -0
  1799. casadi/include/proxsuite/proxqp/sparse/workspace.hpp +790 -0
  1800. casadi/include/proxsuite/proxqp/sparse/wrapper.hpp +772 -0
  1801. casadi/include/proxsuite/proxqp/status.hpp +46 -0
  1802. casadi/include/proxsuite/proxqp/timings.hpp +101 -0
  1803. casadi/include/proxsuite/proxqp/utils/prints.hpp +47 -0
  1804. casadi/include/proxsuite/proxqp/utils/random_qp_problems.hpp +669 -0
  1805. casadi/include/proxsuite/serialization/archive.hpp +231 -0
  1806. casadi/include/proxsuite/serialization/eigen.hpp +107 -0
  1807. casadi/include/proxsuite/serialization/model.hpp +34 -0
  1808. casadi/include/proxsuite/serialization/results.hpp +74 -0
  1809. casadi/include/proxsuite/serialization/settings.hpp +60 -0
  1810. casadi/include/proxsuite/serialization/wrapper.hpp +24 -0
  1811. casadi/include/proxsuite/warning.hpp +35 -0
  1812. casadi/include/qdldl/qdldl.h +169 -0
  1813. casadi/include/qdldl/qdldl_types.h +23 -0
  1814. casadi/include/s_blas.h +78 -0
  1815. casadi/include/s_blas_64.h +73 -0
  1816. casadi/include/simde/arm/neon/aba.h +208 -0
  1817. casadi/include/simde/arm/neon/abd.h +384 -0
  1818. casadi/include/simde/arm/neon/abdl.h +147 -0
  1819. casadi/include/simde/arm/neon/abs.h +408 -0
  1820. casadi/include/simde/arm/neon/add.h +681 -0
  1821. casadi/include/simde/arm/neon/addl.h +127 -0
  1822. casadi/include/simde/arm/neon/addl_high.h +127 -0
  1823. casadi/include/simde/arm/neon/addlv.h +317 -0
  1824. casadi/include/simde/arm/neon/addv.h +447 -0
  1825. casadi/include/simde/arm/neon/addw.h +222 -0
  1826. casadi/include/simde/arm/neon/addw_high.h +193 -0
  1827. casadi/include/simde/arm/neon/and.h +552 -0
  1828. casadi/include/simde/arm/neon/bic.h +472 -0
  1829. casadi/include/simde/arm/neon/bsl.h +448 -0
  1830. casadi/include/simde/arm/neon/cagt.h +168 -0
  1831. casadi/include/simde/arm/neon/ceq.h +711 -0
  1832. casadi/include/simde/arm/neon/ceqz.h +335 -0
  1833. casadi/include/simde/arm/neon/cge.h +677 -0
  1834. casadi/include/simde/arm/neon/cgez.h +378 -0
  1835. casadi/include/simde/arm/neon/cgt.h +686 -0
  1836. casadi/include/simde/arm/neon/cgtz.h +380 -0
  1837. casadi/include/simde/arm/neon/cle.h +677 -0
  1838. casadi/include/simde/arm/neon/clez.h +378 -0
  1839. casadi/include/simde/arm/neon/cls.h +148 -0
  1840. casadi/include/simde/arm/neon/clt.h +679 -0
  1841. casadi/include/simde/arm/neon/cltz.h +263 -0
  1842. casadi/include/simde/arm/neon/clz.h +423 -0
  1843. casadi/include/simde/arm/neon/cnt.h +145 -0
  1844. casadi/include/simde/arm/neon/combine.h +343 -0
  1845. casadi/include/simde/arm/neon/create.h +186 -0
  1846. casadi/include/simde/arm/neon/cvt.h +492 -0
  1847. casadi/include/simde/arm/neon/dot.h +171 -0
  1848. casadi/include/simde/arm/neon/dot_lane.h +196 -0
  1849. casadi/include/simde/arm/neon/dup_lane.h +702 -0
  1850. casadi/include/simde/arm/neon/dup_n.h +534 -0
  1851. casadi/include/simde/arm/neon/eor.h +552 -0
  1852. casadi/include/simde/arm/neon/ext.h +887 -0
  1853. casadi/include/simde/arm/neon/get_high.h +260 -0
  1854. casadi/include/simde/arm/neon/get_lane.h +499 -0
  1855. casadi/include/simde/arm/neon/get_low.h +276 -0
  1856. casadi/include/simde/arm/neon/hadd.h +287 -0
  1857. casadi/include/simde/arm/neon/hsub.h +287 -0
  1858. casadi/include/simde/arm/neon/ld1.h +399 -0
  1859. casadi/include/simde/arm/neon/ld3.h +609 -0
  1860. casadi/include/simde/arm/neon/ld4.h +448 -0
  1861. casadi/include/simde/arm/neon/max.h +614 -0
  1862. casadi/include/simde/arm/neon/maxnm.h +215 -0
  1863. casadi/include/simde/arm/neon/maxv.h +400 -0
  1864. casadi/include/simde/arm/neon/min.h +660 -0
  1865. casadi/include/simde/arm/neon/minnm.h +215 -0
  1866. casadi/include/simde/arm/neon/minv.h +424 -0
  1867. casadi/include/simde/arm/neon/mla.h +530 -0
  1868. casadi/include/simde/arm/neon/mla_n.h +333 -0
  1869. casadi/include/simde/arm/neon/mlal.h +156 -0
  1870. casadi/include/simde/arm/neon/mlal_high.h +156 -0
  1871. casadi/include/simde/arm/neon/mlal_n.h +128 -0
  1872. casadi/include/simde/arm/neon/mls.h +264 -0
  1873. casadi/include/simde/arm/neon/mlsl.h +124 -0
  1874. casadi/include/simde/arm/neon/mlsl_high.h +124 -0
  1875. casadi/include/simde/arm/neon/mlsl_n.h +96 -0
  1876. casadi/include/simde/arm/neon/movl.h +208 -0
  1877. casadi/include/simde/arm/neon/movl_high.h +126 -0
  1878. casadi/include/simde/arm/neon/movn.h +195 -0
  1879. casadi/include/simde/arm/neon/movn_high.h +125 -0
  1880. casadi/include/simde/arm/neon/mul.h +594 -0
  1881. casadi/include/simde/arm/neon/mul_lane.h +472 -0
  1882. casadi/include/simde/arm/neon/mul_n.h +383 -0
  1883. casadi/include/simde/arm/neon/mull.h +236 -0
  1884. casadi/include/simde/arm/neon/mull_high.h +125 -0
  1885. casadi/include/simde/arm/neon/mull_n.h +158 -0
  1886. casadi/include/simde/arm/neon/mvn.h +426 -0
  1887. casadi/include/simde/arm/neon/neg.h +393 -0
  1888. casadi/include/simde/arm/neon/orn.h +505 -0
  1889. casadi/include/simde/arm/neon/orr.h +552 -0
  1890. casadi/include/simde/arm/neon/padal.h +211 -0
  1891. casadi/include/simde/arm/neon/padd.h +293 -0
  1892. casadi/include/simde/arm/neon/paddl.h +239 -0
  1893. casadi/include/simde/arm/neon/pmax.h +253 -0
  1894. casadi/include/simde/arm/neon/pmin.h +260 -0
  1895. casadi/include/simde/arm/neon/qabs.h +281 -0
  1896. casadi/include/simde/arm/neon/qadd.h +553 -0
  1897. casadi/include/simde/arm/neon/qdmulh.h +125 -0
  1898. casadi/include/simde/arm/neon/qdmull.h +125 -0
  1899. casadi/include/simde/arm/neon/qmovn.h +273 -0
  1900. casadi/include/simde/arm/neon/qmovn_high.h +127 -0
  1901. casadi/include/simde/arm/neon/qmovun.h +159 -0
  1902. casadi/include/simde/arm/neon/qneg.h +301 -0
  1903. casadi/include/simde/arm/neon/qrdmulh.h +165 -0
  1904. casadi/include/simde/arm/neon/qrdmulh_n.h +136 -0
  1905. casadi/include/simde/arm/neon/qshl.h +732 -0
  1906. casadi/include/simde/arm/neon/qsub.h +549 -0
  1907. casadi/include/simde/arm/neon/qtbl.h +455 -0
  1908. casadi/include/simde/arm/neon/qtbx.h +470 -0
  1909. casadi/include/simde/arm/neon/rbit.h +165 -0
  1910. casadi/include/simde/arm/neon/reinterpret.h +3101 -0
  1911. casadi/include/simde/arm/neon/rev16.h +137 -0
  1912. casadi/include/simde/arm/neon/rev32.h +235 -0
  1913. casadi/include/simde/arm/neon/rev64.h +358 -0
  1914. casadi/include/simde/arm/neon/rhadd.h +406 -0
  1915. casadi/include/simde/arm/neon/rnd.h +143 -0
  1916. casadi/include/simde/arm/neon/rndi.h +135 -0
  1917. casadi/include/simde/arm/neon/rndm.h +143 -0
  1918. casadi/include/simde/arm/neon/rndn.h +135 -0
  1919. casadi/include/simde/arm/neon/rndp.h +143 -0
  1920. casadi/include/simde/arm/neon/rshl.h +903 -0
  1921. casadi/include/simde/arm/neon/rshr_n.h +471 -0
  1922. casadi/include/simde/arm/neon/rsra_n.h +209 -0
  1923. casadi/include/simde/arm/neon/set_lane.h +422 -0
  1924. casadi/include/simde/arm/neon/shl.h +805 -0
  1925. casadi/include/simde/arm/neon/shl_n.h +560 -0
  1926. casadi/include/simde/arm/neon/shr_n.h +612 -0
  1927. casadi/include/simde/arm/neon/sra_n.h +202 -0
  1928. casadi/include/simde/arm/neon/st1.h +353 -0
  1929. casadi/include/simde/arm/neon/st1_lane.h +363 -0
  1930. casadi/include/simde/arm/neon/st3.h +426 -0
  1931. casadi/include/simde/arm/neon/st4.h +445 -0
  1932. casadi/include/simde/arm/neon/sub.h +659 -0
  1933. casadi/include/simde/arm/neon/subl.h +127 -0
  1934. casadi/include/simde/arm/neon/subw.h +221 -0
  1935. casadi/include/simde/arm/neon/subw_high.h +222 -0
  1936. casadi/include/simde/arm/neon/tbl.h +224 -0
  1937. casadi/include/simde/arm/neon/tbx.h +247 -0
  1938. casadi/include/simde/arm/neon/trn.h +252 -0
  1939. casadi/include/simde/arm/neon/trn1.h +500 -0
  1940. casadi/include/simde/arm/neon/trn2.h +499 -0
  1941. casadi/include/simde/arm/neon/tst.h +540 -0
  1942. casadi/include/simde/arm/neon/types.h +683 -0
  1943. casadi/include/simde/arm/neon/uqadd.h +325 -0
  1944. casadi/include/simde/arm/neon/uzp.h +252 -0
  1945. casadi/include/simde/arm/neon/uzp1.h +643 -0
  1946. casadi/include/simde/arm/neon/uzp2.h +647 -0
  1947. casadi/include/simde/arm/neon/zip.h +252 -0
  1948. casadi/include/simde/arm/neon/zip1.h +625 -0
  1949. casadi/include/simde/arm/neon/zip2.h +625 -0
  1950. casadi/include/simde/arm/neon.h +166 -0
  1951. casadi/include/simde/check.h +276 -0
  1952. casadi/include/simde/debug-trap.h +85 -0
  1953. casadi/include/simde/hedley.h +1971 -0
  1954. casadi/include/simde/simde-align.h +449 -0
  1955. casadi/include/simde/simde-arch.h +532 -0
  1956. casadi/include/simde/simde-common.h +890 -0
  1957. casadi/include/simde/simde-complex.h +148 -0
  1958. casadi/include/simde/simde-constify.h +397 -0
  1959. casadi/include/simde/simde-detect-clang.h +109 -0
  1960. casadi/include/simde/simde-diagnostic.h +428 -0
  1961. casadi/include/simde/simde-features.h +522 -0
  1962. casadi/include/simde/simde-math.h +1805 -0
  1963. casadi/include/simde/x86/avx.h +6193 -0
  1964. casadi/include/simde/x86/avx2.h +5660 -0
  1965. casadi/include/simde/x86/avx512/2intersect.h +250 -0
  1966. casadi/include/simde/x86/avx512/abs.h +562 -0
  1967. casadi/include/simde/x86/avx512/add.h +641 -0
  1968. casadi/include/simde/x86/avx512/adds.h +390 -0
  1969. casadi/include/simde/x86/avx512/and.h +305 -0
  1970. casadi/include/simde/x86/avx512/andnot.h +193 -0
  1971. casadi/include/simde/x86/avx512/avg.h +258 -0
  1972. casadi/include/simde/x86/avx512/blend.h +293 -0
  1973. casadi/include/simde/x86/avx512/broadcast.h +897 -0
  1974. casadi/include/simde/x86/avx512/cast.h +324 -0
  1975. casadi/include/simde/x86/avx512/cmp.h +587 -0
  1976. casadi/include/simde/x86/avx512/cmpeq.h +179 -0
  1977. casadi/include/simde/x86/avx512/cmpge.h +104 -0
  1978. casadi/include/simde/x86/avx512/cmpgt.h +189 -0
  1979. casadi/include/simde/x86/avx512/cmple.h +103 -0
  1980. casadi/include/simde/x86/avx512/cmplt.h +123 -0
  1981. casadi/include/simde/x86/avx512/copysign.h +86 -0
  1982. casadi/include/simde/x86/avx512/cvt.h +122 -0
  1983. casadi/include/simde/x86/avx512/cvts.h +723 -0
  1984. casadi/include/simde/x86/avx512/div.h +162 -0
  1985. casadi/include/simde/x86/avx512/extract.h +198 -0
  1986. casadi/include/simde/x86/avx512/fmadd.h +136 -0
  1987. casadi/include/simde/x86/avx512/fmsub.h +108 -0
  1988. casadi/include/simde/x86/avx512/fnmadd.h +108 -0
  1989. casadi/include/simde/x86/avx512/fnmsub.h +108 -0
  1990. casadi/include/simde/x86/avx512/insert.h +193 -0
  1991. casadi/include/simde/x86/avx512/kshift.h +152 -0
  1992. casadi/include/simde/x86/avx512/load.h +67 -0
  1993. casadi/include/simde/x86/avx512/loadu.h +113 -0
  1994. casadi/include/simde/x86/avx512/lzcnt.h +209 -0
  1995. casadi/include/simde/x86/avx512/madd.h +155 -0
  1996. casadi/include/simde/x86/avx512/maddubs.h +159 -0
  1997. casadi/include/simde/x86/avx512/max.h +587 -0
  1998. casadi/include/simde/x86/avx512/min.h +587 -0
  1999. casadi/include/simde/x86/avx512/mov.h +859 -0
  2000. casadi/include/simde/x86/avx512/mov_mask.h +372 -0
  2001. casadi/include/simde/x86/avx512/movm.h +460 -0
  2002. casadi/include/simde/x86/avx512/mul.h +279 -0
  2003. casadi/include/simde/x86/avx512/mulhi.h +65 -0
  2004. casadi/include/simde/x86/avx512/mulhrs.h +65 -0
  2005. casadi/include/simde/x86/avx512/mullo.h +117 -0
  2006. casadi/include/simde/x86/avx512/negate.h +88 -0
  2007. casadi/include/simde/x86/avx512/or.h +252 -0
  2008. casadi/include/simde/x86/avx512/packs.h +122 -0
  2009. casadi/include/simde/x86/avx512/packus.h +122 -0
  2010. casadi/include/simde/x86/avx512/permutex2var.h +1645 -0
  2011. casadi/include/simde/x86/avx512/permutexvar.h +1180 -0
  2012. casadi/include/simde/x86/avx512/sad.h +77 -0
  2013. casadi/include/simde/x86/avx512/set.h +477 -0
  2014. casadi/include/simde/x86/avx512/set1.h +331 -0
  2015. casadi/include/simde/x86/avx512/set4.h +140 -0
  2016. casadi/include/simde/x86/avx512/setone.h +66 -0
  2017. casadi/include/simde/x86/avx512/setr.h +144 -0
  2018. casadi/include/simde/x86/avx512/setr4.h +140 -0
  2019. casadi/include/simde/x86/avx512/setzero.h +90 -0
  2020. casadi/include/simde/x86/avx512/shuffle.h +176 -0
  2021. casadi/include/simde/x86/avx512/sll.h +247 -0
  2022. casadi/include/simde/x86/avx512/slli.h +179 -0
  2023. casadi/include/simde/x86/avx512/sllv.h +68 -0
  2024. casadi/include/simde/x86/avx512/sqrt.h +127 -0
  2025. casadi/include/simde/x86/avx512/sra.h +81 -0
  2026. casadi/include/simde/x86/avx512/srai.h +70 -0
  2027. casadi/include/simde/x86/avx512/srav.h +67 -0
  2028. casadi/include/simde/x86/avx512/srl.h +216 -0
  2029. casadi/include/simde/x86/avx512/srli.h +180 -0
  2030. casadi/include/simde/x86/avx512/srlv.h +282 -0
  2031. casadi/include/simde/x86/avx512/store.h +93 -0
  2032. casadi/include/simde/x86/avx512/storeu.h +93 -0
  2033. casadi/include/simde/x86/avx512/sub.h +351 -0
  2034. casadi/include/simde/x86/avx512/subs.h +222 -0
  2035. casadi/include/simde/x86/avx512/test.h +193 -0
  2036. casadi/include/simde/x86/avx512/types.h +380 -0
  2037. casadi/include/simde/x86/avx512/unpackhi.h +380 -0
  2038. casadi/include/simde/x86/avx512/unpacklo.h +104 -0
  2039. casadi/include/simde/x86/avx512/xor.h +263 -0
  2040. casadi/include/simde/x86/avx512/xorsign.h +72 -0
  2041. casadi/include/simde/x86/avx512.h +108 -0
  2042. casadi/include/simde/x86/clmul.h +414 -0
  2043. casadi/include/simde/x86/fma.h +724 -0
  2044. casadi/include/simde/x86/gfni.h +802 -0
  2045. casadi/include/simde/x86/mmx.h +2399 -0
  2046. casadi/include/simde/x86/sse.h +4471 -0
  2047. casadi/include/simde/x86/sse2.h +7389 -0
  2048. casadi/include/simde/x86/sse3.h +499 -0
  2049. casadi/include/simde/x86/sse4.1.h +2216 -0
  2050. casadi/include/simde/x86/sse4.2.h +347 -0
  2051. casadi/include/simde/x86/ssse3.h +1032 -0
  2052. casadi/include/simde/x86/svml.h +12139 -0
  2053. casadi/include/simde/x86/xop.h +3644 -0
  2054. casadi/include/sleqp/defs.h +58 -0
  2055. casadi/include/sleqp/export.h +42 -0
  2056. casadi/include/sleqp/pub_cmp.h +18 -0
  2057. casadi/include/sleqp/pub_dyn.h +140 -0
  2058. casadi/include/sleqp/pub_error.h +50 -0
  2059. casadi/include/sleqp/pub_func.h +257 -0
  2060. casadi/include/sleqp/pub_hess_struct.h +105 -0
  2061. casadi/include/sleqp/pub_iterate.h +88 -0
  2062. casadi/include/sleqp/pub_log.h +88 -0
  2063. casadi/include/sleqp/pub_lsq.h +158 -0
  2064. casadi/include/sleqp/pub_mem.h +52 -0
  2065. casadi/include/sleqp/pub_problem.h +213 -0
  2066. casadi/include/sleqp/pub_scale.h +150 -0
  2067. casadi/include/sleqp/pub_settings.h +162 -0
  2068. casadi/include/sleqp/pub_solver.h +155 -0
  2069. casadi/include/sleqp/pub_types.h +230 -0
  2070. casadi/include/sleqp/pub_working_set.h +135 -0
  2071. casadi/include/sleqp/sparse/pub_mat.h +153 -0
  2072. casadi/include/sleqp/sparse/pub_vec.h +336 -0
  2073. casadi/include/sleqp.h +38 -0
  2074. casadi/include/spral.h +13 -0
  2075. casadi/include/spral_lsmr.h +57 -0
  2076. casadi/include/spral_matrix_util.h +40 -0
  2077. casadi/include/spral_random.h +26 -0
  2078. casadi/include/spral_random_matrix.h +27 -0
  2079. casadi/include/spral_rutherford_boeing.h +51 -0
  2080. casadi/include/spral_scaling.h +139 -0
  2081. casadi/include/spral_ssids.h +121 -0
  2082. casadi/include/spral_ssmfe.h +268 -0
  2083. casadi/include/superscs/cones.h +185 -0
  2084. casadi/include/superscs/constants.h +144 -0
  2085. casadi/include/superscs/cs.h +109 -0
  2086. casadi/include/superscs/ctrlc.h +77 -0
  2087. casadi/include/superscs/directions.h +125 -0
  2088. casadi/include/superscs/glbopts.h +240 -0
  2089. casadi/include/superscs/linAlg.h +437 -0
  2090. casadi/include/superscs/linSys.h +205 -0
  2091. casadi/include/superscs/linsys/amatrix.h +77 -0
  2092. casadi/include/superscs/linsys/common.h +49 -0
  2093. casadi/include/superscs/normalize.h +138 -0
  2094. casadi/include/superscs/scs.h +656 -0
  2095. casadi/include/superscs/scs_blas.h +79 -0
  2096. casadi/include/superscs/scs_parser.h +187 -0
  2097. casadi/include/superscs/unit_test_util.h +210 -0
  2098. casadi/include/superscs/util.h +354 -0
  2099. casadi/include/tinyxml2.h +2380 -0
  2100. casadi/include/trlib/trlib_eigen_inverse.h +118 -0
  2101. casadi/include/trlib/trlib_krylov.h +493 -0
  2102. casadi/include/trlib/trlib_leftmost.h +181 -0
  2103. casadi/include/trlib/trlib_private.h +109 -0
  2104. casadi/include/trlib/trlib_quadratic_zero.h +57 -0
  2105. casadi/include/trlib/trlib_tri_factor.h +409 -0
  2106. casadi/include/trlib/trlib_types.h +36 -0
  2107. casadi/include/trlib.h +44 -0
  2108. casadi/lib64/cmake/tinyxml2/tinyxml2-config-version.cmake +70 -0
  2109. casadi/lib64/cmake/tinyxml2/tinyxml2-config.cmake +57 -0
  2110. casadi/lib64/cmake/tinyxml2/tinyxml2-static-targets-release.cmake +19 -0
  2111. casadi/lib64/cmake/tinyxml2/tinyxml2-static-targets.cmake +103 -0
  2112. casadi/lib64/libtinyxml2.a +0 -0
  2113. casadi/lib64/pkgconfig/tinyxml2.pc +10 -0
  2114. casadi/libCbc.la +35 -0
  2115. casadi/libCbc.so +0 -0
  2116. casadi/libCbc.so.3 +0 -0
  2117. casadi/libCbc.so.3.10.11 +0 -0
  2118. casadi/libCbcSolver.la +35 -0
  2119. casadi/libCbcSolver.so +0 -0
  2120. casadi/libCbcSolver.so.3 +0 -0
  2121. casadi/libCbcSolver.so.3.10.11 +0 -0
  2122. casadi/libCgl.la +35 -0
  2123. casadi/libCgl.so +0 -0
  2124. casadi/libCgl.so.1 +0 -0
  2125. casadi/libCgl.so.1.10.8 +0 -0
  2126. casadi/libClp.la +35 -0
  2127. casadi/libClp.so +0 -0
  2128. casadi/libClp.so.1 +0 -0
  2129. casadi/libClp.so.1.14.9 +0 -0
  2130. casadi/libClpSolver.la +35 -0
  2131. casadi/libClpSolver.so +0 -0
  2132. casadi/libClpSolver.so.1 +0 -0
  2133. casadi/libClpSolver.so.1.14.9 +0 -0
  2134. casadi/libCoinUtils.la +35 -0
  2135. casadi/libCoinUtils.so +0 -0
  2136. casadi/libCoinUtils.so.3 +0 -0
  2137. casadi/libCoinUtils.so.3.11.10 +0 -0
  2138. casadi/libOsi.la +35 -0
  2139. casadi/libOsi.so +0 -0
  2140. casadi/libOsi.so.1 +0 -0
  2141. casadi/libOsi.so.1.13.9 +0 -0
  2142. casadi/libOsiCbc.la +35 -0
  2143. casadi/libOsiCbc.so +0 -0
  2144. casadi/libOsiCbc.so.3 +0 -0
  2145. casadi/libOsiCbc.so.3.10.11 +0 -0
  2146. casadi/libOsiClp.la +35 -0
  2147. casadi/libOsiClp.so +0 -0
  2148. casadi/libOsiClp.so.1 +0 -0
  2149. casadi/libOsiClp.so.1.14.9 +0 -0
  2150. casadi/libOsiCommonTests.la +35 -0
  2151. casadi/libOsiCommonTests.so +0 -0
  2152. casadi/libOsiCommonTests.so.1 +0 -0
  2153. casadi/libOsiCommonTests.so.1.13.9 +0 -0
  2154. casadi/libalpaqa-dl-loader.so +0 -0
  2155. casadi/libalpaqa-dl-loader.so.1.0.0 +0 -0
  2156. casadi/libalpaqa.so +0 -0
  2157. casadi/libalpaqa.so.1.0.0 +0 -0
  2158. casadi/libblasfeo.so +0 -0
  2159. casadi/libbonmin.la +35 -0
  2160. casadi/libbonmin.so +0 -0
  2161. casadi/libbonmin.so.4 +0 -0
  2162. casadi/libbonmin.so.4.8.9 +0 -0
  2163. casadi/libcasadi-tp-openblas.so +0 -0
  2164. casadi/libcasadi-tp-openblas.so.0 +0 -0
  2165. casadi/libcasadi-tp-openblas.so.0.3 +0 -0
  2166. casadi/libcasadi.so +0 -0
  2167. casadi/libcasadi.so.3.7 +0 -0
  2168. casadi/libcasadi_conic_cbc.so +0 -0
  2169. casadi/libcasadi_conic_cbc.so.3.7 +0 -0
  2170. casadi/libcasadi_conic_clp.so +0 -0
  2171. casadi/libcasadi_conic_clp.so.3.7 +0 -0
  2172. casadi/libcasadi_conic_cplex.so +0 -0
  2173. casadi/libcasadi_conic_cplex.so.3.7 +0 -0
  2174. casadi/libcasadi_conic_daqp.so +0 -0
  2175. casadi/libcasadi_conic_daqp.so.3.7 +0 -0
  2176. casadi/libcasadi_conic_fatrop.so +0 -0
  2177. casadi/libcasadi_conic_fatrop.so.3.7 +0 -0
  2178. casadi/libcasadi_conic_gurobi.so +0 -0
  2179. casadi/libcasadi_conic_gurobi.so.3.7 +0 -0
  2180. casadi/libcasadi_conic_highs.so +0 -0
  2181. casadi/libcasadi_conic_highs.so.3.7 +0 -0
  2182. casadi/libcasadi_conic_hpipm.so +0 -0
  2183. casadi/libcasadi_conic_hpipm.so.3.7 +0 -0
  2184. casadi/libcasadi_conic_ipqp.so +0 -0
  2185. casadi/libcasadi_conic_ipqp.so.3.7 +0 -0
  2186. casadi/libcasadi_conic_nlpsol.so +0 -0
  2187. casadi/libcasadi_conic_nlpsol.so.3.7 +0 -0
  2188. casadi/libcasadi_conic_osqp.so +0 -0
  2189. casadi/libcasadi_conic_osqp.so.3.7 +0 -0
  2190. casadi/libcasadi_conic_proxqp.so +0 -0
  2191. casadi/libcasadi_conic_proxqp.so.3.7 +0 -0
  2192. casadi/libcasadi_conic_qpoases.so +0 -0
  2193. casadi/libcasadi_conic_qpoases.so.3.7 +0 -0
  2194. casadi/libcasadi_conic_qrqp.so +0 -0
  2195. casadi/libcasadi_conic_qrqp.so.3.7 +0 -0
  2196. casadi/libcasadi_conic_superscs.so +0 -0
  2197. casadi/libcasadi_conic_superscs.so.3.7 +0 -0
  2198. casadi/libcasadi_importer_shell.so +0 -0
  2199. casadi/libcasadi_importer_shell.so.3.7 +0 -0
  2200. casadi/libcasadi_integrator_collocation.so +0 -0
  2201. casadi/libcasadi_integrator_collocation.so.3.7 +0 -0
  2202. casadi/libcasadi_integrator_cvodes.so +0 -0
  2203. casadi/libcasadi_integrator_cvodes.so.3.7 +0 -0
  2204. casadi/libcasadi_integrator_idas.so +0 -0
  2205. casadi/libcasadi_integrator_idas.so.3.7 +0 -0
  2206. casadi/libcasadi_integrator_rk.so +0 -0
  2207. casadi/libcasadi_integrator_rk.so.3.7 +0 -0
  2208. casadi/libcasadi_interpolant_bspline.so +0 -0
  2209. casadi/libcasadi_interpolant_bspline.so.3.7 +0 -0
  2210. casadi/libcasadi_interpolant_linear.so +0 -0
  2211. casadi/libcasadi_interpolant_linear.so.3.7 +0 -0
  2212. casadi/libcasadi_linsol_csparse.so +0 -0
  2213. casadi/libcasadi_linsol_csparse.so.3.7 +0 -0
  2214. casadi/libcasadi_linsol_csparsecholesky.so +0 -0
  2215. casadi/libcasadi_linsol_csparsecholesky.so.3.7 +0 -0
  2216. casadi/libcasadi_linsol_lapacklu.so +0 -0
  2217. casadi/libcasadi_linsol_lapacklu.so.3.7 +0 -0
  2218. casadi/libcasadi_linsol_lapackqr.so +0 -0
  2219. casadi/libcasadi_linsol_lapackqr.so.3.7 +0 -0
  2220. casadi/libcasadi_linsol_ldl.so +0 -0
  2221. casadi/libcasadi_linsol_ldl.so.3.7 +0 -0
  2222. casadi/libcasadi_linsol_lsqr.so +0 -0
  2223. casadi/libcasadi_linsol_lsqr.so.3.7 +0 -0
  2224. casadi/libcasadi_linsol_ma27.so +0 -0
  2225. casadi/libcasadi_linsol_ma27.so.3.7 +0 -0
  2226. casadi/libcasadi_linsol_mumps.so +0 -0
  2227. casadi/libcasadi_linsol_mumps.so.3.7 +0 -0
  2228. casadi/libcasadi_linsol_qr.so +0 -0
  2229. casadi/libcasadi_linsol_qr.so.3.7 +0 -0
  2230. casadi/libcasadi_linsol_symbolicqr.so +0 -0
  2231. casadi/libcasadi_linsol_symbolicqr.so.3.7 +0 -0
  2232. casadi/libcasadi_linsol_tridiag.so +0 -0
  2233. casadi/libcasadi_linsol_tridiag.so.3.7 +0 -0
  2234. casadi/libcasadi_nlpsol_alpaqa.so +0 -0
  2235. casadi/libcasadi_nlpsol_alpaqa.so.3.7 +0 -0
  2236. casadi/libcasadi_nlpsol_ampl.so +0 -0
  2237. casadi/libcasadi_nlpsol_ampl.so.3.7 +0 -0
  2238. casadi/libcasadi_nlpsol_blocksqp.so +0 -0
  2239. casadi/libcasadi_nlpsol_blocksqp.so.3.7 +0 -0
  2240. casadi/libcasadi_nlpsol_bonmin.so +0 -0
  2241. casadi/libcasadi_nlpsol_bonmin.so.3.7 +0 -0
  2242. casadi/libcasadi_nlpsol_fatrop.so +0 -0
  2243. casadi/libcasadi_nlpsol_fatrop.so.3.7 +0 -0
  2244. casadi/libcasadi_nlpsol_feasiblesqpmethod.so +0 -0
  2245. casadi/libcasadi_nlpsol_feasiblesqpmethod.so.3.7 +0 -0
  2246. casadi/libcasadi_nlpsol_ipopt.so +0 -0
  2247. casadi/libcasadi_nlpsol_ipopt.so.3.7 +0 -0
  2248. casadi/libcasadi_nlpsol_knitro.so +0 -0
  2249. casadi/libcasadi_nlpsol_knitro.so.3.7 +0 -0
  2250. casadi/libcasadi_nlpsol_madnlp.so +0 -0
  2251. casadi/libcasadi_nlpsol_madnlp.so.3.7 +0 -0
  2252. casadi/libcasadi_nlpsol_qrsqp.so +0 -0
  2253. casadi/libcasadi_nlpsol_qrsqp.so.3.7 +0 -0
  2254. casadi/libcasadi_nlpsol_scpgen.so +0 -0
  2255. casadi/libcasadi_nlpsol_scpgen.so.3.7 +0 -0
  2256. casadi/libcasadi_nlpsol_sleqp.so +0 -0
  2257. casadi/libcasadi_nlpsol_sleqp.so.3.7 +0 -0
  2258. casadi/libcasadi_nlpsol_snopt.so +0 -0
  2259. casadi/libcasadi_nlpsol_snopt.so.3.7 +0 -0
  2260. casadi/libcasadi_nlpsol_sqpmethod.so +0 -0
  2261. casadi/libcasadi_nlpsol_sqpmethod.so.3.7 +0 -0
  2262. casadi/libcasadi_nlpsol_worhp.so +0 -0
  2263. casadi/libcasadi_nlpsol_worhp.so.3.7 +0 -0
  2264. casadi/libcasadi_rootfinder_fast_newton.so +0 -0
  2265. casadi/libcasadi_rootfinder_fast_newton.so.3.7 +0 -0
  2266. casadi/libcasadi_rootfinder_kinsol.so +0 -0
  2267. casadi/libcasadi_rootfinder_kinsol.so.3.7 +0 -0
  2268. casadi/libcasadi_rootfinder_newton.so +0 -0
  2269. casadi/libcasadi_rootfinder_newton.so.3.7 +0 -0
  2270. casadi/libcasadi_rootfinder_nlpsol.so +0 -0
  2271. casadi/libcasadi_rootfinder_nlpsol.so.3.7 +0 -0
  2272. casadi/libcasadi_sundials_common.so +0 -0
  2273. casadi/libcasadi_sundials_common.so.3.7 +0 -0
  2274. casadi/libcasadi_xmlfile_tinyxml.so +0 -0
  2275. casadi/libcasadi_xmlfile_tinyxml.so.3.7 +0 -0
  2276. casadi/libcoinmetis.la +41 -0
  2277. casadi/libcoinmetis.so +0 -0
  2278. casadi/libcoinmetis.so.2 +0 -0
  2279. casadi/libcoinmetis.so.2.0.0 +0 -0
  2280. casadi/libcoinmumps.la +41 -0
  2281. casadi/libcoinmumps.so +0 -0
  2282. casadi/libcoinmumps.so.3 +0 -0
  2283. casadi/libcoinmumps.so.3.0.1 +0 -0
  2284. casadi/libcplex_adaptor.so +0 -0
  2285. casadi/libdaqp.so +0 -0
  2286. casadi/libdaqpstat.a +0 -0
  2287. casadi/libfatrop.so +0 -0
  2288. casadi/libgfortran-040039e1.so.5.0.0 +0 -0
  2289. casadi/libgurobi_adaptor.so +0 -0
  2290. casadi/libhighs.so +0 -0
  2291. casadi/libhighs.so.1 +0 -0
  2292. casadi/libhighs.so.1.7.2 +0 -0
  2293. casadi/libhpipm.so +0 -0
  2294. casadi/libindirect.a +0 -0
  2295. casadi/libipopt.la +41 -0
  2296. casadi/libipopt.so +0 -0
  2297. casadi/libipopt.so.3 +0 -0
  2298. casadi/libipopt.so.3.14.11 +0 -0
  2299. casadi/liblinsys.a +0 -0
  2300. casadi/libmatlab_ipc.so +0 -0
  2301. casadi/libosqp.a +0 -0
  2302. casadi/libosqp.so +0 -0
  2303. casadi/libqdldl.a +0 -0
  2304. casadi/libqdldl.so +0 -0
  2305. casadi/libquadmath-96973f99.so.0.0.0 +0 -0
  2306. casadi/libsipopt.la +41 -0
  2307. casadi/libsipopt.so +0 -0
  2308. casadi/libsipopt.so.3 +0 -0
  2309. casadi/libsipopt.so.3.14.11 +0 -0
  2310. casadi/libsleqp.so +0 -0
  2311. casadi/libsleqp.so.1.0.1 +0 -0
  2312. casadi/libspral.a +0 -0
  2313. casadi/libsuperscs.a +0 -0
  2314. casadi/libtrlib.so +0 -0
  2315. casadi/libtrlib.so.0.4 +0 -0
  2316. casadi/pkgconfig/blas.pc +11 -0
  2317. casadi/pkgconfig/bonmin.pc +12 -0
  2318. casadi/pkgconfig/casadi.pc +12 -0
  2319. casadi/pkgconfig/cbc.pc +12 -0
  2320. casadi/pkgconfig/cgl.pc +12 -0
  2321. casadi/pkgconfig/clp.pc +12 -0
  2322. casadi/pkgconfig/coinmetis.pc +13 -0
  2323. casadi/pkgconfig/coinmumps.pc +15 -0
  2324. casadi/pkgconfig/coinutils.pc +12 -0
  2325. casadi/pkgconfig/highs.pc +12 -0
  2326. casadi/pkgconfig/ipopt.pc +15 -0
  2327. casadi/pkgconfig/lapack.pc +11 -0
  2328. casadi/pkgconfig/openblas.pc +11 -0
  2329. casadi/pkgconfig/osi-cbc.pc +12 -0
  2330. casadi/pkgconfig/osi-clp.pc +12 -0
  2331. casadi/pkgconfig/osi-unittests.pc +12 -0
  2332. casadi/pkgconfig/osi.pc +12 -0
  2333. casadi/pkgconfig/proxsuite.pc +22 -0
  2334. casadi/pkgconfig/sleqp.pc +10 -0
  2335. casadi/tools/__init__.py +52 -0
  2336. casadi/tools/bounds.py +107 -0
  2337. casadi/tools/graph/__init__.py +35 -0
  2338. casadi/tools/graph/graph.py +747 -0
  2339. casadi/tools/in_out.py +89 -0
  2340. casadi/tools/structure.py +1446 -0
  2341. casadi/tools/structure3.py +1441 -0
  2342. casadi-3.6.7.dist-info/METADATA +45 -0
  2343. casadi-3.6.7.dist-info/RECORD +2345 -0
  2344. casadi-3.6.7.dist-info/WHEEL +4 -0
  2345. dummy.txt +1 -0
@@ -0,0 +1,4691 @@
1
+ /*
2
+ * This file is part of CasADi.
3
+ *
4
+ * CasADi -- A symbolic framework for dynamic optimization.
5
+ * Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl,
6
+ * KU Leuven. All rights reserved.
7
+ * Copyright (C) 2011-2014 Greg Horn
8
+ *
9
+ * CasADi is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU Lesser General Public
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or (at your option) any later version.
13
+ *
14
+ * CasADi is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
+ * Lesser General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU Lesser General Public
20
+ * License along with CasADi; if not, write to the Free Software
21
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
+ *
23
+ */
24
+
25
+
26
+
27
+ %module(package="casadi",directors=1) casadi
28
+
29
+ #ifdef CASADI_WITH_COPYSIGN_UNDEF
30
+ %{
31
+ #ifdef copysign
32
+ #undef copysign
33
+ #endif
34
+ %}
35
+ #endif // CASADI_WITH_COPYSIGN_UNDEF
36
+
37
+ // Include all public CasADi C++
38
+ %{
39
+ #include <casadi/casadi.hpp>
40
+ #include <casadi/core/casadi_interrupt.hpp>
41
+ %}
42
+
43
+ // casadi_int type
44
+ %include <casadi/core/casadi_types.hpp>
45
+
46
+ /// Data structure in the target language holding data
47
+ #ifdef SWIGPYTHON
48
+ #define GUESTOBJECT PyObject
49
+ #elif defined(SWIGMATLAB)
50
+ #define GUESTOBJECT mxArray
51
+ #else
52
+ #define GUESTOBJECT void
53
+ #endif
54
+
55
+ // Define printing routine
56
+
57
+ #ifdef SWIGPYTHON
58
+ %{
59
+ namespace casadi {
60
+ // Redirect printout
61
+ static void pythonlogger(const char* s, std::streamsize num, bool error) {
62
+ if (!casadi::InterruptHandler::is_main_thread()) {
63
+ casadi::Logger::writeDefault(s, num, error);
64
+ return;
65
+ }
66
+ int n = num;
67
+ while (n>0) {
68
+ if (error) {
69
+ PySys_WriteStderr("%.*s", std::min(n, 1000), s);
70
+ } else {
71
+ PySys_WriteStdout("%.*s", std::min(n, 1000), s);
72
+ }
73
+ n -= 1000;
74
+ s += 1000;
75
+ }
76
+ }
77
+
78
+ static bool pythoncheckinterrupted() {
79
+ if (!casadi::InterruptHandler::is_main_thread()) return false;
80
+ return PyErr_CheckSignals();
81
+ }
82
+
83
+ std::string python_string_to_std_string(PyObject *str_py) {
84
+ #if SWIG_VERSION < 0x040200
85
+ const char *str_char = SWIG_Python_str_AsChar(str_py);
86
+ std::string str(str_char);
87
+ SWIG_Python_str_DelForPy3(str_char);
88
+ #else
89
+ PyObject *bytes = NULL;
90
+ std::string str(SWIG_PyUnicode_AsUTF8AndSize(str_py, NULL, &bytes));
91
+ Py_XDECREF(bytes);
92
+ #endif
93
+ return str;
94
+ }
95
+
96
+ void handle_director_exception() {
97
+ std::string msg = "Exception in SWIG director ";
98
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
99
+ if (PyErr_ExceptionMatches(PyExc_KeyboardInterrupt)) {
100
+ PyErr_Clear();
101
+ SWIG_PYTHON_THREAD_END_BLOCK;
102
+ throw casadi::KeyboardInterruptException();
103
+ }
104
+ PyObject *ptype, *pvalue, *ptraceback;
105
+ PyErr_Fetch(&ptype, &pvalue, &ptraceback);
106
+ PyObject* msg_py = PyObject_Str(pvalue);
107
+ msg = python_string_to_std_string(msg_py);
108
+ Py_DECREF(msg_py);
109
+ PyErr_Restore(ptype, pvalue, ptraceback);
110
+ PyErr_Print();
111
+ SWIG_PYTHON_THREAD_END_BLOCK;
112
+ casadi_error(msg.c_str());
113
+ }
114
+ }
115
+
116
+ %}
117
+ %init %{
118
+ // Set logger functions
119
+ casadi::Logger::writeFun = casadi::pythonlogger;
120
+
121
+ // @jgillis: please document
122
+ casadi::InterruptHandler::checkInterrupted = casadi::pythoncheckinterrupted;
123
+
124
+ casadi::InterruptHandler::is_main_thread();
125
+
126
+ %}
127
+ #elif defined(SWIGMATLAB)
128
+ %{
129
+ namespace casadi {
130
+ // Redirect printout to mexPrintf
131
+ static void mexlogger(const char* s, std::streamsize num, bool error) {
132
+ if (!casadi::InterruptHandler::is_main_thread()) {
133
+ casadi::Logger::writeDefault(s, num, error);
134
+ return;
135
+ }
136
+ mexPrintf("%.*s", static_cast<int>(num), s);
137
+ }
138
+
139
+ #ifdef HAVE_OCTAVE
140
+ // Flush the command window buffer (needed in gui mode)
141
+ static void mexflush(bool error) {
142
+ }
143
+ // Never for Octave
144
+ static bool mexcheckinterrupted() {
145
+ return false;
146
+ }
147
+ void mexclearinterrupted() {
148
+
149
+ }
150
+ #else
151
+ // Undocumented matlab feature
152
+ extern "C" bool utIsInterruptPending(void);
153
+ extern "C" void utSetInterruptPending(bool);
154
+
155
+ static bool mexcheckinterrupted() {
156
+ if (!casadi::InterruptHandler::is_main_thread()) return false;
157
+ return utIsInterruptPending();
158
+ }
159
+
160
+ void mexclearinterrupted() {
161
+ utSetInterruptPending(false);
162
+ }
163
+
164
+ // Flush the command window buffer (needed in gui mode)
165
+ static void mexflush(bool error) {
166
+ if (!casadi::InterruptHandler::is_main_thread()) {
167
+ casadi::Logger::flushDefault(error);
168
+ return;
169
+ }
170
+ if (!mexcheckinterrupted()) {
171
+ if (mexEvalString("drawnow('update');pause(0.0001);")) {
172
+ utSetInterruptPending(true);
173
+ }
174
+ }
175
+ }
176
+ #endif
177
+
178
+ }
179
+ %}
180
+ %init %{
181
+ // Get full path
182
+ mxArray *fullpath, *fullpath_cmd = mxCreateString("fullpath");
183
+ mexCallMATLAB(1, &fullpath, 1, &fullpath_cmd, "mfilename");
184
+ mxDestroyArray(fullpath_cmd);
185
+ std::string path = mxArrayToString(fullpath);
186
+ mxDestroyArray(fullpath);
187
+
188
+ // Get file separator
189
+ mxArray *filesep;
190
+ mexCallMATLAB(1, &filesep, 0, 0, "filesep");
191
+ std::string sep = mxArrayToString(filesep);
192
+ mxDestroyArray(filesep);
193
+
194
+ // Truncate at separator
195
+ path = path.substr(0, path.rfind(sep));
196
+
197
+ // Octave-on-Windows seems to pick up superfluous +casadi
198
+ // Make sure we exclude it
199
+ if (path.rfind(sep)!=std::string::npos && path.substr(path.rfind(sep)+1)=="+casadi")
200
+ path = path.substr(0, path.rfind(sep));
201
+
202
+ // Set library path
203
+ casadi::GlobalOptions::setCasadiPath(path);
204
+ casadi::GlobalOptions::setCasadiIncludePath(path+sep+"include");
205
+
206
+ // Matlab is index-one based
207
+ casadi::GlobalOptions::start_index = 1;
208
+
209
+ // @jgillis: please document
210
+ mxArray *warning_rhs[] = {mxCreateString("error"),
211
+
212
+ mxCreateString("SWIG:OverloadError")};
213
+ mexCallMATLAB(0, 0, 2, warning_rhs, "warning");
214
+ mxDestroyArray(warning_rhs[0]);
215
+ mxDestroyArray(warning_rhs[1]);
216
+
217
+
218
+ // Set logger functions
219
+ casadi::Logger::writeFun = casadi::mexlogger;
220
+ casadi::Logger::flush = casadi::mexflush;
221
+
222
+ // @jgillis: please document
223
+ casadi::InterruptHandler::checkInterrupted = casadi::mexcheckinterrupted;
224
+ casadi::InterruptHandler::clearInterrupted = casadi::mexclearinterrupted;
225
+
226
+ casadi::InterruptHandler::is_main_thread();
227
+
228
+ %}
229
+ #endif
230
+
231
+ // Turn off the warnings that certain methods are effectively ignored, this seams to be a false warning,
232
+ // for example vertcat(SXVector), vertcat(DMVector) and vertcat(MXVector) appears to work fine
233
+ #pragma SWIG nowarn=509,303,302
234
+
235
+ #define CASADI_EXPORT
236
+
237
+ // Incude cmath early on, see #622
238
+ %begin %{
239
+ #include <cmath>
240
+ #ifdef _XOPEN_SOURCE
241
+ #undef _XOPEN_SOURCE
242
+ #endif
243
+ #ifdef _POSIX_C_SOURCE
244
+ #undef _POSIX_C_SOURCE
245
+ #endif
246
+ %}
247
+
248
+ %ignore *::operator->;
249
+
250
+ %rename(str) get_str;
251
+
252
+ %begin %{
253
+ #define SWIG_PYTHON_OUTPUT_TUPLE
254
+ %}
255
+
256
+ #ifdef SWIGPYTHON
257
+ %pythoncode %{
258
+
259
+ import contextlib
260
+
261
+ class _copyableObject(object):
262
+ def __copy__(self):
263
+ return self.__class__(self)
264
+
265
+ def __deepcopy__(self,dummy=None):
266
+ return self.__class__(self)
267
+
268
+ _object = object = _copyableObject
269
+
270
+ _swig_repr_default = _swig_repr
271
+ def _swig_repr(self):
272
+ if hasattr(self,'repr'):
273
+ return self.repr()
274
+ else:
275
+ return _swig_repr_default(self)
276
+
277
+ def DM_from_array(m, check_only=True):
278
+ import numpy as np
279
+ if isinstance(m, np.ndarray):
280
+ if len(m.shape)>2:
281
+ return False
282
+ try:
283
+ m = m.astype(float,casting="same_kind",copy=False)
284
+ except:
285
+ return False
286
+ if check_only:
287
+ return True
288
+ else:
289
+ shape = m.shape + (1, 1)
290
+ nrow, ncol = shape[0], shape[1]
291
+ return (nrow,ncol,m.flat)
292
+ return False
293
+
294
+ def IM_from_array(m, check_only=True):
295
+ import numpy as np
296
+ if isinstance(m, np.ndarray):
297
+ if len(m.shape)>2:
298
+ return False
299
+ try:
300
+ m = m.astype(int,casting="same_kind",copy=False)
301
+ except:
302
+ return False
303
+ if check_only:
304
+ return True
305
+ else:
306
+ shape = m.shape + (1, 1)
307
+ nrow, ncol = shape[0], shape[1]
308
+ return (nrow,ncol,m.flat)
309
+ return False
310
+
311
+ def SX_from_array(m, check_only=True):
312
+ import numpy as np
313
+ if isinstance(m, np.ndarray):
314
+ if len(m.shape)>2:
315
+ return False
316
+ if m.dtype!=object: return None
317
+ shape = m.shape + (1, 1)
318
+ nrow, ncol = shape[0], shape[1]
319
+ return (nrow,ncol,m.flat)
320
+ return False
321
+
322
+ def DM_from_csc(m, check_only=True):
323
+ if hasattr(m,"tocsc"):
324
+ m = m.tocsc()
325
+ if m.__class__.__name__ == "csc_matrix":
326
+ if len(m.shape)!=2: return False
327
+ if check_only: return True
328
+ return m.shape + (m.indptr.flat,m.indices.flat,m.data.flat)
329
+ return False
330
+
331
+ %}
332
+ #endif // WITH_SWIGPYTHON
333
+
334
+
335
+ // These are the following styles
336
+ // error
337
+ // overview
338
+ // group
339
+
340
+ %feature("autodoc", "1");
341
+
342
+ %feature("customdoc", "1");
343
+
344
+ %feature("customdoc:arg:self", "self");
345
+
346
+ #if defined(SWIGMATLAB) || defined(SWIGOCTAVE)
347
+ #define MNAME "$NAME"
348
+ %feature("customdoc:proto:constructor", "new_obj = $NAME($in)");
349
+ %feature("customdoc:proto:single_out", "$out = $NAME($in)");
350
+ %feature("customdoc:proto:normal", "[$out] = $NAME($in)");
351
+ %feature("customdoc:main", " $NAME $brief\n\n$overview\n$main");
352
+ #else
353
+ #define MNAME "$name"
354
+ %feature("customdoc:proto:constructor", "$name($in)");
355
+ %feature("customdoc:proto:single_out", "$name($in) -> $out");
356
+ %feature("customdoc:proto:normal", "$name($in) -> ($out)");
357
+ %feature("customdoc:main", " $brief\n\n::\n\n$overview\n$main");
358
+ #endif
359
+
360
+ %feature("customdoc:arg:normal:style_error", "$type");
361
+ %feature("customdoc:arg:only:style_error", "$type");
362
+ %feature("customdoc:arg:separator:style_error", ",");
363
+ %feature("customdoc:proto:void:style_error", MNAME "($in)");
364
+ %feature("customdoc:proto:single_out:style_error", MNAME "($in)");
365
+ %feature("customdoc:proto:normal:style_error", MNAME "($in)");
366
+ %feature("customdoc:proto:constructor:style_error", MNAME "($in)");
367
+
368
+ %feature("customdoc:arg:normal", "$type $name");
369
+ %feature("customdoc:arg:only", "$type $name");
370
+ %feature("customdoc:arg:only:out", "$type");
371
+ %feature("customdoc:arg:no_name", "out$ip");
372
+ %feature("customdoc:arg:separator", ", ");
373
+
374
+
375
+ %feature("customdoc:proto:void", MNAME "($in)");
376
+ %feature("customdoc:proto:single_out:style_group", MNAME "($in)");
377
+ %feature("customdoc:proto:normal:style_group", MNAME "($in)");
378
+ %feature("customdoc:proto:constructor:style_group", MNAME "($in)");
379
+
380
+ %feature("customdoc:protoline", " $proto");
381
+ %feature("customdoc:protoline:style_overview", " $proto");
382
+ %feature("customdoc:protoline:nobrief:style_overview", " $proto");
383
+
384
+ %feature("customdoc:protoline:style_group", " $proto");
385
+
386
+ %feature("customdoc:group", "\n.......\n\n::\n\n$group\n$main\n\n.............\n\n");
387
+
388
+ // append works for strings
389
+
390
+ %naturalvar;
391
+
392
+ // Make data members read-only
393
+ %immutable;
394
+
395
+ // Make sure that a copy constructor is created
396
+ %copyctor;
397
+
398
+ #ifndef SWIGXML
399
+ %feature("compactdefaultargs","1");
400
+ //%feature("compactdefaultargs","0") casadi::taylor; // taylor function has a default argument for which the namespace is not recognised by SWIG
401
+ %feature("compactdefaultargs","0") casadi::Function::generateCode; // buggy
402
+ #endif //SWIGXML
403
+
404
+ // STL
405
+ #ifdef SWIGXML
406
+ namespace std {
407
+ template<class T> class vector {};
408
+ template<class A, class B> class pair {};
409
+ template<class A, class B> class map {};
410
+ }
411
+ #else // SWIGXML
412
+ %include "stl.i"
413
+ #endif // SWIGXML
414
+
415
+ %include "doc.i"
416
+
417
+
418
+ // Note: Only from 3.0.0 onwards,
419
+ // DirectorException inherits from std::exception
420
+ #if SWIG_VERSION >= 0x030000
421
+ // Exceptions handling
422
+ %include "exception.i"
423
+ %exception {
424
+ try {
425
+ $action
426
+ } catch(const std::exception& e) {
427
+ SWIG_exception(SWIG_RuntimeError, e.what());
428
+ }
429
+ }
430
+
431
+ // Python sometimes takes an approach to not check, but just try.
432
+ // It expects a python error to be thrown.
433
+ %exception __int__ {
434
+ try {
435
+ $action
436
+ } catch (const std::exception& e) {
437
+ SWIG_exception(SWIG_RuntimeError, e.what());
438
+ }
439
+ }
440
+
441
+ #ifdef WITH_PYTHON3
442
+ // See https://github.com/casadi/casadi/issues/701
443
+ // Recent numpys will only catch TypeError or ValueError in printing logic
444
+ %exception __bool__ {
445
+ try {
446
+ $action
447
+ } catch (const std::exception& e) {
448
+ SWIG_exception(SWIG_TypeError, e.what());
449
+ }
450
+ }
451
+ #else
452
+ %exception __nonzero__ {
453
+ try {
454
+ $action
455
+ } catch (const std::exception& e) {
456
+ SWIG_exception(SWIG_TypeError, e.what());
457
+ }
458
+ }
459
+ #endif
460
+ #else
461
+ // Exceptions handling
462
+ %include "exception.i"
463
+ %exception {
464
+ try {
465
+ $action
466
+ } catch(const std::exception& e) {
467
+ SWIG_exception(SWIG_RuntimeError, e.what());
468
+ } catch (const Swig::DirectorException& e) {
469
+ SWIG_exception(SWIG_TypeError, e.getMessage());
470
+ }
471
+ }
472
+
473
+ // Python sometimes takes an approach to not check, but just try.
474
+ // It expects a python error to be thrown.
475
+ %exception __int__ {
476
+ try {
477
+ $action
478
+ } catch (const std::exception& e) {
479
+ SWIG_exception(SWIG_RuntimeError, e.what());
480
+ } catch (const Swig::DirectorException& e) {
481
+ SWIG_exception(SWIG_TypeError, e.getMessage());
482
+ }
483
+ }
484
+
485
+ #ifdef WITH_PYTHON3
486
+ // See https://github.com/casadi/casadi/issues/701
487
+ // Recent numpys will only catch TypeError or ValueError in printing logic
488
+ %exception __bool__ {
489
+ try {
490
+ $action
491
+ } catch (const std::exception& e) {
492
+ SWIG_exception(SWIG_TypeError, e.what());
493
+ } catch (const Swig::DirectorException& e) {
494
+ SWIG_exception(SWIG_TypeError, e.getMessage());
495
+ }
496
+ }
497
+ #else
498
+ %exception __nonzero__ {
499
+ try {
500
+ $action
501
+ } catch (const std::exception& e) {
502
+ SWIG_exception(SWIG_TypeError, e.what());
503
+ }
504
+ catch (const Swig::DirectorException& e) {
505
+ SWIG_exception(SWIG_TypeError, e.getMessage());
506
+ }
507
+ }
508
+ #endif
509
+ #endif
510
+
511
+ #ifdef SWIGPYTHON
512
+ %feature("director:except") {
513
+ if ($error != NULL) casadi::handle_director_exception();
514
+ }
515
+ #endif //SWIGPYTHON
516
+
517
+
518
+ #ifdef SWIGPYTHON
519
+
520
+ %{
521
+ #define SWIG_FILE_WITH_INIT
522
+ %}
523
+
524
+ #endif // SWIGPYTHON
525
+
526
+ %{
527
+ #define SWIG_Error_return(code, msg) { std::cerr << "Error occured in CasADi SWIG interface code:" << std::endl << " "<< msg << std::endl;SWIG_Error(code, msg); return 0; }
528
+ %}
529
+
530
+ #ifndef SWIGXML
531
+
532
+ // Can be overloaded by specifying before importing casadi.i
533
+ %fragment("casadi_extra_decl", "header") {}
534
+
535
+ %fragment("casadi_decl", "header",fragment="casadi_extra_decl") {
536
+ namespace casadi {
537
+ /* Check if Null or None */
538
+ bool is_null(GUESTOBJECT *p);
539
+
540
+ /* Typemaps from CasADi types to types in the interfaced language:
541
+ *
542
+ * to_ptr: Converts a pointer in interfaced language to C++:
543
+ * Input: GUESTOBJECT pointer p
544
+ * Output: Pointer to pointer: At input, pointer to pointer to temporary
545
+ * The routine will either:
546
+ * - Do nothing, if 0
547
+ * - Change the pointer
548
+ * - Change the temporary object
549
+ * Returns true upon success, else false
550
+ *
551
+ * from_ptr: Converts result from CasADi to interfaced language
552
+ */
553
+
554
+ // Basic types
555
+ bool to_ptr(GUESTOBJECT *p, bool** m);
556
+ GUESTOBJECT* from_ptr(const bool *a);
557
+ bool to_ptr(GUESTOBJECT *p, casadi_int** m);
558
+ GUESTOBJECT* from_ptr(const casadi_int *a);
559
+ bool to_ptr(GUESTOBJECT *p, double** m);
560
+ GUESTOBJECT* from_ptr(const double *a);
561
+ bool to_ptr(GUESTOBJECT *p, std::string** m);
562
+ GUESTOBJECT* from_ptr(const std::string *a);
563
+
564
+ // std::vector
565
+ #ifdef SWIGMATLAB
566
+ bool to_ptr(GUESTOBJECT *p, std::vector<double> **m);
567
+ GUESTOBJECT* from_ptr(const std::vector<double> *a);
568
+ bool to_ptr(GUESTOBJECT *p, std::vector<casadi_int>** m);
569
+ GUESTOBJECT* from_ptr(const std::vector<casadi_int> *a);
570
+ bool to_ptr(GUESTOBJECT *p, const std::vector<bool> **m);
571
+ GUESTOBJECT* from_ptr(const std::vector<bool> *a);
572
+ bool to_ptr(GUESTOBJECT *p, std::vector<std::string>** m);
573
+ GUESTOBJECT* from_ptr(const std::vector<std::string> *a);
574
+ #endif // SWIGMATLAB
575
+ template<typename M> bool to_ptr(GUESTOBJECT *p, std::vector<M>** m);
576
+ template<typename M> bool to_ptr(GUESTOBJECT *p, std::vector< std::vector<M> >** m);
577
+ template<typename M> GUESTOBJECT* from_ptr(const std::vector<M> *a);
578
+
579
+ // std::pair
580
+ #ifdef SWIGMATLAB
581
+ bool to_ptr(GUESTOBJECT *p, std::pair<casadi_int, casadi_int>** m);
582
+ GUESTOBJECT* from_ptr(const std::pair<casadi_int, casadi_int>* a);
583
+ #endif // SWIGMATLAB
584
+ template<typename M1, typename M2> bool to_ptr(GUESTOBJECT *p, std::pair<M1, M2>** m);
585
+ template<typename M1, typename M2> GUESTOBJECT* from_ptr(const std::pair<M1, M2>* a);
586
+
587
+ // std::map
588
+ template<typename M> bool to_ptr(GUESTOBJECT *p, std::map<std::string, M>** m);
589
+ template<typename M> GUESTOBJECT* from_ptr(const std::map<std::string, M> *a);
590
+
591
+ // Slice
592
+ bool to_ptr(GUESTOBJECT *p, casadi::Slice** m);
593
+ GUESTOBJECT* from_ptr(const casadi::Slice *a);
594
+
595
+ // Sparsity
596
+ bool to_ptr(GUESTOBJECT *p, casadi::Sparsity** m);
597
+ GUESTOBJECT* from_ptr(const casadi::Sparsity *a);
598
+
599
+ // Matrix<>
600
+ bool to_ptr(GUESTOBJECT *p, casadi::DM** m);
601
+ GUESTOBJECT* from_ptr(const casadi::DM *a);
602
+ bool to_ptr(GUESTOBJECT *p, casadi::IM** m);
603
+ GUESTOBJECT* from_ptr(const casadi::IM *a);
604
+ bool to_ptr(GUESTOBJECT *p, casadi::SX** m);
605
+ GUESTOBJECT* from_ptr(const casadi::SX *a);
606
+
607
+ // MX
608
+ bool to_ptr(GUESTOBJECT *p, casadi::MX** m);
609
+ GUESTOBJECT* from_ptr(const casadi::MX *a);
610
+
611
+ // Function
612
+ bool to_ptr(GUESTOBJECT *p, casadi::Function** m);
613
+ GUESTOBJECT* from_ptr(const casadi::Function *a);
614
+
615
+ // SXElem
616
+ bool to_ptr(GUESTOBJECT *p, casadi::SXElem** m);
617
+ GUESTOBJECT* from_ptr(const casadi::SXElem *a);
618
+
619
+ // GenericType
620
+ bool to_ptr(GUESTOBJECT *p, casadi::GenericType** m);
621
+ GUESTOBJECT* from_ptr(const casadi::GenericType *a);
622
+
623
+ // Same as to_ptr, but with pointer instead of pointer to pointer
624
+ template<typename M> bool to_val(GUESTOBJECT *p, M* m);
625
+
626
+ // Check if conversion is possible
627
+ template<typename M> bool can_convert(GUESTOBJECT *p) { return to_ptr(p, static_cast<M**>(0));}
628
+
629
+ // Same as the above, but with reference instead of pointer
630
+ template<typename M> GUESTOBJECT* from_ref(const M& m) { return from_ptr(&m);}
631
+
632
+ // Specialization for std::vectors of booleans
633
+ GUESTOBJECT* from_ref(std::vector<bool>::const_reference m) {
634
+ bool tmp = m;
635
+ return from_ptr(&tmp);
636
+ }
637
+
638
+ // Same as the above, but with a temporary object
639
+ template<typename M> GUESTOBJECT* from_tmp(M m) { return from_ptr(&m);}
640
+ #ifdef SWIGMATLAB
641
+ // Get sparsity pattern
642
+ Sparsity get_sparsity(const mxArray* p);
643
+
644
+ // Number of nonzeros
645
+ size_t getNNZ(const mxArray* p);
646
+ #endif // SWIGMATLAB
647
+
648
+ GUESTOBJECT* full(const DM& m, bool simplify=false) {
649
+ #ifdef SWIGPYTHON
650
+ PyObject *p = from_ptr(&m);
651
+ PyObject *method_name = PyString_FromString("toarray");
652
+ PyObject *cr = PyObject_CallMethodObjArgs(p, method_name, (simplify? Py_True: Py_False), 0);
653
+ Py_DECREF(method_name);
654
+ Py_DECREF(p);
655
+ if (cr) return cr;
656
+ return Py_None;
657
+ #elif defined(SWIGMATLAB)
658
+ mxArray *p = mxCreateDoubleMatrix(m.size1(), m.size2(), mxREAL);
659
+ double* d = static_cast<double*>(mxGetData(p));
660
+ casadi_densify(m.ptr(), m.sparsity(), d, false); // Column-major
661
+ return p;
662
+ #else
663
+ return 0;
664
+ #endif
665
+ }
666
+
667
+
668
+ // Convert to a sparse matrix
669
+ GUESTOBJECT* sparse(const DM& m) {
670
+ #ifdef SWIGPYTHON
671
+ PyObject *p = from_ptr(&m);
672
+ PyObject *cr = PyObject_CallMethod(p, (char*) "tocsc", 0);
673
+ Py_DECREF(p);
674
+ if (cr) return cr;
675
+ return Py_None;
676
+ #elif defined(SWIGMATLAB)
677
+ mxArray *p = mxCreateSparse(m.size1(), m.size2(), m.nnz(), mxREAL);
678
+ casadi::casadi_copy(m.ptr(), m.nnz(), static_cast<double*>(mxGetData(p)));
679
+ std::copy(m.colind(), m.colind()+m.size2()+1, mxGetJc(p));
680
+ std::copy(m.row(), m.row()+m.nnz(), mxGetIr(p));
681
+ return p;
682
+ #else
683
+ return 0;
684
+ #endif
685
+
686
+ }
687
+
688
+ GUESTOBJECT* full_or_sparse(const DM& m, bool simplify=false) {
689
+ if (m.is_dense()) {
690
+ return full(m, simplify);
691
+ } else {
692
+ GUESTOBJECT* p = sparse(m);
693
+ if (is_null(p)) return from_ptr(&m);
694
+ return p;
695
+ }
696
+ }
697
+ #ifdef SWIGPYTHON
698
+
699
+
700
+ PyObject* get_Python_helper(const std::string& name) {
701
+ %#if PY_VERSION_HEX < 0x03070000
702
+ PyObject* module = PyImport_AddModule("casadi");
703
+ %#else
704
+ PyObject* c_name = PyString_FromString("casadi");
705
+ PyObject* module = PyImport_GetModule(c_name);
706
+ Py_DECREF(c_name);
707
+ %#endif
708
+ if (!module) {
709
+ if (PyErr_Occurred()) {
710
+ PyErr_Clear();
711
+ }
712
+ }
713
+ PyObject* dict = PyModule_GetDict(module);
714
+ return PyDict_GetItemString(dict, (char*) name.c_str());
715
+ }
716
+
717
+ template<class T>
718
+ bool casadi_object_from_fun(GUESTOBJECT *p, T** m, const std::string& fun, const std::function<bool(PyObject*, T**)> & conv) {
719
+ PyObject* dm = get_Python_helper(fun);
720
+ if (!dm) return false;
721
+ PyObject *check_only = m? Py_False : Py_True;
722
+ PyObject *cr = PyObject_CallFunctionObjArgs(dm, p, check_only, NULL);
723
+ if (!cr) return false;
724
+ bool ret;
725
+ if (PyBool_Check(cr)) {
726
+ ret = PyObject_IsTrue(cr);
727
+ } else {
728
+ ret = conv(cr, m);
729
+ }
730
+ Py_DECREF(cr);
731
+ return ret;
732
+ }
733
+
734
+ bool SX_from_array_conv(GUESTOBJECT *p, casadi::SX** m) {
735
+ std::vector<SXElem> data;
736
+ if (!to_val(PyTuple_GetItem(p, 2), &data)) return false;
737
+ casadi_int nrow; to_val(PyTuple_GetItem(p, 0), &nrow);
738
+ casadi_int ncol; to_val(PyTuple_GetItem(p, 1), &ncol);
739
+ if (m) {
740
+ **m = casadi::SX::zeros(nrow, ncol);
741
+ casadi_densify(get_ptr(data), (**m).sparsity().T(), (**m).ptr(), true);
742
+ }
743
+ return true;
744
+ }
745
+
746
+ bool IM_from_array_conv(GUESTOBJECT *p, casadi::IM** m) {
747
+ if (!m) return true;
748
+ std::vector<casadi_int> data;
749
+ if (!to_val(PyTuple_GetItem(p, 2), &data)) return false;
750
+ casadi_int nrow; to_val(PyTuple_GetItem(p, 0), &nrow);
751
+ casadi_int ncol; to_val(PyTuple_GetItem(p, 1), &ncol);
752
+ **m = IM::zeros(nrow, ncol);
753
+ casadi_densify(get_ptr(data), (**m).sparsity().T(), (**m).ptr(), true);
754
+ return true;
755
+ }
756
+
757
+ bool DM_from_array_conv(GUESTOBJECT *p, casadi::DM** m) {
758
+ if (!m) return true;
759
+ std::vector<double> data;
760
+ if (!to_val(PyTuple_GetItem(p, 2), &data)) return false;
761
+ casadi_int nrow; to_val(PyTuple_GetItem(p, 0), &nrow);
762
+ casadi_int ncol; to_val(PyTuple_GetItem(p, 1), &ncol);
763
+ **m = DM::zeros(nrow, ncol);
764
+ casadi_densify(get_ptr(data), (**m).sparsity().T(), (**m).ptr(), true);
765
+ return true;
766
+ }
767
+
768
+ bool DM_from_csc_conv(GUESTOBJECT *p, casadi::DM** m) {
769
+ std::vector<double> data;
770
+ std::vector<casadi_int> colind, row;
771
+ if (!to_val(PyTuple_GetItem(p, 4), &data)) return false;
772
+ if (!to_val(PyTuple_GetItem(p, 3), &row)) return false;
773
+ if (!to_val(PyTuple_GetItem(p, 2), &colind)) return false;
774
+ casadi_int nrow; to_val(PyTuple_GetItem(p, 0), &nrow);
775
+ casadi_int ncol; to_val(PyTuple_GetItem(p, 1), &ncol);
776
+ **m = casadi::Matrix<double>(casadi::Sparsity(nrow,ncol,colind,row), data, false);
777
+ return true;
778
+ }
779
+
780
+ bool SX_from_array(GUESTOBJECT *p, casadi::SX** m) {
781
+ return casadi_object_from_fun<casadi::SX>(p, m, "SX_from_array", SX_from_array_conv);
782
+ }
783
+
784
+ bool IM_from_array(GUESTOBJECT *p, casadi::IM** m) {
785
+ return casadi_object_from_fun<casadi::IM>(p, m, "IM_from_array", IM_from_array_conv);
786
+ }
787
+
788
+ bool DM_from_array(GUESTOBJECT *p, casadi::DM** m) {
789
+ return casadi_object_from_fun<casadi::DM>(p, m, "DM_from_array", DM_from_array_conv);
790
+ }
791
+
792
+ bool DM_from_csc(GUESTOBJECT *p, casadi::DM** m) {
793
+ return casadi_object_from_fun<casadi::DM>(p, m, "DM_from_csc", DM_from_csc_conv);
794
+ }
795
+
796
+ bool is_scalar_np_array(GUESTOBJECT *p) {
797
+ if (PyObject_HasAttrString(p, "__array__")) {
798
+ PyObject *cr = PyObject_GetAttrString(p, (char*) "size");
799
+ if (cr) {
800
+ casadi_int size;
801
+ casadi_int res = to_val(cr, &size);
802
+ Py_DECREF(cr);
803
+ if (!res) return false;
804
+ return size==1;
805
+ } else {
806
+ PyErr_Clear();
807
+ return false;
808
+ }
809
+ }
810
+ return false;
811
+ }
812
+
813
+ #endif
814
+
815
+
816
+ } // namespace CasADi
817
+ }
818
+
819
+ %fragment("casadi_aux", "header", fragment="casadi_decl") {
820
+ namespace casadi {
821
+ template<typename M> bool to_val(GUESTOBJECT *p, M* m) {
822
+ // Copy the pointer
823
+ M *m2 = m;
824
+ bool ret = to_ptr(p, m ? &m2 : 0);
825
+ // If pointer changed, copy the object
826
+ if (m!=m2) *m=*m2;
827
+ return ret;
828
+ }
829
+
830
+ // Same as to_ptr, but with GenericType
831
+ template<typename M> bool to_generic(GUESTOBJECT *p, GenericType** m) {
832
+ if (m) {
833
+ // Temporary
834
+ M tmp, *tmp_ptr=&tmp;
835
+ bool ret = to_ptr(p, &tmp_ptr);
836
+ if (!ret) return ret;
837
+ **m = GenericType(*tmp_ptr);
838
+ return ret;
839
+ } else {
840
+ return to_ptr(p, static_cast<M**>(0));
841
+ }
842
+ }
843
+
844
+ // Check if casadi_int
845
+ template<typename T> struct is_int {
846
+ static inline bool check() {return false;}
847
+ };
848
+
849
+ template<> struct is_int<casadi_int> {
850
+ static inline bool check() {return true;}
851
+ };
852
+
853
+ bool is_null(GUESTOBJECT *p) {
854
+ #ifdef SWIGPYTHON
855
+ if (p == Py_None) return true;
856
+ #endif
857
+ #ifdef SWIGMATLAB
858
+ if (p == 0) return true;
859
+ #endif
860
+ return false;
861
+ }
862
+
863
+ #ifdef SWIGMATLAB
864
+ Sparsity get_sparsity(const mxArray* p) {
865
+ // Get sparsity pattern
866
+ size_t nrow = mxGetM(p);
867
+ size_t ncol = mxGetN(p);
868
+
869
+ if (mxIsSparse(p)) {
870
+ // Sparse storage in MATLAB
871
+ mwIndex *Jc = mxGetJc(p);
872
+ mwIndex *Ir = mxGetIr(p);
873
+
874
+ // Store in vectors
875
+ std::vector<casadi_int> colind(ncol+1);
876
+ std::copy(Jc, Jc+colind.size(), colind.begin());
877
+ std::vector<casadi_int> row(colind.back());
878
+ std::copy(Ir, Ir+row.size(), row.begin());
879
+
880
+ // Create pattern and return
881
+ return Sparsity(nrow, ncol, colind, row);
882
+ } else {
883
+ return Sparsity::dense(nrow, ncol);
884
+ }
885
+ }
886
+
887
+ size_t getNNZ(const mxArray* p) {
888
+ // Dimensions
889
+ size_t nrow = mxGetM(p);
890
+ size_t ncol = mxGetN(p);
891
+ if (mxIsSparse(p)) {
892
+ // Sparse storage in MATLAB
893
+ mwIndex *Jc = mxGetJc(p);
894
+ return Jc[ncol];
895
+ } else {
896
+ return nrow*ncol;
897
+ }
898
+ }
899
+ #endif // SWIGMATLAB
900
+ } // namespace casadi
901
+ }
902
+
903
+
904
+ %fragment("casadi_bool", "header", fragment="casadi_aux", fragment=SWIG_AsVal_frag(bool)) {
905
+ namespace casadi {
906
+ bool to_ptr(GUESTOBJECT *p, bool** m) {
907
+ // Treat Null
908
+ if (is_null(p)) return false;
909
+
910
+ // Standard typemaps
911
+ if (SWIG_IsOK(SWIG_AsVal(bool)(p, m ? *m : 0))) return true;
912
+
913
+ #ifdef SWIGMATLAB
914
+ if (mxIsLogicalScalar(p)) {
915
+ if (m) **m = mxIsLogicalScalarTrue(p);
916
+ return true;
917
+ }
918
+ #endif
919
+
920
+ // No match
921
+ return false;
922
+ }
923
+
924
+ GUESTOBJECT * from_ptr(const bool *a) {
925
+ #ifdef SWIGPYTHON
926
+ return PyBool_FromLong(*a);
927
+ #elif defined(SWIGMATLAB)
928
+ return mxCreateLogicalScalar(*a);
929
+ #else
930
+ return 0;
931
+ #endif
932
+ }
933
+ } // namespace casadi
934
+ }
935
+
936
+ %fragment("casadi_int", "header", fragment="casadi_aux", fragment=SWIG_AsVal_frag(int), fragment=SWIG_AsVal_frag(long), fragment=SWIG_AsVal_frag(long long)) {
937
+ namespace casadi {
938
+ bool to_ptr(GUESTOBJECT *p, casadi_int** m) {
939
+ // Treat Null
940
+ if (is_null(p)) return false;
941
+
942
+ // long long
943
+ {
944
+ long long tmp;
945
+ if (SWIG_IsOK(SWIG_AsVal(long long)(p, &tmp))) {
946
+ if (m) **m = static_cast<casadi_int>(tmp);
947
+ return true;
948
+ }
949
+ }
950
+
951
+ #ifdef SWIGPYTHON
952
+ if (is_scalar_np_array(p)) {
953
+ PyObject *cr = PyObject_CallMethod(p, (char*) "item", 0);
954
+ if (cr) {
955
+ casadi_int res = to_ptr(cr, m);
956
+ Py_DECREF(cr);
957
+ if (!res) return false;
958
+ return true;
959
+ } else {
960
+ PyErr_Clear();
961
+ return false;
962
+ }
963
+ }
964
+ #endif // SWIGPYTHON
965
+
966
+ bool tmp;
967
+ if (to_val(p, m? &tmp : 0)) {
968
+ if (m) **m = tmp;
969
+ return true;
970
+ }
971
+
972
+ // No match
973
+ return false;
974
+ }
975
+
976
+ GUESTOBJECT * from_ptr(const casadi_int *a) {
977
+ #ifdef SWIGPYTHON
978
+ #ifdef WITH_PYTHON3
979
+ return PyLong_FromLongLong(*a);
980
+ #else
981
+ // For python on Windows
982
+ if (*a > PyInt_GetMax() || *a < -(PyInt_GetMax()-1)) return PyLong_FromLongLong(*a);
983
+ return PyInt_FromLong(*a);
984
+ #endif
985
+
986
+ #elif defined(SWIGMATLAB)
987
+ return mxCreateDoubleScalar(static_cast<double>(*a));
988
+ #else
989
+ return 0;
990
+ #endif
991
+ }
992
+ } // namespace casadi
993
+ }
994
+
995
+ %fragment("casadi_double", "header", fragment="casadi_aux", fragment=SWIG_AsVal_frag(double)) {
996
+ namespace casadi {
997
+ bool to_ptr(GUESTOBJECT *p, double** m) {
998
+ // Treat Null
999
+ if (is_null(p)) return false;
1000
+
1001
+ // Standard typemaps
1002
+ if (SWIG_IsOK(SWIG_AsVal(double)(p, m ? *m : 0))) return true;
1003
+
1004
+ #ifdef SWIGPYTHON
1005
+ if (is_scalar_np_array(p)) {
1006
+ PyObject *cr = PyObject_CallMethod(p, (char*) "item", 0);
1007
+ if (cr) {
1008
+ casadi_int res = to_ptr(cr, m);
1009
+ Py_DECREF(cr);
1010
+ if (!res) return false;
1011
+ return true;
1012
+ } else {
1013
+ PyErr_Clear();
1014
+ return false;
1015
+ }
1016
+ }
1017
+ #endif // SWIGPYTHON
1018
+
1019
+ casadi_int tmp;
1020
+ if (to_val(p, m? &tmp: 0)) {
1021
+ if (m) **m = tmp;
1022
+ return true;
1023
+ }
1024
+
1025
+ // No match
1026
+ return false;
1027
+ }
1028
+
1029
+ GUESTOBJECT * from_ptr(const double *a) {
1030
+ #ifdef SWIGPYTHON
1031
+ return PyFloat_FromDouble(*a);
1032
+ #elif defined(SWIGMATLAB)
1033
+ return mxCreateDoubleScalar(*a);
1034
+ #else
1035
+ return 0;
1036
+ #endif
1037
+ }
1038
+ } // namespace casadi
1039
+ }
1040
+
1041
+
1042
+ %fragment("casadi_vector", "header", fragment="casadi_aux") {
1043
+ namespace casadi {
1044
+
1045
+ #ifdef SWIGMATLAB
1046
+
1047
+ // Cell array
1048
+ template<typename M> bool to_ptr_cell(GUESTOBJECT *p, std::vector<M>** m) {
1049
+ // Cell arrays (only row vectors)
1050
+ if (mxGetClassID(p)==mxCELL_CLASS) {
1051
+ casadi_int nrow = mxGetM(p), ncol = mxGetN(p);
1052
+ if (nrow==1 || (nrow==0 && ncol==0) || ncol==1) {
1053
+ casadi_int n = (nrow==0 || ncol==0) ? 0 : std::max(nrow, ncol);
1054
+ // Allocate elements
1055
+ if (m) {
1056
+ (**m).clear();
1057
+ (**m).reserve(n);
1058
+ }
1059
+
1060
+ // Temporary
1061
+ M tmp;
1062
+
1063
+ // Loop over elements
1064
+ for (casadi_int i=0; i<n; ++i) {
1065
+ // Get element
1066
+ mxArray* pe = mxGetCell(p, i);
1067
+ if (pe==0) return false;
1068
+
1069
+ // Convert element
1070
+ M *m_i = m ? &tmp : 0;
1071
+ if (!to_ptr(pe, m_i ? &m_i : 0)) {
1072
+ return false;
1073
+ }
1074
+ if (m) (**m).push_back(*m_i);
1075
+ }
1076
+ return true;
1077
+ }
1078
+ }
1079
+ return false;
1080
+ }
1081
+
1082
+ // MATLAB row/column vector maps to std::vector<double>
1083
+ bool to_ptr(GUESTOBJECT *p, std::vector<double> **m) {
1084
+ // Treat Null
1085
+ if (is_null(p)) return false;
1086
+
1087
+ if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2
1088
+ && (mxGetM(p)<=1 || mxGetN(p)<=1)) {
1089
+ if (m) {
1090
+ double* data = static_cast<double*>(mxGetData(p));
1091
+ casadi_int n = mxGetM(p)*mxGetN(p);
1092
+ (**m).resize(n);
1093
+ std::copy(data, data+n, (**m).begin());
1094
+ }
1095
+ return true;
1096
+ }
1097
+
1098
+ // Cell array
1099
+ if (to_ptr_cell(p, m)) return true;
1100
+
1101
+ // No match
1102
+ return false;
1103
+ }
1104
+
1105
+ bool to_ptr(GUESTOBJECT *p, std::vector<casadi_int>** m) {
1106
+ if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2
1107
+ && (mxGetM(p)<=1 || mxGetN(p)<=1)) {
1108
+ double* data = static_cast<double*>(mxGetData(p));
1109
+ casadi_int n = mxGetM(p)*mxGetN(p);
1110
+
1111
+ // Check if all integers
1112
+ bool all_integers=true;
1113
+ for (casadi_int i=0; all_integers && i<n; ++i) {
1114
+ if (data[i]!=static_cast<casadi_int>(data[i])) {
1115
+ all_integers = false;
1116
+ break;
1117
+ }
1118
+ }
1119
+
1120
+ // Successful conversion
1121
+ if (all_integers) {
1122
+ if (m) {
1123
+ (**m).resize(n);
1124
+ std::copy(data, data+n, (**m).begin());
1125
+ }
1126
+ return true;
1127
+ }
1128
+ }
1129
+
1130
+ if (mxIsLogical(p) && !mxIsLogicalScalar(p) &&mxGetNumberOfDimensions(p)==2
1131
+ && (mxGetM(p)<=1 || mxGetN(p)<=1) ) {
1132
+ casadi_int n = mxGetM(p)*mxGetN(p);
1133
+ mxLogical* data = static_cast<mxLogical*>(mxGetData(p));
1134
+ if (m) {
1135
+ (**m).resize(n);
1136
+ std::copy(data, data+n, (**m).begin());
1137
+ }
1138
+ return true;
1139
+ }
1140
+
1141
+ // Cell array
1142
+ if (to_ptr_cell(p, m)) return true;
1143
+
1144
+ return false;
1145
+ }
1146
+
1147
+ bool to_ptr(GUESTOBJECT *p, std::vector<bool>** m) {
1148
+ if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2
1149
+ && (mxGetM(p)<=1 || mxGetN(p)<=1)) {
1150
+ double* data = static_cast<double*>(mxGetData(p));
1151
+ casadi_int n = mxGetM(p)*mxGetN(p);
1152
+
1153
+ // Check if all integers
1154
+ bool all_0_or_1 = true;
1155
+ for (casadi_int i=0; all_0_or_1 && i<n; ++i) {
1156
+ double d = data[i];
1157
+ all_0_or_1 = all_0_or_1 && (d==1 || d==0);
1158
+ }
1159
+
1160
+ // Successful conversion
1161
+ if (all_0_or_1) {
1162
+ if (m) {
1163
+ (**m).resize(n);
1164
+ std::copy(data, data+n, (**m).begin());
1165
+ }
1166
+ return true;
1167
+ }
1168
+ }
1169
+
1170
+ if (mxIsLogical(p) && !mxIsLogicalScalar(p) &&mxGetNumberOfDimensions(p)==2
1171
+ && (mxGetM(p)<=1 || mxGetN(p)<=1) ) {
1172
+ casadi_int n = mxGetM(p)*mxGetN(p);
1173
+ mxLogical* data = static_cast<mxLogical*>(mxGetData(p));
1174
+ if (m) {
1175
+ (**m).resize(n);
1176
+ std::copy(data, data+n, (**m).begin());
1177
+ }
1178
+ return true;
1179
+ }
1180
+
1181
+ // Cell array
1182
+ if (to_ptr_cell(p, m)) return true;
1183
+
1184
+ return false;
1185
+ }
1186
+
1187
+ // MATLAB n-by-m char array mapped to vector of length m
1188
+ bool to_ptr(GUESTOBJECT *p, std::vector<std::string>** m) {
1189
+ if (mxIsChar(p)) {
1190
+ if (m) {
1191
+ // Get data
1192
+ size_t nrow = mxGetM(p);
1193
+ size_t ncol = mxGetN(p);
1194
+ mxChar *data = mxGetChars(p);
1195
+
1196
+ // Allocate space for output
1197
+ (**m).resize(nrow);
1198
+ std::vector<std::string> &m_ref = **m;
1199
+
1200
+ // For all strings
1201
+ for (size_t j=0; j!=nrow; ++j) {
1202
+ // Get length without trailing spaces
1203
+ size_t len = ncol;
1204
+ while (len!=0 && data[j + nrow*(len-1)]==' ') --len;
1205
+
1206
+ // Check if null-terminated
1207
+ for (size_t i=0; i!=len; ++i) {
1208
+ if (data[j + nrow*i]=='\0') {
1209
+ len = i;
1210
+ break;
1211
+ }
1212
+ }
1213
+
1214
+ // Create a string of the desired length
1215
+ m_ref[j] = std::string(len, ' ');
1216
+
1217
+ // Get string content
1218
+ for (size_t i=0; i!=len; ++i) {
1219
+ m_ref[j][i] = data[j + nrow*i];
1220
+ }
1221
+ }
1222
+ }
1223
+ return true;
1224
+ }
1225
+
1226
+ // Cell array
1227
+ if (to_ptr_cell(p, m)) return true;
1228
+
1229
+ // No match
1230
+ return false;
1231
+ }
1232
+ #endif // SWIGMATLAB
1233
+
1234
+ template<typename M> bool to_ptr(GUESTOBJECT *p, std::vector<M>** m) {
1235
+ // Treat Null
1236
+ if (is_null(p)) return false;
1237
+ #ifdef SWIGPYTHON
1238
+
1239
+ // Some built-in types are iterable
1240
+ if (PyDict_Check(p) || PyString_Check(p) || PySet_Check(p) || PyUnicode_Check(p)) return false;
1241
+
1242
+ // Make sure shape is 1D, if defined.
1243
+ if (PyObject_HasAttrString(p, "shape")) {
1244
+ PyObject * shape = PyObject_GetAttrString(p, "shape");
1245
+ if(!PyTuple_Check(shape) || PyTuple_Size(shape)!=1) {
1246
+ Py_DECREF(shape);
1247
+ return false;
1248
+ }
1249
+ }
1250
+
1251
+ // Iterator to the sequence
1252
+ PyObject *it = PyObject_GetIter(p);
1253
+ if (!it) {
1254
+ PyErr_Clear();
1255
+ return false;
1256
+ }
1257
+
1258
+ // Allocate elements
1259
+ if (m) (**m).clear();
1260
+
1261
+ // Temporary
1262
+ M tmp;
1263
+
1264
+ PyObject *pe;
1265
+ // Iterate over sequence
1266
+ while ((pe=PyIter_Next(it))) {
1267
+ // Convert element
1268
+ M *m_i = m ? &tmp : 0;
1269
+ if (!to_ptr(pe, m_i ? &m_i : 0)) {
1270
+ // Failure
1271
+ Py_DECREF(pe);
1272
+ Py_DECREF(it);
1273
+ return false;
1274
+ }
1275
+ if (m) (**m).push_back(*m_i);
1276
+ Py_DECREF(pe);
1277
+ }
1278
+ Py_DECREF(it);
1279
+ return true;
1280
+ #endif // SWIGPYTHON
1281
+ #ifdef SWIGMATLAB
1282
+ // Cell array
1283
+ if (to_ptr_cell(p, m)) return true;
1284
+ #endif // SWIGMATLAB
1285
+ // No match
1286
+ return false;
1287
+ }
1288
+
1289
+ #ifdef SWIGMATLAB
1290
+ GUESTOBJECT* from_ptr(const std::vector<double> *a) {
1291
+ mxArray* ret = mxCreateDoubleMatrix(1, a->size(), mxREAL);
1292
+ std::copy(a->begin(), a->end(), static_cast<double*>(mxGetData(ret)));
1293
+ return ret;
1294
+ }
1295
+ GUESTOBJECT* from_ptr(const std::vector<casadi_int> *a) {
1296
+ mxArray* ret = mxCreateDoubleMatrix(1, a->size(), mxREAL);
1297
+ std::copy(a->begin(), a->end(), static_cast<double*>(mxGetData(ret)));
1298
+ return ret;
1299
+ }
1300
+ GUESTOBJECT* from_ptr(const std::vector<bool> *a) {
1301
+ mxArray* ret = mxCreateLogicalMatrix(1, a->size());
1302
+ std::copy(a->begin(), a->end(), static_cast<bool*>(mxGetData(ret)));
1303
+ return ret;
1304
+ }
1305
+ GUESTOBJECT* from_ptr(const std::vector<std::string> *a) {
1306
+ // Collect arguments as char arrays
1307
+ std::vector<const char*> str(a->size());
1308
+ for (size_t i=0; i<str.size(); ++i) str[i] = (*a)[i].c_str();
1309
+
1310
+ // std::vector<string> maps to MATLAB char array with multiple columns
1311
+ return mxCreateCharMatrixFromStrings(str.size(), str.empty() ? 0 : &str[0]);
1312
+ }
1313
+ #endif // SWIGMATLAB
1314
+
1315
+ template<typename M> GUESTOBJECT* from_ptr(const std::vector<M> *a) {
1316
+ #ifdef SWIGPYTHON
1317
+ // std::vector maps to Python list
1318
+ PyObject* ret = PyList_New(a->size());
1319
+ if (!ret) return 0;
1320
+ for (casadi_int k=0; k<a->size(); ++k) {
1321
+ PyObject* el = from_ref(a->at(k));
1322
+ if (!el) {
1323
+ Py_DECREF(ret);
1324
+ return 0;
1325
+ }
1326
+ PyList_SetItem(ret, k, el);
1327
+ }
1328
+ return ret;
1329
+ #elif defined(SWIGMATLAB)
1330
+ // std::vector maps to MATLAB cell array
1331
+ mxArray* ret = mxCreateCellMatrix(1, a->size());
1332
+ if (!ret) return 0;
1333
+ for (casadi_int k=0; k<a->size(); ++k) {
1334
+ mxArray* el = from_ref(a->at(k));
1335
+ if (!el) return 0;
1336
+ mxSetCell(ret, k, el);
1337
+ }
1338
+ return ret;
1339
+ #else
1340
+ return 0;
1341
+ #endif
1342
+ }
1343
+ } // namespace casadi
1344
+ }
1345
+
1346
+
1347
+ %fragment("casadi_vectorvector", "header", fragment="casadi_aux") {
1348
+ namespace casadi {
1349
+
1350
+ #ifdef SWIGMATLAB
1351
+
1352
+ // Cell array
1353
+ template<typename M> bool to_ptr_cell2(GUESTOBJECT *p, std::vector< std::vector<M> >** m) {
1354
+ // Cell arrays (only row vectors)
1355
+ if (mxGetClassID(p)==mxCELL_CLASS) {
1356
+ casadi_int nrow = mxGetM(p), ncol = mxGetN(p);
1357
+ if (true) {
1358
+ // Allocate elements
1359
+ if (m) {
1360
+ (**m).clear();
1361
+ (**m).resize(nrow, std::vector<M>(ncol));
1362
+ }
1363
+
1364
+ // Temporary
1365
+ M tmp;
1366
+
1367
+ // Loop over elements
1368
+ for (casadi_int i=0; i<nrow*ncol; ++i) {
1369
+ // Get element
1370
+ mxArray* pe = mxGetCell(p, i);
1371
+ if (pe==0) return false;
1372
+
1373
+ // Convert element
1374
+ M *m_i = m ? &tmp : 0;
1375
+ if (!to_ptr(pe, m_i ? &m_i : 0)) {
1376
+ return false;
1377
+ }
1378
+
1379
+ if (m) (**m)[i % nrow][i / nrow] = tmp;
1380
+ }
1381
+ return true;
1382
+ }
1383
+ }
1384
+ return false;
1385
+ }
1386
+
1387
+ #endif // SWIGMATLAB
1388
+
1389
+ template<typename M> bool to_ptr(GUESTOBJECT *p, std::vector< std::vector<M> >** m) {
1390
+ // Treat Null
1391
+ if (is_null(p)) return false;
1392
+
1393
+ // Pass on to to_ptr(GUESTOBJECT *p, std::vector<M>** m)
1394
+ if (to_ptr< std::vector<M> >(p, m)) return true;
1395
+
1396
+ #ifdef SWIGMATLAB
1397
+ // Cell array
1398
+ if (to_ptr_cell2(p, m)) return true;
1399
+ #endif // SWIGMATLAB
1400
+ return false;
1401
+ }
1402
+
1403
+ } // namespace casadi
1404
+ }
1405
+
1406
+ %fragment("casadi_function", "header", fragment="casadi_aux") {
1407
+ namespace casadi {
1408
+ bool to_ptr(GUESTOBJECT *p, Function** m) {
1409
+ // Treat Null
1410
+ if (is_null(p)) return false;
1411
+
1412
+ // Function already?
1413
+ if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
1414
+ $descriptor(casadi::Function*), 0))) {
1415
+ return true;
1416
+ }
1417
+
1418
+ // No match
1419
+ return false;
1420
+ }
1421
+
1422
+ GUESTOBJECT* from_ptr(const Function *a) {
1423
+ return SWIG_NewPointerObj(new Function(*a), $descriptor(casadi::Function *), SWIG_POINTER_OWN);
1424
+ }
1425
+ } // namespace casadi
1426
+ }
1427
+
1428
+ %fragment("casadi_generictype", "header", fragment="casadi_aux") {
1429
+ namespace casadi {
1430
+ bool to_ptr(GUESTOBJECT *p, GenericType** m) {
1431
+ #ifdef SWIGPYTHON
1432
+ if (p==Py_None) {
1433
+ if (m) **m=GenericType();
1434
+ return true;
1435
+ }
1436
+ #endif // SWIGPYTHON
1437
+
1438
+ // Treat Null
1439
+ if (is_null(p)) return false;
1440
+
1441
+ // GenericType already?
1442
+ if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
1443
+ $descriptor(casadi::GenericType*), 0))) {
1444
+ return true;
1445
+ }
1446
+
1447
+ // Try to convert to different types
1448
+ if (to_generic<casadi_int>(p, m)
1449
+ || to_generic<double>(p, m)
1450
+ || to_generic<std::string>(p, m)
1451
+ || to_generic<std::vector<casadi_int> >(p, m)
1452
+ || to_generic<std::vector<double> >(p, m)
1453
+ || to_generic<std::vector<bool> >(p, m)
1454
+ || to_generic<std::vector<std::string> >(p, m)
1455
+ || to_generic<std::vector<std::vector<std::string> > >(p, m)
1456
+ || to_generic<std::vector<std::vector<casadi_int> > >(p, m)
1457
+ || to_generic<std::vector<std::vector<double> > >(p, m)
1458
+ || to_generic<casadi::Function>(p, m)
1459
+ || to_generic<std::vector<casadi::Function> >(p, m)
1460
+ || to_generic<casadi::GenericType::Dict>(p, m)
1461
+ || to_generic<std::vector<casadi::GenericType::Dict> >(p, m)
1462
+ || to_generic<std::vector<std::vector<casadi::GenericType> > >(p, m)
1463
+ || to_generic<std::vector<casadi::GenericType> >(p, m)) {
1464
+ return true;
1465
+ }
1466
+
1467
+ // Check if it can be converted to boolean (last as e.g. can be converted to boolean)
1468
+ if (to_generic<bool>(p, m)) return true;
1469
+
1470
+ // No match
1471
+ return false;
1472
+ }
1473
+
1474
+ GUESTOBJECT * from_ptr(const GenericType *a) {
1475
+ switch (a->getType()) {
1476
+ case OT_BOOL: return from_tmp(a->as_bool());
1477
+ case OT_INT: return from_tmp(a->as_int());
1478
+ case OT_DOUBLE: return from_tmp(a->as_double());
1479
+ case OT_STRING: return from_tmp(a->as_string());
1480
+ case OT_INTVECTOR: return from_tmp(a->as_int_vector());
1481
+ case OT_INTVECTORVECTOR: return from_tmp(a->as_int_vector_vector());
1482
+ case OT_BOOLVECTOR: return from_tmp(a->as_bool_vector());
1483
+ case OT_DOUBLEVECTOR: return from_tmp(a->as_double_vector());
1484
+ case OT_DOUBLEVECTORVECTOR: return from_tmp(a->as_double_vector_vector());
1485
+ case OT_STRINGVECTOR: return from_tmp(a->as_string_vector());
1486
+ case OT_STRINGVECTORVECTOR: return from_tmp(a->as_string_vector_vector());
1487
+ case OT_DICT: return from_tmp(a->as_dict());
1488
+ case OT_DICTVECTOR: return from_tmp(a->as_dict_vector());
1489
+ case OT_VECTORVECTOR: return from_tmp(a->as_vector_vector());
1490
+ case OT_VECTOR: return from_tmp(a->as_vector());
1491
+ case OT_FUNCTION: return from_tmp(a->as_function());
1492
+ case OT_FUNCTIONVECTOR: return from_tmp(a->as_function_vector());
1493
+ #ifdef SWIGPYTHON
1494
+ case OT_NULL:
1495
+ case OT_VOIDPTR:
1496
+ return Py_None;
1497
+ #endif // SWIGPYTHON
1498
+ #ifdef SWIGMATLAB
1499
+ case OT_VOIDPTR:
1500
+ return mxCreateDoubleScalar(0);
1501
+ #endif
1502
+ default: return 0;
1503
+ }
1504
+ }
1505
+ } // namespace casadi
1506
+ }
1507
+
1508
+ %fragment("casadi_string", "header", fragment="casadi_aux") {
1509
+ namespace casadi {
1510
+ bool to_ptr(GUESTOBJECT *p, std::string** m) {
1511
+ // Treat Null
1512
+ if (is_null(p)) return false;
1513
+
1514
+ // String already?
1515
+ if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
1516
+ $descriptor(std::string*), 0))) {
1517
+ return true;
1518
+ }
1519
+
1520
+ #ifdef SWIGPYTHON
1521
+ if (PyString_Check(p) || PyUnicode_Check(p)) {
1522
+ if (m) {
1523
+ (*m)->clear();
1524
+ (*m)->append(python_string_to_std_string(p));
1525
+ }
1526
+ return true;
1527
+ }
1528
+ #endif // SWIGPYTHON
1529
+ #ifdef SWIGMATLAB
1530
+ if (mxIsChar(p) && mxGetM(p)<=1) {
1531
+ if (m) {
1532
+ if (mxGetM(p)==0) return true;
1533
+ size_t len=mxGetN(p);
1534
+ std::vector<char> s(len+1);
1535
+ if (mxGetString(p, &s[0], (len+1)*sizeof(char))) return false;
1536
+ **m = std::string(&s[0], len);
1537
+ }
1538
+ return true;
1539
+ }
1540
+ #endif // SWIGMATLAB
1541
+
1542
+ // No match
1543
+ return false;
1544
+ }
1545
+
1546
+ GUESTOBJECT* from_ptr(const std::string *a) {
1547
+ #ifdef SWIGPYTHON
1548
+ return PyString_FromString(a->c_str());
1549
+ #elif defined(SWIGMATLAB)
1550
+ return mxCreateString(a->c_str());
1551
+ #else
1552
+ return 0;
1553
+ #endif
1554
+ }
1555
+ } // namespace casadi
1556
+ }
1557
+
1558
+ %fragment("casadi_slice", "header", fragment="casadi_aux") {
1559
+ namespace casadi {
1560
+ bool to_ptr(GUESTOBJECT *p, Slice** m) {
1561
+ // Treat Null
1562
+ if (is_null(p)) return false;
1563
+
1564
+ // Slice already?
1565
+ if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
1566
+ $descriptor(casadi::Slice*), 0))) {
1567
+ return true;
1568
+ }
1569
+
1570
+ #ifdef SWIGPYTHON
1571
+
1572
+ // Python casadi_int
1573
+ if (PyInt_Check(p)) {
1574
+ if (m) {
1575
+ (**m).start = PyInt_AsLong(p);
1576
+ (**m).stop = (**m).start+1;
1577
+ if ((**m).stop==0) (**m).stop = std::numeric_limits<casadi_int>::max();
1578
+ }
1579
+ return true;
1580
+ }
1581
+ // Python slice
1582
+ if (PySlice_Check(p)) {
1583
+ PySliceObject *r = (PySliceObject*)(p);
1584
+ if (m) {
1585
+ (**m).start = (r->start == Py_None || PyNumber_AsSsize_t(r->start, NULL) <= std::numeric_limits<int>::min())
1586
+ ? std::numeric_limits<casadi_int>::min() : PyInt_AsLong(r->start);
1587
+ (**m).stop = (r->stop ==Py_None || PyNumber_AsSsize_t(r->stop, NULL)>= std::numeric_limits<int>::max())
1588
+ ? std::numeric_limits<casadi_int>::max() : PyInt_AsLong(r->stop);
1589
+ if(r->step !=Py_None) (**m).step = PyInt_AsLong(r->step);
1590
+ }
1591
+ return true;
1592
+ }
1593
+ #endif // SWIGPYTHON
1594
+
1595
+ // No match
1596
+ return false;
1597
+ }
1598
+
1599
+ GUESTOBJECT* from_ptr(const Slice *a) {
1600
+ return SWIG_NewPointerObj(new Slice(*a), $descriptor(casadi::Slice *), SWIG_POINTER_OWN);
1601
+ }
1602
+
1603
+ } // namespace casadi
1604
+ }
1605
+
1606
+ %fragment("casadi_map", "header", fragment="casadi_aux") {
1607
+ namespace casadi {
1608
+ template<typename M> bool to_ptr(GUESTOBJECT *p, std::map<std::string, M>** m) {
1609
+ #ifdef SWIGPYTHON
1610
+ if (PyDict_Check(p)) {
1611
+ PyObject *key, *value;
1612
+ Py_ssize_t pos = 0;
1613
+ while (PyDict_Next(p, &pos, &key, &value)) {
1614
+ if (!(PyString_Check(key) || PyUnicode_Check(key))) return false;
1615
+ if (m) {
1616
+ M *v=&(**m)[python_string_to_std_string(key)], *v2=v;
1617
+ if (!casadi::to_ptr(value, &v)) return false;
1618
+ if (v!=v2) *v2=*v; // if only pointer changed
1619
+ } else {
1620
+ if (!casadi::to_ptr(value, static_cast<M**>(0))) return false;
1621
+ }
1622
+ }
1623
+ return true;
1624
+ }
1625
+ #elif defined(SWIGMATLAB)
1626
+ if (mxIsStruct(p) && mxGetM(p)==1 && mxGetN(p)==1) {
1627
+ casadi_int len = mxGetNumberOfFields(p);
1628
+ for (casadi_int k=0; k<len; ++k) {
1629
+ mxArray *value = mxGetFieldByNumber(p, 0, k);
1630
+ if (m) {
1631
+ M *v=&(**m)[std::string(mxGetFieldNameByNumber(p, k))], *v2=v;
1632
+ if (!casadi::to_ptr(value, &v)) return false;
1633
+ if (v!=v2) *v2=*v; // if only pointer changed
1634
+ } else {
1635
+ if (!casadi::to_ptr(value, static_cast<M**>(0))) return false;
1636
+ }
1637
+ }
1638
+ return true;
1639
+ }
1640
+ #endif
1641
+ return false;
1642
+ }
1643
+
1644
+ template<typename M> GUESTOBJECT* from_ptr(const std::map<std::string, M> *a) {
1645
+ #ifdef SWIGPYTHON
1646
+ PyObject *p = PyDict_New();
1647
+ for (typename std::map<std::string, M>::const_iterator it=a->begin(); it!=a->end(); ++it) {
1648
+ PyObject * e = from_ptr(&it->second);
1649
+ if (!e) {
1650
+ Py_DECREF(p);
1651
+ return 0;
1652
+ }
1653
+ PyDict_SetItemString(p, it->first.c_str(), e);
1654
+ Py_DECREF(e);
1655
+ }
1656
+ return p;
1657
+ #elif defined(SWIGMATLAB)
1658
+ // Get vectors of the field names and mxArrays
1659
+ std::vector<const char*> fieldnames;
1660
+ std::vector<mxArray*> fields;
1661
+ for (typename std::map<std::string, M>::const_iterator it=a->begin(); it!=a->end(); ++it) {
1662
+ fieldnames.push_back(it->first.c_str());
1663
+ mxArray* f = from_ptr(&it->second);
1664
+ if (!f) {
1665
+ // Deallocate elements created up to now
1666
+ for (casadi_int k=0; k<fields.size(); ++k) mxDestroyArray(fields[k]);
1667
+ return 0;
1668
+ }
1669
+ fields.push_back(f);
1670
+ }
1671
+
1672
+ // Create return object
1673
+ mxArray *p = mxCreateStructMatrix(1, 1, fields.size(),
1674
+ fieldnames.empty() ? 0 : &fieldnames[0]);
1675
+ for (casadi_int k=0; k<fields.size(); ++k) mxSetFieldByNumber(p, 0, k, fields[k]);
1676
+ return p;
1677
+ #else
1678
+ return 0;
1679
+ #endif
1680
+ }
1681
+ } // namespace casadi
1682
+ }
1683
+
1684
+ %fragment("casadi_pair", "header", fragment="casadi_aux") {
1685
+ namespace casadi {
1686
+ #ifdef SWIGMATLAB
1687
+ bool to_ptr(GUESTOBJECT *p, std::pair<casadi_int, casadi_int>** m) {
1688
+ // (casadi_int,casadi_int) mapped to 2-by-1 double matrix
1689
+ if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2 && !mxIsSparse(p)
1690
+ && mxGetM(p)==1 && mxGetN(p)==2) {
1691
+ double* data = static_cast<double*>(mxGetData(p));
1692
+ casadi_int first = static_cast<casadi_int>(data[0]);
1693
+ casadi_int second = static_cast<casadi_int>(data[1]);
1694
+ if (data[0]==first && data[1]==second) {
1695
+ if (m) **m = std::make_pair(first, second);
1696
+ return true;
1697
+ } else {
1698
+ return false;
1699
+ }
1700
+ }
1701
+
1702
+ // No match
1703
+ return false;
1704
+ }
1705
+ #endif // SWIGMATLAB
1706
+
1707
+ template<typename M1, typename M2> bool to_ptr(GUESTOBJECT *p, std::pair<M1, M2>** m) {
1708
+ #ifdef SWIGPYTHON
1709
+ if (PyTuple_Check(p) && PyTuple_Size(p)==2) {
1710
+ PyObject *p_first = PyTuple_GetItem(p, 0);
1711
+ PyObject *p_second = PyTuple_GetItem(p, 1);
1712
+ return to_val(p_first, m ? &(**m).first : 0)
1713
+ && to_val(p_second, m ? &(**m).second : 0);
1714
+ }
1715
+ #elif defined(SWIGMATLAB)
1716
+ // Other overloads mapped to 2-by-1 cell array
1717
+ if (mxGetClassID(p)==mxCELL_CLASS && mxGetM(p)==1 && mxGetN(p)==2) {
1718
+ mxArray *p_first = mxGetCell(p, 0);
1719
+ mxArray *p_second = mxGetCell(p, 1);
1720
+ return to_val(p_first, m ? &(**m).first : 0)
1721
+ && to_val(p_second, m ? &(**m).second : 0);
1722
+ }
1723
+ #endif
1724
+ // No match
1725
+ return false;
1726
+ }
1727
+
1728
+ #ifdef SWIGMATLAB
1729
+ GUESTOBJECT* from_ptr(const std::pair<casadi_int, casadi_int>* a) {
1730
+ // (casadi_int,casadi_int) mapped to 2-by-1 double matrix
1731
+ mxArray* ret = mxCreateDoubleMatrix(1, 2, mxREAL);
1732
+ double* data = static_cast<double*>(mxGetData(ret));
1733
+ data[0] = a->first;
1734
+ data[1] = a->second;
1735
+ return ret;
1736
+ }
1737
+ #endif // SWIGMATLAB
1738
+
1739
+ template<typename M1, typename M2> GUESTOBJECT* from_ptr(const std::pair<M1, M2>* a) {
1740
+ #ifdef SWIGPYTHON
1741
+ PyObject* ret = PyTuple_New(2);
1742
+ PyTuple_SetItem(ret, 0, from_ref(a->first));
1743
+ PyTuple_SetItem(ret, 1, from_ref(a->second));
1744
+ return ret;
1745
+ #elif defined(SWIGMATLAB)
1746
+ // Other overloads mapped to 2-by-1 cell array
1747
+ mxArray* ret = mxCreateCellMatrix(1, 2);
1748
+ mxSetCell(ret, 0, from_ref(a->first));
1749
+ mxSetCell(ret, 1, from_ref(a->second));
1750
+ return ret;
1751
+ #else
1752
+ return 0;
1753
+ #endif // SWIGPYTHON
1754
+ }
1755
+ } // namespace casadi
1756
+ }
1757
+
1758
+ %fragment("casadi_sx", "header", fragment="casadi_aux") {
1759
+ namespace casadi {
1760
+ bool to_ptr(GUESTOBJECT *p, SX** m) {
1761
+ // Treat Null
1762
+ if (is_null(p)) return false;
1763
+
1764
+ // SX already?
1765
+ if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
1766
+ $descriptor(casadi::Matrix<casadi::SXElem>*), 0))) {
1767
+ return true;
1768
+ }
1769
+
1770
+ // Try first converting to a temporary DM
1771
+ {
1772
+ DM tmp;
1773
+ if(to_val(p, m? &tmp: 0)) {
1774
+ if (m) **m = tmp;
1775
+ return true;
1776
+ }
1777
+ }
1778
+
1779
+ #ifdef SWIGPYTHON
1780
+ // Numpy arrays will be cast to dense SX
1781
+ if (SX_from_array(p, m)) return true;
1782
+ // Object has __SX__ method
1783
+ if (PyObject_HasAttrString(p,"__SX__")) {
1784
+ PyObject *cr = PyObject_CallMethod(p, (char*) "__SX__", 0);
1785
+ if (!cr) return false;
1786
+ casadi_int flag = to_ptr(cr, m);
1787
+ Py_DECREF(cr);
1788
+ return flag;
1789
+ }
1790
+ #endif // SWIGPYTHON
1791
+
1792
+ // No match
1793
+ return false;
1794
+ }
1795
+
1796
+ GUESTOBJECT* from_ptr(const SX *a) {
1797
+ return SWIG_NewPointerObj(new SX(*a), $descriptor(casadi::Matrix<casadi::SXElem> *), SWIG_POINTER_OWN);
1798
+ }
1799
+ } // namespace casadi
1800
+ }
1801
+
1802
+ %fragment("casadi_sxelem", "header", fragment="casadi_aux") {
1803
+ namespace casadi {
1804
+ bool to_ptr(GUESTOBJECT *p, SXElem** m) {
1805
+ // Treat Null
1806
+ if (is_null(p)) return false;
1807
+
1808
+ // Try first converting to a temporary SX
1809
+ {
1810
+ SX tmp, *mt=&tmp;
1811
+ if(casadi::to_ptr(p, m ? &mt : 0)) {
1812
+ if (m && !mt->is_scalar()) return false;
1813
+ if (m) **m = mt->scalar();
1814
+ return true;
1815
+ }
1816
+ }
1817
+
1818
+ // No match
1819
+ return false;
1820
+ }
1821
+
1822
+ GUESTOBJECT* from_ptr(const SXElem *a) {
1823
+ return from_ref(SX(*a));
1824
+ }
1825
+ } // namespace casadi
1826
+ }
1827
+
1828
+ %fragment("casadi_mx", "header", fragment="casadi_decl") {
1829
+ namespace casadi {
1830
+ bool to_ptr(GUESTOBJECT *p, MX** m) {
1831
+ // Treat Null
1832
+ if (is_null(p)) return false;
1833
+
1834
+ // MX already?
1835
+ if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
1836
+ $descriptor(casadi::MX*), 0))) {
1837
+ return true;
1838
+ }
1839
+
1840
+ // Try first converting to a temporary DM
1841
+ {
1842
+ DM tmp;
1843
+ if(to_val(p, m ? &tmp : 0)) {
1844
+ if (m) **m = tmp;
1845
+ return true;
1846
+ }
1847
+ }
1848
+
1849
+ #ifdef SWIGPYTHON
1850
+ if (PyObject_HasAttrString(p,"__MX__")) {
1851
+ PyObject *cr = PyObject_CallMethod(p, (char*) "__MX__", 0);
1852
+ if (!cr) return false;
1853
+ casadi_int flag = to_ptr(cr, m);
1854
+ Py_DECREF(cr);
1855
+ return flag;
1856
+ }
1857
+ #endif // SWIGPYTHON
1858
+
1859
+ // No match
1860
+ return false;
1861
+ }
1862
+
1863
+ GUESTOBJECT* from_ptr(const MX *a) {
1864
+ return SWIG_NewPointerObj(new MX(*a), $descriptor(casadi::MX*), SWIG_POINTER_OWN);
1865
+ }
1866
+ } // namespace casadi
1867
+ }
1868
+
1869
+ %fragment("casadi_dmatrix", "header", fragment="casadi_aux") {
1870
+ namespace casadi {
1871
+ #ifdef SWIGPYTHON
1872
+ /** Check PyObjects by class name */
1873
+ bool PyObjectHasClassName(PyObject* p, const char * name) {
1874
+ PyObject * classo = PyObject_GetAttrString( p, "__class__");
1875
+ PyObject * classname = PyObject_GetAttrString( classo, "__name__");
1876
+
1877
+ bool ret = python_string_to_std_string(classname) == name;
1878
+ Py_DECREF(classo);Py_DECREF(classname);
1879
+ return ret;
1880
+ }
1881
+ #endif // SWIGPYTHON
1882
+
1883
+ bool to_ptr(GUESTOBJECT *p, DM** m) {
1884
+ // Treat Null
1885
+ if (is_null(p)) return false;
1886
+
1887
+ // DM already?
1888
+ if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
1889
+ $descriptor(casadi::Matrix<double>*), 0))) {
1890
+ return true;
1891
+ }
1892
+
1893
+ // Object is a sparsity pattern
1894
+ {
1895
+ Sparsity *m2;
1896
+ if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(&m2),
1897
+ $descriptor(casadi::Sparsity*), 0))) {
1898
+ if (m) **m=DM::ones(*m2);
1899
+ return true;
1900
+ }
1901
+ }
1902
+
1903
+ // Double scalar
1904
+ {
1905
+ double tmp;
1906
+ if (to_val(p, m? &tmp: 0)) {
1907
+ if (m) **m=tmp;
1908
+ return true;
1909
+ }
1910
+ }
1911
+
1912
+ #ifdef SWIGPYTHON
1913
+ // Object has __DM__ method
1914
+ if (PyObject_HasAttrString(p,"__DM__")) {
1915
+ char name[] = "__DM__";
1916
+ PyObject *cr = PyObject_CallMethod(p, name, 0);
1917
+ if (!cr) return false;
1918
+ casadi_int result = to_val(cr, m ? *m : 0);
1919
+ Py_DECREF(cr);
1920
+ return result;
1921
+ }
1922
+
1923
+ if (DM_from_array(p, m)) return true;
1924
+
1925
+ if (DM_from_csc(p,m)) return true;
1926
+
1927
+ {
1928
+ std::vector <double> t;
1929
+ casadi_int res = to_val(p, &t);
1930
+ if (t.size()>0) {
1931
+ if (m) **m = casadi::Matrix<double>(t);
1932
+ } else {
1933
+ if (m) **m = casadi::Matrix<double>(0,0);
1934
+ }
1935
+ return res;
1936
+ }
1937
+ #endif // SWIGPYTHON
1938
+ #ifdef SWIGMATLAB
1939
+ // MATLAB double matrix (sparse or dense)
1940
+ if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2) {
1941
+ if (m) {
1942
+ **m = casadi::DM(get_sparsity(p));
1943
+ double* data = static_cast<double*>(mxGetData(p));
1944
+ casadi_copy(data, (*m)->nnz(), (*m)->ptr());
1945
+ }
1946
+ return true;
1947
+ }
1948
+ #endif // SWIGMATLAB
1949
+
1950
+ // No match
1951
+ return false;
1952
+ }
1953
+
1954
+ GUESTOBJECT* from_ptr(const DM *a) {
1955
+ return SWIG_NewPointerObj(new DM(*a), $descriptor(casadi::Matrix<double>*), SWIG_POINTER_OWN);
1956
+ }
1957
+ } // namespace casadi
1958
+ }
1959
+
1960
+ %fragment("casadi_sparsity", "header", fragment="casadi_aux") {
1961
+ namespace casadi {
1962
+ bool to_ptr(GUESTOBJECT *p, Sparsity** m) {
1963
+ // Treat Null
1964
+ if (is_null(p)) return false;
1965
+
1966
+ // Sparsity already?
1967
+ if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
1968
+ $descriptor(casadi::Sparsity*), 0))) {
1969
+ return true;
1970
+ }
1971
+
1972
+ // No match
1973
+ return false;
1974
+ }
1975
+
1976
+ GUESTOBJECT* from_ptr(const Sparsity *a) {
1977
+ return SWIG_NewPointerObj(new Sparsity(*a), $descriptor(casadi::Sparsity*), SWIG_POINTER_OWN);
1978
+ }
1979
+ } // namespace casadi
1980
+ }
1981
+
1982
+ %fragment("casadi_imatrix", "header", fragment="casadi_aux", fragment=SWIG_AsVal_frag(int)) {
1983
+ namespace casadi {
1984
+ bool to_ptr(GUESTOBJECT *p, IM** m) {
1985
+ // Treat Null
1986
+ if (is_null(p)) return false;
1987
+
1988
+ // Object is a sparsity pattern
1989
+ {
1990
+ Sparsity *m2;
1991
+ if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(&m2),
1992
+ $descriptor(casadi::Sparsity*), 0))) {
1993
+ if (m) **m=IM::ones(*m2);
1994
+ return true;
1995
+ }
1996
+ }
1997
+
1998
+ // First convert to integer
1999
+ {
2000
+ casadi_int tmp;
2001
+ if (to_val(p, m? &tmp: 0)) {
2002
+ if (m) **m=tmp;
2003
+ return true;
2004
+ }
2005
+ }
2006
+
2007
+ #ifdef SWIGPYTHON
2008
+ // Numpy arrays will be cast to dense Matrix<casadi_int>
2009
+ if (IM_from_array(p, m)) return true;
2010
+
2011
+ if (PyObject_HasAttrString(p,"__IM__")) {
2012
+ PyObject *cr = PyObject_CallMethod(p, (char*) "__IM__", 0);
2013
+ if (!cr) return false;
2014
+ casadi_int result = to_val(cr, m ? *m : 0);
2015
+ Py_DECREF(cr);
2016
+ return result;
2017
+ }
2018
+
2019
+ {
2020
+ std::vector <casadi_int> t;
2021
+ if (to_val(p, &t)) {
2022
+ if (m) **m = casadi::Matrix<casadi_int>(t);
2023
+ return true;
2024
+ }
2025
+ }
2026
+ #endif // SWIGPYTHON
2027
+
2028
+ #ifdef SWIGMATLAB
2029
+ // In MATLAB, it is common to use floating point values to represent integers
2030
+ if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2) {
2031
+ double* data = static_cast<double*>(mxGetData(p));
2032
+
2033
+ // Check if all integers
2034
+ bool all_integers=true;
2035
+ size_t sz = getNNZ(p);
2036
+ for (size_t i=0; i<sz; ++i) {
2037
+ if (data[i] != casadi_int(data[i])) {
2038
+ all_integers = false;
2039
+ break;
2040
+ }
2041
+ }
2042
+
2043
+ // If successful
2044
+ if (all_integers) {
2045
+ if (m) {
2046
+ **m = casadi::IM(get_sparsity(p));
2047
+ for (size_t i=0; i<sz; ++i) {
2048
+ (**m)->at(i) = casadi_int(data[i]);
2049
+ }
2050
+ }
2051
+ return true;
2052
+ }
2053
+ }
2054
+ #endif // SWIGMATLAB
2055
+
2056
+ // Convert from DM
2057
+ {
2058
+ DM tmp;
2059
+ if (to_val(p, m? &tmp: 0)) {
2060
+ // Check integrality
2061
+ for (double d : tmp.nonzeros()) {
2062
+ if (d!=casadi_int(d)) return false;
2063
+ }
2064
+ // Convert
2065
+ if (m) {
2066
+ **m = casadi::Matrix<double>(tmp);
2067
+ }
2068
+ return true;
2069
+ }
2070
+ }
2071
+
2072
+ // No match
2073
+ return false;
2074
+ }
2075
+ GUESTOBJECT* from_ptr(const IM *a) {
2076
+ DM tmp(*a);
2077
+ return from_ref(tmp);
2078
+ }
2079
+
2080
+ } // namespace casadi
2081
+ }
2082
+
2083
+ // Can be overloaded by specifying before importing casadi.i
2084
+ %fragment("casadi_extra", "header") {}
2085
+
2086
+ // Collect all fragments
2087
+ %fragment("casadi_all", "header", fragment="casadi_aux,casadi_extra,casadi_bool,casadi_int,casadi_double,casadi_vector,casadi_vectorvector,casadi_function,casadi_generictype,casadi_string,casadi_slice,casadi_map,casadi_pair,casadi_sx,casadi_sxelem,casadi_mx,casadi_dmatrix,casadi_sparsity,casadi_imatrix") { }
2088
+
2089
+ #endif // SWIGXML
2090
+
2091
+ // Define all input typemaps
2092
+ %define %casadi_input_typemaps(xName, xPrec, xType...)
2093
+ // Pass input by value, check if matches
2094
+ %typemap(typecheck, noblock=1, precedence=xPrec, fragment="casadi_all") xType {
2095
+ $1 = casadi::to_ptr($input, static_cast< xType **>(0));
2096
+ }
2097
+
2098
+ // Directorout typemap; as input by value
2099
+ %typemap(directorout, noblock=1, fragment="casadi_all") xType {
2100
+ if (!casadi::to_val($input, &$result)) {
2101
+ %dirout_fail(SWIG_TypeError,"$type");
2102
+ }
2103
+ }
2104
+
2105
+ // Pass input by value, convert argument
2106
+ %typemap(in, doc=xName, noblock=1, fragment="casadi_all") xType {
2107
+ if (!casadi::to_val($input, &$1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input $argnum to type '" xName "'.");
2108
+ }
2109
+
2110
+ // Pass input by value, cleanup
2111
+ %typemap(freearg, noblock=1) xType {}
2112
+
2113
+ // Pass input by reference, check if matches
2114
+ %typemap(typecheck, noblock=1, precedence=xPrec, fragment="casadi_all") const xType& {
2115
+ $1 = casadi::to_ptr($input, static_cast< xType **>(0));
2116
+ }
2117
+
2118
+ // Pass input by reference, convert argument
2119
+ %typemap(in, doc=xName, noblock=1, fragment="casadi_all") const xType & (xType m) {
2120
+ $1 = &m;
2121
+ if (!casadi::to_ptr($input, &$1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input $argnum to type '" xName "'.");
2122
+ }
2123
+
2124
+ // Pass input by reference, cleanup
2125
+ %typemap(freearg, noblock=1) const xType & {}
2126
+
2127
+ %enddef
2128
+
2129
+ // Define all output typemaps
2130
+ %define %casadi_output_typemaps(xName, xType...)
2131
+
2132
+ // Return-by-value
2133
+ %typemap(out, doc=xName, noblock=1, fragment="casadi_all") xType, const xType {
2134
+ if(!($result = casadi::from_ref($1))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" xName "'.");
2135
+ }
2136
+
2137
+ // Return a const-ref behaves like return-by-value
2138
+ %typemap(out, doc=xName, noblock=1, fragment="casadi_all") const xType& {
2139
+ if(!($result = casadi::from_ptr($1))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" xName "'.");
2140
+ }
2141
+
2142
+ // Inputs marked OUTPUT are also returned by the function, ...
2143
+ %typemap(argout, noblock=1,fragment="casadi_all") xType &OUTPUT {
2144
+ %append_output(casadi::from_ptr($1));
2145
+ }
2146
+
2147
+ // ... and the corresponding inputs are ignored
2148
+ %typemap(in, doc=xName, noblock=1, numinputs=0) xType &OUTPUT (xType m) {
2149
+ $1 = &m;
2150
+ }
2151
+
2152
+ // Directorin typemap; as output
2153
+ %typemap(directorin, noblock=1, fragment="casadi_all") xType, const xType {
2154
+ if(!($input = casadi::from_ref($1))) %dirout_fail(SWIG_TypeError,"For director inputs, failed to convert input to " xName ".");
2155
+ }
2156
+
2157
+ // Directorin typemap; as output
2158
+ %typemap(directorin, noblock=1, fragment="casadi_all") const xType& {
2159
+ if(!($input = casadi::from_ptr(&$1))) %dirout_fail(SWIG_TypeError,"For director inputs, failed to convert input to " xName ".");
2160
+ }
2161
+
2162
+ // Enable dynamic dispatch
2163
+ %typemap(typecheck, noblock=1, fragment="casadi_all") xType &OUTPUT {
2164
+ $1 = casadi::to_ptr($input, static_cast< xType **>(0));
2165
+ }
2166
+
2167
+ // Alternative names
2168
+ %apply xType &OUTPUT {xType &OUTPUT1};
2169
+ %apply xType &OUTPUT {xType &OUTPUT2};
2170
+ %apply xType &OUTPUT {xType &OUTPUT3};
2171
+ %apply xType &OUTPUT {xType &OUTPUT4};
2172
+ %apply xType &OUTPUT {xType &OUTPUT5};
2173
+ %apply xType &OUTPUT {xType &OUTPUT6};
2174
+
2175
+ // Inputs marked INOUT are also returned by the function, ...
2176
+ %typemap(argout,noblock=1,fragment="casadi_all") xType &INOUT {
2177
+ %append_output(casadi::from_ptr($1));
2178
+ }
2179
+
2180
+ // ... but kept as inputs
2181
+ %typemap(in, doc=xName, noblock=1, fragment="casadi_all") xType &INOUT (xType m) {
2182
+ $1 = &m;
2183
+ if (!casadi::to_ptr($input, &$1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input to type '" xName "'.");
2184
+ }
2185
+
2186
+ // ... also for dynamic dispatch
2187
+ %typemap(typecheck, noblock=1, fragment="casadi_all") xType& INOUT {
2188
+ $1 = casadi::to_ptr($input, static_cast< xType **>(0));
2189
+ }
2190
+
2191
+ // No arguments need to be freed
2192
+ %typemap(freearg, noblock=1) xType& INOUT {}
2193
+
2194
+ // Alternative names
2195
+ %apply xType &INOUT {xType &INOUT1};
2196
+ %apply xType &INOUT {xType &INOUT2};
2197
+ %apply xType &INOUT {xType &INOUT3};
2198
+ %apply xType &INOUT {xType &INOUT4};
2199
+ %apply xType &INOUT {xType &INOUT5};
2200
+ %apply xType &INOUT {xType &INOUT6};
2201
+
2202
+ %enddef
2203
+
2204
+ // Define all typemaps for a template instantiation without proxy classes
2205
+ %define %casadi_template(xName, xPrec, xType...)
2206
+ %template() xType;
2207
+ %casadi_input_typemaps(xName, xPrec, xType)
2208
+ %casadi_output_typemaps(xName, %arg(xType))
2209
+ %enddef
2210
+
2211
+ // Define all input and ouput typemaps
2212
+ %define %casadi_typemaps(xName, xPrec, xType...)
2213
+ %casadi_input_typemaps(xName, xPrec, xType)
2214
+ %casadi_output_typemaps(xName, xType)
2215
+ %enddef
2216
+
2217
+ // Order in typemap matching: Lower value means will be checked first
2218
+
2219
+ %define PREC_DICT 21 %enddef
2220
+ %define PREC_SPARSITY 90 %enddef
2221
+ %define PREC_IVector 92 %enddef
2222
+ %define PREC_IVectorVector 92 %enddef
2223
+ %define PREC_VECTOR 92 %enddef
2224
+ %define PREC_PAIR_SLICE_SLICE 93 %enddef
2225
+ %define PREC_SLICE 94 %enddef
2226
+ %define PREC_PAIR_IVector_IVector 96 %enddef
2227
+ %define PREC_IM 97 %enddef
2228
+ %define PREC_DVector 99 %enddef
2229
+ %define PREC_DM 100 %enddef
2230
+ %define PREC_DMVector 101 %enddef
2231
+ %define PREC_DMVectorVector 101 %enddef
2232
+ %define PREC_SX 103 %enddef
2233
+ %define PREC_SXVector 103 %enddef
2234
+ %define PREC_SXVectorVector 103 %enddef
2235
+ %define PREC_MX 104 %enddef
2236
+ %define PREC_MXVector 105 %enddef
2237
+ %define PREC_MXVectorVector 106 %enddef
2238
+ %define PREC_CREATOR 150 %enddef
2239
+ %define PREC_STRING 180 %enddef
2240
+ %define PREC_FUNCTION 200 %enddef
2241
+ %define PREC_GENERICTYPE 201 %enddef
2242
+
2243
+ #ifndef SWIGXML
2244
+
2245
+ // std::ostream & is redirected to casadi::uout()
2246
+ %typemap(in, noblock=1, numinputs=0) std::ostream &stream {
2247
+ $1 = &casadi::uout();
2248
+ }
2249
+
2250
+ // Add trailing newline in MATLAB and Octave
2251
+ #if defined(SWIGMATLAB) || defined(SWIGOCTAVE)
2252
+ %typemap(argout, noblock=1) std::ostream &stream {
2253
+ *$1 << "\n" << std::flush;
2254
+ }
2255
+ #endif
2256
+
2257
+ #define L_INT "int"
2258
+ #define L_BOOL "bool"
2259
+ #define LPAIR(A,B) "(" A "," B ")"
2260
+
2261
+ #if defined(SWIGMATLAB) || defined(SWIGOCTAVE)
2262
+ #define L_DOUBLE "double"
2263
+ #define L_DICT "struct"
2264
+ #define LDICT(ARG) L_DICT ":" ARG
2265
+ #define LL "{"
2266
+ #define LR "}"
2267
+ #define L_STR "char"
2268
+ #define MATLABSTYLE
2269
+ #else
2270
+ #define LL "["
2271
+ #define LR "]"
2272
+ #define L_DICT "dict"
2273
+ #define L_DOUBLE "float"
2274
+ #define LDICT(ARG) L_DICT ":" ARG
2275
+ #define L_STR "str"
2276
+ #endif
2277
+
2278
+ #ifdef SWIGPYTHON
2279
+ %typemap(in, doc="memoryview(ro)", noblock=1, fragment="casadi_all") (const double * a, casadi_int size) (Py_buffer* buffer) {
2280
+ if (!PyMemoryView_Check($input)) SWIG_exception_fail(SWIG_TypeError, "Must supply a MemoryView.");
2281
+ buffer = PyMemoryView_GET_BUFFER($input);
2282
+ $1 = static_cast<double*>(buffer->buf); // const double cast comes later
2283
+ $2 = buffer->len;
2284
+ }
2285
+
2286
+ %typemap(in, doc="memoryview(rw)", noblock=1, fragment="casadi_all") (double * a, casadi_int size) (Py_buffer* buffer) {
2287
+ if (!PyMemoryView_Check($input)) SWIG_exception_fail(SWIG_TypeError, "Must supply a writable MemoryView.");
2288
+ buffer = PyMemoryView_GET_BUFFER($input);
2289
+ if (buffer->readonly) SWIG_exception_fail(SWIG_TypeError, "Must supply a writable MemoryView.");
2290
+ $1 = static_cast<double*>(buffer->buf);
2291
+ $2 = buffer->len;
2292
+ }
2293
+
2294
+ // Directorin typemap; as output
2295
+ %typemap(directorin, noblock=1, fragment="casadi_all") (const double** arg, const std::vector<casadi_int>& sizes_arg) (PyObject* my_tuple) {
2296
+ PyObject * arg_tuple = PyTuple_New($2.size());
2297
+ for (casadi_int i=0;i<$2.size();++i) {
2298
+
2299
+ #ifdef WITH_PYTHON3
2300
+ PyObject* buf = $1[i] ? PyMemoryView_FromMemory(reinterpret_cast<char*>(const_cast<double*>($1[i])), $2[i]*sizeof(double), PyBUF_READ) : SWIG_Py_Void();
2301
+ #else
2302
+ PyObject* buf = $1[i] ? PyBuffer_FromMemory(const_cast<double*>($1[i]), $2[i]*sizeof(double)) : SWIG_Py_Void();
2303
+ #endif
2304
+ PyTuple_SET_ITEM(arg_tuple, i, buf);
2305
+ }
2306
+ $input = arg_tuple;
2307
+ }
2308
+
2309
+ %typemap(directorin, noblock=1, fragment="casadi_all") (double** res, const std::vector<casadi_int>& sizes_res) {
2310
+ PyObject* res_tuple = PyTuple_New($2.size());
2311
+ for (casadi_int i=0;i<$2.size();++i) {
2312
+ #ifdef WITH_PYTHON3
2313
+ PyObject* buf = $1[i] ? PyMemoryView_FromMemory(reinterpret_cast<char*>(const_cast<double*>($1[i])), $2[i]*sizeof(double), PyBUF_WRITE) : SWIG_Py_Void();
2314
+ #else
2315
+ PyObject* buf = $1[i] ? PyBuffer_FromReadWriteMemory($1[i], $2[i]*sizeof(double)) : SWIG_Py_Void();
2316
+ #endif
2317
+ PyTuple_SET_ITEM(res_tuple, i, buf);
2318
+ }
2319
+ $input = res_tuple;
2320
+ }
2321
+
2322
+ %typemap(in, doc="void*", noblock=1, fragment="casadi_all") void* raw {
2323
+ $1 = PyCapsule_GetPointer($input, NULL);
2324
+ }
2325
+
2326
+ %typemap(out, doc="void*", noblock=1, fragment="casadi_all") void* {
2327
+ $result = PyCapsule_New($1, NULL,NULL);
2328
+ }
2329
+ #endif
2330
+
2331
+ %casadi_typemaps(L_STR, PREC_STRING, std::string)
2332
+ %casadi_template(LL L_STR LR, PREC_VECTOR, std::vector<std::string>)
2333
+ %casadi_template(LL LL L_STR LR LR, PREC_VECTOR, std::vector<std::vector<std::string> >)
2334
+ %casadi_typemaps("Sparsity", PREC_SPARSITY, casadi::Sparsity)
2335
+ %casadi_template(LL "Sparsity" LR, PREC_SPARSITY, std::vector< casadi::Sparsity>)
2336
+ %casadi_template(LL LL "Sparsity" LR LR, PREC_SPARSITY, std::vector<std::vector< casadi::Sparsity> >)
2337
+ %casadi_template(LDICT("Sparsity"), PREC_SPARSITY, std::map<std::string, casadi::Sparsity >)
2338
+ %casadi_template(LDICT(LL "Sparsity" LR), PREC_SPARSITY, std::map<std::string, std::vector<casadi::Sparsity > >)
2339
+ %casadi_template(LPAIR(LDICT("Sparsity"),"[" L_STR "]"), PREC_SPARSITY, std::pair<std::map<std::string, casadi::Sparsity >, std::vector<std::string> >)
2340
+ %casadi_typemaps(L_BOOL, SWIG_TYPECHECK_BOOL, bool)
2341
+ %casadi_template("[" L_BOOL "]", SWIG_TYPECHECK_BOOL, std::vector<bool>)
2342
+ %casadi_template("[[" L_BOOL "]]", SWIG_TYPECHECK_BOOL, std::vector<std::vector<bool> >)
2343
+ %casadi_typemaps( L_INT , SWIG_TYPECHECK_INTEGER, casadi_int)
2344
+
2345
+ #ifdef MATLABSTYLE
2346
+ #define LABEL "[int,int]"
2347
+ #else
2348
+ #define LABEL LPAIR("int","int")
2349
+ #endif
2350
+ %casadi_template(LABEL, SWIG_TYPECHECK_INTEGER, std::pair<casadi_int,casadi_int>)
2351
+ #undef LABEL
2352
+ %casadi_template("[" L_INT "]", PREC_IVector, std::vector<casadi_int>)
2353
+ %casadi_template(LL "[" L_INT "]" LR, PREC_IVectorVector, std::vector<std::vector<casadi_int> >)
2354
+ %casadi_typemaps(L_DOUBLE, SWIG_TYPECHECK_DOUBLE, double)
2355
+ %casadi_template("[" L_DOUBLE "]", SWIG_TYPECHECK_DOUBLE, std::vector<double>)
2356
+ %casadi_template(LL "[" L_DOUBLE "]" LR, SWIG_TYPECHECK_DOUBLE, std::vector<std::vector<double> >)
2357
+ %casadi_typemaps("SXElem", PREC_SX, casadi::SXElem)
2358
+ %casadi_template(LL "SXElem" LR, PREC_SXVector, std::vector<casadi::SXElem>)
2359
+ %casadi_typemaps("SX", PREC_SX, casadi::Matrix<casadi::SXElem>)
2360
+ %casadi_template(LL "SX" LR, PREC_SXVector, std::vector< casadi::Matrix<casadi::SXElem> >)
2361
+ %casadi_template(LL LL "SX" LR LR, PREC_SXVectorVector, std::vector<std::vector< casadi::Matrix<casadi::SXElem> > >)
2362
+ %casadi_template(LDICT("SX"), PREC_SX, std::map<std::string, casadi::Matrix<casadi::SXElem> >)
2363
+ %casadi_typemaps("MX", PREC_MX, casadi::MX)
2364
+ %casadi_template(LL "MX" LR, PREC_MXVector, std::vector<casadi::MX>)
2365
+ %casadi_template(LL LL "MX" LR LR, PREC_MXVectorVector, std::vector<std::vector<casadi::MX> >)
2366
+ %casadi_template(LDICT("MX"), PREC_MX, std::map<std::string, casadi::MX>)
2367
+ %casadi_template(LPAIR("MX","MX"), PREC_MXVector, std::pair<casadi::MX, casadi::MX>)
2368
+ %casadi_typemaps("DM", PREC_DM, casadi::Matrix<double>)
2369
+ %casadi_template(LL "DM" LR, PREC_DMVector, std::vector< casadi::Matrix<double> >)
2370
+ %casadi_template(LL LL "DM" LR LR, PREC_DMVectorVector, std::vector<std::vector< casadi::Matrix<double> > >)
2371
+ %casadi_template(LDICT("DM"), PREC_DM, std::map<std::string, casadi::Matrix<double> >)
2372
+ %casadi_typemaps("IM", PREC_IM, casadi::Matrix<casadi_int>)
2373
+ // Without CASADI_INT_TYPE, you get SwigValueWrapper
2374
+ // With it, docstrings are screwed
2375
+ %casadi_typemaps("GenericType", PREC_GENERICTYPE, casadi::GenericType)
2376
+ %casadi_template(LL "GenericType" LR, PREC_GENERICTYPE, std::vector<casadi::GenericType>)
2377
+ %casadi_typemaps("Slice", PREC_SLICE, casadi::Slice)
2378
+ %casadi_typemaps("Function", PREC_FUNCTION, casadi::Function)
2379
+ %casadi_template(LL "Function" LR, PREC_FUNCTION, std::vector<casadi::Function>)
2380
+ %casadi_template(LPAIR("Function","Function"), PREC_FUNCTION, std::pair<casadi::Function, casadi::Function>)
2381
+ %casadi_template(L_DICT, PREC_DICT, std::map<std::string, casadi::GenericType>)
2382
+ %casadi_template(LDICT(LL L_STR LR), PREC_DICT, std::map<std::string, std::vector<std::string> >)
2383
+
2384
+ #undef L_INT
2385
+ #undef L_BOOL
2386
+ #undef LPAIR
2387
+ #undef L_DOUBLE
2388
+ #undef L_DICT
2389
+ #undef LL
2390
+ #undef LR
2391
+ #undef L_STR
2392
+ #undef MATLABSTYLE
2393
+
2394
+ // Matlab is index-1 based
2395
+ #ifdef SWIGMATLAB
2396
+ %typemap(in, doc="index", noblock=1) casadi_index {
2397
+ if (!casadi::to_val($input, &$1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input $argnum to type ' index '.");
2398
+ if ($1==0) SWIG_exception_fail(SWIG_TypeError,"Index starts at 1, got index '0'.");
2399
+ if ($1>=1) $1--;
2400
+ }
2401
+ #endif
2402
+
2403
+ #endif // SWIGXML
2404
+
2405
+ #ifdef SWIGPYTHON
2406
+ %pythoncode %{
2407
+ if __name__ != "casadi.casadi":
2408
+ raise Exception("""
2409
+ CasADi is not running from its package context.
2410
+
2411
+ You probably specified the wrong casadi directory.
2412
+
2413
+ When setting PYTHONPATH or sys.path.append,
2414
+ take care not to add a trailing '/casadi'.
2415
+
2416
+ """)
2417
+
2418
+ def swigtypeconvertor(*args):
2419
+ return swig_typename_convertor_python2cpp(args)
2420
+
2421
+ def swig_typename_convertor_python2cpp(a):
2422
+ try:
2423
+ import numpy as np
2424
+ except:
2425
+ class NoExist:
2426
+ pass
2427
+ class Temp(object):
2428
+ ndarray = NoExist
2429
+ np = Temp()
2430
+ if isinstance(a,list):
2431
+ if len(a)>0:
2432
+ return "[%s]" % "|".join(set([swig_typename_convertor_python2cpp(i) for i in a]))
2433
+ else:
2434
+ return "[]"
2435
+ elif isinstance(a,tuple):
2436
+ return "(%s)" % ",".join([swig_typename_convertor_python2cpp(i) for i in a])
2437
+ elif isinstance(a,np.ndarray):
2438
+ return "np.array(%s)" % ",".join(set([swig_typename_convertor_python2cpp(i) for i in np.array(a).flatten().tolist()]))
2439
+ elif isinstance(a,dict):
2440
+ if len(a)>0:
2441
+ return "|".join(set([swig_typename_convertor_python2cpp(i) for i in a.keys()])) +":"+ "|".join(set([swig_typename_convertor_python2cpp(i) for i in a.values()]))
2442
+ else:
2443
+ return "dict"
2444
+ return type(a).__name__
2445
+ %}
2446
+ #endif // SWIGPYTHON
2447
+
2448
+ // Init hooks
2449
+ #ifdef SWIGPYTHON
2450
+ #ifdef WITH_PYTHON_INTERRUPTS
2451
+ %{
2452
+ #include <pythonrun.h>
2453
+ void SigIntHandler(casadi_int) {
2454
+ std::cerr << "Keyboard Interrupt" << std::endl;
2455
+ signal(SIGINT, SIG_DFL);
2456
+ kill(getpid(), SIGINT);
2457
+ }
2458
+ %}
2459
+
2460
+ %init %{
2461
+ PyOS_setsig(SIGINT, SigIntHandler);
2462
+ %}
2463
+ #endif // WITH_PYTHON_INTERRUPTS
2464
+
2465
+ %pythoncode%{
2466
+ try:
2467
+ from numpy import pi, inf
2468
+ except:
2469
+ pass
2470
+
2471
+ arcsin = lambda x: _casadi.asin(x)
2472
+ arccos = lambda x: _casadi.acos(x)
2473
+ arctan = lambda x: _casadi.atan(x)
2474
+ arctan2 = lambda x,y: _casadi.atan2(x, y)
2475
+ arctanh = lambda x: _casadi.atanh(x)
2476
+ arcsinh = lambda x: _casadi.asinh(x)
2477
+ arccosh = lambda x: _casadi.acosh(x)
2478
+ %}
2479
+ #endif // SWIGPYTHON
2480
+
2481
+ // Strip leading casadi_ unless followed by ML/int
2482
+ %rename("%(regex:/casadi_(?!ML|int\\b)(.*)/\\1/)s") "";
2483
+ %rename(casadi_int) "casadi_int";
2484
+
2485
+ %rename(row) get_row;
2486
+ %rename(colind) get_colind;
2487
+ %rename(sparsity) get_sparsity;
2488
+ %rename(nonzeros) get_nonzeros;
2489
+ %rename(elements) get_elements;
2490
+
2491
+ // Explicit conversion to double and casadi_int
2492
+ #ifdef SWIGPYTHON
2493
+ %rename(__float__) operator double;
2494
+ %rename(__int__) operator casadi_int;
2495
+ #else
2496
+ %rename(to_double) operator double;
2497
+ %rename(to_int) operator casadi_int;
2498
+ #endif
2499
+ %rename(to_DM) operator Matrix<double>;
2500
+
2501
+ #ifdef SWIGPYTHON
2502
+ %ignore T;
2503
+
2504
+ %rename(logic_and) casadi_and;
2505
+ %rename(logic_or) casadi_or;
2506
+ %rename(logic_not) casadi_not;
2507
+ %rename(logic_all) casadi_all;
2508
+ %rename(logic_any) casadi_any;
2509
+ %rename(fabs) casadi_abs;
2510
+
2511
+ // Concatenations
2512
+ %rename(_veccat) casadi_veccat;
2513
+ %rename(_vertcat) casadi_vertcat;
2514
+ %rename(_horzcat) casadi_horzcat;
2515
+ %rename(_diagcat) casadi_diagcat;
2516
+ %pythoncode %{
2517
+ def veccat(*args):
2518
+ try:
2519
+ if len(args)==0:
2520
+ return DM(0,1)
2521
+ except:
2522
+ pass
2523
+ return _veccat(args)
2524
+ def vertcat(*args):
2525
+ try:
2526
+ if len(args)==0:
2527
+ return DM(0,1)
2528
+ except:
2529
+ pass
2530
+ return _vertcat(args)
2531
+ def horzcat(*args):
2532
+ try:
2533
+ if len(args)==0:
2534
+ return DM(1,0)
2535
+ except:
2536
+ pass
2537
+ return _horzcat(args)
2538
+ def diagcat(*args):
2539
+ try:
2540
+ if len(args)==0:
2541
+ return DM(0,0)
2542
+ except:
2543
+ pass
2544
+ return _diagcat(args)
2545
+ def vvcat(args):
2546
+ try:
2547
+ if len(args)==0:
2548
+ return DM(0,1)
2549
+ except:
2550
+ pass
2551
+ return _veccat(args)
2552
+ def vcat(args):
2553
+ try:
2554
+ if len(args)==0:
2555
+ return DM(0,1)
2556
+ except:
2557
+ pass
2558
+ return _vertcat(args)
2559
+ def hcat(args):
2560
+ try:
2561
+ if len(args)==0:
2562
+ return DM(1,0)
2563
+ except:
2564
+ pass
2565
+ return _horzcat(args)
2566
+ def dcat(args):
2567
+ try:
2568
+ if len(args)==0:
2569
+ return DM(0,0)
2570
+ except:
2571
+ pass
2572
+ return _diagcat(args)
2573
+ %}
2574
+
2575
+ // Non-fatal errors (returning NotImplemented singleton)
2576
+ %feature("python:maybecall") casadi_plus;
2577
+ %feature("python:maybecall") casadi_minus;
2578
+ %feature("python:maybecall") casadi_times;
2579
+ %feature("python:maybecall") casadi_rdivide;
2580
+ %feature("python:maybecall") casadi_lt;
2581
+ %feature("python:maybecall") casadi_le;
2582
+ %feature("python:maybecall") casadi_eq;
2583
+ %feature("python:maybecall") casadi_ne;
2584
+ %feature("python:maybecall") casadi_power;
2585
+ %feature("python:maybecall") casadi_atan2;
2586
+ %feature("python:maybecall") casadi_min;
2587
+ %feature("python:maybecall") casadi_max;
2588
+ %feature("python:maybecall") casadi_and;
2589
+ %feature("python:maybecall") casadi_or;
2590
+ %feature("python:maybecall") casadi_mod;
2591
+ %feature("python:maybecall") casadi_copysign;
2592
+ %feature("python:maybecall") casadi_constpow;
2593
+ #endif // SWIGPYTHON
2594
+
2595
+ #ifdef SWIGMATLAB
2596
+ %rename(uminus) operator-;
2597
+ %rename(uplus) operator+;
2598
+ %feature("varargin","1") casadi_vertcat;
2599
+ %feature("varargin","1") casadi_horzcat;
2600
+ %feature("varargin","1") casadi_diagcat;
2601
+ %feature("varargin","1") casadi_veccat;
2602
+ %feature("optionalunpack","1") size;
2603
+
2604
+ // Raise an error if "this" not correct
2605
+ %typemap(check, noblock=1) SWIGTYPE *self %{
2606
+ if (!$1) {
2607
+ SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
2608
+ SWIG_fail;
2609
+ }
2610
+ %}
2611
+
2612
+ // Workarounds, pending proper fix
2613
+ %rename(nonzero) __nonzero__;
2614
+ %rename(hash) __hash__;
2615
+
2616
+ %rename(rem) casadi_mod;
2617
+ #endif // SWIGMATLAB
2618
+
2619
+ #ifdef SWIGPYTHON
2620
+ %ignore casadi_mod;
2621
+ #endif // SWIGPYTHON
2622
+
2623
+ #ifdef WITH_PYTHON3
2624
+ %rename(__bool__) __nonzero__;
2625
+ #endif
2626
+
2627
+ #ifdef SWIGPYTHON
2628
+
2629
+ %pythoncode %{
2630
+ class NZproxy:
2631
+ def __init__(self,matrix):
2632
+ self.matrix = matrix
2633
+
2634
+ def __getitem__(self,s):
2635
+ return self.matrix.get_nz(False, s)
2636
+
2637
+ def __setitem__(self,s,val):
2638
+ return self.matrix.set_nz(val, False, s)
2639
+
2640
+ def __len__(self):
2641
+ return self.matrix.nnz()
2642
+
2643
+ def __iter__(self):
2644
+ for i in range(len(self)):
2645
+ yield self[i]
2646
+
2647
+ %}
2648
+
2649
+ %define %matrix_helpers(Type)
2650
+ %pythoncode %{
2651
+ @property
2652
+ def shape(self):
2653
+ return (self.size1(),self.size2())
2654
+
2655
+ def reshape(self,arg):
2656
+ return _casadi.reshape(self,arg)
2657
+
2658
+ @property
2659
+ def T(self):
2660
+ return _casadi.transpose(self)
2661
+
2662
+ def __getitem__(self, s):
2663
+ if isinstance(s, tuple) and len(s)==2:
2664
+ if s[1] is None: raise TypeError("Cannot slice with None")
2665
+ return self.get(False, s[0], s[1])
2666
+ return self.get(False, s)
2667
+
2668
+ def __iter__(self):
2669
+ raise Exception("""CasADi matrices are not iterable by design.
2670
+ Did you mean to iterate over m.nz, with m IM/DM/SX?
2671
+ Did you mean to iterate over horzsplit(m,1)/vertsplit(m,1) with m IM/DM/SX/MX?
2672
+ """)
2673
+
2674
+ def __setitem__(self,s,val):
2675
+ if isinstance(s,tuple) and len(s)==2:
2676
+ return self.set(val, False, s[0], s[1])
2677
+ return self.set(val, False, s)
2678
+
2679
+ @property
2680
+ def nz(self):
2681
+ return NZproxy(self)
2682
+
2683
+ %}
2684
+ %enddef
2685
+
2686
+ %define %python_array_wrappers(arraypriority)
2687
+ %pythoncode %{
2688
+
2689
+ __array_priority__ = arraypriority
2690
+
2691
+ def __array_wrap__(self,out_arr,context=None):
2692
+ if context is None:
2693
+ return out_arr
2694
+ name = context[0].__name__
2695
+ args = list(context[1])
2696
+
2697
+ if len(context[1])==3:
2698
+ raise Exception("Error with %s. Looks like you are using an assignment operator, such as 'a+=b' where 'a' is a numpy type. This is not supported, and cannot be supported without changing numpy." % name)
2699
+
2700
+ if "vectorized" in name:
2701
+ name = name[:-len(" (vectorized)")]
2702
+
2703
+ conversion = {"multiply": "mul", "divide": "div", "true_divide": "div", "subtract":"sub","power":"pow","greater_equal":"ge","less_equal": "le", "less": "lt", "greater": "gt", "equal": "eq", "not_equal": "ne"}
2704
+ if name in conversion:
2705
+ name = conversion[name]
2706
+ if len(context[1])==2 and context[1][1] is self and not(context[1][0] is self):
2707
+ name = 'r' + name
2708
+ args.reverse()
2709
+ if not(hasattr(self,name)) or ('mul' in name):
2710
+ name = '__' + name + '__'
2711
+ fun=getattr(self, name)
2712
+ return fun(*args[1:])
2713
+
2714
+ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
2715
+ conversion = {"multiply": "mul", "divide": "div", "true_divide": "div", "subtract":"sub","power":"pow","greater_equal":"ge","less_equal": "le", "less": "lt", "greater": "gt", "equal": "eq", "not_equal": "ne"}
2716
+ name = ufunc.__name__
2717
+ inputs = list(inputs)
2718
+ if len(inputs)==3:
2719
+ import warnings
2720
+ warnings.warn("Error with %s. Looks like you are using an assignment operator, such as 'a+=b' where 'a' is a numpy type. This is not supported, and cannot be supported without changing numpy." % name, RuntimeWarning)
2721
+ return NotImplemented
2722
+ if "vectorized" in name:
2723
+ name = name[:-len(" (vectorized)")]
2724
+ if name in conversion:
2725
+ name = conversion[name]
2726
+ if len(inputs)==2 and inputs[1] is self and not(inputs[0] is self):
2727
+ name = 'r' + name
2728
+ inputs.reverse()
2729
+ if not(hasattr(self,name)) or ('mul' in name):
2730
+ name = '__' + name + '__'
2731
+ try:
2732
+ assert method=="__call__"
2733
+ fun=getattr(self, name)
2734
+ return fun(*inputs[1:])
2735
+ except Exception as e:
2736
+ if "Dimension mismatch" in str(e):
2737
+ import sys
2738
+ if sys.version_info[0] < 3:
2739
+ raise RuntimeError(str(e))
2740
+ else:
2741
+ raise e
2742
+ # Fall back to numpy conversion
2743
+ new_inputs = list(inputs)
2744
+ try:
2745
+ new_inputs[0] = new_inputs[0].full()
2746
+ except:
2747
+ import warnings
2748
+ warnings.warn("Implicit conversion of symbolic CasADi type to numeric matrix not supported.\n"
2749
+ + "This may occur when you pass a CasADi object to a numpy function.\n"
2750
+ + "Use an equivalent CasADi function instead of that numpy function.", RuntimeWarning)
2751
+ return NotImplemented
2752
+ return new_inputs[0].__array_ufunc__(ufunc, method, *new_inputs, **kwargs)
2753
+
2754
+
2755
+ def __array__(self,*args,**kwargs):
2756
+ import numpy as n
2757
+ if len(args) > 1 and isinstance(args[1],tuple) and isinstance(args[1][0],n.ufunc) and isinstance(args[1][0],n.ufunc) and len(args[1])>1 and args[1][0].nin==len(args[1][1]):
2758
+ if len(args[1][1])==3:
2759
+ raise Exception("Error with %s. Looks like you are using an assignment operator, such as 'a+=b'. This is not supported when 'a' is a numpy type, and cannot be supported without changing numpy itself. Either upgrade a to a CasADi type first, or use 'a = a + b'. " % args[1][0].__name__)
2760
+ return n.array([n.nan])
2761
+ else:
2762
+ if hasattr(self,'__array_custom__'):
2763
+ return self.__array_custom__(*args,**kwargs)
2764
+ else:
2765
+ try:
2766
+ return self.full()
2767
+ except:
2768
+ if self.is_scalar(True):
2769
+ # Needed for #2743
2770
+ E=n.empty((),dtype=object)
2771
+ E[()] = self
2772
+ return E
2773
+ else:
2774
+ raise Exception("Implicit conversion of symbolic CasADi type to numeric matrix not supported.\n"
2775
+ + "This may occur when you pass a CasADi object to a numpy function.\n"
2776
+ + "Use an equivalent CasADi function instead of that numpy function.")
2777
+
2778
+ %}
2779
+ %enddef
2780
+ #endif // SWIGPYTHON
2781
+
2782
+ #ifdef SWIGXML
2783
+ %define %matrix_helpers(Type)
2784
+ %enddef
2785
+ #endif
2786
+
2787
+ #ifdef SWIGMATLAB
2788
+ %{
2789
+ namespace casadi {
2790
+ /// Helper function: Convert ':' to Slice
2791
+ inline Slice char2Slice(char ch) {
2792
+ casadi_assert_dev(ch==':');
2793
+ return Slice();
2794
+ }
2795
+ } // namespace casadi
2796
+ %}
2797
+
2798
+ %define %matrix_helpers(Type)
2799
+ // Get a submatrix (index-1)
2800
+ const Type paren(char rr) const {
2801
+ casadi_assert_dev(rr==':');
2802
+ return vec(*$self);
2803
+ }
2804
+ const Type paren(const Matrix<casadi_int>& rr) const {
2805
+ Type m;
2806
+ $self->get(m, true, rr);
2807
+ return m;
2808
+ }
2809
+ const Type paren(const Sparsity& sp) const {
2810
+ Type m;
2811
+ $self->get(m, true, sp);
2812
+ return m;
2813
+ }
2814
+ const Type paren(char rr, char cc) const {
2815
+ Type m;
2816
+ $self->get(m, true, casadi::char2Slice(rr), casadi::char2Slice(cc));
2817
+ return m;
2818
+ }
2819
+ const Type paren(char rr, const Matrix<casadi_int>& cc) const {
2820
+ Type m;
2821
+ $self->get(m, true, casadi::char2Slice(rr), cc);
2822
+ return m;
2823
+ }
2824
+ const Type paren(const Matrix<casadi_int>& rr, char cc) const {
2825
+ Type m;
2826
+ $self->get(m, true, rr, casadi::char2Slice(cc));
2827
+ return m;
2828
+ }
2829
+ const Type paren(const Matrix<casadi_int>& rr, const Matrix<casadi_int>& cc) const {
2830
+ Type m;
2831
+ $self->get(m, true, rr, cc);
2832
+ return m;
2833
+ }
2834
+
2835
+ // Set a submatrix (index-1)
2836
+ void paren_asgn(const Type& m, char rr) {
2837
+ casadi_assert_dev(rr==':');
2838
+ $self->set(m, false, casadi::IM(casadi::range($self->numel())));
2839
+ }
2840
+ void paren_asgn(const Type& m, const Matrix<casadi_int>& rr) { $self->set(m, true, rr);}
2841
+ void paren_asgn(const Type& m, const Sparsity& sp) { $self->set(m, true, sp);}
2842
+ void paren_asgn(const Type& m, char rr, char cc) { $self->set(m, true, casadi::char2Slice(rr), casadi::char2Slice(cc));}
2843
+ void paren_asgn(const Type& m, char rr, const Matrix<casadi_int>& cc) { $self->set(m, true, casadi::char2Slice(rr), cc);}
2844
+ void paren_asgn(const Type& m, const Matrix<casadi_int>& rr, char cc) { $self->set(m, true, rr, casadi::char2Slice(cc));}
2845
+ void paren_asgn(const Type& m, const Matrix<casadi_int>& rr, const Matrix<casadi_int>& cc) { $self->set(m, true, rr, cc);}
2846
+
2847
+ // Get nonzeros (index-1)
2848
+ const Type brace(char rr) const { Type m; $self->get_nz(m, true, casadi::char2Slice(rr)); return m;}
2849
+ const Type brace(const Matrix<casadi_int>& rr) const { Type m; $self->get_nz(m, true, rr); return m;}
2850
+
2851
+ // Set nonzeros (index-1)
2852
+ void setbrace(const Type& m, char rr) { $self->set_nz(m, true, casadi::char2Slice(rr));}
2853
+ void setbrace(const Type& m, const Matrix<casadi_int>& rr) { $self->set_nz(m, true, rr);}
2854
+
2855
+ // 'end' function (needed for end syntax in MATLAB)
2856
+ inline casadi_int end(casadi_int i, casadi_int n) const {
2857
+ return n==1 ? $self->numel() : i==1 ? $self->size1() : $self->size2();
2858
+ }
2859
+
2860
+
2861
+ // Needed for brace syntax to access nonzeros
2862
+ casadi_int numel(casadi_int k) const {
2863
+ return 1;
2864
+ }
2865
+
2866
+ // Needed for brace syntax to access nonzeros
2867
+ casadi_int numel(char rr) const {
2868
+ casadi_assert_dev(rr==':');
2869
+ return 1;
2870
+ }
2871
+
2872
+ // Needed for brace syntax to access nonzeros
2873
+ casadi_int numel(const std::vector<casadi_int> &k) const {
2874
+ return 1;
2875
+ }
2876
+
2877
+ // Needed because original numel call gets hidden by the above extend overloads
2878
+ casadi_int numel() const {
2879
+ return $self->numel();
2880
+ }
2881
+
2882
+
2883
+ // Transpose using the A' syntax in addition to A.'
2884
+ Type ctranspose() const { return $self->T();}
2885
+
2886
+ %enddef
2887
+ #endif
2888
+
2889
+ %include <casadi/core/printable.hpp>
2890
+
2891
+ namespace casadi{
2892
+ %extend PrintableCommon {
2893
+ #ifdef SWIGPYTHON
2894
+ %pythoncode %{
2895
+ def __str__(self): return self.str()
2896
+ def repr(self): return self.type_name() + '(' + self.str() + ')'
2897
+ %}
2898
+ #endif // SWIGPYTHON
2899
+ #ifdef SWIGMATLAB
2900
+ %matlabcode %{
2901
+ function s = repr(self)
2902
+ s = [self.type_name() '(' self.str() ')'];
2903
+ end
2904
+ %}
2905
+ #endif // SWIGMATLAB
2906
+ }
2907
+ } // namespace casadi
2908
+
2909
+ %include <casadi/core/shared_object.hpp>
2910
+ %include <casadi/core/casadi_misc.hpp>
2911
+ %include <casadi/core/casadi_common.hpp>
2912
+ %include <casadi/core/generic_type.hpp>
2913
+ %include <casadi/core/calculus.hpp>
2914
+ %include <casadi/core/sparsity_interface.hpp>
2915
+ %include <casadi/core/sparsity.hpp>
2916
+
2917
+ // Logic for pickling
2918
+ #ifdef SWIGPYTHON
2919
+ namespace casadi{
2920
+ %extend Sparsity {
2921
+ %pythoncode %{
2922
+ def __setstate__(self, state):
2923
+ self.__init__(Sparsity.deserialize(state["serialization"]))
2924
+
2925
+ def __getstate__(self):
2926
+ return {"serialization": self.serialize()}
2927
+ %}
2928
+ }
2929
+
2930
+ } // namespace casadi
2931
+ #endif // SWIGPYTHON
2932
+
2933
+ /* There is no reason to expose the Slice class to e.g. Python or MATLAB. Only if an interfaced language
2934
+ lacks a slice type, the type should be exposed here */
2935
+ // #if !(defined(SWIGPYTHON) || defined(SWIGMATLAB))
2936
+ %include <casadi/core/slice.hpp>
2937
+ //#endif
2938
+
2939
+
2940
+ %include <casadi/core/generic_matrix.hpp>
2941
+
2942
+ %template(GenDM) casadi::GenericMatrix<casadi::Matrix<double> >;
2943
+ %template(GenSX) casadi::GenericMatrix<casadi::Matrix<casadi::SXElem> >;
2944
+ %template(GenMX) casadi::GenericMatrix<casadi::MX>;
2945
+
2946
+ %include <casadi/core/generic_expression.hpp>
2947
+
2948
+ // Flags to allow differentiating the wrapping by type
2949
+ #define IS_GLOBAL 0x1
2950
+ #define IS_MEMBER 0x10
2951
+ #define IS_SPARSITY 0x100
2952
+ #define IS_DMATRIX 0x1000
2953
+ #define IS_IMATRIX 0x10000
2954
+ #define IS_SX 0x100000
2955
+ #define IS_MX 0x1000000
2956
+ #define IS_DOUBLE 0x10000000
2957
+
2958
+ %define SPARSITY_INTERFACE_FUN_BASE(DECL, FLAG, M)
2959
+ #if FLAG & IS_MEMBER
2960
+
2961
+ DECL M casadi_horzcat(const std::vector< M > &v) {
2962
+ return horzcat(v);
2963
+ }
2964
+ DECL M casadi_vertcat(const std::vector< M > &v) {
2965
+ return vertcat(v);
2966
+ }
2967
+ DECL std::vector< M >
2968
+ casadi_horzsplit(const M& v, const std::vector<casadi_int>& offset) {
2969
+ return horzsplit(v, offset);
2970
+ }
2971
+ DECL std::vector< M > casadi_horzsplit(const M& v, casadi_int incr=1) {
2972
+ return horzsplit(v, incr);
2973
+ }
2974
+ DECL std::vector< M > casadi_horzsplit_n(const M& v, casadi_int n) {
2975
+ return horzsplit_n(v, n);
2976
+ }
2977
+ DECL std::vector< M >
2978
+ casadi_vertsplit(const M& v, const std::vector<casadi_int>& offset) {
2979
+ return vertsplit(v, offset);
2980
+ }
2981
+ DECL std::vector<casadi_int >
2982
+ casadi_offset(const std::vector< M > &v, bool vert=true) {
2983
+ return offset(v, vert);
2984
+ }
2985
+ DECL std::vector< M >
2986
+ casadi_vertsplit(const M& v, casadi_int incr=1) {
2987
+ return vertsplit(v, incr);
2988
+ }
2989
+ DECL std::vector< M >
2990
+ casadi_vertsplit_n(const M& v, casadi_int n) {
2991
+ return vertsplit_n(v, n);
2992
+ }
2993
+ DECL M casadi_blockcat(const M& A, const M& B, const M& C, const M& D) {
2994
+ return vertcat(horzcat(A, B), horzcat(C, D));
2995
+ }
2996
+ DECL std::vector< std::vector< M > >
2997
+ casadi_blocksplit(const M& x, const std::vector<casadi_int>& vert_offset,
2998
+ const std::vector<casadi_int>& horz_offset) {
2999
+ return blocksplit(x, vert_offset, horz_offset);
3000
+ }
3001
+ DECL std::vector< std::vector< M > >
3002
+ casadi_blocksplit(const M& x, casadi_int vert_incr=1, casadi_int horz_incr=1) {
3003
+ return blocksplit(x, vert_incr, horz_incr);
3004
+ }
3005
+ DECL M casadi_diagcat(const std::vector< M > &A) {
3006
+ return diagcat(A);
3007
+ }
3008
+ DECL std::vector< M >
3009
+ casadi_diagsplit(const M& x, const std::vector<casadi_int>& output_offset1,
3010
+ const std::vector<casadi_int>& output_offset2) {
3011
+ return diagsplit(x, output_offset1, output_offset2);
3012
+ }
3013
+ DECL std::vector< M >
3014
+ casadi_diagsplit(const M& x, const std::vector<casadi_int>& output_offset) {
3015
+ return diagsplit(x, output_offset);
3016
+ }
3017
+ DECL std::vector< M > casadi_diagsplit(const M& x, casadi_int incr=1) {
3018
+ return diagsplit(x, incr);
3019
+ }
3020
+ DECL std::vector< M >
3021
+ casadi_diagsplit(const M& x, casadi_int incr1, casadi_int incr2) {
3022
+ return diagsplit(x, incr1, incr2);
3023
+ }
3024
+ DECL M casadi_veccat(const std::vector< M >& x) {
3025
+ return veccat(x);
3026
+ }
3027
+ DECL M casadi_mtimes(const M& x, const M& y) {
3028
+ return mtimes(x, y);
3029
+ }
3030
+ DECL M casadi_mtimes(const std::vector< M > &args) {
3031
+ return mtimes(args);
3032
+ }
3033
+ DECL M casadi_mac(const M& X, const M& Y, const M& Z) {
3034
+ return mac(X, Y, Z);
3035
+ }
3036
+ DECL M casadi_transpose(const M& X) {
3037
+ return X.T();
3038
+ }
3039
+ DECL M casadi_vec(const M& a) {
3040
+ return vec(a);
3041
+ }
3042
+ DECL M casadi_reshape(const M& a, casadi_int nrow, casadi_int ncol) {
3043
+ return reshape(a, nrow, ncol);
3044
+ }
3045
+ DECL M casadi_reshape(const M& a, std::pair<casadi_int, casadi_int> rc) {
3046
+ return reshape(a, rc.first, rc.second);
3047
+ }
3048
+ DECL M casadi_reshape(const M& a, const Sparsity& sp) {
3049
+ return reshape(a, sp);
3050
+ }
3051
+ DECL M casadi_sparsity_cast(const M& a, const Sparsity& sp) {
3052
+ return sparsity_cast(a, sp);
3053
+ }
3054
+ DECL casadi_int casadi_sprank(const M& A) {
3055
+ return sprank(A);
3056
+ }
3057
+ DECL casadi_int casadi_norm_0_mul(const M& x, const M& y) {
3058
+ return norm_0_mul(x, y);
3059
+ }
3060
+ DECL M casadi_triu(const M& a, bool includeDiagonal=true) {
3061
+ return triu(a, includeDiagonal);
3062
+ }
3063
+ DECL M casadi_tril(const M& a, bool includeDiagonal=true) {
3064
+ return tril(a, includeDiagonal);
3065
+ }
3066
+ DECL M casadi_kron(const M& a, const M& b) {
3067
+ return kron(a, b);
3068
+ }
3069
+ DECL M casadi_repmat(const M& A, casadi_int n, casadi_int m=1) {
3070
+ return repmat(A, n, m);
3071
+ }
3072
+ DECL M casadi_repmat(const M& A, const std::pair<casadi_int, casadi_int>& rc) {
3073
+ return repmat(A, rc.first, rc.second);
3074
+ }
3075
+ DECL M casadi_sum2(const M& x) {
3076
+ return sum2(x);
3077
+ }
3078
+ DECL M casadi_sum1(const M& x) {
3079
+ return sum1(x);
3080
+ }
3081
+ #endif
3082
+ %enddef
3083
+
3084
+ %define SPARSITY_INTERFACE_ALL(DECL, FLAG)
3085
+ SPARSITY_INTERFACE_FUN(DECL, (FLAG | IS_SPARSITY), Sparsity)
3086
+ SPARSITY_INTERFACE_FUN(DECL, (FLAG | IS_MX), MX)
3087
+ SPARSITY_INTERFACE_FUN(DECL, (FLAG | IS_DMATRIX), Matrix<double>)
3088
+ SPARSITY_INTERFACE_FUN(DECL, (FLAG | IS_SX), Matrix<SXElem>)
3089
+ %enddef
3090
+
3091
+ #ifdef SWIGMATLAB
3092
+ %define SPARSITY_INTERFACE_FUN(DECL, FLAG, M)
3093
+ SPARSITY_INTERFACE_FUN_BASE(DECL, FLAG, M)
3094
+ #if FLAG & IS_MEMBER
3095
+ DECL casadi_int casadi_length(const M &v) {
3096
+ return std::max(v.size1(), v.size2());
3097
+ }
3098
+ #endif
3099
+ %enddef
3100
+ #else
3101
+ %define SPARSITY_INTERFACE_FUN(DECL, FLAG, M)
3102
+ SPARSITY_INTERFACE_FUN_BASE(DECL, FLAG, M)
3103
+ %enddef
3104
+ #endif
3105
+
3106
+ %define GENERIC_MATRIX_FUN(DECL, FLAG, M)
3107
+ #if FLAG & IS_MEMBER
3108
+ DECL M casadi_mpower(const M& x, const M& n) {
3109
+ return mpower(x, n);
3110
+ }
3111
+
3112
+ DECL M casadi_mrdivide(const M& x, const M& y) {
3113
+ return mrdivide(x, y);
3114
+ }
3115
+
3116
+ DECL M casadi_mldivide(const M& x, const M& y) {
3117
+ return mldivide(x, y);
3118
+ }
3119
+
3120
+ DECL std::vector< M > casadi_symvar(const M& x) {
3121
+ return symvar(x);
3122
+ }
3123
+
3124
+ DECL M casadi_bilin(const M& A, const M& x, const M& y) {
3125
+ return bilin(A, x, y);
3126
+ }
3127
+
3128
+ DECL M casadi_bilin(const M& A, const M& x) {
3129
+ return bilin(A, x);
3130
+ }
3131
+
3132
+ DECL M casadi_rank1(const M& A, const M& alpha, const M& x, const M& y) {
3133
+ return rank1(A, alpha, x, y);
3134
+ }
3135
+
3136
+ DECL M casadi_sumsqr(const M& X) {
3137
+ return sumsqr(X);
3138
+ }
3139
+
3140
+ DECL M casadi_linspace(const M& a, const M& b, casadi_int nsteps) {
3141
+ return linspace(a, b, nsteps);
3142
+ }
3143
+
3144
+ DECL M casadi_logsumexp(const M& a) {
3145
+ return logsumexp(a);
3146
+ }
3147
+
3148
+ DECL M casadi_logsumexp(const M& a, const M& margin) {
3149
+ return logsumexp(a, margin);
3150
+ }
3151
+
3152
+ DECL M casadi_interp1d(const std::vector<double>& x, const M&v,
3153
+ const std::vector<double>& xq, const std::string& mode="linear", bool equidistant=false) {
3154
+ return interp1d(x, v, xq, mode, equidistant);
3155
+ }
3156
+
3157
+ DECL M casadi_soc(const M& x, const M& y) {
3158
+ return soc(x, y);
3159
+ }
3160
+
3161
+ DECL M casadi_cross(const M& a, const M& b, casadi_int dim = -1) {
3162
+ return cross(a, b, dim);
3163
+ }
3164
+
3165
+ DECL M casadi_skew(const M& a) {
3166
+ return skew(a);
3167
+ }
3168
+
3169
+ DECL M casadi_inv_skew(const M& a) {
3170
+ return inv_skew(a);
3171
+ }
3172
+
3173
+ DECL M casadi_det(const M& A) {
3174
+ return det(A);
3175
+ }
3176
+
3177
+ DECL M casadi_inv_minor(const M& A) {
3178
+ return inv_minor(A);
3179
+ }
3180
+
3181
+ DECL M casadi_inv(const M& A) {
3182
+ return inv(A);
3183
+ }
3184
+
3185
+ DECL M casadi_inv(const M& A, const std::string& lsolver,
3186
+ const casadi::Dict& opts = casadi::Dict()) {
3187
+ return inv(A, lsolver, opts);
3188
+ }
3189
+
3190
+ DECL M casadi_trace(const M& a) {
3191
+ return trace(a);
3192
+ }
3193
+
3194
+ DECL M casadi_tril2symm(const M& a) {
3195
+ return tril2symm(a);
3196
+ }
3197
+
3198
+ DECL M casadi_triu2symm(const M& a) {
3199
+ return triu2symm(a);
3200
+ }
3201
+
3202
+ DECL M casadi_norm_fro(const M& x) {
3203
+ return norm_fro(x);
3204
+ }
3205
+
3206
+ DECL M casadi_norm_2(const M& x) {
3207
+ return norm_2(x);
3208
+ }
3209
+
3210
+ DECL M casadi_norm_1(const M& x) {
3211
+ return norm_1(x);
3212
+ }
3213
+
3214
+ DECL M casadi_norm_inf(const M& x) {
3215
+ return norm_inf(x);
3216
+ }
3217
+
3218
+ DECL M casadi_dot(const M& x, const M& y) {
3219
+ return dot(x, y);
3220
+ }
3221
+
3222
+ DECL M casadi_nullspace(const M& A) {
3223
+ return nullspace(A);
3224
+ }
3225
+
3226
+ DECL M casadi_polyval(const M& p, const M& x) {
3227
+ return polyval(p, x);
3228
+ }
3229
+
3230
+ DECL M casadi_diag(const M& A) {
3231
+ return diag(A);
3232
+ }
3233
+
3234
+ DECL M casadi_unite(const M& A, const M& B) {
3235
+ return unite(A, B);
3236
+ }
3237
+
3238
+ DECL M casadi_densify(const M& x) {
3239
+ return densify(x);
3240
+ }
3241
+
3242
+ DECL M casadi_project(const M& A, const Sparsity& sp, bool intersect=false) {
3243
+ return project(A, sp, intersect);
3244
+ }
3245
+
3246
+ DECL M casadi_if_else(const M& cond, const M& if_true,
3247
+ const M& if_false, bool short_circuit=false) {
3248
+ return if_else(cond, if_true, if_false, short_circuit);
3249
+ }
3250
+
3251
+ DECL M casadi_conditional(const M& ind, const std::vector< M > &x,
3252
+ const M& x_default, bool short_circuit=false) {
3253
+ return conditional(ind, x, x_default, short_circuit);
3254
+ }
3255
+
3256
+ DECL bool casadi_depends_on(const M& f, const M& arg) {
3257
+ return depends_on(f, arg);
3258
+ }
3259
+
3260
+ DECL M casadi_solve(const M& A, const M& b) {
3261
+ return solve(A, b);
3262
+ }
3263
+
3264
+ DECL M casadi_solve(const M& A, const M& b,
3265
+ const std::string& lsolver,
3266
+ const casadi::Dict& opts = casadi::Dict()) {
3267
+ return solve(A, b, lsolver, opts);
3268
+ }
3269
+
3270
+ DECL M casadi_pinv(const M& A) {
3271
+ return pinv(A);
3272
+ }
3273
+
3274
+ DECL M casadi_pinv(const M& A, const std::string& lsolver,
3275
+ const casadi::Dict& opts = casadi::Dict()) {
3276
+ return pinv(A, lsolver, opts);
3277
+ }
3278
+
3279
+ DECL M casadi_expm_const(const M& A, const M& t) {
3280
+ return expm_const(A, t);
3281
+ }
3282
+
3283
+ DECL M casadi_expm(const M& A) {
3284
+ return expm(A);
3285
+ }
3286
+
3287
+ DECL M casadi_jacobian(const M &ex, const M &arg, const Dict& opts=Dict()) {
3288
+ return jacobian(ex, arg, opts);
3289
+ }
3290
+
3291
+ DECL M casadi_jtimes(const M& ex, const M& arg, const M& v, bool tr=false) {
3292
+ return jtimes(ex, arg, v, tr);
3293
+ }
3294
+
3295
+ DECL M casadi_linearize(const M& f, const M& x, const M& x0) {
3296
+ return linearize(f, x, x0);
3297
+ }
3298
+
3299
+ DECL std::vector<bool> casadi_which_depends(const M& expr, const M& var,
3300
+ casadi_int order=1, bool tr=false) {
3301
+ return which_depends(expr, var, order, tr);
3302
+ }
3303
+
3304
+ DECL Sparsity casadi_jacobian_sparsity(const M& f, const M& x) {
3305
+ return jacobian_sparsity(f, x);
3306
+ }
3307
+
3308
+ DECL bool casadi_is_linear(const M& expr, const M& var) {
3309
+ return is_linear(expr, var);
3310
+ }
3311
+
3312
+ DECL bool casadi_is_quadratic(const M& expr, const M& var) {
3313
+ return is_quadratic(expr, var);
3314
+ }
3315
+
3316
+ DECL M casadi_gradient(const M &ex, const M &arg) {
3317
+ return gradient(ex, arg);
3318
+ }
3319
+
3320
+ DECL M casadi_tangent(const M &ex, const M &arg) {
3321
+ return tangent(ex, arg);
3322
+ }
3323
+
3324
+ DECL M casadi_hessian(const M& ex, const M& arg, M& OUTPUT1, const casadi::Dict& opts = casadi::Dict()) {
3325
+ return hessian(ex, arg, OUTPUT1, opts);
3326
+ }
3327
+
3328
+ DECL void casadi_quadratic_coeff(const M& ex, const M& arg, M& OUTPUT1, M& OUTPUT2, M& OUTPUT3, bool check=true) {
3329
+ quadratic_coeff(ex, arg, OUTPUT1, OUTPUT2, OUTPUT3, check);
3330
+ }
3331
+
3332
+ DECL void casadi_linear_coeff(const M& ex, const M& arg, M& OUTPUT1, M& OUTPUT2, bool check=true) {
3333
+ linear_coeff(ex, arg, OUTPUT1, OUTPUT2, check);
3334
+ }
3335
+
3336
+ DECL casadi_int casadi_n_nodes(const M& A) {
3337
+ return n_nodes(A);
3338
+ }
3339
+
3340
+ DECL std::string casadi_print_operator(const M& xb,
3341
+ const std::vector<std::string>& args) {
3342
+ return print_operator(xb, args);
3343
+ }
3344
+ DECL M casadi_repsum(const M& A, casadi_int n, casadi_int m=1) {
3345
+ return repsum(A, n, m);
3346
+ }
3347
+ DECL M casadi_diff(const M& A, casadi_int n=1, casadi_index axis=-1) {
3348
+ return diff(A, n, axis);
3349
+ }
3350
+ DECL M casadi_cumsum(const M& A, casadi_index axis=-1) {
3351
+ return cumsum(A, axis);
3352
+ }
3353
+ DECL M casadi_einstein(const M& A, const M& B, const M& C,
3354
+ const std::vector<casadi_int>& dim_a, const std::vector<casadi_int>& dim_b, const std::vector<casadi_int>& dim_c,
3355
+ const std::vector<casadi_int>& a, const std::vector<casadi_int>& b, const std::vector<casadi_int>& c) {
3356
+ return einstein(A, B, C, dim_a, dim_b, dim_c, a, b, c);
3357
+ }
3358
+ DECL M casadi_einstein(const M& A, const M& B,
3359
+ const std::vector<casadi_int>& dim_a, const std::vector<casadi_int>& dim_b, const std::vector<casadi_int>& dim_c,
3360
+ const std::vector<casadi_int>& a, const std::vector<casadi_int>& b, const std::vector<casadi_int>& c) {
3361
+ return einstein(A, B, dim_a, dim_b, dim_c, a, b, c);
3362
+ }
3363
+ DECL M casadi_mmin(const M& x) { return mmin(x); }
3364
+ DECL M casadi_mmax(const M& x) { return mmax(x); }
3365
+ DECL casadi::DM casadi_evalf(const M& x) {
3366
+ return evalf(x);
3367
+ }
3368
+ DECL std::vector<M> casadi_cse(const std::vector<M>& e) {
3369
+ return cse(e);
3370
+ }
3371
+ DECL M casadi_cse(const M& e) {
3372
+ return cse(e);
3373
+ }
3374
+
3375
+ #endif // FLAG & IS_MEMBER
3376
+
3377
+ #if FLAG & IS_GLOBAL
3378
+ DECL std::vector<std::vector< M > >
3379
+ casadi_forward(const std::vector< M > &ex, const std::vector< M > &arg,
3380
+ const std::vector<std::vector< M > > &v,
3381
+ const Dict& opts = Dict()) {
3382
+ return forward(ex, arg, v, opts);
3383
+ }
3384
+
3385
+ DECL std::vector<std::vector< M > >
3386
+ casadi_reverse(const std::vector< M > &ex, const std::vector< M > &arg,
3387
+ const std::vector<std::vector< M > > &v,
3388
+ const Dict& opts = Dict()) {
3389
+ return reverse(ex, arg, v, opts);
3390
+ }
3391
+
3392
+ DECL M casadi_substitute(const M& ex, const M& v, const M& vdef) {
3393
+ return substitute(ex, v, vdef);
3394
+ }
3395
+
3396
+ DECL std::vector< M > casadi_substitute(const std::vector< M >& ex,
3397
+ const std::vector< M >& v,
3398
+ const std::vector< M >& vdef) {
3399
+ return substitute(ex, v, vdef);
3400
+ }
3401
+
3402
+ DECL void casadi_substitute_inplace(const std::vector< M >& v,
3403
+ std::vector< M >& INOUT1,
3404
+ std::vector< M >& INOUT2,
3405
+ bool reverse=false) {
3406
+ return substitute_inplace(v, INOUT1, INOUT2, reverse);
3407
+ }
3408
+
3409
+ DECL void casadi_extract(const std::vector< M >& ex,
3410
+ std::vector< M >& OUTPUT1,
3411
+ std::vector< M >& OUTPUT2,
3412
+ std::vector< M >& OUTPUT3,
3413
+ const Dict& opts = Dict()) {
3414
+ OUTPUT1 = ex;
3415
+ extract(OUTPUT1, OUTPUT2, OUTPUT3, opts);
3416
+ }
3417
+
3418
+ DECL void casadi_shared(const std::vector< M >& ex,
3419
+ std::vector< M >& OUTPUT1,
3420
+ std::vector< M >& OUTPUT2,
3421
+ std::vector< M >& OUTPUT3,
3422
+ const std::string& v_prefix="v_",
3423
+ const std::string& v_suffix="") {
3424
+ OUTPUT1 = ex;
3425
+ shared(OUTPUT1, OUTPUT2, OUTPUT3, v_prefix, v_suffix);
3426
+ }
3427
+
3428
+ DECL M casadi_blockcat(const std::vector< std::vector< M > > &v) {
3429
+ return blockcat(v);
3430
+ }
3431
+ #endif // FLAG & IS_GLOBAL
3432
+ %enddef
3433
+
3434
+ %define GENERIC_MATRIX_ALL(DECL, FLAG)
3435
+ GENERIC_MATRIX_FUN(DECL, (FLAG | IS_MX), MX)
3436
+ GENERIC_MATRIX_FUN(DECL, (FLAG | IS_DMATRIX), Matrix<double>)
3437
+ GENERIC_MATRIX_FUN(DECL, (FLAG | IS_SX), Matrix<SXElem>)
3438
+ %enddef
3439
+
3440
+ %define GENERIC_EXPRESSION_FUN(DECL, FLAG, M)
3441
+ #if FLAG & IS_MEMBER
3442
+ DECL M casadi_plus(const M& x, const M& y) { return x+y; }
3443
+ DECL M casadi_minus(const M& x, const M& y) { return x-y; }
3444
+ DECL M casadi_times(const M& x, const M& y) { return x*y; }
3445
+ DECL M casadi_rdivide(const M& x, const M& y) { return x/y; }
3446
+ DECL M casadi_ldivide(const M& x, const M& y) { return y/x; }
3447
+ DECL M casadi_lt(const M& x, const M& y) { return x<y; }
3448
+ DECL M casadi_le(const M& x, const M& y) { return x<=y; }
3449
+ DECL M casadi_gt(const M& x, const M& y) { return x>y; }
3450
+ DECL M casadi_ge(const M& x, const M& y) { return x>=y; }
3451
+ DECL M casadi_eq(const M& x, const M& y) { return x==y; }
3452
+ DECL M casadi_ne(const M& x, const M& y) { return x!=y; }
3453
+ DECL M casadi_and(const M& x, const M& y) { return x&&y; }
3454
+ DECL M casadi_or(const M& x, const M& y) { return x||y; }
3455
+ DECL M casadi_not(const M& x) { return !x; }
3456
+ DECL M casadi_abs(const M& x) { return fabs(x); }
3457
+ DECL M casadi_sqrt(const M& x) { return sqrt(x); }
3458
+ DECL M casadi_sin(const M& x) { return sin(x); }
3459
+ DECL M casadi_cos(const M& x) { return cos(x); }
3460
+ DECL M casadi_tan(const M& x) { return tan(x); }
3461
+ DECL M casadi_atan(const M& x) { return atan(x); }
3462
+ DECL M casadi_asin(const M& x) { return asin(x); }
3463
+ DECL M casadi_acos(const M& x) { return acos(x); }
3464
+ DECL M casadi_tanh(const M& x) { return tanh(x); }
3465
+ DECL M casadi_sinh(const M& x) { return sinh(x); }
3466
+ DECL M casadi_cosh(const M& x) { return cosh(x); }
3467
+ DECL M casadi_atanh(const M& x) { return atanh(x); }
3468
+ DECL M casadi_asinh(const M& x) { return asinh(x); }
3469
+ DECL M casadi_acosh(const M& x) { return acosh(x); }
3470
+ DECL M casadi_exp(const M& x) { return exp(x); }
3471
+ DECL M casadi_log(const M& x) { return log(x); }
3472
+ DECL M casadi_log10(const M& x) { return log10(x); }
3473
+ DECL M casadi_log1p(const M& x) { return log1p(x); }
3474
+ DECL M casadi_expm1(const M& x) { return expm1(x); }
3475
+ DECL M casadi_floor(const M& x) { return floor(x); }
3476
+ DECL M casadi_ceil(const M& x) { return ceil(x); }
3477
+ DECL M casadi_erf(const M& x) { return erf(x); }
3478
+ DECL M casadi_erfinv(const M& x) { using casadi::erfinv; return erfinv(x); }
3479
+ DECL M casadi_sign(const M& x) { using casadi::sign; return sign(x); }
3480
+ DECL M casadi_power(const M& x, const M& n) { return pow(x, n); }
3481
+ DECL M casadi_mod(const M& x, const M& y) { return fmod(x, y); }
3482
+ DECL M casadi_fmod(const M& x, const M& y) { return fmod(x, y); }
3483
+ DECL M casadi_remainder(const M& x, const M& y) { return remainder(x, y); }
3484
+ DECL M casadi_atan2(const M& x, const M& y) { return atan2(x, y); }
3485
+ DECL M casadi_fmin(const M& x, const M& y) { return fmin(x, y); }
3486
+ DECL M casadi_fmax(const M& x, const M& y) { return fmax(x, y); }
3487
+ DECL M casadi_hypot(const M& x, const M& y) { return hypot(x, y); }
3488
+ DECL M casadi_simplify(const M& x) { using casadi::simplify; return simplify(x); }
3489
+ DECL bool casadi_is_equal(const M& x, const M& y, casadi_int depth=0) { using casadi::is_equal; return is_equal(x, y, depth); }
3490
+ DECL M casadi_copysign(const M& x, const M& y) { return copysign(x, y); }
3491
+ DECL M casadi_constpow(const M& x, const M& y) { using casadi::constpow; return constpow(x, y); }
3492
+ #endif // FLAG & IS_MEMBER
3493
+ %enddef
3494
+
3495
+ %define GENERIC_EXPRESSION_ALL(DECL, FLAG)
3496
+ GENERIC_EXPRESSION_FUN(DECL, (FLAG | IS_MX), MX)
3497
+ GENERIC_EXPRESSION_FUN(DECL, (FLAG | IS_DMATRIX), Matrix<double>)
3498
+ GENERIC_EXPRESSION_FUN(DECL, (FLAG | IS_SX), Matrix<SXElem>)
3499
+ GENERIC_EXPRESSION_FUN(DECL, (FLAG | IS_DOUBLE), double)
3500
+ %enddef
3501
+
3502
+ %define MATRIX_FUN(DECL, FLAG, M)
3503
+ #if FLAG & IS_MEMBER
3504
+ DECL M casadi_all(const M& x) {
3505
+ return all(x);
3506
+ }
3507
+
3508
+ DECL M casadi_any(const M& x) {
3509
+ return any(x);
3510
+ }
3511
+
3512
+ DECL M casadi_adj(const M& A) {
3513
+ return adj(A);
3514
+ }
3515
+
3516
+ DECL M casadi_minor(const M& x, casadi_int i, casadi_int j) {
3517
+ return minor(x, i, j);
3518
+ }
3519
+
3520
+ DECL M casadi_cofactor(const M& x, casadi_int i, casadi_int j) {
3521
+ return cofactor(x, i, j);
3522
+ }
3523
+
3524
+ DECL void casadi_qr(const M& A, M& OUTPUT1, M& OUTPUT2) {
3525
+ return qr(A, OUTPUT1, OUTPUT2);
3526
+ }
3527
+
3528
+ DECL void casadi_qr_sparse(const M& A, M& OUTPUT1, M& OUTPUT2, M& OUTPUT3,
3529
+ std::vector<casadi_int>& OUTPUT4, std::vector<casadi_int>& OUTPUT5, bool amd=true) {
3530
+ return qr_sparse(A, OUTPUT1, OUTPUT2, OUTPUT3, OUTPUT4, OUTPUT5, amd);
3531
+ }
3532
+
3533
+ DECL M casadi_qr_solve(const M& b, const M& v, const M& r, const M& beta,
3534
+ const std::vector<casadi_int>& prinv,
3535
+ const std::vector<casadi_int>& pc, bool tr=false) {
3536
+ return qr_solve(b, v, r, beta, prinv, pc, tr);
3537
+ }
3538
+
3539
+ DECL void casadi_ldl(const M& A, M& OUTPUT1, M& OUTPUT2, std::vector<casadi_int>& OUTPUT3, bool amd=true) {
3540
+ return ldl(A, OUTPUT1, OUTPUT2, OUTPUT3, amd);
3541
+ }
3542
+
3543
+ DECL M casadi_ldl_solve(const M& b, const M& D, const M& LT, const std::vector<casadi_int>& p) {
3544
+ return ldl_solve(b, D, LT, p);
3545
+ }
3546
+
3547
+ DECL M casadi_chol(const M& A) {
3548
+ return chol(A);
3549
+ }
3550
+
3551
+ DECL M casadi_norm_inf_mul(const M& x, const M& y) {
3552
+ return norm_inf_mul(x, y);
3553
+ }
3554
+
3555
+ DECL M casadi_sparsify(const M& A, double tol=0) {
3556
+ return sparsify(A, tol);
3557
+ }
3558
+
3559
+ DECL void casadi_expand(const M& ex, M& OUTPUT1, M& OUTPUT2) {
3560
+ expand(ex, OUTPUT1, OUTPUT2);
3561
+ }
3562
+
3563
+ DECL M casadi_pw_const(const M &t, const M& tval, const M& val) {
3564
+ return pw_const(t, tval, val);
3565
+ }
3566
+
3567
+ DECL M casadi_pw_lin(const M& t, const M& tval, const M& val) {
3568
+ return pw_lin(t, tval, val);
3569
+ }
3570
+
3571
+ DECL M casadi_heaviside(const M& x) {
3572
+ return heaviside(x);
3573
+ }
3574
+
3575
+ DECL M casadi_rectangle(const M& x) {
3576
+ return rectangle(x);
3577
+ }
3578
+
3579
+ DECL M casadi_triangle(const M& x) {
3580
+ return triangle(x);
3581
+ }
3582
+
3583
+ DECL M casadi_ramp(const M& x) {
3584
+ return ramp(x);
3585
+ }
3586
+
3587
+ DECL M casadi_gauss_quadrature(const M& f, const M& x,
3588
+ const M& a, const M& b,
3589
+ casadi_int order=5) {
3590
+ return gauss_quadrature(f, x, a, b, order);
3591
+ }
3592
+
3593
+ DECL M casadi_gauss_quadrature(const M& f, const M& x,
3594
+ const M& a, const M& b,
3595
+ casadi_int order, const M& w) {
3596
+ return gauss_quadrature(f, x, a, b, order, w);
3597
+ }
3598
+
3599
+ DECL M casadi_taylor(const M& ex, const M& x, const M& a=0, casadi_int order=1) {
3600
+ return taylor(ex, x, a, order);
3601
+ }
3602
+
3603
+ DECL M casadi_mtaylor(const M& ex, const M& x, const M& a, casadi_int order=1) {
3604
+ return mtaylor(ex, x, a, order);
3605
+ }
3606
+
3607
+ DECL M casadi_mtaylor(const M& ex, const M& x, const M& a, casadi_int order,
3608
+ const std::vector<casadi_int>& order_contributions) {
3609
+ return mtaylor(ex, x, a, order, order_contributions);
3610
+ }
3611
+
3612
+ DECL M casadi_poly_coeff(const M& ex,
3613
+ const M&x) {
3614
+ return poly_coeff(ex, x);
3615
+ }
3616
+
3617
+ DECL M casadi_poly_roots(const M& p) {
3618
+ return poly_roots(p);
3619
+ }
3620
+
3621
+ DECL M casadi_eig_symbolic(const M& m) {
3622
+ return eig_symbolic(m);
3623
+ }
3624
+
3625
+ #endif
3626
+ %enddef
3627
+
3628
+ %define MATRIX_ALL(DECL, FLAG)
3629
+ MATRIX_FUN(DECL, (FLAG | IS_DMATRIX), Matrix<double>)
3630
+ MATRIX_FUN(DECL, (FLAG | IS_SX), Matrix<SXElem>)
3631
+ %enddef
3632
+
3633
+ %define MX_FUN(DECL, FLAG, M)
3634
+ #if FLAG & IS_MEMBER
3635
+ DECL M casadi_find(const M& x) {
3636
+ return find(x);
3637
+ }
3638
+ DECL M casadi_low(const M& v, const M& p, const Dict& options = Dict()) {
3639
+ return low(v, p, options);
3640
+ }
3641
+ DECL M casadi_inv_node(const M& x) {
3642
+ return inv_node(x);
3643
+ }
3644
+ #endif // FLAG & IS_MEMBER
3645
+
3646
+ #if FLAG & IS_GLOBAL
3647
+ DECL std::vector< M >
3648
+ casadi_matrix_expand(const std::vector< M >& e,
3649
+ const std::vector< M > &boundary = std::vector< M >(),
3650
+ const Dict& options = Dict()) {
3651
+ return matrix_expand(e, boundary, options);
3652
+ }
3653
+
3654
+ DECL M casadi_matrix_expand(const M& e,
3655
+ const std::vector< M > &boundary = std::vector< M >(),
3656
+ const Dict& options = Dict()) {
3657
+ return matrix_expand(e, boundary, options);
3658
+ }
3659
+
3660
+ DECL M casadi_graph_substitute(const M& ex, const std::vector< M >& v,
3661
+ const std::vector< M > &vdef) {
3662
+ return graph_substitute(ex, v, vdef);
3663
+ }
3664
+
3665
+ DECL std::vector< M >
3666
+ casadi_graph_substitute(const std::vector< M > &ex,
3667
+ const std::vector< M > &v,
3668
+ const std::vector< M > &vdef) {
3669
+ return graph_substitute(ex, v, vdef);
3670
+ }
3671
+ DECL M casadi_bspline(const M& x,
3672
+ const DM& coeffs,
3673
+ const std::vector< std::vector<double> >& knots,
3674
+ const std::vector<casadi_int>& degree,
3675
+ casadi_int m,
3676
+ const Dict& opts = Dict()) {
3677
+ return bspline(x, coeffs, knots, degree, m, opts);
3678
+ }
3679
+ DECL M casadi_bspline(const M& x,
3680
+ const M& coeffs,
3681
+ const std::vector< std::vector<double> >& knots,
3682
+ const std::vector<casadi_int>& degree,
3683
+ casadi_int m,
3684
+ const Dict& opts = Dict()) {
3685
+ return bspline(x, coeffs, knots, degree, m, opts);
3686
+ }
3687
+ DECL M casadi_convexify(const M& H,
3688
+ const Dict& opts = Dict()) {
3689
+ return convexify(H, opts);
3690
+ }
3691
+ DECL M casadi_stop_diff(const M& expr, casadi_int order) {
3692
+ return stop_diff(expr, order);
3693
+ }
3694
+ DECL M casadi_stop_diff(const M& expr, const M& var, casadi_int order) {
3695
+ return stop_diff(expr, var, order);
3696
+ }
3697
+ DECL std::vector< M > casadi_difference(const std::vector< M >& a, const std::vector< M >& b) {
3698
+ return difference(a, b);
3699
+ }
3700
+ DECL M casadi_no_hess(const M& expr) {
3701
+ return no_hess(expr);
3702
+ }
3703
+ DECL M casadi_no_grad(const M& expr) {
3704
+ return no_grad(expr);
3705
+ }
3706
+
3707
+ #endif
3708
+ %enddef
3709
+
3710
+ %define MX_ALL(DECL, FLAG)
3711
+ MX_FUN(DECL, (FLAG | IS_MX), MX)
3712
+ %enddef
3713
+ %include <casadi/core/matrix_fwd.hpp>
3714
+ %include <casadi/core/matrix_decl.hpp>
3715
+ %include <casadi/core/dm_fwd.hpp>
3716
+ %include <casadi/core/sx_fwd.hpp>
3717
+
3718
+ // Remove from API
3719
+ %warnfilter(401) casadi::Matrix<casadi_int>;
3720
+ %template() casadi::Matrix<casadi_int>;
3721
+
3722
+ %template(DM) casadi::Matrix<double>;
3723
+ %extend casadi::Matrix<double> {
3724
+ %template(DM) Matrix<SXElem>;
3725
+ };
3726
+
3727
+
3728
+ namespace casadi{
3729
+ %extend Matrix<double> {
3730
+ void assign(const casadi::Matrix<double>&rhs) { (*$self)=rhs; }
3731
+ %matrix_helpers(casadi::Matrix<double>)
3732
+
3733
+ }
3734
+
3735
+ }
3736
+
3737
+ // Extend DM with SWIG unique features
3738
+ namespace casadi{
3739
+ %extend Matrix<double> {
3740
+ // Convert to a dense matrix
3741
+ GUESTOBJECT* full() const {
3742
+ return full(*$self);
3743
+ }
3744
+
3745
+ // Convert to a sparse matrix
3746
+ GUESTOBJECT* sparse() const {
3747
+ return sparse(*$self);
3748
+ }
3749
+ }
3750
+
3751
+ } // namespace casadi
3752
+
3753
+
3754
+ #ifdef SWIGPYTHON
3755
+ namespace casadi{
3756
+ %extend Matrix<double> {
3757
+
3758
+ %python_array_wrappers(999.0)
3759
+
3760
+ // The following code has some trickery to fool numpy ufunc.
3761
+ // Normally, because of the presence of __array__, an ufunctor like nump.sqrt
3762
+ // will unleash its activity on the output of __array__
3763
+ // However, we wish DM to remain a DM
3764
+ // So when we receive a call from a functor, we return a dummy empty array
3765
+ // and return the real result during the postprocessing (__array_wrap__) of the functor.
3766
+ %pythoncode %{
3767
+ def __array_custom__(self,*args,**kwargs):
3768
+ if "dtype" in kwargs and not(isinstance(kwargs["dtype"],n.double)):
3769
+ return n.array(self.full(),dtype=kwargs["dtype"])
3770
+ else:
3771
+ return self.full()
3772
+ %}
3773
+
3774
+ %pythoncode %{
3775
+ def tocsc(self):
3776
+ import numpy as np
3777
+ import warnings
3778
+ with warnings.catch_warnings():
3779
+ warnings.simplefilter("ignore")
3780
+ from scipy.sparse import csc_matrix
3781
+ return csc_matrix( (self.nonzeros(),self.row(),self.colind()), shape = self.shape, dtype=np.double )
3782
+ def toarray(self,simplify=False):
3783
+ import numpy as np
3784
+ if simplify:
3785
+ if self.is_scalar():
3786
+ return float(self)
3787
+ elif self.is_vector():
3788
+ return np.array(self.T.elements())
3789
+ return np.array(self.T.elements()).reshape(self.shape)
3790
+ %}
3791
+
3792
+
3793
+ #ifdef WITH_PYTHON3
3794
+ %pythoncode %{
3795
+ def __bool__(self):
3796
+ if self.numel()!=1:
3797
+ raise Exception("Only a scalar can be cast to a float")
3798
+ if self.nnz()==0:
3799
+ return False
3800
+ return float(self)!=0
3801
+ %}
3802
+ #else
3803
+ %pythoncode %{
3804
+ def __nonzero__(self):
3805
+ if self.numel()!=1:
3806
+ raise Exception("Only a scalar can be cast to a float")
3807
+ if self.nnz()==0:
3808
+ return False
3809
+ return float(self)!=0
3810
+ %}
3811
+ #endif
3812
+
3813
+ %pythoncode %{
3814
+ def __abs__(self):
3815
+ return abs(float(self))
3816
+ %}
3817
+
3818
+ }; // extend Matrix<double>
3819
+
3820
+
3821
+ // Logic for pickling
3822
+
3823
+ %extend Matrix<double> {
3824
+
3825
+ %pythoncode %{
3826
+ def __setstate__(self, state):
3827
+ self.__init__(DM.deserialize(state["serialization"]))
3828
+
3829
+ def __getstate__(self):
3830
+ return {"serialization": self.serialize()}
3831
+ %}
3832
+
3833
+ }
3834
+
3835
+
3836
+ %extend Function {
3837
+
3838
+ %pythoncode %{
3839
+ def __setstate__(self, state):
3840
+ self.__init__(Function.deserialize(state["serialization"]))
3841
+
3842
+ def __getstate__(self):
3843
+ return {"serialization": self.serialize()}
3844
+ %}
3845
+
3846
+ }
3847
+
3848
+
3849
+ } // namespace casadi
3850
+ #endif // SWIGPYTHON
3851
+
3852
+
3853
+ #ifdef SWIGMATLAB
3854
+ namespace casadi{
3855
+
3856
+
3857
+ %extend Matrix<double> {
3858
+
3859
+ %matlabcode %{
3860
+ function s = saveobj(obj)
3861
+ try
3862
+ s.serialization = obj.serialize();
3863
+ catch exception
3864
+ warning(['Serializing of CasADi DM failed:' getReport(exception) ]);
3865
+ s = struct;
3866
+ end
3867
+ end
3868
+ %}
3869
+ %matlabcode_static %{
3870
+ function obj = loadobj(s)
3871
+ try
3872
+ if isstruct(s)
3873
+ obj = casadi.DM.deserialize(s.serialization);
3874
+ else
3875
+ obj = s;
3876
+ end
3877
+ catch exception
3878
+ warning(['Serializing of CasADi DM failed:' getReport(exception) ]);
3879
+ s = struct;
3880
+ end
3881
+ end
3882
+ %}
3883
+ }
3884
+
3885
+ %extend Sparsity {
3886
+ %matlabcode %{
3887
+ function s = saveobj(obj)
3888
+ try
3889
+ s.serialization = obj.serialize();
3890
+ catch exception
3891
+ warning(['Serializing of CasADi Sparsity failed:' getReport(exception) ]);
3892
+ s = struct;
3893
+ end
3894
+ end
3895
+ %}
3896
+ %matlabcode_static %{
3897
+ function obj = loadobj(s)
3898
+ try
3899
+ if isstruct(s)
3900
+ obj = casadi.Sparsity.deserialize(s.serialization);
3901
+ else
3902
+ obj = s;
3903
+ end
3904
+ catch exception
3905
+ warning(['Serializing of CasADi Sparsity failed:' getReport(exception) ]);
3906
+ s = struct;
3907
+ end
3908
+ end
3909
+ %}
3910
+ }
3911
+
3912
+
3913
+ %extend Function {
3914
+
3915
+ %matlabcode %{
3916
+ function s = saveobj(obj)
3917
+ try
3918
+ s.serialization = obj.serialize();
3919
+ catch exception
3920
+ warning(['Serializing of CasADi Function failed:' getReport(exception) ]);
3921
+ s = struct;
3922
+ end
3923
+ end
3924
+ %}
3925
+ %matlabcode_static %{
3926
+ function obj = loadobj(s)
3927
+ try
3928
+ if isstruct(s)
3929
+ obj = casadi.Function.deserialize(s.serialization);
3930
+ else
3931
+ obj = s;
3932
+ end
3933
+ catch exception
3934
+ warning(['Serializing of CasADi Function failed:' getReport(exception) ]);
3935
+ s = struct;
3936
+ end
3937
+ end
3938
+ %}
3939
+
3940
+ }
3941
+
3942
+ } // namespace casadi
3943
+ #endif // SWIGMATLAB
3944
+
3945
+ %include <casadi/core/sx_elem.hpp>
3946
+
3947
+ #ifdef SWIGPYTHON
3948
+ %extend casadi::Sparsity{
3949
+ %pythoncode %{
3950
+ @property
3951
+ def shape(self):
3952
+ return (self.size1(),self.size2())
3953
+
3954
+ @property
3955
+ def T(self):
3956
+ return _casadi.transpose(self)
3957
+
3958
+ def __array__(self,*args,**kwargs):
3959
+ return DM.ones(self).full()
3960
+ %}
3961
+ };
3962
+
3963
+ #endif // SWIGPYTHON
3964
+
3965
+ #ifdef SWIGPYTHON
3966
+ %pythoncode %{
3967
+
3968
+ try:
3969
+ import numpy
3970
+
3971
+ def constpow(x,y):
3972
+ pass
3973
+
3974
+ constpow=numpy.frompyfunc(constpow,2,1)
3975
+ except:
3976
+ pass
3977
+ %}
3978
+ #endif // SWIGPYTHON
3979
+
3980
+ namespace casadi {
3981
+ %extend Matrix<SXElem>{
3982
+ %matrix_helpers(casadi::Matrix<casadi::SXElem>)
3983
+
3984
+ #ifdef SWIGPYTHON
3985
+ %python_array_wrappers(1001.0)
3986
+ #endif // SWIGPYTHON
3987
+
3988
+ };
3989
+
3990
+ } // namespace casadi
3991
+
3992
+ #ifdef SWIGPYTHON
3993
+ #include <arrayobject.h>
3994
+ %template() std::vector<PyObject*>;
3995
+ #endif // SWIGPYTHON
3996
+
3997
+ %template(SX) casadi::Matrix<casadi::SXElem>;
3998
+ %extend casadi::Matrix<casadi::SXElem> {
3999
+ %template(SX) Matrix<double>;
4000
+ };
4001
+
4002
+ %include <casadi/core/mx.hpp>
4003
+
4004
+ %extend casadi::MX{
4005
+ %matrix_helpers(casadi::MX)
4006
+ #ifdef SWIGPYTHON
4007
+ %python_array_wrappers(1002.0)
4008
+ #endif //SWIGPYTHON
4009
+ };
4010
+
4011
+ #ifdef SWIGPYTHON
4012
+ %pythoncode %{
4013
+ def attach_return_type(f,t):
4014
+ if not(hasattr(f,'func_annotations')):
4015
+ f.func_annotations = {}
4016
+ if not(isinstance(getattr(f,'func_annotations'),dict)):
4017
+ raise Exception("Cannot annotate this python Method to be a sparsitygenerator. Method has func_annotations attribute with unknown type.")
4018
+ f.func_annotations["return"] = t
4019
+ return f
4020
+
4021
+ def pyevaluate(f):
4022
+ return attach_return_type(f,None)
4023
+
4024
+ def pycallback(f):
4025
+ return attach_return_type(f,int)
4026
+
4027
+
4028
+ def pyfunction(inputs,outputs):
4029
+ def wrap(f):
4030
+
4031
+ @pyevaluate
4032
+ def fcustom(f2):
4033
+ res = f([f2.getInput(i) for i in range(f2.n_in())])
4034
+ if not isinstance(res,list):
4035
+ res = [res]
4036
+ for i in range(f2.n_out()):
4037
+ f2.setOutput(res[i],i)
4038
+ import warnings
4039
+
4040
+ with warnings.catch_warnings():
4041
+ warnings.filterwarnings("ignore",category=DeprecationWarning)
4042
+ Fun = CustomFunction("CustomFunction",fcustom,inputs,outputs)
4043
+ return Fun
4044
+
4045
+ return wrap
4046
+
4047
+ def PyFunction(name, obj, inputs, outputs, opts={}):
4048
+ @pyevaluate
4049
+ def fcustom(f):
4050
+ res = [f.getOutput(i) for i in range(f.n_out())]
4051
+ obj.evaluate([f.getInput(i) for i in range(f.n_in())],res)
4052
+ for i in range(f.n_out()): f.setOutput(res[i], i)
4053
+
4054
+ import warnings
4055
+
4056
+ with warnings.catch_warnings():
4057
+ warnings.filterwarnings("ignore",category=DeprecationWarning)
4058
+ return CustomFunction("CustomFunction", fcustom,
4059
+ inputs, outputs, opts)
4060
+
4061
+ %}
4062
+ #endif
4063
+
4064
+ #ifndef SWIGPYTHON
4065
+ %ignore FunctionBuffer;
4066
+ %ignore _function_buffer_eval;
4067
+ #endif
4068
+
4069
+ %include <casadi/core/function.hpp>
4070
+ #ifdef SWIGPYTHON
4071
+ namespace casadi{
4072
+ %extend Function {
4073
+ %pythoncode %{
4074
+ def __call__(self, *args, **kwargs):
4075
+ # Either named inputs or ordered inputs
4076
+ if len(args)>0 and len(kwargs)>0:
4077
+ raise SyntaxError('Function evaluation requires all arguments to be named or none')
4078
+ if len(args)>0:
4079
+ # Ordered inputs -> return tuple
4080
+ ret = self.call(args)
4081
+ if len(ret)==0:
4082
+ return None
4083
+ elif len(ret)==1:
4084
+ return ret[0]
4085
+ else:
4086
+ return tuple(ret)
4087
+ else:
4088
+ # Named inputs -> return dictionary
4089
+ return self.call(kwargs)
4090
+
4091
+ def buffer(self):
4092
+ """
4093
+ Create a FunctionBuffer object for evaluating with minimal overhead
4094
+
4095
+ """
4096
+ import functools
4097
+ fb = FunctionBuffer(self)
4098
+ caller = functools.partial(_casadi._function_buffer_eval, fb._self())
4099
+ return (fb, caller)
4100
+ %}
4101
+
4102
+
4103
+ }
4104
+
4105
+ }
4106
+ #endif // SWIGPYTHON
4107
+
4108
+ #ifdef SWIGMATLAB
4109
+ namespace casadi{
4110
+ %extend GenericMatrixCommon {
4111
+ %matlabcode %{
4112
+ function varargout = spy(self,varargin)
4113
+ [varargout{1:nargout}] = spy(sparse(casadi.DM(self.sparsity(),1)),varargin{:});
4114
+ end
4115
+ function varargout = subsref(self,s)
4116
+ if numel(s)==1 && strcmp(s.type,'()')
4117
+ [varargout{1}] = paren(self, s.subs{:});
4118
+ elseif numel(s)==1 && strcmp(s.type,'{}')
4119
+ [varargout{1}] = brace(self, s.subs{:});
4120
+ else
4121
+ [varargout{1:nargout}] = builtin('subsref',self,s);
4122
+ end
4123
+ end
4124
+ function self = subsasgn(self,s,v)
4125
+ if numel(s)==1 && strcmp(s.type,'()')
4126
+ paren_asgn(self, v, s.subs{:});
4127
+ elseif numel(s)==1 && strcmp(s.type,'{}')
4128
+ brace_asgn(self, v, s.subs{:});
4129
+ else
4130
+ self = builtin('subsasgn',self,s,v);
4131
+ end
4132
+ end
4133
+ function out = sum(self,varargin)
4134
+ narginchk(1,3);
4135
+ if nargin==1
4136
+ if is_vector(self)
4137
+ if is_column(self)
4138
+ out = sum1(self);
4139
+ else
4140
+ out = sum2(self);
4141
+ end
4142
+ else
4143
+ out = sum1(self);
4144
+ end
4145
+ else
4146
+ i = varargin{1};
4147
+ if i==1
4148
+ out = sum1(self);
4149
+ elseif i==2
4150
+ out = sum2(self);
4151
+ else
4152
+ error('sum argument (if present) must be 1 or 2');
4153
+ end
4154
+ end
4155
+ end
4156
+ function out = norm(self,varargin)
4157
+ narginchk(1,2);
4158
+ % 2-norm by default
4159
+ if nargin==1
4160
+ ind = 2;
4161
+ else
4162
+ ind = varargin{1};
4163
+ end
4164
+ % Typecheck
4165
+ assert((isnumeric(ind) && isscalar(ind)) || ischar(ind))
4166
+ % Pick the right norm
4167
+ if isnumeric(ind)
4168
+ switch ind
4169
+ case 1
4170
+ out = norm_1(self);
4171
+ case 2
4172
+ out = norm_2(self);
4173
+ case inf
4174
+ out = norm_inf(self);
4175
+ otherwise
4176
+ error(sprintf('Unknown norm argument: %g', ind))
4177
+ end
4178
+ else
4179
+ switch ind
4180
+ case 'fro'
4181
+ out = norm_fro(self);
4182
+ case 'inf'
4183
+ out = norm_inf(self);
4184
+ otherwise
4185
+ error(sprintf('Unknown norm argument: ''%s''', ind))
4186
+ end
4187
+ end
4188
+ end
4189
+ function out = min(varargin)
4190
+ narginchk(1,2);
4191
+ if nargin==1
4192
+ out = mmin(varargin{1});
4193
+ else
4194
+ out = fmin(varargin{1}, varargin{2});
4195
+ end
4196
+ end
4197
+ function out = max(varargin)
4198
+ narginchk(1,2);
4199
+ if nargin==1
4200
+ out = mmax(varargin{1});
4201
+ else
4202
+ out = fmax(varargin{1}, varargin{2});
4203
+ end
4204
+ end
4205
+ function b = isrow(self)
4206
+ b = is_row(self);
4207
+ end
4208
+ function b = iscolumn(self)
4209
+ b = is_column(self);
4210
+ end
4211
+ function b = isvector(self)
4212
+ b = is_vector(self);
4213
+ end
4214
+ function b = isscalar(self)
4215
+ b = is_scalar(self);
4216
+ end
4217
+ %}
4218
+ }
4219
+ %extend Function {
4220
+ %matlabcode %{
4221
+ function varargout = subsref(self,s)
4222
+ if numel(s)==1 && strcmp(s.type,'()')
4223
+ [varargout{1:nargout}]= paren(self, s.subs{:});
4224
+ else
4225
+ [varargout{1:nargout}] = builtin('subsref',self,s);
4226
+ end
4227
+ end
4228
+ function varargout = paren(self, varargin)
4229
+ if nargin==1 || (nargin>=2 && ischar(varargin{1}))
4230
+ % Named inputs: return struct
4231
+ assert(nargout<2, 'Syntax error');
4232
+ assert(mod(nargin,2)==1, 'Syntax error');
4233
+ arg = struct;
4234
+ for i=1:2:nargin-1
4235
+ assert(ischar(varargin{i}), 'Syntax error');
4236
+ arg.(varargin{i}) = varargin{i+1};
4237
+ end
4238
+ res = self.call(arg);
4239
+ varargout{1} = res;
4240
+ else
4241
+ % Ordered inputs: return variable number of outputs
4242
+ res = self.call(varargin);
4243
+ assert(nargout<=numel(res), 'Too many outputs');
4244
+ for i=1:max(min(1,numel(res)),nargout)
4245
+ varargout{i} = res{i};
4246
+ end
4247
+ end
4248
+ end
4249
+ %}
4250
+ }
4251
+ }
4252
+ #endif // SWIGMATLAB
4253
+ %include <casadi/core/external.hpp>
4254
+ %include <casadi/core/integrator.hpp>
4255
+ %include <casadi/core/conic.hpp>
4256
+ %include <casadi/core/nlpsol.hpp>
4257
+ %include <casadi/core/rootfinder.hpp>
4258
+ %include <casadi/core/linsol.hpp>
4259
+ %include <casadi/core/dple.hpp>
4260
+ %include <casadi/core/expm.hpp>
4261
+ %include <casadi/core/interpolant.hpp>
4262
+
4263
+ %feature("copyctor", "0") casadi::CodeGenerator;
4264
+ %include <casadi/core/code_generator.hpp>
4265
+
4266
+ #ifdef SWIGMATLAB
4267
+ // Wrap (static) member functions
4268
+ %feature("nonstatic");
4269
+ namespace casadi {
4270
+ %extend SparsityInterfaceCommon {
4271
+ SPARSITY_INTERFACE_ALL(static inline, IS_MEMBER)
4272
+ }
4273
+ %extend GenericExpressionCommon {
4274
+ GENERIC_EXPRESSION_ALL(static inline, IS_MEMBER)
4275
+ }
4276
+ %extend GenericMatrixCommon {
4277
+ GENERIC_MATRIX_ALL(static inline, IS_MEMBER)
4278
+ }
4279
+ %extend MatrixCommon {
4280
+ MATRIX_ALL(static inline, IS_MEMBER)
4281
+ }
4282
+ %extend MX {
4283
+ MX_ALL(static inline, IS_MEMBER)
4284
+ const MX brace(const casadi::MX& rr) const { casadi::MX m; $self->get_nz(m, true, rr); return m;}
4285
+ const MX paren(const casadi::MX& rr) const {
4286
+ casadi::MX m;
4287
+ $self->get(m, true, rr);
4288
+ return m;
4289
+ }
4290
+ const MX paren(char rr, const casadi::MX& cc) const {
4291
+ casadi::MX m;
4292
+ $self->get(m, true, casadi::char2Slice(rr), cc);
4293
+ return m;
4294
+ }
4295
+ const MX paren(const casadi::MX& rr, char cc) const {
4296
+ casadi::MX m;
4297
+ $self->get(m, true, rr, casadi::char2Slice(cc));
4298
+ return m;
4299
+ }
4300
+ const MX paren(const casadi::MX& rr, const casadi::MX& cc) const {
4301
+ casadi::MX m;
4302
+ $self->get(m, true, rr, cc);
4303
+ return m;
4304
+ }
4305
+ }
4306
+ } // namespace casadi
4307
+ %feature("nonstatic", "");
4308
+ // Member functions already wrapped
4309
+ #define FLAG IS_GLOBAL
4310
+ #else // SWIGMATLAB
4311
+ // Need to wrap member functions below
4312
+ #define FLAG (IS_GLOBAL | IS_MEMBER)
4313
+ #endif // SWIGMATLAB
4314
+
4315
+ // Wrap non-member functions, possibly with casadi_ prefix
4316
+
4317
+ %inline {
4318
+ namespace casadi {
4319
+ SPARSITY_INTERFACE_ALL(inline, FLAG)
4320
+ GENERIC_EXPRESSION_ALL(inline, FLAG)
4321
+ GENERIC_MATRIX_ALL(inline, FLAG)
4322
+ MATRIX_ALL(inline, FLAG)
4323
+ MX_ALL(inline, FLAG)
4324
+ }
4325
+ }
4326
+
4327
+ // Wrap the casadi_ prefixed functions in member functions
4328
+ #ifdef SWIGPYTHON
4329
+ #ifdef WITH_PYTHON3
4330
+ namespace casadi {
4331
+ %extend GenericExpressionCommon {
4332
+ %pythoncode %{
4333
+ def __hash__(self):
4334
+ try:
4335
+ return self.element_hash()
4336
+ except:
4337
+ return SharedObject.__hash__(self)
4338
+ def __matmul__(x, y): return _casadi.mtimes(x, y)
4339
+ def __rmatmul__(x, y): return _casadi.mtimes(y, x)
4340
+ %}
4341
+ }
4342
+ }
4343
+ #endif
4344
+ namespace casadi {
4345
+ %extend GenericExpressionCommon {
4346
+ %pythoncode %{
4347
+ def __add__(x, y): return _casadi.plus(x, y)
4348
+ def __radd__(x, y): return _casadi.plus(y, x)
4349
+ def __sub__(x, y): return _casadi.minus(x, y)
4350
+ def __rsub__(x, y): return _casadi.minus(y, x)
4351
+ def __mul__(x, y): return _casadi.times(x, y)
4352
+ def __rmul__(x, y): return _casadi.times(y, x)
4353
+ def __div__(x, y): return _casadi.rdivide(x, y)
4354
+ def __rdiv__(x, y): return _casadi.rdivide(y, x)
4355
+ def __truediv__(x, y): return _casadi.rdivide(x, y)
4356
+ def __rtruediv__(x, y): return _casadi.rdivide(y, x)
4357
+ def __lt__(x, y): return _casadi.lt(x, y)
4358
+ def __rlt__(x, y): return _casadi.lt(y, x)
4359
+ def __le__(x, y): return _casadi.le(x, y)
4360
+ def __rle__(x, y): return _casadi.le(y, x)
4361
+ def __gt__(x, y): return _casadi.lt(y, x)
4362
+ def __rgt__(x, y): return _casadi.lt(x, y)
4363
+ def __ge__(x, y): return _casadi.le(y, x)
4364
+ def __rge__(x, y): return _casadi.le(x, y)
4365
+ def __eq__(x, y): return _casadi.eq(x, y)
4366
+ def __req__(x, y): return _casadi.eq(y, x)
4367
+ def __ne__(x, y): return _casadi.ne(x, y)
4368
+ def __rne__(x, y): return _casadi.ne(y, x)
4369
+ def __pow__(x, n): return _casadi.power(x, n)
4370
+ def __rpow__(n, x): return _casadi.power(x, n)
4371
+ def __arctan2__(x, y): return _casadi.atan2(x, y)
4372
+ def __rarctan2__(y, x): return _casadi.atan2(x, y)
4373
+ def fmin(x, y): return _casadi.fmin(x, y)
4374
+ def fmax(x, y): return _casadi.fmax(x, y)
4375
+ def __fmin__(x, y): return _casadi.fmin(x, y)
4376
+ def __rfmin__(y, x): return _casadi.fmin(x, y)
4377
+ def __fmax__(x, y): return _casadi.fmax(x, y)
4378
+ def __rfmax__(y, x): return _casadi.fmax(x, y)
4379
+ def logic_and(x, y): return _casadi.logic_and(x, y)
4380
+ def logic_or(x, y): return _casadi.logic_or(x, y)
4381
+ def fabs(x): return _casadi.fabs(x)
4382
+ def sqrt(x): return _casadi.sqrt(x)
4383
+ def sin(x): return _casadi.sin(x)
4384
+ def cos(x): return _casadi.cos(x)
4385
+ def tan(x): return _casadi.tan(x)
4386
+ def arcsin(x): return _casadi.asin(x)
4387
+ def arccos(x): return _casadi.acos(x)
4388
+ def arctan(x): return _casadi.atan(x)
4389
+ def sinh(x): return _casadi.sinh(x)
4390
+ def cosh(x): return _casadi.cosh(x)
4391
+ def tanh(x): return _casadi.tanh(x)
4392
+ def arcsinh(x): return _casadi.asinh(x)
4393
+ def arccosh(x): return _casadi.acosh(x)
4394
+ def arctanh(x): return _casadi.atanh(x)
4395
+ def exp(x): return _casadi.exp(x)
4396
+ def log(x): return _casadi.log(x)
4397
+ def log10(x): return _casadi.log10(x)
4398
+ def log1p(x): return _casadi.log1p(x)
4399
+ def expm1(x): return _casadi.expm1(x)
4400
+ def floor(x): return _casadi.floor(x)
4401
+ def ceil(x): return _casadi.ceil(x)
4402
+ def erf(x): return _casadi.erf(x)
4403
+ def sign(x): return _casadi.sign(x)
4404
+ def fmod(x, y): return _casadi.mod(x, y)
4405
+ def hypot(x, y): return _casadi.hypot(x, y)
4406
+ def remainder(x, y): return _casadi.remainder(x, y)
4407
+ def __copysign__(x, y): return _casadi.copysign(x, y)
4408
+ def __rcopysign__(y, x): return _casadi.copysign(x, y)
4409
+ def copysign(x, y): return _casadi.copysign(x, y)
4410
+ def rcopysign(y, x): return _casadi.copysign(x, y)
4411
+ def __constpow__(x, y): return _casadi.constpow(x, y)
4412
+ def __rconstpow__(y, x): return _casadi.constpow(x, y)
4413
+ def constpow(x, y): return _casadi.constpow(x, y)
4414
+ def rconstpow(y, x): return _casadi.constpow(x, y)
4415
+ %}
4416
+ }
4417
+
4418
+ %extend GenericMatrixCommon {
4419
+ %pythoncode %{
4420
+ def __mldivide__(x, y): return _casadi.mldivide(x, y)
4421
+ def __rmldivide__(y, x): return _casadi.mldivide(x, y)
4422
+ def __mrdivide__(x, y): return _casadi.mrdivide(x, y)
4423
+ def __rmrdivide__(y, x): return _casadi.mrdivide(x, y)
4424
+ def __mpower__(x, y): return _casadi.mpower(x, y)
4425
+ def __rmpower__(y, x): return _casadi.mpower(x, y)
4426
+ %}
4427
+ }
4428
+
4429
+ } // namespace casadi
4430
+ #endif // SWIGPYTHON
4431
+
4432
+ %feature("director") casadi::Callback;
4433
+
4434
+ %include <casadi/core/importer.hpp>
4435
+ %include <casadi/core/callback.hpp>
4436
+ %include <casadi/core/global_options.hpp>
4437
+ %include <casadi/core/casadi_meta.hpp>
4438
+ %include <casadi/core/integration_tools.hpp>
4439
+ %include <casadi/core/nlp_tools.hpp>
4440
+ %include <casadi/core/tools.hpp>
4441
+ %include <casadi/core/nlp_builder.hpp>
4442
+ %include <casadi/core/dae_builder.hpp>
4443
+ %include <casadi/core/xml_file.hpp>
4444
+
4445
+ %feature("copyctor", "0") casadi::SerializerBase;
4446
+ %feature("copyctor", "0") casadi::DeserializerBase;
4447
+ %feature("copyctor", "0") casadi::StringSerializer;
4448
+ %feature("copyctor", "0") casadi::StringDeserializer;
4449
+ %feature("copyctor", "0") casadi::FileSerializer;
4450
+ %feature("copyctor", "0") casadi::FileDeserializer;
4451
+ %nodefaultctor casadi::SerializerBase;
4452
+ %nodefaultctor casadi::DeserializerBase;
4453
+
4454
+ #ifdef SWIGPYTHON
4455
+ %rename("_pop_type") casadi::DeserializerBase::pop_type;
4456
+ %rename("%(regex:/(SERIALIZED_\w+)/_\\1/)s", regextarget=1, fullname=1) "casadi::SerializerBase::SERIALIZED_\w+";
4457
+ #endif // SWIG_PYTHON
4458
+
4459
+
4460
+ #ifdef SWIGMATLAB
4461
+ %rename("internal_pop_type") casadi::DeserializerBase::pop_type;
4462
+ %rename("%(regex:/(SERIALIZED_\w+)/internal_\\1/)s", regextarget=1, fullname=1) "casadi::SerializerBase::SERIALIZED_\w+";
4463
+ #endif // SWIG_PYTHON
4464
+
4465
+ %include <casadi/core/serializer.hpp>
4466
+
4467
+ #ifdef SWIGPYTHON
4468
+ %extend casadi::DeserializerBase {
4469
+ %pythoncode %{
4470
+ def unpack(self):
4471
+ type = SerializerBase.type_to_string(self._pop_type())
4472
+ f = getattr(self, "blind_unpack_"+type)
4473
+ return f()
4474
+ %}
4475
+ }
4476
+ #endif // SWIGPYTHON
4477
+ #ifdef SWIGMATLAB
4478
+ %extend casadi::DeserializerBase {
4479
+ %matlabcode %{
4480
+ function out = unpack(self)
4481
+ type = casadi.SerializerBase.type_to_string(self.internal_pop_type);
4482
+ out = self.(['blind_unpack_' type]);
4483
+ end
4484
+ %}
4485
+ }
4486
+ #endif // SWIGMATLAB
4487
+
4488
+ %feature("director") casadi::OptiCallback;
4489
+
4490
+ // Return-by-value
4491
+ %typemap(out, doc="double", noblock=1, fragment="casadi_all") casadi::native_DM {
4492
+ if(!($result = full_or_sparse($1, true))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type 'double'.");
4493
+ }
4494
+
4495
+
4496
+ %apply casadi_int &OUTPUT { Opti::ConstraintType &OUTPUT };
4497
+
4498
+ %typemap(argout, noblock=1,fragment="casadi_all") casadi::Opti::ConstraintType &OUTPUT {
4499
+ %append_output(casadi::from_ptr((casadi_int *) $1));
4500
+ }
4501
+
4502
+ %typemap(in, doc="Opti.ConstraintType", noblock=1, numinputs=0) casadi::Opti::ConstraintType &OUTPUT (casadi::Opti::ConstraintType m) {
4503
+ $1 = &m;
4504
+ }
4505
+
4506
+
4507
+ #ifdef SWIGPYTHON
4508
+
4509
+ %define make_property(class, name)
4510
+ %rename(_ ## name) class ## :: ## name;
4511
+ %extend class {
4512
+ %pythoncode %{
4513
+ @property
4514
+ def name(self):
4515
+ return self._ ## name()
4516
+ %}
4517
+ }
4518
+ %enddef
4519
+
4520
+
4521
+ make_property(casadi::Opti, debug);
4522
+ make_property(casadi::Opti, advanced);
4523
+ make_property(casadi::OptiSol, opti);
4524
+
4525
+ %define make_property_opti(name)
4526
+ make_property(casadi::Opti, name);
4527
+ %enddef
4528
+
4529
+ make_property(casadi::OptiSol, debug);
4530
+ make_property_opti(f)
4531
+ make_property_opti(g)
4532
+ make_property_opti(x)
4533
+ make_property_opti(p)
4534
+ make_property_opti(lam_g)
4535
+ make_property_opti(lbg)
4536
+ make_property_opti(ubg)
4537
+ make_property_opti(nx)
4538
+ make_property_opti(np)
4539
+ make_property_opti(ng)
4540
+
4541
+ make_property(casadi::Opti, casadi_solver);
4542
+ %define opti_metadata_modifiers(class)
4543
+ %rename(_variable) class ## :: variable;
4544
+ %rename(_parameter) class ## :: parameter;
4545
+ %rename(_subject_to) class ## :: subject_to;
4546
+ %extend class {
4547
+ %pythoncode %{
4548
+ def parameter(self,*args):
4549
+ import sys
4550
+ import os
4551
+ try:
4552
+ frame = sys._getframe(1)
4553
+ except:
4554
+ frame = {}
4555
+ meta = {} if frame is None else {"stacktrace": {"file":os.path.abspath(frame.f_code.co_filename),"line":frame.f_lineno,"name":frame.f_code.co_name}}
4556
+ ret = self._parameter(*args)
4557
+ if len(meta)>0:
4558
+ self.update_user_dict(ret, meta)
4559
+ return ret
4560
+
4561
+ def variable(self,*args):
4562
+ import sys
4563
+ import os
4564
+ try:
4565
+ frame = sys._getframe(1)
4566
+ except:
4567
+ frame = {}
4568
+ meta = {} if frame is None else {"stacktrace": {"file":os.path.abspath(frame.f_code.co_filename),"line":frame.f_lineno,"name":frame.f_code.co_name}}
4569
+ ret = self._variable(*args)
4570
+ if len(meta)>0:
4571
+ self.update_user_dict(ret, meta)
4572
+ return ret
4573
+
4574
+ def subject_to(self,*args):
4575
+ if len(args)==0:
4576
+ return self._subject_to()
4577
+ import sys
4578
+ import os
4579
+ try:
4580
+ frame = sys._getframe(1)
4581
+ except:
4582
+ frame = {}
4583
+ meta = {} if frame is None else {"stacktrace": {"file":os.path.abspath(frame.f_code.co_filename),"line":frame.f_lineno,"name":frame.f_code.co_name}}
4584
+ ret = self._subject_to(*args)
4585
+ if len(meta)>0:
4586
+ self.update_user_dict(args[0], meta)
4587
+ return ret
4588
+ %}
4589
+ }
4590
+ %enddef
4591
+
4592
+ opti_metadata_modifiers(casadi::Opti);
4593
+
4594
+ #endif
4595
+
4596
+
4597
+ #ifdef SWIGMATLAB
4598
+ %define opti_metadata_modifiers(class)
4599
+ %rename(internal_variable) class ## ::variable;
4600
+ %rename(internal_parameter) class ## ::parameter;
4601
+ %rename(internal_subject_to) class ## ::subject_to;
4602
+ %extend class {
4603
+ %matlabcode %{
4604
+ function out = variable(self, varargin)
4605
+ st = dbstack('-completenames',1);
4606
+ if length(st)>0
4607
+ meta = struct('stacktrace', st(1));
4608
+ else
4609
+ meta = struct;
4610
+ end
4611
+ out = self.internal_variable(varargin{:});
4612
+ self.update_user_dict(out, meta);
4613
+ end
4614
+ function out = parameter(self, varargin)
4615
+ st = dbstack('-completenames',1);
4616
+ if length(st)>0
4617
+ meta = struct('stacktrace', st(1));
4618
+ else
4619
+ meta = struct;
4620
+ end
4621
+ out = self.internal_parameter(varargin{:});
4622
+ self.update_user_dict(out, meta);
4623
+ end
4624
+ function [] = subject_to(self, varargin)
4625
+ if length(varargin)==0
4626
+ self.internal_subject_to();
4627
+ return;
4628
+ end
4629
+ st = dbstack('-completenames',1);
4630
+ if length(st)>0
4631
+ meta = struct('stacktrace', st(1));
4632
+ else
4633
+ meta = struct;
4634
+ end
4635
+ self.internal_subject_to(varargin{:});
4636
+ self.update_user_dict(varargin{1}, meta);
4637
+ end
4638
+ %}
4639
+ }
4640
+ %enddef
4641
+
4642
+ opti_metadata_modifiers(casadi::Opti)
4643
+ #endif
4644
+ %include <casadi/core/optistack.hpp>
4645
+
4646
+
4647
+ #ifdef SWIGPYTHON
4648
+ %extend casadi::Opti {
4649
+ %pythoncode %{
4650
+
4651
+ @staticmethod
4652
+ def _callback(self,fh=None):
4653
+ if fh is None:
4654
+ self.callback_class();
4655
+ return
4656
+ class OptiCallbackHelper(OptiCallback):
4657
+ def __init__(self, callback):
4658
+ OptiCallback.__init__(self)
4659
+ self.callback = callback
4660
+
4661
+ def call(self, i):
4662
+ self.callback(i)
4663
+
4664
+ self._fh = fh
4665
+ self._cb = OptiCallbackHelper(fh);
4666
+ self.callback_class(self._cb);
4667
+
4668
+
4669
+ def callback(self,fh=None):
4670
+ self._callback(self,fh)
4671
+
4672
+
4673
+ %}
4674
+
4675
+ }
4676
+ #endif
4677
+
4678
+ #ifdef SWIGMATLAB
4679
+ %extend casadi::Opti {
4680
+ %matlabcode %{
4681
+ function [] = callback(self, varargin)
4682
+ casadi.OptiCallbackHelper.callback_setup(self, varargin{:})
4683
+ end
4684
+ %}
4685
+ }
4686
+ #endif
4687
+
4688
+ // Cleanup for dependent modules
4689
+ %exception {
4690
+ $action
4691
+ }