casadi 3.7.0__cp313-none-macosx_11_0_arm64.whl → 3.7.2__cp313-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 (231) hide show
  1. casadi/_casadi.so +0 -0
  2. casadi/casadi-cli +0 -0
  3. casadi/casadi.py +1184 -724
  4. casadi/cbc +0 -0
  5. casadi/clp +0 -0
  6. casadi/cmake/casadi-config-version.cmake +1 -1
  7. casadi/cmake/casadi-config.cmake +1 -1
  8. casadi/highs +0 -0
  9. casadi/include/casadi/casadi.i +83 -4
  10. casadi/include/casadi/config.h +6 -6
  11. casadi/include/casadi/core/callback.hpp +9 -0
  12. casadi/include/casadi/core/casadi_misc.hpp +14 -0
  13. casadi/include/casadi/core/code_generator.hpp +21 -3
  14. casadi/include/casadi/core/dae_builder.hpp +20 -0
  15. casadi/include/casadi/core/fmu.hpp +11 -0
  16. casadi/include/casadi/core/function.hpp +23 -0
  17. casadi/include/casadi/core/generic_shared.hpp +80 -3
  18. casadi/include/casadi/core/generic_shared_impl.hpp +4 -0
  19. casadi/include/casadi/core/matrix_decl.hpp +4 -0
  20. casadi/include/casadi/core/nlp_builder.hpp +2 -1
  21. casadi/include/casadi/core/runtime/casadi_finite_diff.hpp +1 -1
  22. casadi/include/casadi/core/runtime/casadi_print_canonical.hpp +55 -0
  23. casadi/include/casadi/core/runtime/casadi_print_scalar.hpp +25 -0
  24. casadi/include/casadi/core/runtime/casadi_print_vector.hpp +32 -0
  25. casadi/include/casadi/core/runtime/casadi_printme.hpp +1 -0
  26. casadi/include/casadi/core/serializer.hpp +1 -1
  27. casadi/include/casadi/core/serializing_stream.hpp +6 -2
  28. casadi/include/casadi/doc.i +1590 -1241
  29. casadi/include/casadi/doc_merged.i +1198 -939
  30. casadi/include/licenses/LICENSE.bzip2.txt +42 -0
  31. casadi/libCbc.3.10.11.dylib +0 -0
  32. casadi/libCbc.3.dylib +0 -0
  33. casadi/libCbc.dylib +0 -0
  34. casadi/libCbc.la +1 -1
  35. casadi/libCbcSolver.3.10.11.dylib +0 -0
  36. casadi/libCbcSolver.3.dylib +0 -0
  37. casadi/libCbcSolver.dylib +0 -0
  38. casadi/libCbcSolver.la +1 -1
  39. casadi/libCgl.1.10.8.dylib +0 -0
  40. casadi/libCgl.1.dylib +0 -0
  41. casadi/libCgl.dylib +0 -0
  42. casadi/libCgl.la +1 -1
  43. casadi/libClp.1.14.9.dylib +0 -0
  44. casadi/libClp.1.dylib +0 -0
  45. casadi/libClp.dylib +0 -0
  46. casadi/libClp.la +1 -1
  47. casadi/libClpSolver.1.14.9.dylib +0 -0
  48. casadi/libClpSolver.1.dylib +0 -0
  49. casadi/libClpSolver.dylib +0 -0
  50. casadi/libClpSolver.la +1 -1
  51. casadi/libCoinUtils.3.11.10.dylib +0 -0
  52. casadi/libCoinUtils.3.dylib +0 -0
  53. casadi/libCoinUtils.dylib +0 -0
  54. casadi/libOsi.1.13.9.dylib +0 -0
  55. casadi/libOsi.1.dylib +0 -0
  56. casadi/libOsi.dylib +0 -0
  57. casadi/libOsiCbc.3.10.11.dylib +0 -0
  58. casadi/libOsiCbc.3.dylib +0 -0
  59. casadi/libOsiCbc.dylib +0 -0
  60. casadi/libOsiCbc.la +1 -1
  61. casadi/libOsiClp.1.14.9.dylib +0 -0
  62. casadi/libOsiClp.1.dylib +0 -0
  63. casadi/libOsiClp.dylib +0 -0
  64. casadi/libOsiClp.la +1 -1
  65. casadi/libOsiCommonTests.1.13.9.dylib +0 -0
  66. casadi/libOsiCommonTests.1.dylib +0 -0
  67. casadi/libOsiCommonTests.dylib +0 -0
  68. casadi/libblasfeo.dylib +0 -0
  69. casadi/libbonmin.4.8.9.dylib +0 -0
  70. casadi/libbonmin.4.dylib +0 -0
  71. casadi/libbonmin.dylib +0 -0
  72. casadi/libbonmin.la +1 -1
  73. casadi/libbz2.1.0.8.dylib +0 -0
  74. casadi/libc++.1.0.dylib +0 -0
  75. casadi/libcasadi.3.7.dylib +0 -0
  76. casadi/libcasadi.dylib +0 -0
  77. casadi/libcasadi_archiver_libzip.3.7.dylib +0 -0
  78. casadi/libcasadi_archiver_libzip.dylib +0 -0
  79. casadi/libcasadi_conic_cbc.3.7.dylib +0 -0
  80. casadi/libcasadi_conic_cbc.dylib +0 -0
  81. casadi/libcasadi_conic_clp.3.7.dylib +0 -0
  82. casadi/libcasadi_conic_clp.dylib +0 -0
  83. casadi/libcasadi_conic_cplex.3.7.dylib +0 -0
  84. casadi/libcasadi_conic_cplex.dylib +0 -0
  85. casadi/libcasadi_conic_daqp.3.7.dylib +0 -0
  86. casadi/libcasadi_conic_daqp.dylib +0 -0
  87. casadi/libcasadi_conic_fatrop.3.7.dylib +0 -0
  88. casadi/libcasadi_conic_fatrop.dylib +0 -0
  89. casadi/libcasadi_conic_gurobi.3.7.dylib +0 -0
  90. casadi/libcasadi_conic_gurobi.dylib +0 -0
  91. casadi/libcasadi_conic_highs.3.7.dylib +0 -0
  92. casadi/libcasadi_conic_highs.dylib +0 -0
  93. casadi/libcasadi_conic_ipqp.3.7.dylib +0 -0
  94. casadi/libcasadi_conic_ipqp.dylib +0 -0
  95. casadi/libcasadi_conic_nlpsol.3.7.dylib +0 -0
  96. casadi/libcasadi_conic_nlpsol.dylib +0 -0
  97. casadi/libcasadi_conic_osqp.3.7.dylib +0 -0
  98. casadi/libcasadi_conic_osqp.dylib +0 -0
  99. casadi/libcasadi_conic_proxqp.3.7.dylib +0 -0
  100. casadi/libcasadi_conic_proxqp.dylib +0 -0
  101. casadi/libcasadi_conic_qpoases.3.7.dylib +0 -0
  102. casadi/libcasadi_conic_qpoases.dylib +0 -0
  103. casadi/libcasadi_conic_qrqp.3.7.dylib +0 -0
  104. casadi/libcasadi_conic_qrqp.dylib +0 -0
  105. casadi/libcasadi_conic_superscs.3.7.dylib +0 -0
  106. casadi/libcasadi_conic_superscs.dylib +0 -0
  107. casadi/libcasadi_filesystem_ghc.3.7.dylib +0 -0
  108. casadi/libcasadi_filesystem_ghc.dylib +0 -0
  109. casadi/libcasadi_importer_shell.3.7.dylib +0 -0
  110. casadi/libcasadi_importer_shell.dylib +0 -0
  111. casadi/libcasadi_integrator_collocation.3.7.dylib +0 -0
  112. casadi/libcasadi_integrator_collocation.dylib +0 -0
  113. casadi/libcasadi_integrator_cvodes.3.7.dylib +0 -0
  114. casadi/libcasadi_integrator_cvodes.dylib +0 -0
  115. casadi/libcasadi_integrator_idas.3.7.dylib +0 -0
  116. casadi/libcasadi_integrator_idas.dylib +0 -0
  117. casadi/libcasadi_integrator_rk.3.7.dylib +0 -0
  118. casadi/libcasadi_integrator_rk.dylib +0 -0
  119. casadi/libcasadi_interpolant_bspline.3.7.dylib +0 -0
  120. casadi/libcasadi_interpolant_bspline.dylib +0 -0
  121. casadi/libcasadi_interpolant_linear.3.7.dylib +0 -0
  122. casadi/libcasadi_interpolant_linear.dylib +0 -0
  123. casadi/libcasadi_linsol_csparse.3.7.dylib +0 -0
  124. casadi/libcasadi_linsol_csparse.dylib +0 -0
  125. casadi/libcasadi_linsol_csparsecholesky.3.7.dylib +0 -0
  126. casadi/libcasadi_linsol_csparsecholesky.dylib +0 -0
  127. casadi/libcasadi_linsol_lapacklu.3.7.dylib +0 -0
  128. casadi/libcasadi_linsol_lapacklu.dylib +0 -0
  129. casadi/libcasadi_linsol_lapackqr.3.7.dylib +0 -0
  130. casadi/libcasadi_linsol_lapackqr.dylib +0 -0
  131. casadi/libcasadi_linsol_ldl.3.7.dylib +0 -0
  132. casadi/libcasadi_linsol_ldl.dylib +0 -0
  133. casadi/libcasadi_linsol_lsqr.3.7.dylib +0 -0
  134. casadi/libcasadi_linsol_lsqr.dylib +0 -0
  135. casadi/libcasadi_linsol_ma27.3.7.dylib +0 -0
  136. casadi/libcasadi_linsol_ma27.dylib +0 -0
  137. casadi/libcasadi_linsol_mumps.3.7.dylib +0 -0
  138. casadi/libcasadi_linsol_mumps.dylib +0 -0
  139. casadi/libcasadi_linsol_qr.3.7.dylib +0 -0
  140. casadi/libcasadi_linsol_qr.dylib +0 -0
  141. casadi/libcasadi_linsol_symbolicqr.3.7.dylib +0 -0
  142. casadi/libcasadi_linsol_symbolicqr.dylib +0 -0
  143. casadi/libcasadi_linsol_tridiag.3.7.dylib +0 -0
  144. casadi/libcasadi_linsol_tridiag.dylib +0 -0
  145. casadi/libcasadi_nlpsol_ampl.3.7.dylib +0 -0
  146. casadi/libcasadi_nlpsol_ampl.dylib +0 -0
  147. casadi/libcasadi_nlpsol_blocksqp.3.7.dylib +0 -0
  148. casadi/libcasadi_nlpsol_blocksqp.dylib +0 -0
  149. casadi/libcasadi_nlpsol_bonmin.3.7.dylib +0 -0
  150. casadi/libcasadi_nlpsol_bonmin.dylib +0 -0
  151. casadi/libcasadi_nlpsol_fatrop.3.7.dylib +0 -0
  152. casadi/libcasadi_nlpsol_fatrop.dylib +0 -0
  153. casadi/libcasadi_nlpsol_feasiblesqpmethod.3.7.dylib +0 -0
  154. casadi/libcasadi_nlpsol_feasiblesqpmethod.dylib +0 -0
  155. casadi/libcasadi_nlpsol_ipopt.3.7.dylib +0 -0
  156. casadi/libcasadi_nlpsol_ipopt.dylib +0 -0
  157. casadi/libcasadi_nlpsol_knitro.3.7.dylib +0 -0
  158. casadi/libcasadi_nlpsol_knitro.dylib +0 -0
  159. casadi/libcasadi_nlpsol_madnlp.3.7.dylib +0 -0
  160. casadi/libcasadi_nlpsol_madnlp.dylib +0 -0
  161. casadi/libcasadi_nlpsol_qrsqp.3.7.dylib +0 -0
  162. casadi/libcasadi_nlpsol_qrsqp.dylib +0 -0
  163. casadi/libcasadi_nlpsol_scpgen.3.7.dylib +0 -0
  164. casadi/libcasadi_nlpsol_scpgen.dylib +0 -0
  165. casadi/libcasadi_nlpsol_sleqp.3.7.dylib +0 -0
  166. casadi/libcasadi_nlpsol_sleqp.dylib +0 -0
  167. casadi/libcasadi_nlpsol_snopt.3.7.dylib +0 -0
  168. casadi/libcasadi_nlpsol_snopt.dylib +0 -0
  169. casadi/libcasadi_nlpsol_sqpmethod.3.7.dylib +0 -0
  170. casadi/libcasadi_nlpsol_sqpmethod.dylib +0 -0
  171. casadi/libcasadi_rootfinder_fast_newton.3.7.dylib +0 -0
  172. casadi/libcasadi_rootfinder_fast_newton.dylib +0 -0
  173. casadi/libcasadi_rootfinder_kinsol.3.7.dylib +0 -0
  174. casadi/libcasadi_rootfinder_kinsol.dylib +0 -0
  175. casadi/libcasadi_rootfinder_newton.3.7.dylib +0 -0
  176. casadi/libcasadi_rootfinder_newton.dylib +0 -0
  177. casadi/libcasadi_rootfinder_nlpsol.3.7.dylib +0 -0
  178. casadi/libcasadi_rootfinder_nlpsol.dylib +0 -0
  179. casadi/libcasadi_sundials_common.3.7.dylib +0 -0
  180. casadi/libcasadi_sundials_common.dylib +0 -0
  181. casadi/libcasadi_xmlfile_tinyxml.3.7.dylib +0 -0
  182. casadi/libcasadi_xmlfile_tinyxml.dylib +0 -0
  183. casadi/libcoinmetis.2.dylib +0 -0
  184. casadi/libcoinmetis.dylib +0 -0
  185. casadi/libcoinmumps.3.dylib +0 -0
  186. casadi/libcoinmumps.dylib +0 -0
  187. casadi/libcoinmumps.la +1 -1
  188. casadi/libcplex_adaptor.dylib +0 -0
  189. casadi/libdaqp.dylib +0 -0
  190. casadi/libdaqpstat.a +0 -0
  191. casadi/libfatrop.dylib +0 -0
  192. casadi/libgcc_s.1.1.dylib +0 -0
  193. casadi/libgfortran.5.dylib +0 -0
  194. casadi/libgurobi_adaptor.dylib +0 -0
  195. casadi/libhighs.1.10.dylib +0 -0
  196. casadi/libhighs.1.dylib +0 -0
  197. casadi/libhighs.dylib +0 -0
  198. casadi/libindirect.a +0 -0
  199. casadi/libipopt.3.dylib +0 -0
  200. casadi/libipopt.dylib +0 -0
  201. casadi/libipopt.la +1 -1
  202. casadi/liblinsys.a +0 -0
  203. casadi/libmatlab_ipc.dylib +0 -0
  204. casadi/libosqp.a +0 -0
  205. casadi/libosqp.dylib +0 -0
  206. casadi/libqdldl.a +0 -0
  207. casadi/libqdldl.dylib +0 -0
  208. casadi/libquadmath.0.dylib +0 -0
  209. casadi/libsipopt.3.dylib +0 -0
  210. casadi/libsipopt.dylib +0 -0
  211. casadi/libsipopt.la +1 -1
  212. casadi/libsleqp.1.0.1.dylib +0 -0
  213. casadi/libsleqp.dylib +0 -0
  214. casadi/libsuperscs.a +0 -0
  215. casadi/libtrlib.0.4.dylib +0 -0
  216. casadi/libtrlib.dylib +0 -0
  217. casadi/libz.1.2.13.dylib +0 -0
  218. casadi/libz.1.3.1.dylib +0 -0
  219. casadi/libz.1.dylib +0 -0
  220. casadi/libz.a +0 -0
  221. casadi/libz.dylib +0 -0
  222. casadi/libzip.a +0 -0
  223. casadi/pkgconfig/casadi.pc +1 -1
  224. casadi/pkgconfig/coinmumps.pc +1 -1
  225. casadi/tools/structure3.py +6 -6
  226. {casadi-3.7.0.dist-info → casadi-3.7.2.dist-info}/METADATA +1 -1
  227. {casadi-3.7.0.dist-info → casadi-3.7.2.dist-info}/RECORD +228 -226
  228. casadi/include/highs/lp_data/HighsRuntimeOptions.h +0 -276
  229. casadi/include/highs/pdlp/cupdlp/cupdlp_scaling_cuda.h +0 -28
  230. casadi/libhighs.1.7.dylib +0 -0
  231. {casadi-3.7.0.dist-info → casadi-3.7.2.dist-info}/WHEEL +0 -0
