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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (448) hide show
  1. casadi/_casadi.so +0 -0
  2. casadi/casadi-cli +0 -0
  3. casadi/casadi.py +6070 -3038
  4. casadi/cbc +0 -0
  5. casadi/clp +0 -0
  6. casadi/cmake/casadi-config-version.cmake +1 -1
  7. casadi/cmake/casadi-targets-release.cmake +5 -5
  8. casadi/cmake/casadi-targets.cmake +7 -7
  9. casadi/{lib/cmake/tinyxml2/tinyxml2-config-version.cmake → cmake/ghc_filesystem/ghc_filesystem-config-version.cmake} +30 -10
  10. casadi/cmake/ghc_filesystem/ghc_filesystem-config.cmake +30 -0
  11. casadi/{lib/cmake/tinyxml2/tinyxml2-static-targets.cmake → cmake/ghc_filesystem/ghc_filesystem-targets.cmake} +10 -10
  12. casadi/cmake/highs/highs-targets-release.cmake +2 -2
  13. casadi/cmake/highs/highs-targets.cmake +3 -3
  14. casadi/cmake/libzip/libzip-config-version.cmake +43 -0
  15. casadi/cmake/libzip/libzip-config.cmake +69 -0
  16. casadi/cmake/libzip/libzip-targets-release.cmake +19 -0
  17. casadi/cmake/libzip/libzip-targets.cmake +107 -0
  18. casadi/cmake/libzip/modules/FindMbedTLS.cmake +141 -0
  19. casadi/cmake/libzip/modules/FindNettle.cmake +141 -0
  20. casadi/cmake/libzip/modules/Findzstd.cmake +186 -0
  21. casadi/cmake/osqp/osqp-targets.cmake +2 -2
  22. casadi/cmake/proxsuite/proxsuiteTargets.cmake +2 -2
  23. casadi/cmake/qdldl/qdldl-targets.cmake +2 -2
  24. casadi/cmake/sleqp/sleqp-targets.cmake +2 -2
  25. casadi/cmake/trlib/trlib-config.cmake +2 -2
  26. casadi/highs +0 -0
  27. casadi/include/casadi/casadi.i +194 -44
  28. casadi/include/casadi/config.h +11 -11
  29. casadi/include/casadi/core/archiver.hpp +58 -0
  30. casadi/include/casadi/core/blazing_spline.hpp +47 -0
  31. casadi/include/casadi/core/calculus.hpp +57 -2
  32. casadi/include/casadi/core/casadi_common.hpp +37 -0
  33. casadi/include/casadi/core/casadi_meta.hpp +15 -0
  34. casadi/include/casadi/core/casadi_misc.hpp +7 -0
  35. casadi/include/casadi/core/code_generator.hpp +95 -17
  36. casadi/include/casadi/core/core.hpp +5 -0
  37. casadi/include/casadi/core/dae_builder.hpp +283 -141
  38. casadi/include/casadi/core/dm.hpp +3 -0
  39. casadi/include/casadi/core/filesystem.hpp +58 -0
  40. casadi/include/casadi/core/fmu.hpp +51 -16
  41. casadi/include/casadi/core/function.hpp +19 -0
  42. casadi/include/casadi/core/generic_matrix.hpp +214 -7
  43. casadi/include/casadi/core/generic_shared.hpp +318 -0
  44. casadi/include/casadi/core/generic_shared_impl.hpp +214 -0
  45. casadi/include/casadi/core/generic_shared_internal.hpp +215 -0
  46. casadi/include/casadi/core/generic_type.hpp +3 -0
  47. casadi/include/casadi/core/global_options.hpp +10 -0
  48. casadi/include/casadi/core/integrator.hpp +41 -7
  49. casadi/include/casadi/core/matrix_decl.hpp +67 -0
  50. casadi/include/casadi/core/mx.hpp +63 -2
  51. casadi/include/casadi/core/options.hpp +6 -3
  52. casadi/include/casadi/core/optistack.hpp +43 -9
  53. casadi/include/casadi/core/printable.hpp +8 -0
  54. casadi/include/casadi/core/resource.hpp +107 -0
  55. casadi/include/casadi/core/runtime/casadi_blazing_1d_boor_eval.hpp +112 -0
  56. casadi/include/casadi/core/runtime/casadi_blazing_2d_boor_eval.hpp +311 -0
  57. casadi/include/casadi/core/runtime/casadi_blazing_3d_boor_eval.hpp +645 -0
  58. casadi/include/casadi/core/runtime/casadi_blazing_de_boor.hpp +101 -0
  59. casadi/include/casadi/core/runtime/casadi_nlp.hpp +8 -2
  60. casadi/include/casadi/core/runtime/casadi_printme.hpp +25 -0
  61. casadi/include/casadi/core/serializer.hpp +12 -4
  62. casadi/include/casadi/core/serializing_stream.hpp +3 -0
  63. casadi/include/casadi/core/shared_object.hpp +73 -161
  64. casadi/include/casadi/core/sparsity.hpp +13 -1
  65. casadi/include/casadi/core/sparsity_interface.hpp +19 -1
  66. casadi/include/casadi/core/sx.hpp +41 -0
  67. casadi/include/casadi/core/sx_elem.hpp +25 -0
  68. casadi/include/casadi/core/xml_node.hpp +5 -0
  69. casadi/include/casadi/doc.i +9703 -6539
  70. casadi/include/casadi/doc_merged.i +6483 -4447
  71. casadi/include/casadi/valgrind-casadi.supp +138 -0
  72. casadi/include/casadi/valgrind-python.supp +2470 -0
  73. casadi/include/fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp +4 -1
  74. casadi/include/ghc/filesystem.hpp +6083 -0
  75. casadi/include/ghc/fs_fwd.hpp +38 -0
  76. casadi/include/ghc/fs_impl.hpp +35 -0
  77. casadi/include/ghc/fs_std.hpp +60 -0
  78. casadi/include/ghc/fs_std_fwd.hpp +63 -0
  79. casadi/include/ghc/fs_std_impl.hpp +46 -0
  80. casadi/include/highs/HConfig.h +6 -4
  81. casadi/include/highs/Highs.h +260 -86
  82. casadi/include/highs/filereaderlp/reader.hpp +10 -10
  83. casadi/include/highs/interfaces/highs_c_api.h +195 -22
  84. casadi/include/highs/io/Filereader.h +4 -6
  85. casadi/include/highs/io/FilereaderEms.h +0 -3
  86. casadi/include/highs/io/FilereaderLp.h +0 -3
  87. casadi/include/highs/io/FilereaderMps.h +0 -3
  88. casadi/include/highs/io/HMPSIO.h +1 -4
  89. casadi/include/highs/io/HMpsFF.h +8 -5
  90. casadi/include/highs/io/HighsIO.h +10 -5
  91. casadi/include/highs/io/LoadOptions.h +0 -3
  92. casadi/include/highs/ipm/IpxSolution.h +0 -3
  93. casadi/include/highs/ipm/IpxWrapper.h +4 -7
  94. casadi/include/highs/ipm/ipx/control.h +1 -0
  95. casadi/include/highs/ipm/ipx/ipx_parameters.h +1 -0
  96. casadi/include/highs/ipm/ipx/lp_solver.h +3 -2
  97. casadi/include/highs/ipm/ipx/model.h +7 -3
  98. casadi/include/highs/lp_data/HConst.h +21 -6
  99. casadi/include/highs/lp_data/HStruct.h +40 -4
  100. casadi/include/highs/lp_data/HighsAnalysis.h +0 -3
  101. casadi/include/highs/lp_data/HighsCallback.h +10 -3
  102. casadi/include/highs/lp_data/HighsCallbackStruct.h +3 -3
  103. casadi/include/highs/lp_data/HighsDebug.h +0 -3
  104. casadi/include/highs/lp_data/HighsIis.h +62 -0
  105. casadi/include/highs/lp_data/HighsInfo.h +50 -43
  106. casadi/include/highs/lp_data/HighsInfoDebug.h +0 -3
  107. casadi/include/highs/lp_data/HighsLp.h +2 -3
  108. casadi/include/highs/lp_data/HighsLpSolverObject.h +0 -3
  109. casadi/include/highs/lp_data/HighsLpUtils.h +38 -6
  110. casadi/include/highs/lp_data/HighsModelUtils.h +21 -18
  111. casadi/include/highs/lp_data/HighsOptions.h +134 -22
  112. casadi/include/highs/lp_data/HighsRanging.h +0 -3
  113. casadi/include/highs/lp_data/HighsSolution.h +10 -3
  114. casadi/include/highs/lp_data/HighsSolutionDebug.h +0 -3
  115. casadi/include/highs/lp_data/HighsSolve.h +0 -3
  116. casadi/include/highs/lp_data/HighsStatus.h +0 -3
  117. casadi/include/highs/mip/HighsCliqueTable.h +3 -3
  118. casadi/include/highs/mip/HighsConflictPool.h +0 -3
  119. casadi/include/highs/mip/HighsCutGeneration.h +13 -3
  120. casadi/include/highs/mip/HighsCutPool.h +0 -3
  121. casadi/include/highs/mip/HighsDebugSol.h +0 -3
  122. casadi/include/highs/mip/HighsDomain.h +16 -4
  123. casadi/include/highs/mip/HighsDomainChange.h +0 -3
  124. casadi/include/highs/mip/HighsDynamicRowMatrix.h +0 -3
  125. casadi/include/highs/mip/HighsGFkSolve.h +3 -6
  126. casadi/include/highs/mip/HighsImplications.h +29 -5
  127. casadi/include/highs/mip/HighsLpAggregator.h +0 -3
  128. casadi/include/highs/mip/HighsLpRelaxation.h +0 -3
  129. casadi/include/highs/mip/HighsMipAnalysis.h +52 -0
  130. casadi/include/highs/mip/HighsMipSolver.h +11 -4
  131. casadi/include/highs/mip/HighsMipSolverData.h +67 -6
  132. casadi/include/highs/mip/HighsModkSeparator.h +1 -4
  133. casadi/include/highs/mip/HighsNodeQueue.h +0 -3
  134. casadi/include/highs/mip/HighsObjectiveFunction.h +0 -3
  135. casadi/include/highs/mip/HighsPathSeparator.h +1 -4
  136. casadi/include/highs/mip/HighsPrimalHeuristics.h +7 -5
  137. casadi/include/highs/mip/HighsPseudocost.h +0 -3
  138. casadi/include/highs/mip/HighsRedcostFixing.h +0 -3
  139. casadi/include/highs/mip/HighsSearch.h +0 -3
  140. casadi/include/highs/mip/HighsSeparation.h +0 -3
  141. casadi/include/highs/mip/HighsSeparator.h +1 -5
  142. casadi/include/highs/mip/HighsTableauSeparator.h +1 -4
  143. casadi/include/highs/mip/HighsTransformedLp.h +0 -3
  144. casadi/include/highs/mip/MipTimer.h +471 -0
  145. casadi/include/highs/parallel/HighsBinarySemaphore.h +1 -1
  146. casadi/include/highs/parallel/HighsCacheAlign.h +1 -1
  147. casadi/include/highs/parallel/HighsCombinable.h +1 -1
  148. casadi/include/highs/parallel/HighsMutex.h +1 -1
  149. casadi/include/highs/parallel/HighsRaceTimer.h +1 -1
  150. casadi/include/highs/parallel/HighsSchedulerConstants.h +1 -1
  151. casadi/include/highs/parallel/HighsSplitDeque.h +1 -1
  152. casadi/include/highs/parallel/HighsTaskExecutor.h +68 -55
  153. casadi/include/highs/pdlp/CupdlpWrapper.h +18 -7
  154. casadi/include/highs/pdlp/cupdlp/cupdlp_cs.h +2 -3
  155. casadi/include/highs/pdlp/cupdlp/cupdlp_defs.h +16 -6
  156. casadi/include/highs/pdlp/cupdlp/cupdlp_linalg.h +10 -4
  157. casadi/include/highs/pdlp/cupdlp/cupdlp_proj.h +3 -3
  158. casadi/include/highs/pdlp/cupdlp/cupdlp_restart.h +6 -6
  159. casadi/include/highs/pdlp/cupdlp/cupdlp_scaling.h +26 -0
  160. casadi/include/highs/pdlp/cupdlp/cupdlp_solver.h +11 -11
  161. casadi/include/highs/pdlp/cupdlp/cupdlp_step.h +8 -4
  162. casadi/include/highs/pdlp/cupdlp/cupdlp_utils.c +253 -172
  163. casadi/include/highs/presolve/HPresolve.h +50 -10
  164. casadi/include/highs/presolve/HPresolveAnalysis.h +0 -3
  165. casadi/include/highs/presolve/HighsPostsolveStack.h +39 -6
  166. casadi/include/highs/presolve/HighsSymmetry.h +0 -3
  167. casadi/include/highs/presolve/ICrash.h +0 -3
  168. casadi/include/highs/presolve/ICrashUtil.h +1 -4
  169. casadi/include/highs/presolve/ICrashX.h +0 -3
  170. casadi/include/highs/presolve/PresolveComponent.h +0 -3
  171. casadi/include/highs/qpsolver/a_asm.hpp +20 -17
  172. casadi/include/highs/qpsolver/a_quass.hpp +5 -9
  173. casadi/include/highs/qpsolver/basis.hpp +12 -10
  174. casadi/include/highs/qpsolver/crashsolution.hpp +4 -3
  175. casadi/include/highs/qpsolver/dantzigpricing.hpp +3 -2
  176. casadi/include/highs/qpsolver/devexpricing.hpp +3 -1
  177. casadi/include/highs/qpsolver/factor.hpp +6 -5
  178. casadi/include/highs/qpsolver/feasibility_bounded.hpp +31 -29
  179. casadi/include/highs/qpsolver/feasibility_highs.hpp +94 -70
  180. casadi/include/highs/qpsolver/gradient.hpp +1 -1
  181. casadi/include/highs/qpsolver/instance.hpp +1 -1
  182. casadi/include/highs/qpsolver/pricing.hpp +2 -2
  183. casadi/include/highs/qpsolver/qpconst.hpp +2 -2
  184. casadi/include/highs/qpsolver/quass.hpp +2 -2
  185. casadi/include/highs/qpsolver/runtime.hpp +2 -2
  186. casadi/include/highs/qpsolver/settings.hpp +20 -8
  187. casadi/include/highs/qpsolver/steepestedgepricing.hpp +38 -39
  188. casadi/include/highs/simplex/HApp.h +88 -34
  189. casadi/include/highs/simplex/HEkk.h +24 -11
  190. casadi/include/highs/simplex/HEkkDual.h +2 -4
  191. casadi/include/highs/simplex/HEkkDualRHS.h +0 -3
  192. casadi/include/highs/simplex/HEkkDualRow.h +0 -3
  193. casadi/include/highs/simplex/HEkkPrimal.h +1 -5
  194. casadi/include/highs/simplex/HSimplex.h +0 -3
  195. casadi/include/highs/simplex/HSimplexDebug.h +0 -3
  196. casadi/include/highs/simplex/HSimplexNla.h +0 -26
  197. casadi/include/highs/simplex/HSimplexReport.h +0 -3
  198. casadi/include/highs/simplex/HighsSimplexAnalysis.h +5 -8
  199. casadi/include/highs/simplex/SimplexConst.h +10 -11
  200. casadi/include/highs/simplex/SimplexStruct.h +9 -12
  201. casadi/include/highs/simplex/SimplexTimer.h +83 -101
  202. casadi/include/highs/test/DevKkt.h +0 -3
  203. casadi/include/highs/test/KktCh2.h +0 -3
  204. casadi/include/highs/util/FactorTimer.h +39 -64
  205. casadi/include/highs/util/HFactor.h +4 -4
  206. casadi/include/highs/util/HFactorConst.h +0 -3
  207. casadi/include/highs/util/HFactorDebug.h +0 -3
  208. casadi/include/highs/util/HSet.h +0 -3
  209. casadi/include/highs/util/HVector.h +0 -3
  210. casadi/include/highs/util/HVectorBase.h +1 -4
  211. casadi/include/highs/util/HighsCDouble.h +12 -3
  212. casadi/include/highs/util/HighsComponent.h +0 -3
  213. casadi/include/highs/util/HighsDataStack.h +0 -3
  214. casadi/include/highs/util/HighsDisjointSets.h +0 -3
  215. casadi/include/highs/util/HighsHash.h +9 -12
  216. casadi/include/highs/util/HighsHashTree.h +15 -11
  217. casadi/include/highs/util/HighsInt.h +0 -3
  218. casadi/include/highs/util/HighsIntegers.h +0 -3
  219. casadi/include/highs/util/HighsLinearSumBounds.h +0 -3
  220. casadi/include/highs/util/HighsMatrixPic.h +0 -3
  221. casadi/include/highs/util/HighsMatrixSlice.h +3 -6
  222. casadi/include/highs/util/HighsMatrixUtils.h +0 -3
  223. casadi/include/highs/util/HighsMemoryAllocation.h +11 -3
  224. casadi/include/highs/util/HighsRandom.h +3 -6
  225. casadi/include/highs/util/HighsRbTree.h +0 -3
  226. casadi/include/highs/util/HighsSort.h +0 -3
  227. casadi/include/highs/util/HighsSparseMatrix.h +6 -3
  228. casadi/include/highs/util/HighsSparseVectorSum.h +0 -3
  229. casadi/include/highs/util/HighsSplay.h +0 -3
  230. casadi/include/highs/util/HighsTimer.h +94 -56
  231. casadi/include/highs/util/HighsUtils.h +10 -3
  232. casadi/include/highs/util/stringutil.h +14 -12
  233. casadi/include/licenses/ghc-external/LICENSE +19 -0
  234. casadi/include/licenses/libz-external/LICENSE +22 -0
  235. casadi/include/licenses/libz-external/contrib/dotzlib/LICENSE_1_0.txt +23 -0
  236. casadi/include/licenses/libzip-external/LICENSE +31 -0
  237. casadi/include/zconf.h +545 -0
  238. casadi/include/zip.h +528 -0
  239. casadi/include/zipconf.h +48 -0
  240. casadi/include/zlib.h +1938 -0
  241. casadi/libCbc.3.10.11.dylib +0 -0
  242. casadi/libCbc.3.dylib +0 -0
  243. casadi/libCbc.dylib +0 -0
  244. casadi/libCbc.la +1 -1
  245. casadi/libCbcSolver.3.10.11.dylib +0 -0
  246. casadi/libCbcSolver.3.dylib +0 -0
  247. casadi/libCbcSolver.dylib +0 -0
  248. casadi/libCbcSolver.la +1 -1
  249. casadi/libCgl.1.10.8.dylib +0 -0
  250. casadi/libCgl.1.dylib +0 -0
  251. casadi/libCgl.dylib +0 -0
  252. casadi/libCgl.la +1 -1
  253. casadi/libClp.1.14.9.dylib +0 -0
  254. casadi/libClp.1.dylib +0 -0
  255. casadi/libClp.dylib +0 -0
  256. casadi/libClp.la +1 -1
  257. casadi/libClpSolver.1.14.9.dylib +0 -0
  258. casadi/libClpSolver.1.dylib +0 -0
  259. casadi/libClpSolver.dylib +0 -0
  260. casadi/libClpSolver.la +1 -1
  261. casadi/libCoinUtils.3.11.10.dylib +0 -0
  262. casadi/libCoinUtils.3.dylib +0 -0
  263. casadi/libCoinUtils.dylib +0 -0
  264. casadi/libOsi.1.13.9.dylib +0 -0
  265. casadi/libOsi.1.dylib +0 -0
  266. casadi/libOsi.dylib +0 -0
  267. casadi/libOsiCbc.3.10.11.dylib +0 -0
  268. casadi/libOsiCbc.3.dylib +0 -0
  269. casadi/libOsiCbc.dylib +0 -0
  270. casadi/libOsiCbc.la +1 -1
  271. casadi/libOsiClp.1.14.9.dylib +0 -0
  272. casadi/libOsiClp.1.dylib +0 -0
  273. casadi/libOsiClp.dylib +0 -0
  274. casadi/libOsiClp.la +1 -1
  275. casadi/libOsiCommonTests.1.13.9.dylib +0 -0
  276. casadi/libOsiCommonTests.1.dylib +0 -0
  277. casadi/libOsiCommonTests.dylib +0 -0
  278. casadi/libblasfeo.dylib +0 -0
  279. casadi/libbonmin.4.8.9.dylib +0 -0
  280. casadi/libbonmin.4.dylib +0 -0
  281. casadi/libbonmin.dylib +0 -0
  282. casadi/libbonmin.la +1 -1
  283. casadi/libc++.1.0.dylib +0 -0
  284. casadi/libcasadi.3.7.dylib +0 -0
  285. casadi/libcasadi.dylib +0 -0
  286. casadi/libcasadi_archiver_libzip.3.7.dylib +0 -0
  287. casadi/libcasadi_archiver_libzip.dylib +0 -0
  288. casadi/libcasadi_conic_cbc.3.7.dylib +0 -0
  289. casadi/libcasadi_conic_cbc.dylib +0 -0
  290. casadi/libcasadi_conic_clp.3.7.dylib +0 -0
  291. casadi/libcasadi_conic_clp.dylib +0 -0
  292. casadi/libcasadi_conic_cplex.3.7.dylib +0 -0
  293. casadi/libcasadi_conic_cplex.dylib +0 -0
  294. casadi/libcasadi_conic_daqp.3.7.dylib +0 -0
  295. casadi/libcasadi_conic_daqp.dylib +0 -0
  296. casadi/libcasadi_conic_fatrop.3.7.dylib +0 -0
  297. casadi/libcasadi_conic_fatrop.dylib +0 -0
  298. casadi/libcasadi_conic_gurobi.3.7.dylib +0 -0
  299. casadi/libcasadi_conic_gurobi.dylib +0 -0
  300. casadi/libcasadi_conic_highs.3.7.dylib +0 -0
  301. casadi/libcasadi_conic_highs.dylib +0 -0
  302. casadi/libcasadi_conic_ipqp.3.7.dylib +0 -0
  303. casadi/libcasadi_conic_ipqp.dylib +0 -0
  304. casadi/libcasadi_conic_nlpsol.3.7.dylib +0 -0
  305. casadi/libcasadi_conic_nlpsol.dylib +0 -0
  306. casadi/libcasadi_conic_osqp.3.7.dylib +0 -0
  307. casadi/libcasadi_conic_osqp.dylib +0 -0
  308. casadi/libcasadi_conic_proxqp.3.7.dylib +0 -0
  309. casadi/libcasadi_conic_proxqp.dylib +0 -0
  310. casadi/libcasadi_conic_qpoases.3.7.dylib +0 -0
  311. casadi/libcasadi_conic_qpoases.dylib +0 -0
  312. casadi/libcasadi_conic_qrqp.3.7.dylib +0 -0
  313. casadi/libcasadi_conic_qrqp.dylib +0 -0
  314. casadi/libcasadi_conic_superscs.3.7.dylib +0 -0
  315. casadi/libcasadi_conic_superscs.dylib +0 -0
  316. casadi/libcasadi_filesystem_ghc.3.7.dylib +0 -0
  317. casadi/libcasadi_filesystem_ghc.dylib +0 -0
  318. casadi/libcasadi_importer_shell.3.7.dylib +0 -0
  319. casadi/libcasadi_importer_shell.dylib +0 -0
  320. casadi/libcasadi_integrator_collocation.3.7.dylib +0 -0
  321. casadi/libcasadi_integrator_collocation.dylib +0 -0
  322. casadi/libcasadi_integrator_cvodes.3.7.dylib +0 -0
  323. casadi/libcasadi_integrator_cvodes.dylib +0 -0
  324. casadi/libcasadi_integrator_idas.3.7.dylib +0 -0
  325. casadi/libcasadi_integrator_idas.dylib +0 -0
  326. casadi/libcasadi_integrator_rk.3.7.dylib +0 -0
  327. casadi/libcasadi_integrator_rk.dylib +0 -0
  328. casadi/libcasadi_interpolant_bspline.3.7.dylib +0 -0
  329. casadi/libcasadi_interpolant_bspline.dylib +0 -0
  330. casadi/libcasadi_interpolant_linear.3.7.dylib +0 -0
  331. casadi/libcasadi_interpolant_linear.dylib +0 -0
  332. casadi/libcasadi_linsol_csparse.3.7.dylib +0 -0
  333. casadi/libcasadi_linsol_csparse.dylib +0 -0
  334. casadi/libcasadi_linsol_csparsecholesky.3.7.dylib +0 -0
  335. casadi/libcasadi_linsol_csparsecholesky.dylib +0 -0
  336. casadi/libcasadi_linsol_lapacklu.3.7.dylib +0 -0
  337. casadi/libcasadi_linsol_lapacklu.dylib +0 -0
  338. casadi/libcasadi_linsol_lapackqr.3.7.dylib +0 -0
  339. casadi/libcasadi_linsol_lapackqr.dylib +0 -0
  340. casadi/libcasadi_linsol_ldl.3.7.dylib +0 -0
  341. casadi/libcasadi_linsol_ldl.dylib +0 -0
  342. casadi/libcasadi_linsol_lsqr.3.7.dylib +0 -0
  343. casadi/libcasadi_linsol_lsqr.dylib +0 -0
  344. casadi/libcasadi_linsol_ma27.3.7.dylib +0 -0
  345. casadi/libcasadi_linsol_ma27.dylib +0 -0
  346. casadi/libcasadi_linsol_mumps.3.7.dylib +0 -0
  347. casadi/libcasadi_linsol_mumps.dylib +0 -0
  348. casadi/libcasadi_linsol_qr.3.7.dylib +0 -0
  349. casadi/libcasadi_linsol_qr.dylib +0 -0
  350. casadi/libcasadi_linsol_symbolicqr.3.7.dylib +0 -0
  351. casadi/libcasadi_linsol_symbolicqr.dylib +0 -0
  352. casadi/libcasadi_linsol_tridiag.3.7.dylib +0 -0
  353. casadi/libcasadi_linsol_tridiag.dylib +0 -0
  354. casadi/libcasadi_nlpsol_ampl.3.7.dylib +0 -0
  355. casadi/libcasadi_nlpsol_ampl.dylib +0 -0
  356. casadi/libcasadi_nlpsol_blocksqp.3.7.dylib +0 -0
  357. casadi/libcasadi_nlpsol_blocksqp.dylib +0 -0
  358. casadi/libcasadi_nlpsol_bonmin.3.7.dylib +0 -0
  359. casadi/libcasadi_nlpsol_bonmin.dylib +0 -0
  360. casadi/libcasadi_nlpsol_fatrop.3.7.dylib +0 -0
  361. casadi/libcasadi_nlpsol_fatrop.dylib +0 -0
  362. casadi/libcasadi_nlpsol_feasiblesqpmethod.3.7.dylib +0 -0
  363. casadi/libcasadi_nlpsol_feasiblesqpmethod.dylib +0 -0
  364. casadi/libcasadi_nlpsol_ipopt.3.7.dylib +0 -0
  365. casadi/libcasadi_nlpsol_ipopt.dylib +0 -0
  366. casadi/libcasadi_nlpsol_knitro.3.7.dylib +0 -0
  367. casadi/libcasadi_nlpsol_knitro.dylib +0 -0
  368. casadi/libcasadi_nlpsol_madnlp.3.7.dylib +0 -0
  369. casadi/libcasadi_nlpsol_madnlp.dylib +0 -0
  370. casadi/libcasadi_nlpsol_qrsqp.3.7.dylib +0 -0
  371. casadi/libcasadi_nlpsol_qrsqp.dylib +0 -0
  372. casadi/libcasadi_nlpsol_scpgen.3.7.dylib +0 -0
  373. casadi/libcasadi_nlpsol_scpgen.dylib +0 -0
  374. casadi/libcasadi_nlpsol_sleqp.3.7.dylib +0 -0
  375. casadi/libcasadi_nlpsol_sleqp.dylib +0 -0
  376. casadi/libcasadi_nlpsol_snopt.3.7.dylib +0 -0
  377. casadi/libcasadi_nlpsol_snopt.dylib +0 -0
  378. casadi/libcasadi_nlpsol_sqpmethod.3.7.dylib +0 -0
  379. casadi/libcasadi_nlpsol_sqpmethod.dylib +0 -0
  380. casadi/libcasadi_rootfinder_fast_newton.3.7.dylib +0 -0
  381. casadi/libcasadi_rootfinder_fast_newton.dylib +0 -0
  382. casadi/libcasadi_rootfinder_kinsol.3.7.dylib +0 -0
  383. casadi/libcasadi_rootfinder_kinsol.dylib +0 -0
  384. casadi/libcasadi_rootfinder_newton.3.7.dylib +0 -0
  385. casadi/libcasadi_rootfinder_newton.dylib +0 -0
  386. casadi/libcasadi_rootfinder_nlpsol.3.7.dylib +0 -0
  387. casadi/libcasadi_rootfinder_nlpsol.dylib +0 -0
  388. casadi/libcasadi_sundials_common.3.7.dylib +0 -0
  389. casadi/libcasadi_sundials_common.dylib +0 -0
  390. casadi/libcasadi_xmlfile_tinyxml.3.7.dylib +0 -0
  391. casadi/libcasadi_xmlfile_tinyxml.dylib +0 -0
  392. casadi/libcoinmetis.2.dylib +0 -0
  393. casadi/libcoinmetis.dylib +0 -0
  394. casadi/libcoinmumps.3.dylib +0 -0
  395. casadi/libcoinmumps.dylib +0 -0
  396. casadi/libcoinmumps.la +1 -1
  397. casadi/libcplex_adaptor.dylib +0 -0
  398. casadi/libdaqp.dylib +0 -0
  399. casadi/libdaqpstat.a +0 -0
  400. casadi/libfatrop.dylib +0 -0
  401. casadi/libgcc_s.1.1.dylib +0 -0
  402. casadi/libgfortran.5.dylib +0 -0
  403. casadi/libgurobi_adaptor.dylib +0 -0
  404. casadi/libhighs.1.10.dylib +0 -0
  405. casadi/libhighs.1.7.dylib +0 -0
  406. casadi/libhighs.1.dylib +0 -0
  407. casadi/libhighs.dylib +0 -0
  408. casadi/libindirect.a +0 -0
  409. casadi/libipopt.3.dylib +0 -0
  410. casadi/libipopt.dylib +0 -0
  411. casadi/libipopt.la +1 -1
  412. casadi/liblinsys.a +0 -0
  413. casadi/libmatlab_ipc.dylib +0 -0
  414. casadi/libosqp.a +0 -0
  415. casadi/libosqp.dylib +0 -0
  416. casadi/libqdldl.a +0 -0
  417. casadi/libqdldl.dylib +0 -0
  418. casadi/libquadmath.0.dylib +0 -0
  419. casadi/libsipopt.3.dylib +0 -0
  420. casadi/libsipopt.dylib +0 -0
  421. casadi/libsipopt.la +1 -1
  422. casadi/libsleqp.1.0.1.dylib +0 -0
  423. casadi/libsleqp.dylib +0 -0
  424. casadi/libsuperscs.a +0 -0
  425. casadi/libtrlib.0.4.dylib +0 -0
  426. casadi/libtrlib.dylib +0 -0
  427. casadi/libz.1.2.13.dylib +0 -0
  428. casadi/libz.1.3.1.dylib +0 -0
  429. casadi/libz.1.dylib +0 -0
  430. casadi/libz.a +0 -0
  431. casadi/libz.dylib +0 -0
  432. casadi/libzip.a +0 -0
  433. casadi/pkgconfig/casadi.pc +1 -1
  434. casadi/pkgconfig/coinmumps.pc +1 -1
  435. casadi/pkgconfig/highs.pc +1 -1
  436. casadi/pkgconfig/libzip.pc +14 -0
  437. casadi/tools/__init__.py +3 -1
  438. casadi/tools/graph/graph.py +1 -1
  439. casadi/tools/structure3.py +2 -2
  440. {casadi-3.6.7.dist-info → casadi-3.7.0.dist-info}/METADATA +1 -1
  441. {casadi-3.6.7.dist-info → casadi-3.7.0.dist-info}/RECORD +442 -399
  442. casadi/include/tinyxml2.h +0 -2380
  443. casadi/lib/cmake/tinyxml2/tinyxml2-config.cmake +0 -57
  444. casadi/lib/cmake/tinyxml2/tinyxml2-static-targets-release.cmake +0 -19
  445. casadi/lib/libtinyxml2.a +0 -0
  446. casadi/lib/pkgconfig/tinyxml2.pc +0 -10
  447. casadi/tools/structure.py +0 -1446
  448. {casadi-3.6.7.dist-info → casadi-3.7.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,215 @@
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
+ #ifndef CASADI_GENERIC_SHARED_INTERNAL_HPP
27
+ #define CASADI_GENERIC_SHARED_INTERNAL_HPP
28
+
29
+ #include "generic_shared.hpp"
30
+ #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
31
+ #include <memory>
32
+ #endif // CASADI_WITH_THREADSAFE_SYMBOLICS
33
+
34
+ #ifdef CASADI_WITH_THREAD
35
+ #include <atomic>
36
+ #endif // CASADI_WITH_THREAD
37
+
38
+ namespace casadi {
39
+
40
+ /// \cond INTERNAL
41
+ /// Internal class for the reference counting framework, see comments on the public class.
42
+ template<typename Shared, typename Internal>
43
+ class GenericSharedInternal {
44
+ friend class GenericShared<Shared, Internal>;
45
+ public:
46
+
47
+ /// Default constructor
48
+ GenericSharedInternal();
49
+
50
+ /// Copy constructor
51
+ GenericSharedInternal(const GenericSharedInternal& node);
52
+
53
+ /// Assignment operator
54
+ GenericSharedInternal& operator=(const GenericSharedInternal& node);
55
+
56
+ /// Destructor
57
+ virtual ~GenericSharedInternal() = 0;
58
+
59
+ /// Get the reference count
60
+ casadi_int getCount() const;
61
+
62
+ std::string debug_repr(const Internal*) const;
63
+
64
+ /** \brief Get a weak reference to the object
65
+
66
+ \identifier{1ai} */
67
+ GenericWeakRef<Shared, Internal>* weak();
68
+
69
+ protected:
70
+ /** Called in the constructor of singletons to avoid that the counter reaches zero */
71
+ void initSingleton() {
72
+ casadi_assert_dev(static_cast<Internal*>(this)->count==0);
73
+ static_cast<Internal*>(this)->count++;
74
+ }
75
+
76
+ /** Called in the destructor of singletons */
77
+ void destroySingleton() {
78
+ static_cast<Internal*>(this)->count--;
79
+ }
80
+
81
+ /// Get a shared object from the current internal object
82
+ template<class B>
83
+ B shared_from_this() {
84
+ casadi_assert_dev(B::test_cast(static_cast<Internal*>(this)));
85
+ B ret;
86
+ ret.own(static_cast<Internal*>(this));
87
+ return ret;
88
+ }
89
+
90
+ /// Get a shared object from the current internal object
91
+ template<class B>
92
+ const B shared_from_this() const {
93
+ casadi_assert_dev(B::test_cast(static_cast<const Internal*>(this)));
94
+ B ret;
95
+ ret.own(const_cast<Internal*>(static_cast<const Internal*>(this)));
96
+ return ret;
97
+ }
98
+
99
+ private:
100
+ /// Weak pointer (non-owning) object for the object
101
+ GenericWeakRef<Shared, Internal>* weak_ref_;
102
+ };
103
+
104
+ template<typename Shared, typename Internal>
105
+ class GenericWeakRefInternal : public Internal {
106
+ public:
107
+ // Constructor
108
+ GenericWeakRefInternal(Internal* raw);
109
+
110
+ // Destructor
111
+ ~GenericWeakRefInternal() override;
112
+
113
+ // Raw pointer to the cached object
114
+ Internal* raw_;
115
+
116
+ #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
117
+ mutable std::shared_ptr<std::mutex> mutex_;
118
+ #endif // CASADI_WITH_THREADSAFE_SYMBOLICS
119
+ };
120
+
121
+
122
+ template<class A>
123
+ A getcopy(const A& a,
124
+ std::map<typename A::base_type*,
125
+ typename A::internal_base_type> & already_copied) {
126
+ A ret;
127
+ if (!a.is_null()) {
128
+ auto it =
129
+ already_copied.find(const_cast<typename A::base_type*>(a.get()));
130
+ if (it!=already_copied.end()) {
131
+ ret.own(it->second.get());
132
+ }
133
+ }
134
+ return ret;
135
+ }
136
+
137
+ /// \endcond
138
+
139
+
140
+ template<typename Shared, typename Internal>
141
+ GenericSharedInternal<Shared, Internal>::
142
+ GenericSharedInternal(const GenericSharedInternal& node) {
143
+ static_cast<Internal*>(this)->count = 0; // reference counter is _not_ copied
144
+ weak_ref_ = nullptr; // nor will they have the same weak references
145
+ }
146
+
147
+ template<typename Shared, typename Internal>
148
+ GenericSharedInternal<Shared, Internal>&
149
+ GenericSharedInternal<Shared, Internal>::
150
+ operator=(const GenericSharedInternal<Shared, Internal>& node) {
151
+ // do _not_ copy the reference counter
152
+ return *this;
153
+ }
154
+
155
+ template<typename Shared, typename Internal>
156
+ GenericSharedInternal<Shared, Internal>::GenericSharedInternal() {
157
+ static_cast<Internal*>(this)->count = 0;
158
+ weak_ref_ = nullptr;
159
+ }
160
+
161
+ template<typename Shared, typename Internal>
162
+ std::string GenericSharedInternal<Shared, Internal>::debug_repr(const Internal* i) const {
163
+ // Note: i != this because of something something multiple inheritance
164
+ return str( (casadi_int)(i)) + "/" + static_cast<const Internal*>(this)->class_name();
165
+ }
166
+
167
+ template<typename Shared, typename Internal>
168
+ GenericSharedInternal<Shared, Internal>::~GenericSharedInternal() {
169
+ #ifdef WITH_REFCOUNT_WARNINGS
170
+ if (static_cast<Internal*>(this)->count!=0) {
171
+ // Note that casadi_assert_warning cannot be used in destructors
172
+ std::cerr << "Reference counting failure." <<
173
+ "Possible cause: Circular dependency in user code." << std::endl;
174
+ }
175
+ #endif // WITH_REFCOUNT_WARNINGS
176
+ if (weak_ref_!=nullptr) {
177
+ // Assumption: no other GenericSharedInternal instances
178
+ // point to the same WeakRefInternal through weak_ref_
179
+ weak_ref_->kill();
180
+ delete weak_ref_;
181
+ weak_ref_ = nullptr;
182
+ }
183
+ }
184
+
185
+ template<typename Shared, typename Internal>
186
+ casadi_int GenericSharedInternal<Shared, Internal>::getCount() const {
187
+ return static_cast<const Internal*>(this)->count;
188
+ }
189
+
190
+ template<typename Shared, typename Internal>
191
+ GenericWeakRef<Shared, Internal>* GenericSharedInternal<Shared, Internal>::weak() {
192
+ if (weak_ref_==nullptr) {
193
+ weak_ref_ = new GenericWeakRef<Shared, Internal>(static_cast<Internal*>(this));
194
+ }
195
+ return weak_ref_;
196
+ }
197
+
198
+ template<typename Shared, typename Internal>
199
+ GenericWeakRefInternal<Shared, Internal>::GenericWeakRefInternal(Internal* raw) :
200
+ raw_(raw)
201
+ #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
202
+ , mutex_(std::make_shared<std::mutex>())
203
+ #endif // CASADI_WITH_THREADSAFE_SYMBOLICS
204
+ {
205
+ }
206
+
207
+ template<typename Shared, typename Internal>
208
+ GenericWeakRefInternal<Shared, Internal>::~GenericWeakRefInternal() {
209
+ }
210
+
211
+
212
+ } // namespace casadi
213
+
214
+
215
+ #endif // CASADI_GENERIC_SHARED_INTERNAL_HPP
@@ -303,6 +303,9 @@ namespace casadi {
303
303
 
304
304
  \identifier{17u} */
305
305
  CASADI_EXPORT void update_dict(Dict& target, const Dict& source, bool recurse=false);
306
+
307
+ CASADI_EXPORT void update_dict(Dict& target, const std::string& key,
308
+ const GenericType& value, bool recurse=false);
306
309
  #endif
307
310
 
308
311
  } // namespace casadi
@@ -72,6 +72,8 @@ namespace casadi {
72
72
 
73
73
  static bool julia_initialized;
74
74
 
75
+ static casadi_int copy_elision_min_size;
76
+
75
77
  #endif //SWIG
76
78
  // Setter and getter for simplification_on_the_fly
77
79
  static void setSimplificationOnTheFly(bool flag) { simplification_on_the_fly = flag; }
@@ -90,6 +92,14 @@ namespace casadi {
90
92
  static void setMaxNumDir(casadi_int ndir) { max_num_dir=ndir; }
91
93
  static casadi_int getMaxNumDir() { return max_num_dir; }
92
94
 
95
+ static void setCopyElisionMinSize(casadi_int sz) {
96
+ copy_elision_min_size=sz;
97
+ if (copy_elision_min_size!=-1 && copy_elision_min_size<2) {
98
+ copy_elision_min_size = 2;
99
+ }
100
+ }
101
+ static casadi_int getCopyElisionMinSize() { return copy_elision_min_size; }
102
+
93
103
  };
94
104
 
95
105
  } // namespace casadi
@@ -144,36 +144,45 @@ namespace casadi {
144
144
  \identifier{7g} */
145
145
  CASADI_EXPORT casadi_int integrator_n_out();
146
146
 
147
- /** \brief Get input scheme of simulators
147
+ /** \brief Get input scheme of a DAE function
148
148
 
149
149
  \identifier{25p} */
150
150
  CASADI_EXPORT std::vector<std::string> dyn_in();
151
151
 
152
- /** \brief Get simulator output scheme of simulators
152
+ /** \brief Get output scheme of a DAE function
153
153
 
154
154
  \identifier{25q} */
155
155
  CASADI_EXPORT std::vector<std::string> dyn_out();
156
156
 
157
- /** \brief Get simulator input scheme name by index
157
+ /** \brief Get input scheme of a DAE function by index
158
158
 
159
159
  \identifier{25r} */
160
160
  CASADI_EXPORT std::string dyn_in(casadi_int ind);
161
161
 
162
- /** \brief Get output scheme name by index
162
+ /** \brief Get output scheme of a DAE function by index
163
163
 
164
164
  \identifier{25s} */
165
165
  CASADI_EXPORT std::string dyn_out(casadi_int ind);
166
166
 
167
- /** \brief Get the number of simulator inputs
167
+ /** \brief Get the number of inputs for a DAE function
168
168
 
169
169
  \identifier{25t} */
170
170
  CASADI_EXPORT casadi_int dyn_n_in();
171
171
 
172
- /** \brief Get the number of simulator outputs
172
+ /** \brief Get the number of outputs for a DAE function
173
173
 
174
174
  \identifier{25u} */
175
175
  CASADI_EXPORT casadi_int dyn_n_out();
176
176
 
177
+ /** \brief Get input scheme of an event transition function
178
+
179
+ \identifier{2b4} */
180
+ CASADI_EXPORT std::vector<std::string> event_in();
181
+
182
+ /** \brief Get output scheme of an event transition functions
183
+
184
+ \identifier{2b5} */
185
+ CASADI_EXPORT std::vector<std::string> event_out();
177
186
  /** @} */
178
187
 
179
188
  #ifndef SWIG
@@ -186,13 +195,30 @@ enum DynIn {
186
195
  DYN_U,
187
196
  DYN_NUM_IN};
188
197
 
189
- /// Inputs of the symbolic representation of the DAE
198
+ /// Outputs of the symbolic representation of the DAE
190
199
  enum DynOut {
191
200
  DYN_ODE,
192
201
  DYN_ALG,
193
202
  DYN_QUAD,
203
+ DYN_ZERO,
194
204
  DYN_NUM_OUT};
195
205
 
206
+ /// Inputs of an event transition function
207
+ enum EventIn {
208
+ EVENT_INDEX,
209
+ EVENT_T,
210
+ EVENT_X,
211
+ EVENT_Z,
212
+ EVENT_P,
213
+ EVENT_U,
214
+ EVENT_NUM_IN};
215
+
216
+ /// Outputs of an event transition function
217
+ enum EventOut {
218
+ EVENT_POST_X,
219
+ EVENT_POST_Z,
220
+ EVENT_NUM_OUT};
221
+
196
222
  /// Input arguments of an integrator
197
223
  enum IntegratorInput {
198
224
  /// Differential state at the initial time
@@ -241,12 +267,20 @@ template<> struct enum_traits<DynIn> {
241
267
  template<> struct enum_traits<DynOut> {
242
268
  static const size_t n_enum = DYN_NUM_OUT;
243
269
  };
270
+ template<> struct enum_traits<EventIn> {
271
+ static const size_t n_enum = EVENT_NUM_IN;
272
+ };
273
+ template<> struct enum_traits<EventOut> {
274
+ static const size_t n_enum = EVENT_NUM_OUT;
275
+ };
244
276
  ///@}
245
277
 
246
278
  ///@{
247
279
  /// Convert to string
248
280
  CASADI_EXPORT std::string to_string(DynIn v);
249
281
  CASADI_EXPORT std::string to_string(DynOut v);
282
+ CASADI_EXPORT std::string to_string(EventIn v);
283
+ CASADI_EXPORT std::string to_string(EventOut v);
250
284
  ///@}
251
285
 
252
286
  #endif // SWIG
@@ -38,6 +38,13 @@
38
38
  #include <typeinfo>
39
39
  #include <vector>
40
40
  #include <initializer_list>
41
+ #ifdef CASADI_WITH_THREAD
42
+ #ifdef CASADI_WITH_THREAD_MINGW
43
+ #include <mingw.mutex.h>
44
+ #else // CASADI_WITH_THREAD_MINGW
45
+ #include <mutex>
46
+ #endif // CASADI_WITH_THREAD_MINGW
47
+ #endif //CASADI_WITH_THREAD
41
48
 
42
49
  namespace casadi {
43
50
 
@@ -284,6 +291,9 @@ namespace casadi {
284
291
  const Matrix<Scalar> &x, const Matrix<Scalar> &y);
285
292
  static Matrix<Scalar> matrix_matrix(casadi_int op,
286
293
  const Matrix<Scalar> &x, const Matrix<Scalar> &y);
294
+ static std::vector< Matrix<Scalar> > call(const Function& f,
295
+ const std::vector< Matrix<Scalar> > &x);
296
+ static std::vector< Scalar > call(const Function& f, const std::vector< Scalar > &x);
287
297
  ///@}
288
298
  /// \endcond
289
299
 
@@ -356,6 +366,12 @@ namespace casadi {
356
366
  const Matrix<Scalar> &x_default,
357
367
  bool short_circuit=false);
358
368
  static bool depends_on(const Matrix<Scalar> &x, const Matrix<Scalar> &arg);
369
+ static bool contains(const std::vector<Matrix<Scalar> >& v, const Matrix<Scalar> &n);
370
+ static bool contains_all(const std::vector<Matrix<Scalar> >& v,
371
+ const std::vector<Matrix<Scalar> > &n);
372
+ static bool contains_any(const std::vector<Matrix<Scalar> >& v,
373
+ const std::vector<Matrix<Scalar> > &n);
374
+
359
375
  static Matrix<Scalar> mrdivide(const Matrix<Scalar> &x, const Matrix<Scalar> &y);
360
376
  static Matrix<Scalar> mldivide(const Matrix<Scalar> &x, const Matrix<Scalar> &y);
361
377
  static std::vector<Matrix<Scalar> > symvar(const Matrix<Scalar> &x);
@@ -417,6 +433,15 @@ namespace casadi {
417
433
  static Matrix<Scalar> mac(const Matrix<Scalar> &x,
418
434
  const Matrix<Scalar> &y,
419
435
  const Matrix<Scalar> &z);
436
+ static void extract_parametric(const Matrix<Scalar> &expr,
437
+ const Matrix<Scalar>& par,
438
+ Matrix<Scalar>& expr_ret,
439
+ std::vector<Matrix<Scalar> >& symbols,
440
+ std::vector<Matrix<Scalar>>& parametric,
441
+ const Dict& opts);
442
+ static void separate_linear(const Matrix<Scalar> &expr,
443
+ const Matrix<Scalar> &sym_lin, const Matrix<Scalar> &sym_const,
444
+ Matrix<Scalar>& expr_const, Matrix<Scalar>& expr_lin, Matrix<Scalar>& expr_nonlin);
420
445
  ///@}
421
446
 
422
447
  ///@{
@@ -749,6 +774,12 @@ namespace casadi {
749
774
  * taylor(sin(x), x)
750
775
  * \endcode
751
776
  * \verbatim >> x \endverbatim
777
+ *
778
+ * \code
779
+ * taylor(sin(x),x,x0) -> sin(x0)+cos(x0)*(x-x0)
780
+ * \endcode
781
+ *
782
+ * \sa linearize, mtaylor, linear_coeff
752
783
 
753
784
  \identifier{23q} */
754
785
  friend inline Matrix<Scalar> taylor(const Matrix<Scalar>& ex, const Matrix<Scalar>& x,
@@ -765,6 +796,7 @@ namespace casadi {
765
796
  * Do Taylor expansions until the aggregated order of a term is equal to 'order'.
766
797
  * The aggregated order of \f$x^n y^m\f$ equals \f$n+m\f$.
767
798
  *
799
+ * \sa taylor
768
800
 
769
801
  \identifier{23r} */
770
802
  friend inline Matrix<Scalar> mtaylor(const Matrix<Scalar>& ex, const Matrix<Scalar>& x,
@@ -796,6 +828,7 @@ namespace casadi {
796
828
  * \endcode
797
829
  * \f$ (-3 x^2 y-x^3)/6+y+x \f$
798
830
  *
831
+ * \sa taylor
799
832
 
800
833
  \identifier{23s} */
801
834
  friend inline Matrix<Scalar> mtaylor(const Matrix<Scalar>& ex, const Matrix<Scalar>& x,
@@ -978,6 +1011,11 @@ namespace casadi {
978
1011
  \identifier{19j} */
979
1012
  Sparsity get_sparsity() const;
980
1013
 
1014
+ /** \brief Get an output
1015
+
1016
+ \identifier{28i} */
1017
+ Matrix<Scalar> get_output(casadi_int oind) const;
1018
+
981
1019
  /** \brief Construct a sparse matrix from triplet form
982
1020
 
983
1021
  * Default matrix size is max(col) x max(row)
@@ -1099,6 +1137,31 @@ namespace casadi {
1099
1137
  \identifier{19v} */
1100
1138
  bool is_constant() const;
1101
1139
 
1140
+ /** \brief Check if function call
1141
+
1142
+ \identifier{28j} */
1143
+ bool is_call() const;
1144
+
1145
+ /** \brief Check if evaluation output
1146
+
1147
+ \identifier{28k} */
1148
+ bool is_output() const;
1149
+
1150
+ /** \brief Check if a multiple output node
1151
+
1152
+ \identifier{28l} */
1153
+ bool has_output() const;
1154
+
1155
+ /** \brief Get the index of evaluation output - only valid when is_output() is true
1156
+
1157
+ \identifier{28m} */
1158
+ casadi_int which_output() const;
1159
+
1160
+ /** \brief Get function - only valid when is_call() is true
1161
+
1162
+ \identifier{28n} */
1163
+ Function which_function() const;
1164
+
1102
1165
  /** \brief Check if the matrix is integer-valued
1103
1166
 
1104
1167
  * (note that false negative answers are possible)
@@ -1301,6 +1364,10 @@ namespace casadi {
1301
1364
  static Matrix<Scalar> _sym(const std::string& name, const Sparsity& sp);
1302
1365
  /// \endcond
1303
1366
 
1367
+ #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
1368
+ static std::mutex& get_mutex_temp();
1369
+ #endif //CASADI_WITH_THREADSAFE_SYMBOLICS
1370
+
1304
1371
  private:
1305
1372
  /// Sparsity of the matrix in a compressed column storage (CCS) format
1306
1373
  Sparsity sparsity_;
@@ -34,6 +34,14 @@
34
34
  #include "generic_type.hpp"
35
35
  #include "printable.hpp"
36
36
  #include <vector>
37
+ #ifdef CASADI_WITH_THREAD
38
+ #ifdef CASADI_WITH_THREAD_MINGW
39
+ #include <mingw.mutex.h>
40
+ #else // CASADI_WITH_THREAD_MINGW
41
+ #include <mutex>
42
+ #endif // CASADI_WITH_THREAD_MINGW
43
+ #endif //CASADI_WITH_THREAD
44
+
37
45
  namespace casadi {
38
46
 
39
47
  /** \brief Forward declaration
@@ -122,6 +130,14 @@ namespace casadi {
122
130
  \identifier{q5} */
123
131
  MX(const Sparsity& sp, const std::string& fname);
124
132
 
133
+
134
+ /** \brief Construct matrix with a given sparsity and nonzeros,
135
+
136
+ * configurable in codegen via a pool
137
+
138
+ \identifier{2aa} */
139
+ MX(const Matrix<double>& val, const std::string& name);
140
+
125
141
  /** \brief Create scalar constant (also implicit type conversion)
126
142
 
127
143
  \identifier{q6} */
@@ -188,6 +204,21 @@ namespace casadi {
188
204
  \identifier{qd} */
189
205
  Sparsity get_sparsity() const { return sparsity();}
190
206
 
207
+ /** \brief Get nonzeros as list of scalar MXes
208
+ *
209
+ * Since MX is not a containter, the scalar MXes may be complex
210
+ * When the expression satisfies is_valid_input, the results may be simple
211
+ *
212
+ * For example:
213
+ * vertcat(x,y).nonzeros()
214
+ * will return {x,y}
215
+ *
216
+ * \sa expr.nz[:]
217
+ *
218
+
219
+ \identifier{2bh} */
220
+ std::vector<MX> get_nonzeros() const;
221
+
191
222
  /** \brief Erase a submatrix (leaving structural zeros in its place)
192
223
 
193
224
  Erase rows and/or columns of a matrix
@@ -611,6 +642,8 @@ namespace casadi {
611
642
  static MX conditional(const MX& ind, const std::vector<MX> &x, const MX& x_default,
612
643
  bool short_circuit=false);
613
644
  static bool depends_on(const MX& x, const MX& arg);
645
+ static bool contains_all(const std::vector<MX>& v, const std::vector<MX> &n);
646
+ static bool contains_any(const std::vector<MX>& v, const std::vector<MX> &n);
614
647
  static MX simplify(const MX& x);
615
648
  static MX dot(const MX& x, const MX& y);
616
649
  static MX mrdivide(const MX& a, const MX& b);
@@ -636,6 +669,11 @@ namespace casadi {
636
669
  static MX cumsum(const MX &x, casadi_int axis=-1);
637
670
  static MX _logsumexp(const MX& x);
638
671
  static std::vector<MX> cse(const std::vector<MX>& e);
672
+ static void extract_parametric(const MX &expr, const MX& par,
673
+ MX& expr_ret, std::vector<MX>& symbols, std::vector<MX>& parametric, const Dict& opts);
674
+ static void separate_linear(const MX &expr,
675
+ const MX &sym_lin, const MX &sym_const,
676
+ MX& expr_const, MX& expr_lin, MX& expr_nonlin);
639
677
  ///@}
640
678
 
641
679
  ///@{
@@ -644,9 +682,15 @@ namespace casadi {
644
682
  static MX low(const MX& v, const MX& p, const Dict& options = Dict());
645
683
  static MX graph_substitute(const MX& x, const std::vector<MX> &v,
646
684
  const std::vector<MX> &vdef);
685
+ static MX graph_substitute(const MX& x, const std::vector<MX> &v,
686
+ const std::vector<MX> &vdef, bool& updated);
687
+ static std::vector<MX> graph_substitute(const std::vector<MX> &ex,
688
+ const std::vector<MX> &v,
689
+ const std::vector<MX> &vdef);
647
690
  static std::vector<MX> graph_substitute(const std::vector<MX> &ex,
648
- const std::vector<MX> &expr,
649
- const std::vector<MX> &exprs);
691
+ const std::vector<MX> &v,
692
+ const std::vector<MX> &vdef,
693
+ bool& updated);
650
694
  static MX matrix_expand(const MX& e, const std::vector<MX> &boundary,
651
695
  const Dict& options);
652
696
  static std::vector<MX> matrix_expand(const std::vector<MX>& e,
@@ -724,6 +768,11 @@ namespace casadi {
724
768
  return MX::graph_substitute(ex, v, vdef);
725
769
  }
726
770
 
771
+ inline friend MX graph_substitute(const MX& ex, const std::vector<MX> &v,
772
+ const std::vector<MX> &vdef, bool& updated) {
773
+ return MX::graph_substitute(ex, v, vdef, updated);
774
+ }
775
+
727
776
  /** \brief Substitute multiple expressions in graph
728
777
 
729
778
  * Substitute variable var with expression expr in
@@ -737,6 +786,14 @@ namespace casadi {
737
786
  return MX::graph_substitute(ex, v, vdef);
738
787
  }
739
788
 
789
+ inline friend std::vector<MX>
790
+ graph_substitute(const std::vector<MX> &ex,
791
+ const std::vector<MX> &v,
792
+ const std::vector<MX> &vdef,
793
+ bool& updated) {
794
+ return MX::graph_substitute(ex, v, vdef, updated);
795
+ }
796
+
740
797
  /** \brief Expand MX graph to SXFunction call
741
798
  *
742
799
  * Expand the given expression e, optionally
@@ -928,6 +985,10 @@ namespace casadi {
928
985
  // Create matrix symbolic primitive
929
986
  static MX _sym(const std::string& name, const Sparsity& sp);
930
987
 
988
+ #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
989
+ static std::mutex& get_mutex_temp() { return mutex_temp; }
990
+ static std::mutex mutex_temp;
991
+ #endif //CASADI_WITH_THREADSAFE_SYMBOLICS
931
992
  private:
932
993
 
933
994
  /// Create an expression from a node: extra dummy arguments to avoid ambiguity for 0/NULL
@@ -30,7 +30,6 @@
30
30
 
31
31
  namespace casadi {
32
32
  /// \cond INTERNAL
33
- #ifndef SWIG
34
33
 
35
34
  /** \brief Options metadata for a class
36
35
 
@@ -39,6 +38,7 @@ namespace casadi {
39
38
 
40
39
  \identifier{x9} */
41
40
  struct CASADI_EXPORT Options {
41
+ #ifndef SWIG
42
42
  // Base classes, whose options are also valid for the derived class
43
43
  std::vector<const Options*> bases;
44
44
 
@@ -57,6 +57,8 @@ namespace casadi {
57
57
  // Locate an entry
58
58
  const Options::Entry* find(const std::string& name) const;
59
59
 
60
+ #endif // SWIG
61
+
60
62
  // Get all entries
61
63
  std::vector<std::string> all() const;
62
64
 
@@ -66,8 +68,10 @@ namespace casadi {
66
68
  // Get description for an entry
67
69
  std::string info(const std::string& name) const;
68
70
 
71
+ #ifndef SWIG
69
72
  // Print all entries
70
73
  void disp(std::ostream& stream) const;
74
+ #endif // SWIG
71
75
 
72
76
  /** \brief A distance metric between two words
73
77
 
@@ -95,7 +99,7 @@ namespace casadi {
95
99
  static bool is_sane(const Dict& opts);
96
100
 
97
101
  /// Sanitize a options dictionary
98
- static Dict sanitize(const Dict& opts);
102
+ static Dict sanitize(const Dict& opts, bool top_level=true);
99
103
 
100
104
  /// Check if options exist
101
105
  void check(const Dict& opts) const;
@@ -111,7 +115,6 @@ namespace casadi {
111
115
  void print_one(const std::string &name, std::ostream &stream) const;
112
116
  };
113
117
 
114
- #endif // SWIG
115
118
  /// \endcond
116
119
  } // namespace casadi
117
120