casadi 3.6.7__cp38-none-manylinux2014_aarch64.whl → 3.7.0__cp38-none-manylinux2014_aarch64.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.
- casadi/_casadi.so +0 -0
- casadi/casadi-cli +0 -0
- casadi/casadi.py +6070 -3038
- casadi/cmake/casadi-config-version.cmake +1 -1
- casadi/cmake/casadi-targets-release.cmake +5 -5
- casadi/cmake/casadi-targets.cmake +5 -5
- casadi/{lib/cmake/tinyxml2/tinyxml2-config-version.cmake → cmake/ghc_filesystem/ghc_filesystem-config-version.cmake} +30 -10
- casadi/cmake/ghc_filesystem/ghc_filesystem-config.cmake +30 -0
- casadi/cmake/ghc_filesystem/ghc_filesystem-targets.cmake +107 -0
- casadi/cmake/libzip/libzip-config-version.cmake +43 -0
- casadi/cmake/libzip/libzip-config.cmake +69 -0
- casadi/cmake/libzip/libzip-targets-release.cmake +19 -0
- casadi/{lib/cmake/tinyxml2/tinyxml2-static-targets.cmake → cmake/libzip/libzip-targets.cmake} +11 -7
- casadi/cmake/libzip/modules/FindMbedTLS.cmake +141 -0
- casadi/cmake/libzip/modules/FindNettle.cmake +141 -0
- casadi/cmake/libzip/modules/Findzstd.cmake +186 -0
- casadi/include/casadi/casadi.i +194 -44
- casadi/include/casadi/config.h +11 -11
- casadi/include/casadi/core/archiver.hpp +58 -0
- casadi/include/casadi/core/blazing_spline.hpp +47 -0
- casadi/include/casadi/core/calculus.hpp +57 -2
- casadi/include/casadi/core/casadi_common.hpp +37 -0
- casadi/include/casadi/core/casadi_meta.hpp +15 -0
- casadi/include/casadi/core/casadi_misc.hpp +7 -0
- casadi/include/casadi/core/code_generator.hpp +95 -17
- casadi/include/casadi/core/core.hpp +5 -0
- casadi/include/casadi/core/dae_builder.hpp +283 -141
- casadi/include/casadi/core/dm.hpp +3 -0
- casadi/include/casadi/core/filesystem.hpp +58 -0
- casadi/include/casadi/core/fmu.hpp +51 -16
- casadi/include/casadi/core/function.hpp +19 -0
- casadi/include/casadi/core/generic_matrix.hpp +214 -7
- casadi/include/casadi/core/generic_shared.hpp +318 -0
- casadi/include/casadi/core/generic_shared_impl.hpp +214 -0
- casadi/include/casadi/core/generic_shared_internal.hpp +215 -0
- casadi/include/casadi/core/generic_type.hpp +3 -0
- casadi/include/casadi/core/global_options.hpp +10 -0
- casadi/include/casadi/core/integrator.hpp +41 -7
- casadi/include/casadi/core/matrix_decl.hpp +67 -0
- casadi/include/casadi/core/mx.hpp +63 -2
- casadi/include/casadi/core/options.hpp +6 -3
- casadi/include/casadi/core/optistack.hpp +43 -9
- casadi/include/casadi/core/printable.hpp +8 -0
- casadi/include/casadi/core/resource.hpp +107 -0
- casadi/include/casadi/core/runtime/casadi_blazing_1d_boor_eval.hpp +112 -0
- casadi/include/casadi/core/runtime/casadi_blazing_2d_boor_eval.hpp +311 -0
- casadi/include/casadi/core/runtime/casadi_blazing_3d_boor_eval.hpp +645 -0
- casadi/include/casadi/core/runtime/casadi_blazing_de_boor.hpp +101 -0
- casadi/include/casadi/core/runtime/casadi_nlp.hpp +8 -2
- casadi/include/casadi/core/runtime/casadi_printme.hpp +25 -0
- casadi/include/casadi/core/serializer.hpp +12 -4
- casadi/include/casadi/core/serializing_stream.hpp +3 -0
- casadi/include/casadi/core/shared_object.hpp +73 -161
- casadi/include/casadi/core/sparsity.hpp +13 -1
- casadi/include/casadi/core/sparsity_interface.hpp +19 -1
- casadi/include/casadi/core/sx.hpp +41 -0
- casadi/include/casadi/core/sx_elem.hpp +25 -0
- casadi/include/casadi/core/xml_node.hpp +5 -0
- casadi/include/casadi/doc.i +9703 -6539
- casadi/include/casadi/doc_merged.i +6483 -4447
- casadi/include/casadi/valgrind-casadi.supp +138 -0
- casadi/include/casadi/valgrind-python.supp +2470 -0
- casadi/include/fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp +4 -1
- casadi/include/ghc/filesystem.hpp +6083 -0
- casadi/include/ghc/fs_fwd.hpp +38 -0
- casadi/include/ghc/fs_impl.hpp +35 -0
- casadi/include/ghc/fs_std.hpp +60 -0
- casadi/include/ghc/fs_std_fwd.hpp +63 -0
- casadi/include/ghc/fs_std_impl.hpp +46 -0
- casadi/include/licenses/ghc-external/LICENSE +19 -0
- casadi/include/licenses/libz-external/LICENSE +22 -0
- casadi/include/licenses/libz-external/contrib/dotzlib/LICENSE_1_0.txt +23 -0
- casadi/include/licenses/libzip-external/LICENSE +31 -0
- casadi/include/zconf.h +545 -0
- casadi/include/zip.h +528 -0
- casadi/include/zipconf.h +48 -0
- casadi/include/zlib.h +1938 -0
- casadi/libcasadi.so +0 -0
- casadi/libcasadi.so.3.7 +0 -0
- casadi/libcasadi_archiver_libzip.so +0 -0
- casadi/libcasadi_archiver_libzip.so.3.7 +0 -0
- casadi/libcasadi_conic_cplex.so +0 -0
- casadi/libcasadi_conic_cplex.so.3.7 +0 -0
- casadi/libcasadi_conic_daqp.so +0 -0
- casadi/libcasadi_conic_daqp.so.3.7 +0 -0
- casadi/libcasadi_conic_fatrop.so +0 -0
- casadi/libcasadi_conic_fatrop.so.3.7 +0 -0
- casadi/libcasadi_conic_gurobi.so +0 -0
- casadi/libcasadi_conic_gurobi.so.3.7 +0 -0
- casadi/libcasadi_conic_hpipm.so +0 -0
- casadi/libcasadi_conic_hpipm.so.3.7 +0 -0
- casadi/libcasadi_conic_ipqp.so +0 -0
- casadi/libcasadi_conic_ipqp.so.3.7 +0 -0
- casadi/libcasadi_conic_nlpsol.so +0 -0
- casadi/libcasadi_conic_nlpsol.so.3.7 +0 -0
- casadi/libcasadi_conic_osqp.so +0 -0
- casadi/libcasadi_conic_osqp.so.3.7 +0 -0
- casadi/libcasadi_conic_proxqp.so +0 -0
- casadi/libcasadi_conic_proxqp.so.3.7 +0 -0
- casadi/libcasadi_conic_qpoases.so +0 -0
- casadi/libcasadi_conic_qpoases.so.3.7 +0 -0
- casadi/libcasadi_conic_qrqp.so +0 -0
- casadi/libcasadi_conic_qrqp.so.3.7 +0 -0
- casadi/libcasadi_conic_superscs.so +0 -0
- casadi/libcasadi_conic_superscs.so.3.7 +0 -0
- casadi/libcasadi_filesystem_ghc.so +0 -0
- casadi/libcasadi_filesystem_ghc.so.3.7 +0 -0
- casadi/libcasadi_importer_shell.so +0 -0
- casadi/libcasadi_importer_shell.so.3.7 +0 -0
- casadi/libcasadi_integrator_collocation.so +0 -0
- casadi/libcasadi_integrator_collocation.so.3.7 +0 -0
- casadi/libcasadi_integrator_cvodes.so +0 -0
- casadi/libcasadi_integrator_cvodes.so.3.7 +0 -0
- casadi/libcasadi_integrator_idas.so +0 -0
- casadi/libcasadi_integrator_idas.so.3.7 +0 -0
- casadi/libcasadi_integrator_rk.so +0 -0
- casadi/libcasadi_integrator_rk.so.3.7 +0 -0
- casadi/libcasadi_interpolant_bspline.so +0 -0
- casadi/libcasadi_interpolant_bspline.so.3.7 +0 -0
- casadi/libcasadi_interpolant_linear.so +0 -0
- casadi/libcasadi_interpolant_linear.so.3.7 +0 -0
- casadi/libcasadi_linsol_csparse.so +0 -0
- casadi/libcasadi_linsol_csparse.so.3.7 +0 -0
- casadi/libcasadi_linsol_csparsecholesky.so +0 -0
- casadi/libcasadi_linsol_csparsecholesky.so.3.7 +0 -0
- casadi/libcasadi_linsol_lapacklu.so +0 -0
- casadi/libcasadi_linsol_lapacklu.so.3.7 +0 -0
- casadi/libcasadi_linsol_lapackqr.so +0 -0
- casadi/libcasadi_linsol_lapackqr.so.3.7 +0 -0
- casadi/libcasadi_linsol_ldl.so +0 -0
- casadi/libcasadi_linsol_ldl.so.3.7 +0 -0
- casadi/libcasadi_linsol_lsqr.so +0 -0
- casadi/libcasadi_linsol_lsqr.so.3.7 +0 -0
- casadi/libcasadi_linsol_ma27.so +0 -0
- casadi/libcasadi_linsol_ma27.so.3.7 +0 -0
- casadi/libcasadi_linsol_mumps.so +0 -0
- casadi/libcasadi_linsol_mumps.so.3.7 +0 -0
- casadi/libcasadi_linsol_qr.so +0 -0
- casadi/libcasadi_linsol_qr.so.3.7 +0 -0
- casadi/libcasadi_linsol_symbolicqr.so +0 -0
- casadi/libcasadi_linsol_symbolicqr.so.3.7 +0 -0
- casadi/libcasadi_linsol_tridiag.so +0 -0
- casadi/libcasadi_linsol_tridiag.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_alpaqa.so +0 -0
- casadi/libcasadi_nlpsol_alpaqa.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_ampl.so +0 -0
- casadi/libcasadi_nlpsol_ampl.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_blocksqp.so +0 -0
- casadi/libcasadi_nlpsol_blocksqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_fatrop.so +0 -0
- casadi/libcasadi_nlpsol_fatrop.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.so +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_ipopt.so +0 -0
- casadi/libcasadi_nlpsol_ipopt.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_knitro.so +0 -0
- casadi/libcasadi_nlpsol_knitro.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_madnlp.so +0 -0
- casadi/libcasadi_nlpsol_madnlp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_qrsqp.so +0 -0
- casadi/libcasadi_nlpsol_qrsqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_scpgen.so +0 -0
- casadi/libcasadi_nlpsol_scpgen.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_snopt.so +0 -0
- casadi/libcasadi_nlpsol_snopt.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.so +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_worhp.so +0 -0
- casadi/libcasadi_nlpsol_worhp.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_fast_newton.so +0 -0
- casadi/libcasadi_rootfinder_fast_newton.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_kinsol.so +0 -0
- casadi/libcasadi_rootfinder_kinsol.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_newton.so +0 -0
- casadi/libcasadi_rootfinder_newton.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_nlpsol.so +0 -0
- casadi/libcasadi_rootfinder_nlpsol.so.3.7 +0 -0
- casadi/libcasadi_sundials_common.so +0 -0
- casadi/libcasadi_sundials_common.so.3.7 +0 -0
- casadi/libcasadi_xmlfile_tinyxml.so +0 -0
- casadi/libcasadi_xmlfile_tinyxml.so.3.7 +0 -0
- casadi/libcoinmumps.so +0 -0
- casadi/libcoinmumps.so.3 +0 -0
- casadi/libcoinmumps.so.3.0.1 +0 -0
- casadi/libfatrop.so +0 -0
- casadi/libipopt.so +0 -0
- casadi/libipopt.so.3 +0 -0
- casadi/libipopt.so.3.14.11 +0 -0
- casadi/libsipopt.so +0 -0
- casadi/libsipopt.so.3 +0 -0
- casadi/libsipopt.so.3.14.11 +0 -0
- casadi/libz.a +0 -0
- casadi/libz.so +0 -0
- casadi/libz.so.1 +0 -0
- casadi/libz.so.1.3.1 +0 -0
- casadi/libzip.a +0 -0
- casadi/pkgconfig/casadi.pc +1 -1
- casadi/pkgconfig/libzip.pc +14 -0
- casadi/tools/__init__.py +3 -1
- casadi/tools/graph/graph.py +1 -1
- casadi/tools/structure3.py +2 -2
- {casadi-3.6.7.dist-info → casadi-3.7.0.dist-info}/METADATA +1 -1
- {casadi-3.6.7.dist-info → casadi-3.7.0.dist-info}/RECORD +204 -166
- casadi/include/tinyxml2.h +0 -2380
- casadi/lib/cmake/tinyxml2/tinyxml2-config.cmake +0 -57
- casadi/lib/cmake/tinyxml2/tinyxml2-static-targets-release.cmake +0 -19
- casadi/lib/libtinyxml2.a +0 -0
- casadi/lib/pkgconfig/tinyxml2.pc +0 -10
- casadi/tools/structure.py +0 -1446
- {casadi-3.6.7.dist-info → casadi-3.7.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,101 @@
|
|
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 "blazing_printvec"
|
21
|
+
template<typename T1>
|
22
|
+
void casadi_blazing_printvec(const simde__m256d* e) {
|
23
|
+
double elements[4];
|
24
|
+
simde_mm256_storeu_pd(elements, *e);
|
25
|
+
printf("mm256d: <%.4f %.4f %.4f %.4f>\n", elements[0], elements[1], elements[2], elements[3]);
|
26
|
+
}
|
27
|
+
|
28
|
+
// SYMBOL "blazing_de_boor"
|
29
|
+
template<typename T1>
|
30
|
+
void casadi_blazing_de_boor(T1 x, const T1* knots, simde__m256d* boor_d0, simde__m256d* boor_d1, simde__m256d* boor_d2, const simde__m256d* boor_d3) { // NOLINT(whitespace/line_length)
|
31
|
+
simde__m256d x_ = simde_mm256_set1_pd(x);
|
32
|
+
simde__m256d zero = simde_mm256_set1_pd(0.0);
|
33
|
+
simde__m256d mask_end = simde_mm256_set_pd(0.0, -1.0, -1.0, -1.0);
|
34
|
+
|
35
|
+
// shift one up
|
36
|
+
simde__m256d boor_d3i_1 = simde_mm256_permute4x64_pd(*boor_d3, SIMDE_MM_SHUFFLE(3, 3, 2, 1));
|
37
|
+
boor_d3i_1 = simde_mm256_blendv_pd(zero, boor_d3i_1, mask_end);
|
38
|
+
|
39
|
+
simde__m256d knotsi = simde_mm256_loadu_pd(knots);
|
40
|
+
simde__m256d knotsi_1 = simde_mm256_loadu_pd(knots+1);
|
41
|
+
simde__m256d knotsi_2 = simde_mm256_loadu_pd(knots+2);
|
42
|
+
simde__m256d knotsi_3 = simde_mm256_loadu_pd(knots+3);
|
43
|
+
simde__m256d knotsi_4 = simde_mm256_loadu_pd(knots+4);
|
44
|
+
|
45
|
+
simde__m256d bottom = simde_mm256_sub_pd(knotsi_1, knotsi); // bottom = knots[i + 1] - knots[i];
|
46
|
+
simde__m256d bottom_mask = simde_mm256_cmp_pd(bottom, zero, SIMDE_CMP_EQ_OQ); // if (bottom)
|
47
|
+
|
48
|
+
// (x - knots[i]) / bottom;
|
49
|
+
simde__m256d r = simde_mm256_div_pd(simde_mm256_sub_pd(x_, knotsi), bottom);
|
50
|
+
r = simde_mm256_blendv_pd(r, zero, bottom_mask);
|
51
|
+
*boor_d2 = simde_mm256_mul_pd(r, *boor_d3);
|
52
|
+
|
53
|
+
*boor_d2 = simde_mm256_blendv_pd(*boor_d2, zero, bottom_mask);
|
54
|
+
|
55
|
+
bottom = simde_mm256_sub_pd(knotsi_2, knotsi_1); // bottom = knots[i + 2] - knots[i + 1];
|
56
|
+
bottom_mask = simde_mm256_cmp_pd(bottom, zero, SIMDE_CMP_EQ_OQ);
|
57
|
+
r = simde_mm256_div_pd(simde_mm256_sub_pd(knotsi_2, x_), bottom); // (knots[i + 2] - x) / bottom
|
58
|
+
r = simde_mm256_blendv_pd(r, zero, bottom_mask);
|
59
|
+
|
60
|
+
*boor_d2 = simde_mm256_fmadd_pd(r, boor_d3i_1, *boor_d2);
|
61
|
+
|
62
|
+
// shift one up
|
63
|
+
simde__m256d boor_d2i_1 = simde_mm256_permute4x64_pd(*boor_d2, SIMDE_MM_SHUFFLE(3, 3, 2, 1));
|
64
|
+
boor_d2i_1 = simde_mm256_blendv_pd(zero, boor_d2i_1, mask_end);
|
65
|
+
|
66
|
+
bottom = simde_mm256_sub_pd(knotsi_2, knotsi); // bottom = knots[i + 2] - knots[i];
|
67
|
+
bottom_mask = simde_mm256_cmp_pd(bottom, zero, SIMDE_CMP_EQ_OQ); // if (bottom)
|
68
|
+
|
69
|
+
r = simde_mm256_div_pd(simde_mm256_sub_pd(x_, knotsi), bottom); // (x - knots[i]) / bottom;
|
70
|
+
r = simde_mm256_blendv_pd(r, zero, bottom_mask);
|
71
|
+
*boor_d1 = simde_mm256_mul_pd(r, *boor_d2);
|
72
|
+
|
73
|
+
*boor_d1 = simde_mm256_blendv_pd(*boor_d1, zero, bottom_mask);
|
74
|
+
|
75
|
+
bottom = simde_mm256_sub_pd(knotsi_3, knotsi_1); // bottom = knots[i + 3] - knots[i + 1];
|
76
|
+
bottom_mask = simde_mm256_cmp_pd(bottom, zero, SIMDE_CMP_EQ_OQ);
|
77
|
+
r = simde_mm256_div_pd(simde_mm256_sub_pd(knotsi_3, x_), bottom); // (knots[i + 3] - x) / bottom
|
78
|
+
r = simde_mm256_blendv_pd(r, zero, bottom_mask);
|
79
|
+
|
80
|
+
*boor_d1 = simde_mm256_fmadd_pd(r, boor_d2i_1, *boor_d1);
|
81
|
+
|
82
|
+
// shift one up
|
83
|
+
simde__m256d boor_d1i_1 = simde_mm256_permute4x64_pd(*boor_d1, SIMDE_MM_SHUFFLE(3, 3, 2, 1));
|
84
|
+
boor_d1i_1 = simde_mm256_blendv_pd(zero, boor_d1i_1, mask_end);
|
85
|
+
|
86
|
+
bottom = simde_mm256_sub_pd(knotsi_3, knotsi); // bottom = knots[i + 3] - knots[i];
|
87
|
+
bottom_mask = simde_mm256_cmp_pd(bottom, zero, SIMDE_CMP_EQ_OQ); // if (bottom)
|
88
|
+
|
89
|
+
r = simde_mm256_div_pd(simde_mm256_sub_pd(x_, knotsi), bottom); // (x - knots[i]) / bottom;
|
90
|
+
r = simde_mm256_blendv_pd(r, zero, bottom_mask);
|
91
|
+
*boor_d0 = simde_mm256_mul_pd(r, *boor_d1);
|
92
|
+
|
93
|
+
*boor_d0 = simde_mm256_blendv_pd(*boor_d0, zero, bottom_mask);
|
94
|
+
|
95
|
+
bottom = simde_mm256_sub_pd(knotsi_4, knotsi_1); // bottom = knots[i + 4] - knots[i + 1];
|
96
|
+
bottom_mask = simde_mm256_cmp_pd(bottom, zero, SIMDE_CMP_EQ_OQ);
|
97
|
+
r = simde_mm256_div_pd(simde_mm256_sub_pd(knotsi_4, x_), bottom); // (knots[i + 4] - x) / bottom
|
98
|
+
r = simde_mm256_blendv_pd(r, zero, bottom_mask);
|
99
|
+
|
100
|
+
*boor_d0 = simde_mm256_fmadd_pd(r, boor_d1i_1, *boor_d0);
|
101
|
+
}
|
@@ -161,7 +161,8 @@ int casadi_detect_bounds_before(casadi_nlpsol_data<T1>* d_nlp) {
|
|
161
161
|
const casadi_nlpsol_detect_bounds_prob<T1>* p_bounds = &p_nlp->detect_bounds;
|
162
162
|
|
163
163
|
casadi_int nx = p_nlp->nx;
|
164
|
-
d_bounds->arg[0] = d_nlp->
|
164
|
+
d_bounds->arg[0] = d_nlp->z;
|
165
|
+
d_bounds->arg[1] = d_nlp->p;
|
165
166
|
d_bounds->res[0] = d_bounds->a;
|
166
167
|
d_bounds->res[1] = d_bounds->b;
|
167
168
|
p_bounds->callback(d_bounds->arg, d_bounds->res,
|
@@ -203,6 +204,8 @@ int casadi_detect_bounds_before(casadi_nlpsol_data<T1>* d_nlp) {
|
|
203
204
|
ub = tmp;
|
204
205
|
}
|
205
206
|
casadi_int j = p_bounds->target_x[k];
|
207
|
+
lb += d_nlp->z[j];
|
208
|
+
ub += d_nlp->z[j];
|
206
209
|
|
207
210
|
if (lb==d_nlp->lbz[j]) {
|
208
211
|
if (d_nlp->lam_g0) d_bounds->lam_xl[j] += (d_nlp->lam_g0[i]<0)*d_nlp->lam_g0[i];
|
@@ -253,7 +256,10 @@ int casadi_detect_bounds_after(casadi_nlpsol_data<T1>* d_nlp) {
|
|
253
256
|
for (casadi_int i=0;i<p_bounds->ng;++i) {
|
254
257
|
if (p_bounds->is_simple[i]) {
|
255
258
|
casadi_int j = p_bounds->target_x[k];
|
256
|
-
if (d_nlp->g)
|
259
|
+
if (d_nlp->g) {
|
260
|
+
d_nlp->g[i] = d_bounds->a[k]*d_nlp->z[j]-d_bounds->b[k];
|
261
|
+
if (d_nlp->x0) d_nlp->g[i] += d_nlp->x0[j];
|
262
|
+
}
|
257
263
|
k++;
|
258
264
|
} else {
|
259
265
|
if (d_nlp->g) d_nlp->g[i] = d_nlp->z[nx+k_normal];
|
@@ -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 "printme"
|
21
|
+
template<typename T1>
|
22
|
+
T1 casadi_printme(T1 a, T1 b) {
|
23
|
+
printf("|> %.15g : %.15g\n", b, a);
|
24
|
+
return a;
|
25
|
+
}
|
@@ -77,9 +77,9 @@ namespace casadi {
|
|
77
77
|
|
78
78
|
enum SerializationType {
|
79
79
|
SERIALIZED_SPARSITY,
|
80
|
-
|
80
|
+
SERIALIZED_MX_v1,
|
81
81
|
SERIALIZED_DM,
|
82
|
-
|
82
|
+
SERIALIZED_SX_v1,
|
83
83
|
SERIALIZED_LINSOL,
|
84
84
|
SERIALIZED_FUNCTION,
|
85
85
|
SERIALIZED_GENERICTYPE,
|
@@ -87,15 +87,19 @@ namespace casadi {
|
|
87
87
|
SERIALIZED_DOUBLE,
|
88
88
|
SERIALIZED_STRING,
|
89
89
|
SERIALIZED_SPARSITY_VECTOR,
|
90
|
-
|
90
|
+
SERIALIZED_MX_VECTOR_v1,
|
91
91
|
SERIALIZED_DM_VECTOR,
|
92
|
-
|
92
|
+
SERIALIZED_SX_VECTOR_v1,
|
93
93
|
SERIALIZED_LINSOL_VECTOR,
|
94
94
|
SERIALIZED_FUNCTION_VECTOR,
|
95
95
|
SERIALIZED_GENERICTYPE_VECTOR,
|
96
96
|
SERIALIZED_INT_VECTOR,
|
97
97
|
SERIALIZED_DOUBLE_VECTOR,
|
98
98
|
SERIALIZED_STRING_VECTOR,
|
99
|
+
SERIALIZED_MX,
|
100
|
+
SERIALIZED_SX,
|
101
|
+
SERIALIZED_MX_VECTOR,
|
102
|
+
SERIALIZED_SX_VECTOR
|
99
103
|
};
|
100
104
|
|
101
105
|
static std::string type_to_string(SerializationType type);
|
@@ -121,8 +125,10 @@ namespace casadi {
|
|
121
125
|
|
122
126
|
Sparsity blind_unpack_sparsity();
|
123
127
|
MX blind_unpack_mx();
|
128
|
+
MX blind_unpack_mx_v1();
|
124
129
|
Matrix<double> blind_unpack_dm();
|
125
130
|
Matrix<SXElem> blind_unpack_sx();
|
131
|
+
Matrix<SXElem> blind_unpack_sx_v1();
|
126
132
|
Linsol blind_unpack_linsol();
|
127
133
|
Function blind_unpack_function();
|
128
134
|
GenericType blind_unpack_generictype();
|
@@ -131,8 +137,10 @@ namespace casadi {
|
|
131
137
|
std::string blind_unpack_string();
|
132
138
|
std::vector<Sparsity> blind_unpack_sparsity_vector();
|
133
139
|
std::vector<MX> blind_unpack_mx_vector();
|
140
|
+
std::vector<MX> blind_unpack_mx_vector_v1();
|
134
141
|
std::vector< Matrix<double> > blind_unpack_dm_vector();
|
135
142
|
std::vector< Matrix<SXElem> > blind_unpack_sx_vector();
|
143
|
+
std::vector< Matrix<SXElem> > blind_unpack_sx_vector_v1();
|
136
144
|
std::vector<Linsol> blind_unpack_linsol_vector();
|
137
145
|
std::vector<Function> blind_unpack_function_vector();
|
138
146
|
std::vector<GenericType> blind_unpack_generictype_vector();
|
@@ -41,6 +41,7 @@ namespace casadi {
|
|
41
41
|
class SXElem;
|
42
42
|
class GenericType;
|
43
43
|
class Importer;
|
44
|
+
class Resource;
|
44
45
|
class Fmu;
|
45
46
|
class SharedObject;
|
46
47
|
class SharedObjectInternal;
|
@@ -93,6 +94,7 @@ namespace casadi {
|
|
93
94
|
}
|
94
95
|
void unpack(Function& e);
|
95
96
|
void unpack(Importer& e);
|
97
|
+
void unpack(Resource& e);
|
96
98
|
void unpack(Fmu& e);
|
97
99
|
void unpack(GenericType& e);
|
98
100
|
void unpack(std::ostream& s);
|
@@ -231,6 +233,7 @@ namespace casadi {
|
|
231
233
|
}
|
232
234
|
void pack(const Function& e);
|
233
235
|
void pack(const Importer& e);
|
236
|
+
void pack(const Resource& e);
|
234
237
|
void pack(const Fmu& e);
|
235
238
|
void pack(const Slice& e);
|
236
239
|
void pack(const GenericType& e);
|
@@ -26,27 +26,21 @@
|
|
26
26
|
#ifndef CASADI_SHARED_OBJECT_HPP
|
27
27
|
#define CASADI_SHARED_OBJECT_HPP
|
28
28
|
|
29
|
-
#include "
|
30
|
-
#include "exception.hpp"
|
31
|
-
#include <map>
|
32
|
-
#include <vector>
|
29
|
+
#include "generic_shared_internal.hpp"
|
33
30
|
|
34
31
|
namespace casadi {
|
35
32
|
|
36
|
-
// Forward declaration of weak reference class
|
37
|
-
class WeakRef;
|
38
|
-
|
39
33
|
/// \cond INTERNAL
|
40
34
|
// Forward declaration of internal classes
|
41
35
|
class SharedObjectInternal;
|
42
36
|
class WeakRefInternal;
|
43
37
|
/// \endcond
|
44
38
|
|
45
|
-
/** \brief
|
39
|
+
/** \brief GenericShared implements a reference counting framework similar for efficient and
|
46
40
|
|
47
41
|
easily-maintained memory management.
|
48
42
|
|
49
|
-
To use the class, both the
|
43
|
+
To use the class, both the GenericShared class (the public class), and the GenericSharedInternal
|
50
44
|
class (the internal class) must be inherited from. It can be done in two different files
|
51
45
|
and together with memory management, this approach provides a clear distinction of which
|
52
46
|
methods of the class are to be considered "public", i.e. methods for public use that can
|
@@ -81,190 +75,108 @@ namespace casadi {
|
|
81
75
|
\date 2010
|
82
76
|
|
83
77
|
\identifier{as} */
|
84
|
-
class CASADI_EXPORT SharedObject
|
85
|
-
|
86
|
-
|
87
|
-
template<class B> friend const B shared_cast(const SharedObject& A);
|
88
|
-
#endif // SWIG
|
89
|
-
|
90
|
-
public:
|
91
|
-
#ifndef SWIG
|
92
|
-
/// Default constructor
|
93
|
-
SharedObject();
|
94
|
-
|
95
|
-
/// Copy constructor (shallow copy)
|
96
|
-
SharedObject(const SharedObject& ref);
|
78
|
+
class CASADI_EXPORT SharedObject :
|
79
|
+
public GenericShared<SharedObject, SharedObjectInternal> {
|
80
|
+
public:
|
97
81
|
|
98
|
-
|
99
|
-
~SharedObject();
|
82
|
+
/** \brief Get class name
|
100
83
|
|
101
|
-
|
102
|
-
|
84
|
+
\identifier{au} */
|
85
|
+
std::string class_name() const;
|
103
86
|
|
104
|
-
|
105
|
-
|
106
|
-
void own(SharedObjectInternal* node);
|
87
|
+
/// Print a description of the object
|
88
|
+
void disp(std::ostream& stream, bool more=false) const;
|
107
89
|
|
108
|
-
|
109
|
-
|
110
|
-
|
90
|
+
/// Get string representation
|
91
|
+
std::string get_str(bool more=false) const {
|
92
|
+
std::stringstream ss;
|
93
|
+
disp(ss, more);
|
94
|
+
return ss.str();
|
95
|
+
}
|
111
96
|
|
112
|
-
|
113
|
-
|
97
|
+
/// \cond INTERNAL
|
98
|
+
/// Print the pointer to the internal class
|
99
|
+
void print_ptr(std::ostream &stream=casadi::uout()) const;
|
100
|
+
/// \endcond
|
114
101
|
|
115
|
-
|
116
|
-
|
102
|
+
using internal_base_type = SharedObjectInternal;
|
103
|
+
using base_type = SharedObject;
|
117
104
|
|
118
|
-
/// Get the reference count
|
119
|
-
casadi_int getCount() const;
|
120
|
-
|
121
|
-
/// Swap content with another instance
|
122
|
-
void swap(SharedObject& other);
|
123
|
-
|
124
|
-
/// Access a member function or object
|
125
|
-
SharedObjectInternal* operator->() const;
|
126
|
-
/// \endcond
|
127
|
-
#endif // SWIG
|
128
|
-
|
129
|
-
/** \brief Get class name
|
130
|
-
|
131
|
-
\identifier{au} */
|
132
|
-
std::string class_name() const;
|
133
|
-
|
134
|
-
/// Print a description of the object
|
135
|
-
void disp(std::ostream& stream, bool more=false) const;
|
136
|
-
|
137
|
-
/// Get string representation
|
138
|
-
std::string get_str(bool more=false) const {
|
139
|
-
std::stringstream ss;
|
140
|
-
disp(ss, more);
|
141
|
-
return ss.str();
|
142
|
-
}
|
143
|
-
|
144
|
-
/// \cond INTERNAL
|
145
|
-
/// Print the pointer to the internal class
|
146
|
-
void print_ptr(std::ostream &stream=casadi::uout()) const;
|
147
|
-
/// \endcond
|
148
|
-
|
149
|
-
/// Is a null pointer?
|
150
|
-
bool is_null() const;
|
151
|
-
|
152
|
-
/** \brief Returns a number that is unique for a given Node.
|
153
|
-
|
154
|
-
* If the Object does not point to any node, "0" is returned.
|
155
|
-
|
156
|
-
\identifier{av} */
|
157
|
-
casadi_int __hash__() const;
|
158
|
-
|
159
|
-
/// \cond INTERNAL
|
160
|
-
#ifndef SWIG
|
161
|
-
/** \brief Get a weak reference to the object
|
162
|
-
|
163
|
-
\identifier{aw} */
|
164
|
-
WeakRef* weak();
|
165
|
-
protected:
|
166
|
-
void count_up(); // increase counter of the node
|
167
|
-
void count_down(); // decrease counter of the node
|
168
|
-
private:
|
169
|
-
SharedObjectInternal *node;
|
170
|
-
#endif // SWIG
|
171
|
-
/// \endcond
|
172
105
|
};
|
173
106
|
|
174
107
|
/** \brief Weak reference type
|
175
108
|
|
176
|
-
A weak reference to a
|
109
|
+
A weak reference to a GenericShared
|
177
110
|
\author Joel Andersson
|
178
111
|
\date 2013
|
179
112
|
|
180
113
|
\identifier{ax} */
|
181
|
-
class CASADI_EXPORT WeakRef :
|
114
|
+
class CASADI_EXPORT WeakRef :
|
115
|
+
public GenericWeakRef<SharedObject, SharedObjectInternal> {
|
182
116
|
public:
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
WeakRef(
|
189
|
-
|
190
|
-
/** \brief Construct from a shared object (also implicit type conversion)
|
191
|
-
|
192
|
-
\identifier{az} */
|
193
|
-
WeakRef(SharedObject shared);
|
194
|
-
|
195
|
-
/** \brief Get a shared (owning) reference
|
196
|
-
|
197
|
-
\identifier{b0} */
|
198
|
-
SharedObject shared();
|
199
|
-
|
200
|
-
/** \brief Check if alive
|
201
|
-
|
202
|
-
\identifier{b1} */
|
203
|
-
bool alive() const;
|
204
|
-
|
205
|
-
/** \brief Access functions of the node
|
206
|
-
|
207
|
-
\identifier{b2} */
|
208
|
-
WeakRefInternal* operator->();
|
209
|
-
|
210
|
-
/** \brief Const access functions of the node
|
211
|
-
|
212
|
-
\identifier{b3} */
|
213
|
-
const WeakRefInternal* operator->() const;
|
214
|
-
|
215
|
-
#ifndef SWIG
|
216
|
-
private:
|
217
|
-
/** \brief Construct from a shared object (internal)
|
218
|
-
|
219
|
-
\identifier{b4} */
|
220
|
-
explicit WeakRef(SharedObjectInternal* raw);
|
221
|
-
|
222
|
-
/** \brief The shared object has been deleted
|
223
|
-
|
224
|
-
\identifier{b5} */
|
225
|
-
void kill();
|
226
|
-
#endif // SWIG
|
117
|
+
WeakRef(int dummy=0) : GenericWeakRef<SharedObject, SharedObjectInternal>(dummy) {
|
118
|
+
}
|
119
|
+
WeakRef(SharedObject shared) : GenericWeakRef<SharedObject, SharedObjectInternal>(shared) {
|
120
|
+
}
|
121
|
+
/*private:
|
122
|
+
explicit WeakRef(SharedObjectInternal* raw) : GenericWeakRef<SharedObject, SharedObjectInternal>(raw) {
|
123
|
+
};*/
|
227
124
|
};
|
228
125
|
|
229
126
|
#ifndef SWIG
|
127
|
+
class CASADI_EXPORT SharedObjectInternal :
|
128
|
+
public GenericSharedInternal<SharedObject, SharedObjectInternal> {
|
129
|
+
friend class GenericShared<SharedObject, SharedObjectInternal>;
|
130
|
+
friend class SharedObject;
|
131
|
+
friend class GenericWeakRef<SharedObject, SharedObjectInternal>;
|
132
|
+
friend class GenericSharedInternal<SharedObject, SharedObjectInternal>;
|
133
|
+
friend class Memory;
|
134
|
+
friend class UniversalNodeOwner;
|
135
|
+
public:
|
136
|
+
/// NOTE: these two constructors added because defaults are ill-formed defaults
|
137
|
+
/// This may hint at a bug
|
138
|
+
/// Default constructor
|
139
|
+
SharedObjectInternal() : GenericSharedInternal<SharedObject, SharedObjectInternal>() {
|
140
|
+
}
|
141
|
+
/// Copy constructor
|
142
|
+
SharedObjectInternal(const SharedObjectInternal& node) :
|
143
|
+
GenericSharedInternal<SharedObject, SharedObjectInternal>(node) {
|
144
|
+
}
|
230
145
|
|
231
|
-
|
146
|
+
/// Readable name of the internal class
|
147
|
+
virtual std::string class_name() const = 0;
|
232
148
|
|
233
|
-
|
149
|
+
/// Print a description of the object
|
150
|
+
virtual void disp(std::ostream& stream, bool more) const = 0;
|
234
151
|
|
235
|
-
|
236
|
-
template<class B>
|
237
|
-
B shared_cast(SharedObject& A) {
|
152
|
+
using weak_ref_type = WeakRefInternal;
|
238
153
|
|
239
|
-
|
240
|
-
|
154
|
+
private:
|
155
|
+
/// Number of references pointing to the object
|
156
|
+
#ifdef CASADI_WITH_THREAD
|
157
|
+
std::atomic<casadi_int> count;
|
158
|
+
#else // CASADI_WITH_THREAD
|
159
|
+
casadi_int count;
|
160
|
+
#endif
|
241
161
|
|
242
|
-
|
243
|
-
B ret;
|
162
|
+
};
|
244
163
|
|
245
|
-
|
246
|
-
|
164
|
+
class CASADI_EXPORT WeakRefInternal :
|
165
|
+
public GenericWeakRefInternal<SharedObject, SharedObjectInternal> {
|
166
|
+
public:
|
167
|
+
/// Print a description of the object
|
168
|
+
void disp(std::ostream& stream, bool more) const override;
|
247
169
|
|
248
|
-
///
|
249
|
-
|
250
|
-
return ret;
|
251
|
-
}
|
170
|
+
/// Readable name of the class
|
171
|
+
std::string class_name() const override {return "WeakRefInternal";}
|
252
172
|
|
253
|
-
|
173
|
+
using GenericWeakRefInternal<SharedObject, SharedObjectInternal>::GenericWeakRefInternal;
|
254
174
|
|
255
|
-
|
175
|
+
};
|
256
176
|
|
257
|
-
\identifier{b7} */
|
258
|
-
template<class B>
|
259
|
-
const B shared_cast(const SharedObject& A) {
|
260
|
-
SharedObject A_copy = A;
|
261
|
-
return shared_cast<B>(A_copy);
|
262
|
-
}
|
263
177
|
|
264
178
|
#endif // SWIG
|
265
179
|
|
266
|
-
|
267
180
|
} // namespace casadi
|
268
181
|
|
269
|
-
|
270
182
|
#endif // CASADI_SHARED_OBJECT_HPP
|
@@ -36,6 +36,13 @@
|
|
36
36
|
#include <list>
|
37
37
|
#include <limits>
|
38
38
|
#include <unordered_map>
|
39
|
+
#ifdef CASADI_WITH_THREAD
|
40
|
+
#ifdef CASADI_WITH_THREAD_MINGW
|
41
|
+
#include <mingw.mutex.h>
|
42
|
+
#else // CASADI_WITH_THREAD_MINGW
|
43
|
+
#include <mutex>
|
44
|
+
#endif // CASADI_WITH_THREAD_MINGW
|
45
|
+
#endif //CASADI_WITH_THREAD
|
39
46
|
|
40
47
|
namespace casadi {
|
41
48
|
// Forward declaration
|
@@ -269,7 +276,7 @@ namespace casadi {
|
|
269
276
|
Sparsity get_diag(std::vector<casadi_int>& SWIG_OUTPUT(mapping)) const;
|
270
277
|
|
271
278
|
/// Compress a sparsity pattern
|
272
|
-
std::vector<casadi_int> compress() const;
|
279
|
+
std::vector<casadi_int> compress(bool canonical=true) const;
|
273
280
|
|
274
281
|
#ifndef SWIG
|
275
282
|
/// Access a member function or object
|
@@ -876,6 +883,11 @@ namespace casadi {
|
|
876
883
|
/// Cached sparsity patterns
|
877
884
|
static CachingMap& getCache();
|
878
885
|
|
886
|
+
#ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
|
887
|
+
// Safe access to CachingMap
|
888
|
+
static std::mutex cachingmap_mtx;
|
889
|
+
#endif //CASADI_WITH_THREADSAFE_SYMBOLICS
|
890
|
+
|
879
891
|
/// (Dense) scalar
|
880
892
|
static const Sparsity& getScalar();
|
881
893
|
|
@@ -590,7 +590,25 @@ namespace casadi {
|
|
590
590
|
\identifier{4q} */
|
591
591
|
inline friend MatType sum2(const MatType &x) { return MatType::sum2(x);}
|
592
592
|
|
593
|
-
/**
|
593
|
+
/** \brief Returns summation of all elements
|
594
|
+
|
595
|
+
\identifier{2d6} */
|
596
|
+
inline friend MatType sum(const MatType &x) {
|
597
|
+
if (x.is_vector()) {
|
598
|
+
if (x.is_column()) {
|
599
|
+
return MatType::sum1(x);
|
600
|
+
} else {
|
601
|
+
return MatType::sum2(x);
|
602
|
+
}
|
603
|
+
}
|
604
|
+
if (x.size1()>x.size2()) {
|
605
|
+
return MatType::sum2(MatType::sum1(x));
|
606
|
+
} else {
|
607
|
+
return MatType::sum1(MatType::sum2(x));
|
608
|
+
}
|
609
|
+
}
|
610
|
+
|
611
|
+
/** \@} */
|
594
612
|
};
|
595
613
|
#endif // SWIG
|
596
614
|
|
@@ -64,6 +64,27 @@ template<> inline std::string matrixName<SXElem>() { return "SX"; }
|
|
64
64
|
template<>
|
65
65
|
bool SX::is_symbolic() const;
|
66
66
|
|
67
|
+
template<>
|
68
|
+
bool SX::is_call() const;
|
69
|
+
|
70
|
+
template<>
|
71
|
+
std::vector<SXElem> SX::call(const Function& f, const std::vector<SXElem>& dep);
|
72
|
+
|
73
|
+
template<>
|
74
|
+
bool SX::is_output() const;
|
75
|
+
|
76
|
+
template<>
|
77
|
+
bool SX::has_output() const;
|
78
|
+
|
79
|
+
template<>
|
80
|
+
SX SX::get_output(casadi_int oind) const;
|
81
|
+
|
82
|
+
template<>
|
83
|
+
Function SX::which_function() const;
|
84
|
+
|
85
|
+
template<>
|
86
|
+
casadi_int SX::which_output() const;
|
87
|
+
|
67
88
|
template<>
|
68
89
|
casadi_int SX::op() const;
|
69
90
|
|
@@ -109,12 +130,28 @@ template<> inline std::string matrixName<SXElem>() { return "SX"; }
|
|
109
130
|
void SX::substitute_inplace(const std::vector<SX>& v, std::vector<SX>& vdef,
|
110
131
|
std::vector<SX>& ex, bool reverse);
|
111
132
|
|
133
|
+
template<>
|
134
|
+
void SX::extract_parametric(const SX &expr, const SX& par,
|
135
|
+
SX& expr_ret, std::vector<SX>& symbols, std::vector<SX>& parametric,
|
136
|
+
const Dict& opts);
|
137
|
+
|
138
|
+
template<>
|
139
|
+
void SX::separate_linear(const SX &expr,
|
140
|
+
const SX &sym_lin, const SX &sym_const,
|
141
|
+
SX& expr_const, SX& expr_lin, SX& expr_nonlin);
|
142
|
+
|
112
143
|
template<>
|
113
144
|
std::vector<SX> SX::cse(const std::vector<SX>& e);
|
114
145
|
|
115
146
|
template<>
|
116
147
|
bool SX::depends_on(const SX &x, const SX &arg);
|
117
148
|
|
149
|
+
template<>
|
150
|
+
bool SX::contains_all(const std::vector<SX>& v, const std::vector<SX> &n);
|
151
|
+
|
152
|
+
template<>
|
153
|
+
bool SX::contains_any(const std::vector<SX>& v, const std::vector<SX> &n);
|
154
|
+
|
118
155
|
template<>
|
119
156
|
SX SX::jacobian(const SX &f, const SX &x, const Dict& opts);
|
120
157
|
template<>
|
@@ -192,6 +229,10 @@ template<> inline std::string matrixName<SXElem>() { return "SX"; }
|
|
192
229
|
void CASADI_EXPORT SX::to_file(const std::string& filename, const Sparsity& sp,
|
193
230
|
const SXElem* nonzeros, const std::string& format_hint);
|
194
231
|
|
232
|
+
#ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
|
233
|
+
template<>
|
234
|
+
std::mutex& SX::get_mutex_temp();
|
235
|
+
#endif // CASADI_WITH_THREADSAFE_SYMBOLICS
|
195
236
|
|
196
237
|
#ifndef CASADI_SX_INSTANTIATOR_CPP
|
197
238
|
extern template class Matrix<SXElem>;
|