casadi/cbc CHANGED
Binary file
casadi/clp CHANGED
Binary file
@@ -1,4 +1,4 @@
1
- set(PACKAGE_VERSION "3.7.0")
1
+ set(PACKAGE_VERSION "3.7.2")
2
2
 
3
3
  # Check whether the requested PACKAGE_FIND_VERSION is compatible
4
4
  if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
@@ -4,5 +4,5 @@ get_filename_component(CASADI_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
4
4
  include("${CASADI_CMAKE_DIR}/casadi-targets.cmake")
5
5
 
6
6
  if(OFF AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
7
- target_compile_definitions(casadi INTERFACE _GLIBCXX_USE_CXX11_ABI=0)
7
+ target_compile_definitions(casadi::casadi INTERFACE _GLIBCXX_USE_CXX11_ABI=0)
8
8
  endif()
casadi/highs CHANGED
Binary file
@@ -2982,6 +2982,52 @@ namespace casadi{
2982
2982
  return {"serialization": self.serialize()}
2983
2983
  %}
2984
2984
  }
2985
+ %extend Matrix<SXElem> {
2986
+ %pythoncode %{
2987
+ def __setstate__(self, state):
2988
+ ctx = _current_unpickle_context()
2989
+ if not ctx:
2990
+ raise Exception("Cannot unpickle SX objects without a casadi context. " +
2991
+ "Use something like:\n"+
2992
+ "with ca.global_unpickle_context(): \n"+
2993
+ " f_ref = pickle.load(open(filename,'rb'))")
2994
+ ctx.decode(state)
2995
+ self.__init__(ctx.unpack())
2996
+
2997
+ def __getstate__(self):
2998
+ ctx = _current_pickle_context()
2999
+ if not ctx:
3000
+ raise Exception("Cannot pickle SX objects without a casadi context. " +
3001
+ "Use something like:\n"+
3002
+ "with ca.global_pickle_context(): \n"+
3003
+ " pickle.dump(f,open(filename,'wb'))")
3004
+ ctx.pack(self)
3005
+ return ctx.encode()
3006
+ %}
3007
+ }
3008
+ %extend MX {
3009
+ %pythoncode %{
3010
+ def __setstate__(self, state):
3011
+ ctx = _current_unpickle_context()
3012
+ if not ctx:
3013
+ raise Exception("Cannot unpickle MX objects without a casadi context. " +
3014
+ "Use something like:\n"+
3015
+ "with ca.global_unpickle_context(): \n"+
3016
+ " f_ref = pickle.load(open(filename,'rb'))")
3017
+ ctx.decode(state)
3018
+ self.__init__(ctx.unpack())
3019
+
3020
+ def __getstate__(self):
3021
+ ctx = _current_pickle_context()
3022
+ if not ctx:
3023
+ raise Exception("Cannot pickle MX objects without a casadi context. " +
3024
+ "Use something like:\n"+
3025
+ "with ca.global_pickle_context(): \n"+
3026
+ " pickle.dump(f,open(filename,'wb'))")
3027
+ ctx.pack(self)
3028
+ return ctx.encode()
3029
+ %}
3030
+ }
2985
3031
 
2986
3032
  } // namespace casadi
