casadi 3.6.4__cp35-none-manylinux1_i686.whl → 3.6.5__cp35-none-manylinux1_i686.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 (155) hide show
  1. casadi/_casadi.so +0 -0
  2. casadi/casadi.py +328 -250
  3. casadi/clp +0 -0
  4. casadi/cmake/casadi-config-version.cmake +1 -1
  5. casadi/include/casadi/casadi.i +30 -15
  6. casadi/include/casadi/config.h +5 -5
  7. casadi/include/casadi/core/code_generator.hpp +29 -1
  8. casadi/include/casadi/core/core.hpp +1 -0
  9. casadi/include/casadi/core/generic_expression.hpp +1 -1
  10. casadi/include/casadi/core/generic_type.hpp +25 -1
  11. casadi/include/casadi/core/matrix_decl.hpp +15 -0
  12. casadi/include/casadi/core/runtime/casadi_nlp.hpp +131 -6
  13. casadi/include/casadi/core/runtime/casadi_sqpmethod.hpp +11 -1
  14. casadi/include/casadi/core/sparsity.hpp +5 -3
  15. casadi/include/casadi/core/tools.hpp +67 -0
  16. casadi/include/casadi/doc.i +1166 -816
  17. casadi/include/casadi/doc_merged.i +834 -569
  18. casadi/include/coin-or/IpAlgBuilder.hpp +417 -0
  19. casadi/include/coin-or/IpAlgStrategy.hpp +201 -0
  20. casadi/include/coin-or/IpAlgTypes.hpp +64 -0
  21. casadi/include/coin-or/IpAugSystemSolver.hpp +212 -0
  22. casadi/include/coin-or/IpBlas.hpp +426 -0
  23. casadi/include/coin-or/IpCachedResults.hpp +897 -0
  24. casadi/include/coin-or/IpCompoundMatrix.hpp +423 -0
  25. casadi/include/coin-or/IpCompoundSymMatrix.hpp +348 -0
  26. casadi/include/coin-or/IpCompoundVector.hpp +395 -0
  27. casadi/include/coin-or/IpConvCheck.hpp +97 -0
  28. casadi/include/coin-or/IpDebug.hpp +167 -0
  29. casadi/include/coin-or/IpDenseVector.hpp +626 -0
  30. casadi/include/coin-or/IpDiagMatrix.hpp +158 -0
  31. casadi/include/coin-or/IpEqMultCalculator.hpp +76 -0
  32. casadi/include/coin-or/IpException.hpp +156 -0
  33. casadi/include/coin-or/IpExpansionMatrix.hpp +245 -0
  34. casadi/include/coin-or/IpGenTMatrix.hpp +290 -0
  35. casadi/include/coin-or/IpHessianUpdater.hpp +73 -0
  36. casadi/include/coin-or/IpIdentityMatrix.hpp +167 -0
  37. casadi/include/coin-or/IpIpoptAlg.hpp +257 -0
  38. casadi/include/coin-or/IpIpoptApplication.hpp +367 -0
  39. casadi/include/coin-or/IpIpoptCalculatedQuantities.hpp +1009 -0
  40. casadi/include/coin-or/IpIpoptData.hpp +966 -0
  41. casadi/include/coin-or/IpIpoptNLP.hpp +328 -0
  42. casadi/include/coin-or/IpIterateInitializer.hpp +68 -0
  43. casadi/include/coin-or/IpIteratesVector.hpp +840 -0
  44. casadi/include/coin-or/IpIterationOutput.hpp +78 -0
  45. casadi/include/coin-or/IpJournalist.hpp +573 -0
  46. casadi/include/coin-or/IpLapack.hpp +227 -0
  47. casadi/include/coin-or/IpLibraryLoader.hpp +76 -0
  48. casadi/include/coin-or/IpLineSearch.hpp +106 -0
  49. casadi/include/coin-or/IpLinearSolvers.h +46 -0
  50. casadi/include/coin-or/IpMatrix.hpp +434 -0
  51. casadi/include/coin-or/IpMuUpdate.hpp +77 -0
  52. casadi/include/coin-or/IpNLP.hpp +306 -0
  53. casadi/include/coin-or/IpNLPScaling.hpp +582 -0
  54. casadi/include/coin-or/IpObserver.hpp +422 -0
  55. casadi/include/coin-or/IpOptionsList.hpp +412 -0
  56. casadi/include/coin-or/IpOrigIpoptNLP.hpp +603 -0
  57. casadi/include/coin-or/IpPDSystemSolver.hpp +137 -0
  58. casadi/include/coin-or/IpReferenced.hpp +262 -0
  59. casadi/include/coin-or/IpRegOptions.hpp +1152 -0
  60. casadi/include/coin-or/IpReturnCodes.h +23 -0
  61. casadi/include/coin-or/IpReturnCodes.hpp +18 -0
  62. casadi/include/coin-or/IpReturnCodes.inc +71 -0
  63. casadi/include/coin-or/IpReturnCodes_inc.h +45 -0
  64. casadi/include/coin-or/IpScaledMatrix.hpp +291 -0
  65. casadi/include/coin-or/IpSearchDirCalculator.hpp +72 -0
  66. casadi/include/coin-or/IpSmartPtr.hpp +865 -0
  67. casadi/include/coin-or/IpSolveStatistics.hpp +210 -0
  68. casadi/include/coin-or/IpSparseSymLinearSolverInterface.hpp +260 -0
  69. casadi/include/coin-or/IpStdAugSystemSolver.cpp +555 -0
  70. casadi/include/coin-or/IpStdCInterface.h +428 -0
  71. casadi/include/coin-or/IpSumSymMatrix.hpp +186 -0
  72. casadi/include/coin-or/IpSymLinearSolver.hpp +141 -0
  73. casadi/include/coin-or/IpSymMatrix.hpp +167 -0
  74. casadi/include/coin-or/IpSymScaledMatrix.hpp +255 -0
  75. casadi/include/coin-or/IpSymTMatrix.hpp +275 -0
  76. casadi/include/coin-or/IpTNLP.hpp +820 -0
  77. casadi/include/coin-or/IpTNLPAdapter.hpp +648 -0
  78. casadi/include/coin-or/IpTNLPReducer.hpp +274 -0
  79. casadi/include/coin-or/IpTaggedObject.hpp +128 -0
  80. casadi/include/coin-or/IpTimedTask.hpp +218 -0
  81. casadi/include/coin-or/IpTimingStatistics.hpp +323 -0
  82. casadi/include/coin-or/IpTripletHelper.hpp +308 -0
  83. casadi/include/coin-or/IpTypes.h +81 -0
  84. casadi/include/coin-or/IpTypes.hpp +30 -0
  85. casadi/include/coin-or/IpUtils.hpp +166 -0
  86. casadi/include/coin-or/IpVector.hpp +892 -0
  87. casadi/include/coin-or/IpZeroSymMatrix.hpp +155 -0
  88. casadi/include/coin-or/IpoptConfig.h +45 -0
  89. casadi/include/coin-or/SensAlgorithm.hpp +114 -0
  90. casadi/include/coin-or/SensApplication.hpp +188 -0
  91. casadi/include/coin-or/SensBacksolver.hpp +36 -0
  92. casadi/include/coin-or/SensMeasurement.hpp +56 -0
  93. casadi/include/coin-or/SensPCalculator.hpp +137 -0
  94. casadi/include/coin-or/SensRegOp.hpp +21 -0
  95. casadi/include/coin-or/SensSchurData.hpp +182 -0
  96. casadi/include/coin-or/SensSchurDriver.hpp +118 -0
  97. casadi/include/coin-or/SensSimpleBacksolver.hpp +49 -0
  98. casadi/include/coin-or/SensStepCalc.hpp +85 -0
  99. casadi/include/coin-or/SensUtils.hpp +63 -0
  100. casadi/include/coin-or/metis/defs.h +161 -0
  101. casadi/include/coin-or/metis/macros.h +143 -0
  102. casadi/include/coin-or/metis/metis.h +37 -0
  103. casadi/include/coin-or/metis/proto.h +505 -0
  104. casadi/include/coin-or/metis/rename.h +418 -0
  105. casadi/include/coin-or/metis/struct.h +251 -0
  106. casadi/include/coin-or/mumps/dmumps_c.h +142 -0
  107. casadi/include/coin-or/mumps/mumps_c_types.h +72 -0
  108. casadi/include/coin-or/mumps/mumps_compat.h +27 -0
  109. casadi/include/coin-or/mumps/mumps_int_def.h +11 -0
  110. casadi/include/coin-or/mumps/mumps_mpi.h +67 -0
  111. casadi/lib/libtinyxml2.a +0 -0
  112. casadi/libCbcSolver.so +0 -0
  113. casadi/libCbcSolver.so.3 +0 -0
  114. casadi/libCbcSolver.so.3.10.11 +0 -0
  115. casadi/libClpSolver.so +0 -0
  116. casadi/libClpSolver.so.1 +0 -0
  117. casadi/libClpSolver.so.1.14.9 +0 -0
  118. casadi/libbonmin.so +0 -0
  119. casadi/libbonmin.so.4 +0 -0
  120. casadi/libbonmin.so.4.8.9 +0 -0
  121. casadi/libcasadi.so +0 -0
  122. casadi/libcasadi.so.3.7 +0 -0
  123. casadi/libcasadi_nlpsol_ampl.so +0 -0
  124. casadi/libcasadi_nlpsol_ampl.so.3.7 +0 -0
  125. casadi/libcasadi_nlpsol_blocksqp.so +0 -0
  126. casadi/libcasadi_nlpsol_blocksqp.so.3.7 +0 -0
  127. casadi/libcasadi_nlpsol_bonmin.so +0 -0
  128. casadi/libcasadi_nlpsol_bonmin.so.3.7 +0 -0
  129. casadi/libcasadi_nlpsol_feasiblesqpmethod.so +0 -0
  130. casadi/libcasadi_nlpsol_feasiblesqpmethod.so.3.7 +0 -0
  131. casadi/libcasadi_nlpsol_ipopt.so +0 -0
  132. casadi/libcasadi_nlpsol_ipopt.so.3.7 +0 -0
  133. casadi/libcasadi_nlpsol_knitro.so +0 -0
  134. casadi/libcasadi_nlpsol_knitro.so.3.7 +0 -0
  135. casadi/libcasadi_nlpsol_qrsqp.so +0 -0
  136. casadi/libcasadi_nlpsol_qrsqp.so.3.7 +0 -0
  137. casadi/libcasadi_nlpsol_scpgen.so +0 -0
  138. casadi/libcasadi_nlpsol_scpgen.so.3.7 +0 -0
  139. casadi/libcasadi_nlpsol_snopt.so +0 -0
  140. casadi/libcasadi_nlpsol_snopt.so.3.7 +0 -0
  141. casadi/libcasadi_nlpsol_sqpmethod.so +0 -0
  142. casadi/libcasadi_nlpsol_sqpmethod.so.3.7 +0 -0
  143. casadi/libcasadi_nlpsol_worhp.so +0 -0
  144. casadi/libcasadi_nlpsol_worhp.so.3.7 +0 -0
  145. casadi/libcasadi_rootfinder_fast_newton.so +0 -0
  146. casadi/libcasadi_rootfinder_fast_newton.so.3.7 +0 -0
  147. casadi/libindirect.a +0 -0
  148. casadi/liblinsys.a +0 -0
  149. casadi/libosqp.a +0 -0
  150. casadi/libqdldl.a +0 -0
  151. casadi/libsuperscs.a +0 -0
  152. casadi/pkgconfig/casadi.pc +1 -1
  153. {casadi-3.6.4.dist-info → casadi-3.6.5.dist-info}/METADATA +11 -3
  154. {casadi-3.6.4.dist-info → casadi-3.6.5.dist-info}/RECORD +155 -61
  155. {casadi-3.6.4.dist-info → casadi-3.6.5.dist-info}/WHEEL +0 -0