2987
3033
  #endif // SWIGPYTHON
@@ -3176,7 +3222,7 @@ SPARSITY_INTERFACE_FUN(DECL, (FLAG | IS_SX), Matrix<SXElem>)
3176
3222
  if (dim==0) return sum1(x);
3177
3223
  if (dim==1) return sum2(x);
3178
3224
  casadi_error(
3179
- "Expected sum(A,1), sum(A,2), sum(A,\"all\") got " + casadi::str(dim) + " instead.");
3225
+ "Expected sum(A,0), sum(A,1), sum(A,\"all\") got " + casadi::str(dim) + " instead.");
3180
3226
  }
3181
3227
  DECL M casadi_sum(const M& x) {
3182
3228
  return sum(x);
@@ -4604,6 +4650,39 @@ namespace casadi {
4604
4650
  return f()
4605
4651
  %}
4606
4652
  }
4653
+ %pythoncode %{
4654
+
4655
+ try:
4656
+ import threading
4657
+ _thread_local = threading.local()
4658
+ except:
4659
+ threading_available = True
4660
+ _thread_local = globals()
4661
+
4662
+ def _current_pickle_context():
4663
+ return getattr(_thread_local, "casadi_pickle_ctx", None)
4664
+
4665
+ def _current_unpickle_context():
4666
+ return getattr(_thread_local, "casadi_unpickle_ctx", None)
4667
+
4668
+ class global_pickle_context:
4669
+ def __enter__(self):
4670
+ self.ctx = StringSerializer()
4671
+ _thread_local.casadi_pickle_ctx = self.ctx
4672
+ return self.ctx
4673
+
4674
+ def __exit__(self, *args):
4675
+ _thread_local.casadi_pickle_ctx = None
4676
+
4677
+ class global_unpickle_context:
4678
+ def __enter__(self):
4679
+ self.ctx = StringDeserializer("")
4680
+ _thread_local.casadi_unpickle_ctx = self.ctx
4681
+ return self.ctx
4682
+
4683
+ def __exit__(self, *args):
4684
+ _thread_local.casadi_unpickle_ctx = None
4685
+ %}
4607
4686
  #endif // SWIGPYTHON
4608
4687
  #ifdef SWIGMATLAB
4609
4688
  %extend casadi::DeserializerBase {
@@ -4752,7 +4831,7 @@ opti_metadata_modifiers(casadi::Opti);
4752
4831
  function out = variable(self, varargin)
4753
4832
  st = dbstack('-completenames',1);
4754
4833
  if length(st)>0
4755
- meta = struct('stacktrace', st(1));
4834
+ meta = struct('stacktrace', {num2cell(st)});
4756
4835
  else
4757
4836
  meta = struct;
4758
4837
  end
@@ -4762,7 +4841,7 @@ opti_metadata_modifiers(casadi::Opti);
4762
4841
  function out = parameter(self, varargin)
4763
4842
  st = dbstack('-completenames',1);
4764
4843
  if length(st)>0
4765
- meta = struct('stacktrace', st(1));
4844
+ meta = struct('stacktrace', {num2cell(st)});
4766
4845
  else
4767
4846
  meta = struct;
4768
4847
  end
@@ -4776,7 +4855,7 @@ opti_metadata_modifiers(casadi::Opti);
4776
4855
  end
4777
4856
  st = dbstack('-completenames',1);
4778
4857
  if length(st)>0
4779
- meta = struct('stacktrace', st(1));
4858
+ meta = struct('stacktrace', {num2cell(st)});
4780
4859
  else
4781
4860
  meta = struct;
4782
4861
  end
@@ -26,16 +26,16 @@
26
26
 
27
27
  #define CASADI_MAJOR_VERSION 3
28
28
  #define CASADI_MINOR_VERSION 7
29
- #define CASADI_PATCH_VERSION 0
29
+ #define CASADI_PATCH_VERSION 2
30
30
  #define CASADI_IS_RELEASE 1
31
- #define CASADI_VERSION_STRING "3.7.0"
32
- #define CASADI_GIT_REVISION "1f5f284959d3c7591033b4ff03947ca7a44b3b11" // NOLINT(whitespace/line_length)
33
- #define CASADI_GIT_DESCRIBE "3.6.3-975.1f5f28495" // NOLINT(whitespace/line_length)
34
- #define CASADI_FEATURE_LIST "\n * dynamic-loading, Support for import of FMI 3.0 binaries\n * sundials-interface, Interface to the ODE/DAE integrator suite SUNDIALS.\n * csparse-interface, Interface to the sparse direct linear solver CSparse.\n * superscs-interface, Interface to QP solver SUPERSCS.\n * osqp-interface, Interface to QP solver OSQP.\n * tinyxml-interface, Interface to the XML parser TinyXML.\n * qpoases-interface, Interface to the active-set QP solver qpOASES.\n * blocksqp-interface, Interface to the NLP solver blockSQP.\n * cplex-mockup-build, Use mockup CPLEX (BUILD_MOCKUPS_VERSION=master) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * snopt-mockup-build, Use mockup SNOPT (BUILD_MOCKUPS_VERSION=master) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * knitro-mockup-build, Use mockup KNITRO (BUILD_MOCKUPS_VERSION=master) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * gurobi-mockup-build, Use mockup GUROBI (BUILD_MOCKUPS_VERSION=master) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * hsl-mockup-build, Use mockup WORHP (BUILD_MOCKUPS_VERSION=master) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * madnlp-mockup-build, Use mockup MadNLP (BUILD_MOCKUPS_VERSION=master) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * highs-sourcebuild, Build HiGHS (BUILD_HIGHS_VERSION=v1.10.0) from downloaded source (BUILD_HIGHS_GIT_REPO=https://github.com/ERGO-Code/HiGHS).\n * daqp-sourcebuild, Build DAQP (BUILD_DAQP_VERSION=master) from downloaded source (BUILD_DAQP_GIT_REPO=https://github.com/jgillis/daqp.git).\n * proxqp-sourcebuild, Build PROXQP (BUILD_PROXQP_VERSION=v0.3.2) from downloaded source (BUILD_PROXQP_GIT_REPO=https://github.com/Simple-Robotics/proxsuite.git).\n * osqp-sourcebuild, Build OSQP (BUILD_OSQP_VERSION=v0.6.3) from downloaded source (BUILD_OSQP_GIT_REPO=https://github.com/osqp/osqp.git).\n * superscs-sourcebuild, Build SuperSCS (BUILD_SUPERSCS_VERSION=4d2d1bd03ed4cf93e684a880b233760ce34ca69c) from downloaded source (BUILD_SUPERSCS_GIT_REPO=https://github.com/jgillis/scs.git).\n * sleqp-sourcebuild, Build SLEQP (BUILD_SLEQP_VERSION=patch-1) from downloaded source (BUILD_SLEQP_GIT_REPO=https://github.com/jgillis/sleqp.git).\n * bonmin-sourcebuild, Build BONMIN (BUILD_BONMIN_VERSION=releases/1.8.9) from downloaded source (BUILD_BONMIN_GIT_REPO=https://github.com/coin-or/Bonmin.git).\n * ipopt-sourcebuild, Build IPOPT (BUILD_IPOPT_VERSION=3.14.11.mod) from downloaded source (BUILD_IPOPT_GIT_REPO=https://github.com/jgillis/Ipopt-1.git).\n * cbc-sourcebuild, Build CBC (BUILD_CBC_VERSION=releases/2.10.11) from downloaded source.\n * clp-sourcebuild, Build CLP (BUILD_CLP_VERSION=releases/1.17.9) from downloaded source (BUILD_CLP_GIT_REPO=https://github.com/coin-or/Clp.git).\n * mumps-sourcebuild, Build MUMPS (BUILD_MUMPS_TP_VERSION=releases/3.0.2) from downloaded source (BUILD_MUMPS_TP_GIT_REPO=https://github.com/coin-or-tools/ThirdParty-Mumps.git).\n * metis-sourcebuild, Build METIS (BUILD_METIS_TP_VERSION=6997f64) from downloaded source.\n * fatrop-sourcebuild, Build FATROP (BUILD_FATROP_VERSION=v0.0.4.post1) from downloaded source (BUILD_FATROP_GIT_REPO=https://github.com/meco-group/fatrop.git).\n * trlib-sourcebuild, Build TRLIB (BUILD_TRLIB_VERSION=c7632b8b14152e78bc21721a3bd1a2432586b824) from downloaded source (BUILD_TRLIB_GIT_REPO=https://github.com/jgillis/trlib.git).\n * blasfeo-sourcebuild, Build BLASFEO (BUILD_BLASFEO_VERSION=edf92b396adddd9e548b9786f87ad290a0971329) from downloaded source (BUILD_BLASFEO_GIT_REPO=https://github.com/giaf/blasfeo.git).\n * eigen3-sourcebuild, Build Eigen (BUILD_EIGEN3_VERSION=3.4.0) from downloaded source (BUILD_EIGEN3_GIT_REPO=https://gitlab.com/libeigen/eigen.git).\n * simde-sourcebuild, Build Simde (BUILD_SIMDE_VERSION=v0.7.2) from downloaded source.\n * libzip-sourcebuild, Build LIBZIP (BUILD_LIBZIP_VERSION=v1.11.3) from downloaded source (BUILD_LIBZIP_GIT_REPO=https://github.com/nih-at/libzip).\n * zlib-sourcebuild, Build ZLIB (BUILD_ZLIB_VERSION=v1.3.1) from downloaded source (BUILD_ZLIB_GIT_REPO=https://github.com/madler/zlib).\n * cplex-interface, Interface to the QP solver CPLEX.\n * gurobi-interface, Interface to the (mixed-integer) QP solver GUROBI\n * knitro-interface, Interface to the NLP solver KNITRO.\n * madnlp-interface, Interface to the NLP solver MadNLP.\n * snopt-interface, Interface to the NLP solver KNITRO.\n * lapack-interface, Interface to LAPACK.\n * mumps-interface, Interface to MUMPS.\n * coinutils-sourcebuild, Build COINUTILS (BUILD_COINUTILS_VERSION=releases/2.11.10) from downloaded source.\n * osi-sourcebuild, Build OSI (BUILD_OSI_VERSION=releases/0.108.9) from downloaded source.\n * clp-interface, Interface to the LP solver CLP.\n * cgl-sourcebuild, Build CGL (BUILD_CGL_VERSION=releases/0.60.8) from downloaded source.\n * cbc-interface, Interface to the LP solver CBC.\n * ipopt-interface, Interface to the NLP solver Ipopt.\n * bonmin-interface, Interface to the MINLP framework Bonmin.\n * highs-interface, Interface to the MILP / QP solver HiGHS.\n * daqp-interface, Interface to the MILP / QP solver HiGHS.\n * sleqp-interface, Interface to the NLP solver SLEQP.\n * proxqp-interface, Interface to QP solver PROXQP.\n * ampl-interface, Interface to the AMPL solver library.\n * zlib-interface, Interface to the zlib.\n * libzip-interface, Interface to the libzip.\n * ghc-filesystem-interface, Interface to the ghc.\n" // NOLINT(whitespace/line_length)
31
+ #define CASADI_VERSION_STRING "3.7.2"
32
+ #define CASADI_GIT_REVISION "0e672301aa9046162d311f69421f6375805f4fca" // NOLINT(whitespace/line_length)
33
+ #define CASADI_GIT_DESCRIBE "3.6.3-1094.0e672301a" // NOLINT(whitespace/line_length)
34
+ #define CASADI_FEATURE_LIST "\n * dynamic-loading, Support for import of FMI 3.0 binaries\n * sundials-interface, Interface to the ODE/DAE integrator suite SUNDIALS.\n * csparse-interface, Interface to the sparse direct linear solver CSparse.\n * superscs-interface, Interface to QP solver SUPERSCS.\n * osqp-interface, Interface to QP solver OSQP.\n * tinyxml-interface, Interface to the XML parser TinyXML.\n * qpoases-interface, Interface to the active-set QP solver qpOASES.\n * blocksqp-interface, Interface to the NLP solver blockSQP.\n * cplex-mockup-build, Use mockup CPLEX (BUILD_MOCKUPS_VERSION=master) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * snopt-mockup-build, Use mockup SNOPT (BUILD_MOCKUPS_VERSION=master) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * knitro-mockup-build, Use mockup KNITRO (BUILD_MOCKUPS_VERSION=master) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * gurobi-mockup-build, Use mockup GUROBI (BUILD_MOCKUPS_VERSION=master) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * hsl-mockup-build, Use mockup WORHP (BUILD_MOCKUPS_VERSION=master) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * madnlp-mockup-build, Use mockup MadNLP (BUILD_MOCKUPS_VERSION=master) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * highs-sourcebuild, Build HiGHS (BUILD_HIGHS_VERSION=v1.10.0) from downloaded source (BUILD_HIGHS_GIT_REPO=https://github.com/ERGO-Code/HiGHS).\n * daqp-sourcebuild, Build DAQP (BUILD_DAQP_VERSION=master) from downloaded source (BUILD_DAQP_GIT_REPO=https://github.com/jgillis/daqp.git).\n * proxqp-sourcebuild, Build PROXQP (BUILD_PROXQP_VERSION=v0.3.2) from downloaded source (BUILD_PROXQP_GIT_REPO=https://github.com/Simple-Robotics/proxsuite.git).\n * osqp-sourcebuild, Build OSQP (BUILD_OSQP_VERSION=v0.6.3) from downloaded source (BUILD_OSQP_GIT_REPO=https://github.com/osqp/osqp.git).\n * superscs-sourcebuild, Build SuperSCS (BUILD_SUPERSCS_VERSION=4d2d1bd03ed4cf93e684a880b233760ce34ca69c) from downloaded source (BUILD_SUPERSCS_GIT_REPO=https://github.com/jgillis/scs.git).\n * sleqp-sourcebuild, Build SLEQP (BUILD_SLEQP_VERSION=patch-1) from downloaded source (BUILD_SLEQP_GIT_REPO=https://github.com/jgillis/sleqp.git).\n * bonmin-sourcebuild, Build BONMIN (BUILD_BONMIN_VERSION=releases/1.8.9) from downloaded source (BUILD_BONMIN_GIT_REPO=https://github.com/coin-or/Bonmin.git).\n * ipopt-sourcebuild, Build IPOPT (BUILD_IPOPT_VERSION=3.14.11.mod) from downloaded source (BUILD_IPOPT_GIT_REPO=https://github.com/jgillis/Ipopt-1.git).\n * cbc-sourcebuild, Build CBC (BUILD_CBC_VERSION=releases/2.10.11) from downloaded source.\n * clp-sourcebuild, Build CLP (BUILD_CLP_VERSION=releases/1.17.9) from downloaded source (BUILD_CLP_GIT_REPO=https://github.com/coin-or/Clp.git).\n * mumps-sourcebuild, Build MUMPS (BUILD_MUMPS_TP_VERSION=releases/3.0.2) from downloaded source (BUILD_MUMPS_TP_GIT_REPO=https://github.com/coin-or-tools/ThirdParty-Mumps.git).\n * metis-sourcebuild, Build METIS (BUILD_METIS_TP_VERSION=6997f64) from downloaded source.\n * fatrop-sourcebuild, Build FATROP (BUILD_FATROP_VERSION=v0.0.4.post1) from downloaded source (BUILD_FATROP_GIT_REPO=https://github.com/meco-group/fatrop.git).\n * trlib-sourcebuild, Build TRLIB (BUILD_TRLIB_VERSION=c7632b8b14152e78bc21721a3bd1a2432586b824) from downloaded source (BUILD_TRLIB_GIT_REPO=https://github.com/jgillis/trlib.git).\n * blasfeo-sourcebuild, Build BLASFEO (BUILD_BLASFEO_VERSION=14d6e66f0662182a8dd02ddc7ec4738738c6344d) from downloaded source (BUILD_BLASFEO_GIT_REPO=https://github.com/jgillis/blasfeo.git).\n * eigen3-sourcebuild, Build Eigen (BUILD_EIGEN3_VERSION=3.4.0) from downloaded source (BUILD_EIGEN3_GIT_REPO=https://gitlab.com/libeigen/eigen.git).\n * simde-sourcebuild, Build Simde (BUILD_SIMDE_VERSION=v0.7.2) from downloaded source.\n * libzip-sourcebuild, Build LIBZIP (BUILD_LIBZIP_VERSION=v1.11.3) from downloaded source (BUILD_LIBZIP_GIT_REPO=https://github.com/nih-at/libzip).\n * zlib-sourcebuild, Build ZLIB (BUILD_ZLIB_VERSION=v1.3.1) from downloaded source (BUILD_ZLIB_GIT_REPO=https://github.com/madler/zlib).\n * cplex-interface, Interface to the QP solver CPLEX.\n * gurobi-interface, Interface to the (mixed-integer) QP solver GUROBI\n * knitro-interface, Interface to the NLP solver KNITRO.\n * madnlp-interface, Interface to the NLP solver MadNLP.\n * snopt-interface, Interface to the NLP solver KNITRO.\n * lapack-interface, Interface to LAPACK.\n * mumps-interface, Interface to MUMPS.\n * coinutils-sourcebuild, Build COINUTILS (BUILD_COINUTILS_VERSION=releases/2.11.10) from downloaded source.\n * osi-sourcebuild, Build OSI (BUILD_OSI_VERSION=releases/0.108.9) from downloaded source.\n * clp-interface, Interface to the LP solver CLP.\n * cgl-sourcebuild, Build CGL (BUILD_CGL_VERSION=releases/0.60.8) from downloaded source.\n * cbc-interface, Interface to the LP solver CBC.\n * ipopt-interface, Interface to the NLP solver Ipopt.\n * bonmin-interface, Interface to the MINLP framework Bonmin.\n * highs-interface, Interface to the MILP / QP solver HiGHS.\n * daqp-interface, Interface to the MILP / QP solver DAQP.\n * sleqp-interface, Interface to the NLP solver SLEQP.\n * proxqp-interface, Interface to QP solver PROXQP.\n * ampl-interface, Interface to the AMPL solver library.\n * zlib-interface, Interface to the zlib.\n * libzip-interface, Interface to the libzip.\n * ghc-filesystem-interface, Interface to the ghc.\n" // NOLINT(whitespace/line_length)
35
35
  #define CASADI_BUILD_TYPE "Release" // NOLINT(whitespace/line_length)
36
36
  #define CASADI_COMPILER_ID "Clang" // NOLINT(whitespace/line_length)
37
37
  #define CASADI_COMPILER "clang++" // NOLINT(whitespace/line_length)
38
- #define CASADI_COMPILER_FLAGS " -pthread -DUSE_CXX11 -DHAVE_MKSTEMPS -DWITH_DEEPBIND -DCASADI_MAJOR_VERSION=3 -DCASADI_MINOR_VERSION=7 -DCASADI_PATCH_VERSION=0 -DCASADI_IS_RELEASE=1 -DCASADI_VERSION=31 -D_USE_MATH_DEFINES -D_SCL_SECURE_NO_WARNINGS -DWITH_DL -DWITH_DEPRECATED_FEATURES -DCASADI_DEFAULT_COMPILER_PLUGIN=shell -DCASADI_SNPRINTF=snprintf -DCASADI_WITH_THREADSAFE_SYMBOLICS -DCASADI_WITH_THREAD" // NOLINT(whitespace/line_length)
38
+ #define CASADI_COMPILER_FLAGS " -pthread -DUSE_CXX11 -DHAVE_MKSTEMPS -DWITH_DEEPBIND -DCASADI_MAJOR_VERSION=3 -DCASADI_MINOR_VERSION=7 -DCASADI_PATCH_VERSION=2 -DCASADI_IS_RELEASE=1 -DCASADI_VERSION=31 -D_USE_MATH_DEFINES -D_SCL_SECURE_NO_WARNINGS -DWITH_DL -DWITH_DEPRECATED_FEATURES -DCASADI_DEFAULT_COMPILER_PLUGIN=shell -DCASADI_SNPRINTF=snprintf -DCASADI_WITH_THREADSAFE_SYMBOLICS -DCASADI_WITH_THREAD" // NOLINT(whitespace/line_length)
39
39
  #define CASADI_MODULES "casadi;casadi_linsol_lapacklu;casadi_linsol_lapackqr;casadi_sundials_common;casadi_integrator_cvodes;casadi_integrator_idas;casadi_rootfinder_kinsol;casadi_nlpsol_sleqp;casadi_nlpsol_ipopt;casadi_nlpsol_madnlp;casadi_nlpsol_bonmin;casadi_conic_qpoases;casadi_nlpsol_knitro;casadi_conic_cplex;casadi_conic_clp;casadi_conic_cbc;casadi_linsol_csparse;casadi_linsol_csparsecholesky;casadi_conic_highs;casadi_conic_daqp;casadi_linsol_ma27;casadi_linsol_mumps;casadi_conic_gurobi;casadi_nlpsol_snopt;casadi_xmlfile_tinyxml;casadi_nlpsol_blocksqp;casadi_conic_fatrop;casadi_nlpsol_fatrop;casadi_conic_superscs;casadi_nlpsol_ampl;casadi_conic_proxqp;casadi_conic_osqp;casadi_archiver_libzip;casadi_filesystem_ghc;casadi_conic_nlpsol;casadi_conic_qrqp;casadi_conic_ipqp;casadi_nlpsol_qrsqp;casadi_importer_shell;casadi_integrator_rk;casadi_integrator_collocation;casadi_interpolant_linear;casadi_interpolant_bspline;casadi_linsol_symbolicqr;casadi_linsol_qr;casadi_linsol_ldl;casadi_linsol_tridiag;casadi_linsol_lsqr;casadi_nlpsol_sqpmethod;casadi_nlpsol_feasiblesqpmethod;casadi_nlpsol_scpgen;casadi_rootfinder_newton;casadi_rootfinder_fast_newton;casadi_rootfinder_nlpsol" // NOLINT(whitespace/line_length)
40
40
  #define CASADI_PLUGINS "Linsol::lapacklu;Linsol::lapackqr;Integrator::cvodes;Integrator::idas;Rootfinder::kinsol;Nlpsol::sleqp;Nlpsol::ipopt;Nlpsol::madnlp;Nlpsol::bonmin;Conic::qpoases;Nlpsol::knitro;Conic::cplex;Conic::clp;Conic::cbc;Linsol::csparse;Linsol::csparsecholesky;Conic::highs;Conic::daqp;Linsol::ma27;Linsol::mumps;Conic::gurobi;Nlpsol::snopt;XmlFile::tinyxml;Nlpsol::blocksqp;Conic::fatrop;Nlpsol::fatrop;Conic::superscs;Nlpsol::ampl;Conic::proxqp;Conic::osqp;Archiver::libzip;Filesystem::ghc;Conic::nlpsol;Conic::qrqp;Conic::ipqp;Nlpsol::qrsqp;Importer::shell;Integrator::rk;Integrator::collocation;Interpolant::linear;Interpolant::bspline;Linsol::symbolicqr;Linsol::qr;Linsol::ldl;Linsol::tridiag;Linsol::lsqr;Nlpsol::sqpmethod;Nlpsol::feasiblesqpmethod;Nlpsol::scpgen;Rootfinder::newton;Rootfinder::fast_newton;Rootfinder::nlpsol" // NOLINT(whitespace/line_length)
41
41
  #define CASADI_INSTALL_PREFIX "" // NOLINT(whitespace/line_length)
@@ -168,6 +168,15 @@ namespace casadi {
168
168
  \identifier{og} */
169
169
  virtual bool uses_output() const;
170
170
 
171
+ /** \brief Customize calls to the function factory
172
+
173
+ \identifier{2de} */
174
+ virtual Function get_factory(const std::string& name,
175
+ const std::vector<std::string>& s_in,
176
+ const std::vector<std::string>& s_out,
177
+ const Function::AuxOut& aux,
178
+ const Dict& opts) const;
179
+
171
180
  ///@{
172
181
  /** \brief Return Jacobian of all input elements with respect to all output elements
173
182
 
@@ -426,6 +426,20 @@ private:
426
426
  CASADI_EXPORT void normalized_setup(std::istream& stream);
427
427
  CASADI_EXPORT void normalized_setup(std::ostream& stream);
428
428
 
429
+
430
+ class CASADI_EXPORT StreamStateGuard {
431
+ public:
432
+ explicit StreamStateGuard(std::ostream& os);
433
+ ~StreamStateGuard();
434
+
435
+ private:
436
+ std::ostream& stream_;
437
+ std::ios::fmtflags flags_;
438
+ std::streamsize precision_;
439
+ std::streamsize width_;
440
+ std::locale locale_;
441
+ };
442
+
429
443
  inline void normalized_out(std::ostream& stream, double val) {
430
444
  if (val==std::numeric_limits<double>::infinity()) {
431
445
  stream << "inf";
@@ -687,7 +687,10 @@ namespace casadi {
687
687
  AUX_BLAZING_1D_BOOR_EVAL,
688
688
  AUX_BLAZING_2D_BOOR_EVAL,
689
689
  AUX_BLAZING_3D_BOOR_EVAL,
690
- AUX_PRINTME
690
+ AUX_PRINTME,
691
+ AUX_PRINT_SCALAR,
692
+ AUX_PRINT_VECTOR,
693
+ AUX_PRINT_CANONICAL
691
694
  };
692
695
 
693
696
  /** \brief Add a built-in auxiliary function
@@ -741,6 +744,21 @@ namespace casadi {
741
744
  void print_vector(std::ostream &s, const std::string& name,
742
745
  const std::vector<std::string>& v);
743
746
 
747
+ /** \brief Print canonical representaion of a matrix
748
+
749
+ \identifier{2dk} */
750
+ std::string print_canonical(const Sparsity& sp, const std::string& arg);
751
+
752
+ /** \brief Print canonical representaion of a vector
753
+
754
+ \identifier{2dl} */
755
+ std::string print_vector(casadi_int sz, const std::string& arg);
756
+
757
+ /** \brief Print canonical representaion of a scalar
758
+
759
+ \identifier{2dm} */
760
+ std::string print_scalar(const std::string& arg);
761
+
744
762
  /** \brief Create a copy operation
745
763
 
746
764
  \identifier{tt} */
@@ -852,10 +870,10 @@ namespace casadi {
852
870
  static std::string casadi_version();
853
871
 
854
872
  /// Print file header
855
- static void file_open(std::ofstream& f, const std::string& name, bool cpp);
873
+ static void stream_open(std::ostream& f, bool cpp);
856
874
 
857
875
  /// Print file header
858
- static void file_close(std::ofstream& f, bool cpp);
876
+ static void stream_close(std::ostream& f, bool cpp);
859
877
 
860
878
  /** \brief Get number of temporary variables needed for all functions
861
879
 
@@ -140,6 +140,21 @@ class CASADI_EXPORT DaeBuilder
140
140
  \identifier{5m} */
141
141
  std::vector<MX> ydef() const;
142
142
 
143
+ /** \brief Set all output variables
144
+
145
+ \identifier{2db} */
146
+ void set_y(const std::vector<std::string>& name);
147
+
148
+ /** \brief Get all rate variables
149
+
150
+ \identifier{2dc} */
151
+ std::vector<std::string> rate() const;
152
+
153
+ /** \brief Set rate variables
154
+
155
+ \identifier{2dd} */
156
+ void set_rate(const std::vector<std::string>& name);
157
+
143
158
  /** \brief Free controls
144
159
 
145
160
  \identifier{5n} */
@@ -217,6 +232,11 @@ class CASADI_EXPORT DaeBuilder
217
232
  \identifier{64} */
218
233
  bool has_t() const;
219
234
 
235
+ /** \brief Is there a rate output?
236
+
237
+ \identifier{2dg} */
238
+ bool has_rate() const;
239
+
220
240
  /** \brief Differential states
221
241
 
222
242
  \identifier{65} */
@@ -36,6 +36,7 @@ namespace casadi {
36
36
 
37
37
  // Forward declarations
38
38
  class DaeBuilderInternal;
39
+ class FmuFunction;
39
40
  struct FmuMemory;
40
41
  struct InputStruct;
41
42
 
@@ -160,11 +161,21 @@ class CASADI_EXPORT Fmu
160
161
  return hess_sparsity(ired(r), ired(c));
161
162
  }
162
163
 
164
+ /** \brief Create memory block
165
+
166
+ \identifier{2dn} */
167
+ FmuMemory* alloc_mem(const FmuFunction& f) const;
168
+
163
169
  /** \brief Initalize memory block
164
170
 
165
171
  \identifier{26x} */
166
172
  int init_mem(FmuMemory* m) const;
167
173
 
174
+ /** \brief Free memory block
175
+
176
+ \identifier{2dt} */
177
+ void free_mem(void *mem) const;
178
+
168
179
  // Free FMU instance
169
180
  void free_instance(void* instance) const;
170
181
 
@@ -463,6 +463,11 @@ namespace casadi {
463
463
  \identifier{1w2} */
464
464
  void change_option(const std::string& option_name, const GenericType& option_value);
465
465
 
466
+ /** \brief Reset the counter used to name dump files
467
+
468
+ \identifier{2dy} */
469
+ void reset_dump_count();
470
+
466
471
  /** \brief Do the derivative functions need nondifferentiated outputs?
467
472
 
468
473
  \identifier{1w3} */
@@ -956,6 +961,16 @@ namespace casadi {
956
961
  return mx_in(index_in(iname));
957
962
  }
958
963
  const std::vector<MX> mx_in() const;
964
+ #ifndef SWIG
965
+ template<typename T>
966
+ const T sym_in(casadi_int iind) const;
967
+ template<typename T>
968
+ const T sym_in(const std::string& iname) const {
969
+ return sym_in<T>(index_in(iname));
970
+ }
971
+ template<typename T>
972
+ const std::vector<T> sym_in() const;
973
+ #endif // SWIG
959
974
  ///@}
960
975
 
961
976
  ///@{
@@ -1357,6 +1372,14 @@ public:
1357
1372
 
1358
1373
  void CASADI_EXPORT _function_buffer_eval(void* raw);
1359
1374
 
1375
+ template<>
1376
+ const SX CASADI_EXPORT Function::sym_in(casadi_int iind) const;
1377
+ template<>
1378
+ const MX CASADI_EXPORT Function::sym_in(casadi_int iind) const;
1379
+ template<>
1380
+ const std::vector<SX> CASADI_EXPORT Function::sym_in() const;
1381
+ template<>
1382
+ const std::vector<MX> CASADI_EXPORT Function::sym_in() const;
1360
1383
 
1361
1384
  } // namespace casadi
1362
1385
 
@@ -30,6 +30,7 @@
30
30
  #include "exception.hpp"
31
31
  #include <unordered_map>
32
32
  #include <vector>
33
+ #include <cstdint>
33
34
  #ifdef CASADI_WITH_THREAD
34
35
  #ifdef CASADI_WITH_THREAD_MINGW
35
36
  #include <mingw.mutex.h>
@@ -38,9 +39,7 @@
38
39
  #endif // CASADI_WITH_THREAD_MINGW
39
40
  #endif //CASADI_WITH_THREAD
40
41
 
41
- #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
42
42
  #include <memory>
43
- #endif // CASADI_WITH_THREADSAFE_SYMBOLICS
44
43
 
45
44
  namespace casadi {
46
45
 
@@ -235,7 +234,10 @@ namespace casadi {
235
234
 
236
235
  #endif // SWIG
237
236
 
238
-
237
+ /**
238
+ * Key is stored as a regular ref
239
+ * Value is stored as weakref
240
+ */
239
241
  template<typename K, typename T>
240
242
  class CASADI_EXPORT WeakCache {
241
243
  public:
@@ -310,7 +312,82 @@ class CASADI_EXPORT WeakCache {
310
312
  #endif // CASADI_WITH_THREADSAFE_SYMBOLICS
311
313
  };
312
314
 
315
+ // gcc-12 is overzealous about use-after-free warnings
316
+ // <12 or >12 works fine
317
+ #pragma GCC diagnostic push
318
+ #if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ == 12)
319
+ #pragma GCC diagnostic ignored "-Wuse-after-free"
320
+ #endif
321
+
322
+ /**
323
+ * Key is stored as a weakref
324
+ * Value is stored as regular ref
325
+ */
326
+ template<typename K, typename T>
327
+ class CASADI_EXPORT RevWeakCache {
328
+ public:
329
+ void tocache(const K& key, const T& f, bool needs_lock=true) {
330
+ #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
331
+ // Safe access to cache_
332
+ casadi::conditional_lock_guard<std::mutex> lock(mtx_, needs_lock);
333
+ #endif // CASADI_WITH_THREADSAFE_SYMBOLICS
334
+ // Add to cache
335
+ const void* k = key.get();
336
+ pre_cache_.insert(std::make_pair(k, key));
337
+ cache_.insert(std::make_pair(k, f));
338
+ // Remove a lost reference, if any, to prevent uncontrolled growth
339
+ for (auto it = pre_cache_.begin(); it!=pre_cache_.end(); ++it) {
340
+ if (!it->second.alive()) {
341
+ pre_cache_.erase(it);
342
+ cache_.erase(it->first);
343
+ break; // just one dead reference is enough
344
+ }
345
+ }
346
+ }
347
+ /* \brief Thread-safe unique caching
348
+ * While an incache/tocache pair in multi-threaded context is safe
349
+ * it may lead to fresh cache entries being overwritten.
350
+ *
351
+ * A mutex lock_guard on the scope of an incache/tocache pair
352
+ * may lead to deadlocks.
353
+ *
354
+ */
355
+ void tocache_if_missing(const K& key, T& f) {
356
+ #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
357
+ // Safe access to cache_
358
+ std::lock_guard<std::mutex> lock(mtx_);
359
+ #endif // CASADI_WITH_THREADSAFE_SYMBOLICS
360
+ if (!incache(key, f, false)) {
361
+ tocache(key, f, false);
362
+ }
363
+ }
364
+ bool incache(const K& key, T& f, bool needs_lock=true) const {
365
+ #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
366
+ // Safe access to cache_
367
+ casadi::conditional_lock_guard<std::mutex> lock(mtx_, needs_lock);
368
+ #endif // CASADI_WITH_THREADSAFE_SYMBOLICS
369
+ const void* k = key.get();
370
+ auto it = pre_cache_.find(k);
371
+ K temp;
372
+ if (it!=pre_cache_.end() && it->second.shared_if_alive(temp)) {
373
+ auto it2 = cache_.find(k);
374
+ f = it2->second;
375
+ return true;
376
+ } else {
377
+ return false;
378
+ }
379
+ }
380
+ private:
381
+ std::unordered_map<const void*,
382
+ GenericWeakRef<typename K::base_type, typename K::internal_base_type>
383
+ > pre_cache_;
384
+ std::unordered_map<const void*, T> cache_;
385
+ #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
386
+ mutable std::mutex mtx_;
387
+ #endif // CASADI_WITH_THREADSAFE_SYMBOLICS
388
+ };
313
389
 
390
+ #pragma GCC diagnostic pop
314
391
 
315
392
  } // namespace casadi
316
393
 
@@ -26,6 +26,10 @@
26
26
  #ifndef CASADI_GENERIC_SHARED_IMPL_HPP
27
27
  #define CASADI_GENERIC_SHARED_IMPL_HPP
28
28
 
29
+ #ifdef WITH_EXTRA_CHECKS
30
+ #include "function.hpp"
31
+ #endif // WITH_EXTRA_CHECKS
32
+
29
33
  namespace casadi {
30
34
 
31
35
  template<typename Shared, typename Internal>
@@ -936,6 +936,10 @@ namespace casadi {
936
936
  static void print_vector(std::ostream &stream, const Sparsity& sp, const Scalar* nonzeros,
937
937
  bool truncate=true);
938
938
 
939
+ /// Print canonical style
940
+ static void print_canonical(std::ostream &stream, const Sparsity& sp, const Scalar* nonzeros,
941
+ bool truncate=true);
942
+
939
943
  /// Print scalar
940
944
  static void print_sparse(std::ostream &stream, const Sparsity& sp, const Scalar* nonzeros,
941
945
  bool truncate=true);
@@ -27,6 +27,7 @@
27
27
  #define CASADI_NLP_BUILDER_HPP
28
28
 
29
29
  #include "mx.hpp"
30
+ #include <memory>
30
31
 
31
32
  namespace casadi {
32
33
 
@@ -112,7 +113,7 @@ namespace casadi {
112
113
  // Binary mode
113
114
  bool binary_;
114
115
  // File stream
115
- std::ifstream s_;
116
+ std::unique_ptr<std::istream> s_ptr_;
116
117
  // All variables, including dependent
117
118
  std::vector<MX> v_;
118
119
  // Number of objectives and constraints
@@ -205,7 +205,7 @@ T1 casadi_smoothing_diff_err(const T1** yk, T1 h, casadi_int n_y, casadi_int i,
205
205
  // If sw is 0, no stencil worked
206
206
  if (sw == 0) {
207
207
  // Cannot be calculated
208
- return std::numeric_limits<T1>::quiet_NaN();;
208
+ return std::numeric_limits<T1>::quiet_NaN();
209
209
  } else {
210
210
  // Finalize estimate using the sum of weights and the step length
211
211
  return ui / sw;
@@ -0,0 +1,55 @@
1
+ //
2
+ // MIT No Attribution
3
+ //
4
+ // Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl, KU Leuven.
5
+ //
6
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of this
7
+ // software and associated documentation files (the "Software"), to deal in the Software
8
+ // without restriction, including without limitation the rights to use, copy, modify,
9
+ // merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
10
+ // permit persons to whom the Software is furnished to do so.
11
+ //
12
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
14
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
15
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
16
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
17
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
+ //
19
+
20
+ // SYMBOL "print_canonical"
21
+ template<typename T1>
22
+ void casadi_print_canonical(const casadi_int* sp, const T1* x) {
23
+ // C-REPLACE "printf" "CASADI_PRINTF"
24
+ // C-REPLACE "static_cast<int>" "(int) "
25
+ if (x) {
26
+ casadi_int nrow = sp[0];
27
+ casadi_int ncol = sp[1];
28
+ const casadi_int* colind = sp+2;
29
+ const casadi_int* row = colind + ncol + 1;
30
+ casadi_int nnz = sp[2+ncol];
31
+ if (nrow==1 && ncol==1 && nnz==1) {
32
+ casadi_print_scalar(x[0]);
33
+ } else {
34
+ casadi_int i;
35
+ printf("%dx%d: ", static_cast<int>(nrow), static_cast<int>(ncol));
36
+ casadi_print_vector(nnz, x);
37
+ if (nnz!=nrow*ncol) {
38
+ printf(", colind: [");
39
+ for (i = 0; i < ncol; ++i) {
40
+ if (i > 0) printf(", ");
41
+ printf("%d", static_cast<int>(colind[i]));
42
+ }
43
+ printf("], row: [");
44
+ for (i = 0; i < nnz; ++i) {
45
+ if (i > 0) printf(", ");
46
+ printf("%d", static_cast<int>(row[i]));
47
+ }
48
+ printf("]");
49
+ }
50
+ }
51
+ } else {
52
+ printf("NULL");
53
+ }
54
+
55
+ }
@@ -0,0 +1,25 @@
1
+ //
2
+ // MIT No Attribution
3
+ //
4
+ // Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl, KU Leuven.
5
+ //
6
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of this
7
+ // software and associated documentation files (the "Software"), to deal in the Software
8
+ // without restriction, including without limitation the rights to use, copy, modify,
9
+ // merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
10
+ // permit persons to whom the Software is furnished to do so.
11
+ //
12
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
14
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
15
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
16
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
17
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
+ //
19
+
20
+ // SYMBOL "print_scalar"
21
+ template<typename T1>
22
+ void casadi_print_scalar(T1 a) {
23
+ // C-REPLACE "printf" "CASADI_PRINTF"
24
+ printf("%.16e", a);
25
+ }