casadi/clp CHANGED
Binary file
@@ -1,4 +1,4 @@
1
- set(PACKAGE_VERSION "3.6.4")
1
+ set(PACKAGE_VERSION "3.6.5")
2
2
 
3
3
  # Check whether the requested PACKAGE_FIND_VERSION is compatible
4
4
  if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
@@ -80,6 +80,19 @@
80
80
  return PyErr_CheckSignals();
81
81
  }
82
82
 
83
+ std::string python_string_to_std_string(PyObject *str_py) {
84
+ #if SWIG_VERSION < 0x040200
85
+ const char *str_char = SWIG_Python_str_AsChar(str_py);
86
+ std::string str(str_char);
87
+ SWIG_Python_str_DelForPy3(str_char);
88
+ #else
89
+ PyObject *bytes = NULL;
90
+ std::string str(SWIG_PyUnicode_AsUTF8AndSize(str_py, NULL, &bytes));
91
+ Py_XDECREF(bytes);
92
+ #endif
93
+ return str;
94
+ }
95
+
83
96
  void handle_director_exception() {
84
97
  std::string msg = "Exception in SWIG director ";
85
98
  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
@@ -91,9 +104,7 @@
91
104
  PyObject *ptype, *pvalue, *ptraceback;
92
105
  PyErr_Fetch(&ptype, &pvalue, &ptraceback);
93
106
  PyObject* msg_py = PyObject_Str(pvalue);
94
- char *msg_char = SWIG_Python_str_AsChar(msg_py);
95
- msg = msg_char;
96
- SWIG_Python_str_DelForPy3(msg_char);
107
+ msg = python_string_to_std_string(msg_py);
97
108
  Py_DECREF(msg_py);
98
109
  PyErr_Restore(ptype, pvalue, ptraceback);
99
110
  PyErr_Print();
@@ -1441,11 +1452,15 @@ namespace std {
1441
1452
  || to_generic<std::vector<double> >(p, m)
1442
1453
  || to_generic<std::vector<bool> >(p, m)
1443
1454
  || to_generic<std::vector<std::string> >(p, m)
1455
+ || to_generic<std::vector<std::vector<std::string> > >(p, m)
1444
1456
  || to_generic<std::vector<std::vector<casadi_int> > >(p, m)
1445
1457
  || to_generic<std::vector<std::vector<double> > >(p, m)
1446
1458
  || to_generic<casadi::Function>(p, m)
1447
1459
  || to_generic<std::vector<casadi::Function> >(p, m)
1448
- || to_generic<casadi::GenericType::Dict>(p, m)) {
1460
+ || to_generic<casadi::GenericType::Dict>(p, m)
1461
+ || to_generic<std::vector<casadi::GenericType::Dict> >(p, m)
1462
+ || to_generic<std::vector<std::vector<casadi::GenericType> > >(p, m)
1463
+ || to_generic<std::vector<casadi::GenericType> >(p, m)) {
1449
1464
  return true;
1450
1465
  }
1451
1466
 
@@ -1468,7 +1483,11 @@ namespace std {
1468
1483
  case OT_DOUBLEVECTOR: return from_tmp(a->as_double_vector());
1469
1484
  case OT_DOUBLEVECTORVECTOR: return from_tmp(a->as_double_vector_vector());
1470
1485
  case OT_STRINGVECTOR: return from_tmp(a->as_string_vector());
1486
+ case OT_STRINGVECTORVECTOR: return from_tmp(a->as_string_vector_vector());
1471
1487
  case OT_DICT: return from_tmp(a->as_dict());
1488
+ case OT_DICTVECTOR: return from_tmp(a->as_dict_vector());
1489
+ case OT_VECTORVECTOR: return from_tmp(a->as_vector_vector());
1490
+ case OT_VECTOR: return from_tmp(a->as_vector());
1472
1491
  case OT_FUNCTION: return from_tmp(a->as_function());
1473
1492
  case OT_FUNCTIONVECTOR: return from_tmp(a->as_function_vector());
1474
1493
  #ifdef SWIGPYTHON
@@ -1500,10 +1519,10 @@ namespace std {
1500
1519
 
1501
1520
  #ifdef SWIGPYTHON
1502
1521
  if (PyString_Check(p) || PyUnicode_Check(p)) {
1503
- if (m) (*m)->clear();
1504
- char* my_char = SWIG_Python_str_AsChar(p);
1505
- if (m) (*m)->append(my_char);
1506
- SWIG_Python_str_DelForPy3(my_char);
1522
+ if (m) {
1523
+ (*m)->clear();
1524
+ (*m)->append(python_string_to_std_string(p));
1525
+ }
1507
1526
  return true;
1508
1527
  }
1509
1528
  #endif // SWIGPYTHON
@@ -1594,9 +1613,7 @@ namespace std {
1594
1613
  while (PyDict_Next(p, &pos, &key, &value)) {
1595
1614
  if (!(PyString_Check(key) || PyUnicode_Check(key))) return false;
1596
1615
  if (m) {
1597
- char* c_key = SWIG_Python_str_AsChar(key);
1598
- M *v=&(**m)[std::string(c_key)], *v2=v;
1599
- SWIG_Python_str_DelForPy3(c_key);
1616
+ M *v=&(**m)[python_string_to_std_string(key)], *v2=v;
1600
1617
  if (!casadi::to_ptr(value, &v)) return false;
1601
1618
  if (v!=v2) *v2=*v; // if only pointer changed
1602
1619
  } else {
@@ -1857,11 +1874,8 @@ namespace std {
1857
1874
  PyObject * classo = PyObject_GetAttrString( p, "__class__");
1858
1875
  PyObject * classname = PyObject_GetAttrString( classo, "__name__");
1859
1876
 
1860
- char* c_classname = SWIG_Python_str_AsChar(classname);
1861
- bool ret = strcmp(c_classname, name)==0;
1862
-
1877
+ bool ret = python_string_to_std_string(classname) == name;
1863
1878
  Py_DECREF(classo);Py_DECREF(classname);
1864
- SWIG_Python_str_DelForPy3(c_classname);
1865
1879
  return ret;
1866
1880
  }
1867
1881
  #endif // SWIGPYTHON
@@ -4420,6 +4434,7 @@ namespace casadi {
4420
4434
  %include <casadi/core/casadi_meta.hpp>
4421
4435
  %include <casadi/core/integration_tools.hpp>
4422
4436
  %include <casadi/core/nlp_tools.hpp>
4437
+ %include <casadi/core/tools.hpp>
4423
4438
  %include <casadi/core/nlp_builder.hpp>
4424
4439
  %include <casadi/core/dae_builder.hpp>
4425
4440
  %include <casadi/core/xml_file.hpp>
@@ -26,16 +26,16 @@
26
26
 
27
27
  #define CASADI_MAJOR_VERSION 3
28
28
  #define CASADI_MINOR_VERSION 6
29
- #define CASADI_PATCH_VERSION 4
29
+ #define CASADI_PATCH_VERSION 5
30
30
  #define CASADI_IS_RELEASE 1
31
- #define CASADI_VERSION_STRING "3.6.4"
32
- #define CASADI_GIT_REVISION "329e2282664f584b17fd6319f8ce765a111a6022" // NOLINT(whitespace/line_length)
33
- #define CASADI_GIT_DESCRIBE "3.6.3-116.329e22826" // NOLINT(whitespace/line_length)
31
+ #define CASADI_VERSION_STRING "3.6.5"
32
+ #define CASADI_GIT_REVISION "3d820e62cb588e76498c92bf6feff6876b4e7ca0" // NOLINT(whitespace/line_length)
33
+ #define CASADI_GIT_DESCRIBE "3.6.3-175.3d820e62c" // NOLINT(whitespace/line_length)
34
34
  #define CASADI_FEATURE_LIST "\n * dynamic-loading, Support for import of FMI 2.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 * snopt-mockup-build, Use mockup SNOPT (BUILD_MOCKUPS_VERSION=v65) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * knitro-mockup-build, Use mockup KNITRO (BUILD_MOCKUPS_VERSION=v65) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * gurobi-mockup-build, Use mockup GUROBI (BUILD_MOCKUPS_VERSION=v65) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * worhp-mockup-build, Use mockup WORHP (BUILD_MOCKUPS_VERSION=v65) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * hsl-mockup-build, Use mockup WORHP (BUILD_MOCKUPS_VERSION=v65) from downloaded source (BUILD_MOCKUPS_GIT_REPO=https://github.com/casadi/mockups.git).\n * osqp-sourcebuild, Build OSQP (BUILD_OSQP_VERSION=v0.6.2) 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 * 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=releases/2.0.0) from downloaded source.\n * lapack-sourcebuild, Download and install OpenBLAS for LAPACK+BLAS\n * gurobi-interface, Interface to the (mixed-integer) QP solver GUROBI\n * knitro-interface, Interface to the NLP solver KNITRO.\n * snopt-interface, Interface to the NLP solver KNITRO.\n * worhp-interface, Interface to the NLP solver Worhp (requires gfortran, gomp).\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 * ampl-interface, Interface to the AMPL solver library.\n" // NOLINT(whitespace/line_length)
35
35
  #define CASADI_BUILD_TYPE "Release" // NOLINT(whitespace/line_length)
36
36
  #define CASADI_COMPILER_ID "GNU" // NOLINT(whitespace/line_length)
37
37
  #define CASADI_COMPILER "/opt/rh/devtoolset-2/root/usr/bin/g++" // NOLINT(whitespace/line_length)
38
- #define CASADI_COMPILER_FLAGS " -std=c++11 -pthread -DUSE_CXX11 -DHAVE_SIMPLE_MKSTEMPS -DCASADI_WITH_THREAD -DWITH_DEEPBIND -DCASADI_MAJOR_VERSION=3 -DCASADI_MINOR_VERSION=6 -DCASADI_PATCH_VERSION=4 -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" // NOLINT(whitespace/line_length)
38
+ #define CASADI_COMPILER_FLAGS " -std=c++11 -pthread -DUSE_CXX11 -DHAVE_SIMPLE_MKSTEMPS -DCASADI_WITH_THREAD -DWITH_DEEPBIND -DCASADI_MAJOR_VERSION=3 -DCASADI_MINOR_VERSION=6 -DCASADI_PATCH_VERSION=5 -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" // 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_ipopt;casadi_nlpsol_bonmin;casadi_conic_qpoases;casadi_nlpsol_knitro;casadi_conic_clp;casadi_conic_cbc;casadi_linsol_csparse;casadi_linsol_csparsecholesky;casadi_linsol_ma27;casadi_linsol_mumps;casadi_conic_gurobi;casadi_nlpsol_worhp;casadi_nlpsol_snopt;casadi_xmlfile_tinyxml;casadi_nlpsol_blocksqp;casadi_conic_superscs;casadi_nlpsol_ampl;casadi_conic_osqp;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::ipopt;Nlpsol::bonmin;Conic::qpoases;Nlpsol::knitro;Conic::clp;Conic::cbc;Linsol::csparse;Linsol::csparsecholesky;Linsol::ma27;Linsol::mumps;Conic::gurobi;Nlpsol::worhp;Nlpsol::snopt;XmlFile::tinyxml;Nlpsol::blocksqp;Conic::superscs;Nlpsol::ampl;Conic::osqp;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 "/usr/local" // NOLINT(whitespace/line_length)
@@ -103,6 +103,11 @@ namespace casadi {
103
103
  \identifier{ry} */
104
104
  casadi_int get_constant(const std::vector<casadi_int>& v, bool allow_adding=false);
105
105
 
106
+ /** \brief Get or add a char constant
107
+
108
+ \identifier{27l} */
109
+ casadi_int get_constant(const std::vector<char>& v, bool allow_adding=false);
110
+
106
111
  /** \brief Represent an array constant; adding it when new
107
112
 
108
113
  \identifier{rz} */
@@ -128,6 +133,11 @@ namespace casadi {
128
133
  \identifier{s1} */
129
134
  std::string constant(const std::vector<double>& v);
130
135
 
136
+ /** \brief Represent an array constant; adding it when new
137
+
138
+ \identifier{27m} */
139
+ std::string constant(const std::vector<char>& v);
140
+
131
141
  /** \brief Allocate file scope double read-only memory
132
142
 
133
143
  \identifier{s2} */
@@ -153,7 +163,7 @@ namespace casadi {
153
163
  \identifier{s6} */
154
164
  std::string operator()(const Function& f, const std::string& arg,
155
165
  const std::string& res, const std::string& iw,
156
- const std::string& w);
166
+ const std::string& w, const std::string& failure_ret="1");
157
167
 
158
168
  /** \brief Print a string to buffer
159
169
 
@@ -232,6 +242,7 @@ namespace casadi {
232
242
  \identifier{sk} */
233
243
  std::string initializer(const std::vector<double>& v);
234
244
  std::string initializer(const std::vector<casadi_int>& v);
245
+ std::string initializer(const std::vector<char>& v);
235
246
 
236
247
  /** \brief Sanitize source files for codegen
237
248
 
@@ -634,6 +645,12 @@ namespace casadi {
634
645
  void print_vector(std::ostream &s, const std::string& name,
635
646
  const std::vector<casadi_int>& v);
636
647
 
648
+ /** \brief Print char vector to a c file
649
+
650
+ \identifier{27n} */
651
+ void print_vector(std::ostream &s, const std::string& name,
652
+ const std::vector<char>& v);
653
+
637
654
  /** \brief Print real vector to a c file
638
655
 
639
656
  \identifier{ts} */
@@ -810,6 +827,9 @@ namespace casadi {
810
827
  bool with_sfunction;
811
828
  std::vector<std::string> added_sfunctions;
812
829
 
830
+ // Unroll arguments?
831
+ bool unroll_args;
832
+
813
833
  // Verbose codegen?
814
834
  bool verbose;
815
835
 
@@ -874,6 +894,7 @@ namespace casadi {
874
894
  std::multimap<Auxiliary, std::vector<std::string>> added_auxiliaries_;
875
895
  std::multimap<size_t, size_t> added_double_constants_;
876
896
  std::multimap<size_t, size_t> added_integer_constants_;
897
+ std::multimap<size_t, size_t> added_char_constants_;
877
898
  std::map<std::string, std::pair<std::string, std::string> > local_variables_;
878
899
  std::map<std::string, std::string> local_default_;
879
900
  std::map<const void *, casadi_int> file_scope_double_;
@@ -888,9 +909,13 @@ namespace casadi {
888
909
  };
889
910
  std::vector<FunctionMeta> added_functions_;
890
911
 
912
+ // Counters for creating unique identifiers
913
+ std::map<std::string, std::map<FunctionInternal*, casadi_int> > added_wrappers_;
914
+
891
915
  // Constants
892
916
  std::vector<std::vector<double> > double_constants_;
893
917
  std::vector<std::vector<casadi_int> > integer_constants_;
918
+ std::vector<std::vector<char> > char_constants_;
894
919
 
895
920
  // Does any function need thread-local memory?
896
921
  bool needs_mem_;
@@ -898,6 +923,9 @@ namespace casadi {
898
923
  // Hash a vector
899
924
  static size_t hash(const std::vector<double>& v);
900
925
  static size_t hash(const std::vector<casadi_int>& v);
926
+ static size_t hash(const std::vector<char>& v);
927
+
928
+ std::string wrapper(const Function& base, const std::string& name);
901
929
 
902
930
  // Compare two vectors
903
931
  template<typename T>
@@ -65,5 +65,6 @@
65
65
  #include "xml_file.hpp"
66
66
  #include "optistack.hpp"
67
67
  #include "serializer.hpp"
68
+ #include "tools.hpp"
68
69
 
69
70
  #endif // CASADI_CORE_HPP
@@ -170,7 +170,7 @@ class GenericExpression : public GenericExpressionCommon {
170
170
  ///@}
171
171
 
172
172
  ///@{
173
- /** \brief Logical greater or equal to: (x,y) -> x <= y
173
+ /** \brief Logical greater or equal to: (x,y) -> x >= y
174
174
 
175
175
  \identifier{ou} */
176
176
  static ExType ge(const ExType &x, const ExType &y) {
@@ -56,7 +56,11 @@ namespace casadi {
56
56
  OT_FUNCTION,
57
57
  OT_FUNCTIONVECTOR,
58
58
  OT_VOIDPTR,
59
- OT_UNKNOWN};
59
+ OT_UNKNOWN,
60
+ OT_STRINGVECTORVECTOR,
61
+ OT_DICTVECTOR,
62
+ OT_VECTORVECTOR,
63
+ OT_VECTOR};
60
64
  #endif // SWIG
61
65
 
62
66
  /** \brief Generic data type, can hold different types such as bool, casadi_int, std::string etc.
@@ -93,10 +97,14 @@ namespace casadi {
93
97
  GenericType(const std::vector<double>& dv);
94
98
  GenericType(const std::vector< std::vector<double> >& dv);
95
99
  GenericType(const std::vector<std::string>& sv);
100
+ GenericType(const std::vector<std::vector<std::string> >& sv);
96
101
  GenericType(const char s[]);
97
102
  GenericType(const Function& f);
98
103
  GenericType(const std::vector<Function>& f);
99
104
  GenericType(const Dict& dict);
105
+ GenericType(const std::vector<Dict>& dictv);
106
+ GenericType(const std::vector<std::vector<GenericType> >& gvv);
107
+ GenericType(const std::vector<GenericType>& gv);
100
108
  GenericType(void* ptr);
101
109
 
102
110
  /// Public class name
@@ -140,9 +148,13 @@ namespace casadi {
140
148
  return to_double_vector_vector();
141
149
  }
142
150
  operator std::vector<std::string>() const { return to_string_vector();}
151
+ operator std::vector<std::vector<std::string> >() const { return to_string_vector_vector();}
143
152
  operator const Function&() const { return as_function();}
144
153
  operator const std::vector<Function>&() const { return as_function_vector();}
145
154
  operator const Dict&() const { return as_dict();}
155
+ operator const std::vector<Dict>&() const { return as_dict_vector();}
156
+ operator const std::vector<std::vector<GenericType> >&() const { return as_vector_vector();}
157
+ operator const std::vector<GenericType>&() const { return as_vector();}
146
158
  ///@}
147
159
 
148
160
  bool can_cast_to(TypeID other) const;
@@ -169,7 +181,11 @@ namespace casadi {
169
181
  bool is_double_vector_vector() const;
170
182
  bool is_bool_vector() const;
171
183
  bool is_string_vector() const;
184
+ bool is_string_vector_vector() const;
172
185
  bool is_dict() const;
186
+ bool is_dict_vector() const;
187
+ bool is_vector_vector() const;
188
+ bool is_vector() const;
173
189
  bool is_function() const;
174
190
  bool is_function_vector() const;
175
191
  bool is_void_pointer() const;
@@ -189,7 +205,11 @@ namespace casadi {
189
205
  const std::vector<double>& as_double_vector() const;
190
206
  const std::vector< std::vector<double> >& as_double_vector_vector() const;
191
207
  const std::vector<std::string>& as_string_vector() const;
208
+ const std::vector<std::vector<std::string> >& as_string_vector_vector() const;
192
209
  const Dict& as_dict() const;
210
+ const std::vector<Dict>& as_dict_vector() const;
211
+ const std::vector<std::vector< GenericType> >& as_vector_vector() const;
212
+ const std::vector<GenericType>& as_vector() const;
193
213
  const Function& as_function() const;
194
214
  const std::vector<Function>& as_function_vector() const;
195
215
  void* const & as_void_pointer() const;
@@ -207,7 +227,11 @@ namespace casadi {
207
227
  std::vector<double> to_double_vector() const;
208
228
  std::vector< std::vector<double> > to_double_vector_vector() const;
209
229
  std::vector<std::string> to_string_vector() const;
230
+ std::vector<std::vector<std::string> > to_string_vector_vector() const;
210
231
  Dict to_dict() const;
232
+ std::vector<Dict> to_dict_vector() const;
233
+ std::vector<GenericType> to_vector() const;
234
+ std::vector< std::vector< GenericType> > to_vector_vector() const;
211
235
  Function to_function() const;
212
236
  std::vector<Function> to_function_vector() const;
213
237
  void* to_void_pointer() const;
@@ -1050,15 +1050,30 @@ namespace casadi {
1050
1050
 
1051
1051
  /** \brief Check if symbolic (Dense)
1052
1052
 
1053
+ Check if an expression is a pure symbol.
1054
+ Pure means that no operations should happen on the symbol
1055
+ (not even vec, transpose, index, concatenation, ...)
1056
+ By consequence, a slice of a vector-shaped MX symbol is not a symbol.
1057
+ However, the SX type is really a container format with scalar entries.
1058
+ Therefore, a slice of a vector-shaped SX symbol is still a symbol.
1059
+
1053
1060
  Sparse matrices invariable return false
1054
1061
 
1062
+ \seealso is_valid_input
1063
+
1055
1064
  \identifier{19r} */
1056
1065
  bool is_symbolic() const;
1057
1066
 
1058
1067
  /** \brief Check if matrix can be used to define function inputs.
1059
1068
 
1069
+
1070
+ is_valid_input is more forgiving than is_symbolic.
1071
+ Some compositions are allowed: vec, vertcat.
1072
+
1060
1073
  Sparse matrices can return true if all non-zero elements are symbolic
1061
1074
 
1075
+ \seealso is_symbolic
1076
+
1062
1077
  \identifier{19s} */
1063
1078
  bool is_valid_input() const;
1064
1079
 
@@ -29,9 +29,12 @@ struct casadi_nlpsol_detect_bounds_prob {
29
29
  casadi_int ng;
30
30
  // Number of bounds
31
31
  casadi_int nb;
32
- casadi_int *target_x;
33
- casadi_int *target_g;
34
- char *is_simple;
32
+ const casadi_int *target_x;
33
+ const casadi_int *target_g;
34
+ const char *is_simple;
35
+
36
+ int (*callback)(const T1** arg, T1** res, casadi_int* iw, T1* w, void* callback_data);
37
+ void* callback_data;
35
38
  };
36
39
  // C-REPLACE "casadi_nlpsol_detect_bounds_prob<T1>" "struct casadi_nlpsol_detect_bounds_prob"
37
40
 
@@ -48,10 +51,10 @@ struct casadi_nlpsol_prob {
48
51
  template<typename T1>
49
52
  struct casadi_nlpsol_detect_bounds_data {
50
53
  // Work vectors
51
- const double** arg;
52
- double** res;
54
+ const T1** arg;
55
+ T1** res;
53
56
  casadi_int* iw;
54
- double* w;
57
+ T1* w;
55
58
 
56
59
  // Simple bounds g(x)=A(b)x+b(p);
57
60
  // a[i]*x[target_x[i]]+b[i]
@@ -147,3 +150,125 @@ void casadi_nlpsol_init(casadi_nlpsol_data<T1>* d, const T1*** arg, T1*** res,
147
150
  }
148
151
 
149
152
  }
153
+
154
+ // C-REPLACE "fabs" "casadi_fabs"
155
+
156
+ // SYMBOL "nlpsol_detect_bounds_before"
157
+ template<typename T1>
158
+ int casadi_detect_bounds_before(casadi_nlpsol_data<T1>* d_nlp) {
159
+ const casadi_nlpsol_prob<T1>* p_nlp = d_nlp->prob;
160
+ casadi_nlpsol_detect_bounds_data<T1>* d_bounds = &d_nlp->detect_bounds;
161
+ const casadi_nlpsol_detect_bounds_prob<T1>* p_bounds = &p_nlp->detect_bounds;
162
+
163
+ casadi_int nx = p_nlp->nx;
164
+ d_bounds->arg[0] = d_nlp->p;
165
+ d_bounds->res[0] = d_bounds->a;
166
+ d_bounds->res[1] = d_bounds->b;
167
+ p_bounds->callback(d_bounds->arg, d_bounds->res,
168
+ d_bounds->iw, d_bounds->w, p_bounds->callback_data);
169
+
170
+ for (casadi_int i=0;i<p_bounds->nb;++i) {
171
+ if (d_bounds->a[i]==0) {
172
+ casadi_int k = p_bounds->target_g[i];
173
+ if (d_nlp->lbg[k]>d_bounds->b[i]) return 1;
174
+ if (d_nlp->ubg[k]<d_bounds->b[i]) return 1;
175
+ }
176
+ }
177
+
178
+ T1* lbz = d_nlp->lbz+nx;
179
+ T1* ubz = d_nlp->ubz+nx;
180
+ T1* lam = d_nlp->lam+nx;
181
+
182
+ for (casadi_int i=0;i<nx;++i) {
183
+ d_bounds->lam_xl[i] = d_nlp->lam_x0 ? (d_nlp->lam_x0[i]<0)*d_nlp->lam_x0[i] : 0.;
184
+ d_bounds->lam_xu[i] = d_nlp->lam_x0 ? (d_nlp->lam_x0[i]>0)*d_nlp->lam_x0[i] : 0.;
185
+ }
186
+
187
+ for (casadi_int i=0;i<nx;++i) {
188
+ d_bounds->target_l[i] = i;
189
+ d_bounds->target_u[i] = i;
190
+ }
191
+
192
+ // Update lbz/ubz
193
+ casadi_int k=0;
194
+ for (casadi_int i=0;i<p_bounds->ng;++i) {
195
+ if (p_bounds->is_simple[i]) {
196
+ // Update lbz/ubz
197
+ T1 lb = (d_nlp->lbg[i]-d_bounds->b[k])/fabs(d_bounds->a[k]);
198
+ T1 ub = (d_nlp->ubg[i]-d_bounds->b[k])/fabs(d_bounds->a[k]);
199
+ casadi_int j = p_bounds->target_x[k];
200
+
201
+ if (lb==d_nlp->lbz[j]) {
202
+ if (d_nlp->lam_g0) d_bounds->lam_xl[j] += (d_nlp->lam_g0[i]<0)*d_nlp->lam_g0[i];
203
+ } else if (lb>d_nlp->lbz[j]) {
204
+ d_nlp->lbz[j] = lb;
205
+ d_bounds->target_l[j] = nx+i;
206
+ if (d_nlp->lam_g0) d_bounds->lam_xl[j] = (d_nlp->lam_g0[i]<0)*d_nlp->lam_g0[i];
207
+ }
208
+
209
+ if (ub==d_nlp->ubz[j]) {
210
+ if (d_nlp->lam_g0) d_bounds->lam_xu[j] += (d_nlp->lam_g0[i]>0)*d_nlp->lam_g0[i];
211
+ } else if (ub<d_nlp->ubz[j]) {
212
+ d_nlp->ubz[j] = ub;
213
+ d_bounds->target_u[j] = nx+i;
214
+ if (d_nlp->lam_g0) d_bounds->lam_xu[j] = (d_nlp->lam_g0[i]>0)*d_nlp->lam_g0[i];
215
+ }
216
+
217
+ k++;
218
+ } else {
219
+
220
+ // Update lbz/ubz
221
+ *lbz++ = d_nlp->lbg[i];
222
+ *ubz++ = d_nlp->ubg[i];
223
+
224
+ if (d_nlp->lam_g0) *lam++ = d_nlp->lam_g0[i];
225
+ }
226
+ }
227
+
228
+ for (casadi_int i=0;i<nx;++i) {
229
+ d_nlp->lam[i] = d_bounds->lam_xl[i]+d_bounds->lam_xu[i];
230
+ }
231
+ return 0;
232
+ }
233
+
234
+ // SYMBOL "nlpsol_detect_bounds_after"
235
+ template<typename T1>
236
+ int casadi_detect_bounds_after(casadi_nlpsol_data<T1>* d_nlp) {
237
+ const casadi_nlpsol_prob<T1>* p_nlp = d_nlp->prob;
238
+ casadi_nlpsol_detect_bounds_data<T1>* d_bounds = &d_nlp->detect_bounds;
239
+ const casadi_nlpsol_detect_bounds_prob<T1>* p_bounds = &p_nlp->detect_bounds;
240
+ casadi_int nx = p_nlp->nx;
241
+
242
+ casadi_fill(d_nlp->lam_x, nx, 0.);
243
+ casadi_fill(d_nlp->lam_g, p_bounds->ng, 0.);
244
+
245
+ casadi_int k = 0;
246
+ casadi_int k_normal = 0;
247
+ for (casadi_int i=0;i<p_bounds->ng;++i) {
248
+ if (p_bounds->is_simple[i]) {
249
+ casadi_int j = p_bounds->target_x[k];
250
+ if (d_nlp->g) d_nlp->g[i] = d_bounds->a[k]*d_nlp->z[j]+d_bounds->b[k];
251
+ k++;
252
+ } else {
253
+ if (d_nlp->g) d_nlp->g[i] = d_nlp->z[nx+k_normal];
254
+ if (d_nlp->lam_g) d_nlp->lam_g[i] = d_nlp->lam[nx+k_normal];
255
+ k_normal++;
256
+ }
257
+ }
258
+
259
+ for (casadi_int i=0;i<nx;++i) {
260
+ if (d_bounds->target_l[i]<nx) {
261
+ if (d_nlp->lam_x) d_nlp->lam_x[i] += (d_nlp->lam[i]<0)*d_nlp->lam[i];
262
+ } else {
263
+ if (d_nlp->lam_g)
264
+ d_nlp->lam_g[d_bounds->target_l[i]-nx] += (d_nlp->lam[i]<0)*d_nlp->lam[i];
265
+ }
266
+ if (d_bounds->target_u[i]<nx) {
267
+ if (d_nlp->lam_x) d_nlp->lam_x[i] += (d_nlp->lam[i]>0)*d_nlp->lam[i];
268
+ } else {
269
+ if (d_nlp->lam_g)
270
+ d_nlp->lam_g[d_bounds->target_u[i]-nx] += (d_nlp->lam[i]>0)*d_nlp->lam[i];
271
+ }
272
+ }
273
+ return 0;
274
+ }
@@ -57,6 +57,11 @@ struct casadi_sqpmethod_data {
57
57
  T1* temp_mem;
58
58
  // temp_sol
59
59
  T1* temp_sol;
60
+
61
+ const T1** arg;
62
+ T1** res;
63
+ casadi_int* iw;
64
+ T1* w;
60
65
  };
61
66
  // C-REPLACE "casadi_sqpmethod_data<T1>" "struct casadi_sqpmethod_data"
62
67
 
@@ -113,7 +118,8 @@ void casadi_sqpmethod_work(const casadi_sqpmethod_prob<T1>* p,
113
118
 
114
119
  // SYMBOL "sqpmethod_init"
115
120
  template<typename T1>
116
- void casadi_sqpmethod_init(casadi_sqpmethod_data<T1>* d, casadi_int** iw, T1** w,
121
+ void casadi_sqpmethod_init(casadi_sqpmethod_data<T1>* d,
122
+ const T1*** arg, T1*** res, casadi_int** iw, T1** w,
117
123
  int elastic_mode, int so_corr) {
118
124
  // Local variables
119
125
  casadi_int nnz_h, nnz_a, nx, ng;
@@ -165,4 +171,8 @@ void casadi_sqpmethod_init(casadi_sqpmethod_data<T1>* d, casadi_int** iw, T1** w
165
171
  // Jacobian
166
172
  d->Jk = *w; *w += nnz_a;
167
173
  }
174
+ d->arg = *arg;
175
+ d->res = *res;
176
+ d->iw = *iw;
177
+ d->w = *w;
168
178
  }
@@ -1006,7 +1006,7 @@ namespace casadi {
1006
1006
  /** \brief Propagate sparsity through a linear solve
1007
1007
 
1008
1008
  \identifier{d9} */
1009
- void spsolve(bvec_t* X, const bvec_t* B, bool tr) const;
1009
+ void spsolve(bvec_t* X, bvec_t* B, bool tr) const;
1010
1010
  #endif // SWIG
1011
1011
 
1012
1012
  /** \brief Get the location of all non-zero elements as they would appear in a Dense matrix
@@ -1199,14 +1199,16 @@ namespace casadi {
1199
1199
  /** \brief Generate a hash value incrementally, array
1200
1200
 
1201
1201
  \identifier{dq} */
1202
- inline void hash_combine(std::size_t& seed, const casadi_int* v, std::size_t sz) {
1202
+ template<typename T>
1203
+ inline void hash_combine(std::size_t& seed, const T* v, std::size_t sz) {
1203
1204
  for (casadi_int i=0; i<sz; ++i) hash_combine(seed, v[i]);
1204
1205
  }
1205
1206
 
1206
1207
  /** \brief Generate a hash value incrementally (function taken from boost)
1207
1208
 
1208
1209
  \identifier{dr} */
1209
- inline void hash_combine(std::size_t& seed, const std::vector<casadi_int>& v) {
1210
+ template<typename T>
1211
+ inline void hash_combine(std::size_t& seed, const std::vector<T>& v) {
1210
1212
  hash_combine(seed, get_ptr(v), v.size());
1211
1213
  }
1212
1214
 
@@ -0,0 +1,67 @@
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_TOOLS_HPP
27
+ #define CASADI_TOOLS_HPP
28
+
29
+ #include "casadi/core/function.hpp"
30
+
31
+ namespace casadi {
32
+
33
+ /** \brief Apply a transformation defined externally
34
+
35
+ \param name Name of the shared library
36
+ \param op Name of the operation
37
+ \param f Function to transform
38
+ \param opts Options
39
+
40
+ \identifier{27i} */
41
+ CASADI_EXPORT Function external_transform(const std::string& name,
42
+ const std::string& op,
43
+ const Function& f,
44
+ const Dict& opts=Dict());
45
+
46
+
47
+ typedef void (*external_print_callback_t)(const char* s);
48
+ typedef const char* (*external_transform_t)(char api_version, const char* casadi_version,
49
+ const char* in,
50
+ external_print_callback_t cb_stdout, external_print_callback_t cb_stderr);
51
+
52
+ } // namespace casadi
53
+
54
+ #ifndef SWIG
55
+ extern "C" {
56
+ CASADI_EXPORT const char* external_transform_test_success__f(char api_version,
57
+ const char* casadi_version,
58
+ const char* in,
59
+ casadi::external_print_callback_t cb_stdout, casadi::external_print_callback_t cb_stderr);
60
+ CASADI_EXPORT const char* external_transform_test_fail__f(char api_version,
61
+ const char* casadi_version,
62
+ const char* in,
63
+ casadi::external_print_callback_t cb_stdout, casadi::external_print_callback_t cb_stderr);
64
+ }
65
+ #endif // SWIG
66
+
67
+ #endif // CASADI_TOOLS_HPP