casadi 3.6.5__cp37-none-manylinux2014_aarch64.whl → 3.6.7__cp37-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.
Files changed (181) hide show
  1. casadi/_casadi.so +0 -0
  2. casadi/casadi.py +739 -308
  3. casadi/cmake/alpaqa/alpaqaConfigVersion.cmake +0 -5
  4. casadi/cmake/alpaqa/alpaqaTargets.cmake +1 -1
  5. casadi/cmake/casadi-config-version.cmake +1 -1
  6. casadi/cmake/casadi-targets.cmake +1 -1
  7. casadi/cmake/osqp/osqp-targets.cmake +1 -1
  8. casadi/cmake/proxsuite/proxsuiteConfigVersion.cmake +0 -5
  9. casadi/cmake/proxsuite/proxsuiteTargets.cmake +1 -1
  10. casadi/cmake/qdldl/qdldl-targets.cmake +1 -1
  11. casadi/include/casadi/casadi.i +3 -0
  12. casadi/include/casadi/casadi_c.h +2 -0
  13. casadi/include/casadi/config.h +8 -8
  14. casadi/include/casadi/core/casadi_common.hpp +1 -0
  15. casadi/include/casadi/core/casadi_misc.hpp +52 -0
  16. casadi/include/casadi/core/casadi_types.hpp +3 -2
  17. casadi/include/casadi/core/code_generator.hpp +30 -1
  18. casadi/include/casadi/core/global_options.hpp +2 -0
  19. casadi/include/casadi/core/mx.hpp +18 -3
  20. casadi/include/casadi/core/optistack.hpp +23 -0
  21. casadi/include/casadi/core/runtime/casadi_nlp.hpp +19 -4
  22. casadi/include/casadi/core/runtime/casadi_ocp_block.hpp +55 -0
  23. casadi/include/casadi/core/runtime/casadi_oracle.hpp +44 -0
  24. casadi/include/casadi/core/runtime/casadi_oracle_callback.hpp +39 -0
  25. casadi/include/casadi/core/runtime/casadi_runtime.hpp +4 -1
  26. casadi/include/casadi/core/runtime/casadi_scaled_copy.hpp +31 -0
  27. casadi/include/casadi/core/serializing_stream.hpp +2 -2
  28. casadi/include/casadi/core/sparsity.hpp +7 -0
  29. casadi/include/casadi/doc.i +1513 -1016
  30. casadi/include/casadi/doc_merged.i +965 -719
  31. casadi/include/casadi/mem.h +1 -0
  32. casadi/include/daqp/api.h +46 -0
  33. casadi/include/daqp/auxiliary.h +29 -0
  34. casadi/include/daqp/bnb.h +32 -0
  35. casadi/include/daqp/codegen.h +18 -0
  36. casadi/include/daqp/constants.h +92 -0
  37. casadi/include/daqp/daqp.h +22 -0
  38. casadi/include/daqp/daqp_prox.h +18 -0
  39. casadi/include/daqp/factorization.h +18 -0
  40. casadi/include/daqp/types.h +161 -0
  41. casadi/include/daqp/utils.h +44 -0
  42. casadi/include/fatrop/auxiliary/Common.hpp +34 -0
  43. casadi/include/fatrop/auxiliary/DynamicLib.hpp +34 -0
  44. casadi/include/fatrop/auxiliary/FatropOptions.hpp +68 -0
  45. casadi/include/fatrop/auxiliary/FatropVector.hpp +143 -0
  46. casadi/include/fatrop/auxiliary/LinearAlgebra.hpp +88 -0
  47. casadi/include/fatrop/auxiliary/VectorUtils.hpp +54 -0
  48. casadi/include/fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp +493 -0
  49. casadi/include/fatrop/fatrop.hpp +39 -0
  50. casadi/include/fatrop/function_evaluation/CasadiCodegen.hpp +104 -0
  51. casadi/include/fatrop/function_evaluation/FunctionEvaluation.hpp +60 -0
  52. casadi/include/fatrop/json/json.h +946 -0
  53. casadi/include/fatrop/ocp/CasadiCApiUserdataWrap.hpp +87 -0
  54. casadi/include/fatrop/ocp/DuInfEvaluator.hpp +38 -0
  55. casadi/include/fatrop/ocp/FatropOCP.hpp +161 -0
  56. casadi/include/fatrop/ocp/FatropOCPBuilder.hpp +52 -0
  57. casadi/include/fatrop/ocp/FatropOCPResto.hpp +299 -0
  58. casadi/include/fatrop/ocp/OCP.hpp +82 -0
  59. casadi/include/fatrop/ocp/OCPAbstract.hpp +254 -0
  60. casadi/include/fatrop/ocp/OCPAdapter.hpp +197 -0
  61. casadi/include/fatrop/ocp/OCPCInterface.h +289 -0
  62. casadi/include/fatrop/ocp/OCPDims.hpp +60 -0
  63. casadi/include/fatrop/ocp/OCPInitializer.hpp +41 -0
  64. casadi/include/fatrop/ocp/OCPKKT.hpp +69 -0
  65. casadi/include/fatrop/ocp/OCPLSRiccati.hpp +198 -0
  66. casadi/include/fatrop/ocp/OCPLSScaler.hpp +66 -0
  67. casadi/include/fatrop/ocp/OCPLinearSolver.hpp +75 -0
  68. casadi/include/fatrop/ocp/OCPNoScaling.hpp +42 -0
  69. casadi/include/fatrop/ocp/OCPScalingMethod.hpp +42 -0
  70. casadi/include/fatrop/ocp/StageOCP.hpp +592 -0
  71. casadi/include/fatrop/ocp/StageOCPApplication.hpp +242 -0
  72. casadi/include/fatrop/ocp/StageOCPExpressions.hpp +182 -0
  73. casadi/include/fatrop/ocp/UStageEvalAbstract.hpp +168 -0
  74. casadi/include/fatrop/ocp/UStageOCPImpl.hpp +152 -0
  75. casadi/include/fatrop/quasi_newton/bfgs.hpp +159 -0
  76. casadi/include/fatrop/solver/AlgBuilder.hpp +76 -0
  77. casadi/include/fatrop/solver/AlgStrategy.hpp +33 -0
  78. casadi/include/fatrop/solver/FatropAlg.hpp +121 -0
  79. casadi/include/fatrop/solver/FatropData.hpp +188 -0
  80. casadi/include/fatrop/solver/FatropOptions.hpp +95 -0
  81. casadi/include/fatrop/solver/FatropPrinter.hpp +65 -0
  82. casadi/include/fatrop/solver/FatropStats.hpp +63 -0
  83. casadi/include/fatrop/solver/Filter.hpp +54 -0
  84. casadi/include/fatrop/solver/IterationData.hpp +56 -0
  85. casadi/include/fatrop/solver/LineSearch.hpp +86 -0
  86. casadi/include/fatrop/solver/NLPL1.hpp +263 -0
  87. casadi/include/fatrop/templates/NLPAlg.hpp +104 -0
  88. casadi/include/licenses/daqp-external/LICENSE +21 -0
  89. casadi/include/licenses/fatrop-external/LICENSE.txt +165 -0
  90. casadi/include/licenses/fatrop-external/external/blasfeo/LICENSE.txt +26 -0
  91. casadi/include/licenses/fatrop-external/external/pybind11/LICENSE +29 -0
  92. casadi/include/osqp/constants.h +2 -3
  93. casadi/include/osqp/version.h +9 -0
  94. casadi/lib/cmake/tinyxml2/tinyxml2-config-version.cmake +0 -5
  95. casadi/lib/cmake/tinyxml2/tinyxml2-static-targets.cmake +1 -1
  96. casadi/libcasadi.so +0 -0
  97. casadi/libcasadi.so.3.7 +0 -0
  98. casadi/libcasadi_conic_cplex.so +0 -0
  99. casadi/libcasadi_conic_cplex.so.3.7 +0 -0
  100. casadi/libcasadi_conic_daqp.so +0 -0
  101. casadi/libcasadi_conic_daqp.so.3.7 +0 -0
  102. casadi/libcasadi_conic_fatrop.so +0 -0
  103. casadi/libcasadi_conic_fatrop.so.3.7 +0 -0
  104. casadi/libcasadi_conic_gurobi.so +0 -0
  105. casadi/libcasadi_conic_gurobi.so.3.7 +0 -0
  106. casadi/libcasadi_conic_hpipm.so +0 -0
  107. casadi/libcasadi_conic_hpipm.so.3.7 +0 -0
  108. casadi/libcasadi_conic_ipqp.so +0 -0
  109. casadi/libcasadi_conic_ipqp.so.3.7 +0 -0
  110. casadi/libcasadi_conic_nlpsol.so +0 -0
  111. casadi/libcasadi_conic_nlpsol.so.3.7 +0 -0
  112. casadi/libcasadi_conic_osqp.so +0 -0
  113. casadi/libcasadi_conic_osqp.so.3.7 +0 -0
  114. casadi/libcasadi_conic_proxqp.so +0 -0
  115. casadi/libcasadi_conic_proxqp.so.3.7 +0 -0
  116. casadi/libcasadi_conic_qpoases.so +0 -0
  117. casadi/libcasadi_conic_qpoases.so.3.7 +0 -0
  118. casadi/libcasadi_conic_qrqp.so +0 -0
  119. casadi/libcasadi_conic_qrqp.so.3.7 +0 -0
  120. casadi/libcasadi_conic_superscs.so +0 -0
  121. casadi/libcasadi_conic_superscs.so.3.7 +0 -0
  122. casadi/libcasadi_integrator_collocation.so +0 -0
  123. casadi/libcasadi_integrator_collocation.so.3.7 +0 -0
  124. casadi/libcasadi_integrator_cvodes.so +0 -0
  125. casadi/libcasadi_integrator_cvodes.so.3.7 +0 -0
  126. casadi/libcasadi_integrator_idas.so +0 -0
  127. casadi/libcasadi_integrator_idas.so.3.7 +0 -0
  128. casadi/libcasadi_integrator_rk.so +0 -0
  129. casadi/libcasadi_integrator_rk.so.3.7 +0 -0
  130. casadi/libcasadi_nlpsol_alpaqa.so +0 -0
  131. casadi/libcasadi_nlpsol_alpaqa.so.3.7 +0 -0
  132. casadi/libcasadi_nlpsol_ampl.so +0 -0
  133. casadi/libcasadi_nlpsol_ampl.so.3.7 +0 -0
  134. casadi/libcasadi_nlpsol_blocksqp.so +0 -0
  135. casadi/libcasadi_nlpsol_blocksqp.so.3.7 +0 -0
  136. casadi/libcasadi_nlpsol_fatrop.so +0 -0
  137. casadi/libcasadi_nlpsol_fatrop.so.3.7 +0 -0
  138. casadi/libcasadi_nlpsol_feasiblesqpmethod.so +0 -0
  139. casadi/libcasadi_nlpsol_feasiblesqpmethod.so.3.7 +0 -0
  140. casadi/libcasadi_nlpsol_ipopt.so +0 -0
  141. casadi/libcasadi_nlpsol_ipopt.so.3.7 +0 -0
  142. casadi/libcasadi_nlpsol_knitro.so +0 -0
  143. casadi/libcasadi_nlpsol_knitro.so.3.7 +0 -0
  144. casadi/libcasadi_nlpsol_madnlp.so +0 -0
  145. casadi/libcasadi_nlpsol_madnlp.so.3.7 +0 -0
  146. casadi/libcasadi_nlpsol_qrsqp.so +0 -0
  147. casadi/libcasadi_nlpsol_qrsqp.so.3.7 +0 -0
  148. casadi/libcasadi_nlpsol_scpgen.so +0 -0
  149. casadi/libcasadi_nlpsol_scpgen.so.3.7 +0 -0
  150. casadi/libcasadi_nlpsol_snopt.so +0 -0
  151. casadi/libcasadi_nlpsol_snopt.so.3.7 +0 -0
  152. casadi/libcasadi_nlpsol_sqpmethod.so +0 -0
  153. casadi/libcasadi_nlpsol_sqpmethod.so.3.7 +0 -0
  154. casadi/libcasadi_nlpsol_worhp.so +0 -0
  155. casadi/libcasadi_nlpsol_worhp.so.3.7 +0 -0
  156. casadi/libcasadi_rootfinder_fast_newton.so +0 -0
  157. casadi/libcasadi_rootfinder_fast_newton.so.3.7 +0 -0
  158. casadi/libcasadi_rootfinder_kinsol.so +0 -0
  159. casadi/libcasadi_rootfinder_kinsol.so.3.7 +0 -0
  160. casadi/libcasadi_rootfinder_newton.so +0 -0
  161. casadi/libcasadi_rootfinder_newton.so.3.7 +0 -0
  162. casadi/libcasadi_rootfinder_nlpsol.so +0 -0
  163. casadi/libcasadi_rootfinder_nlpsol.so.3.7 +0 -0
  164. casadi/libcasadi_sundials_common.so +0 -0
  165. casadi/libcasadi_sundials_common.so.3.7 +0 -0
  166. casadi/libcoinmetis.la +1 -1
  167. casadi/libcoinmetis.so +0 -0
  168. casadi/libcoinmetis.so.2 +0 -0
  169. casadi/libcoinmetis.so.2.0.0 +0 -0
  170. casadi/libdaqp.so +0 -0
  171. casadi/libdaqpstat.a +0 -0
  172. casadi/libfatrop.so +0 -0
  173. casadi/libmatlab_ipc.so +0 -0
  174. casadi/libosqp.a +0 -0
  175. casadi/libosqp.so +0 -0
  176. casadi/pkgconfig/casadi.pc +1 -1
  177. casadi/tools/__init__.py +4 -0
  178. casadi/tools/bounds.py +3 -3
  179. {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/METADATA +2 -2
  180. {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/RECORD +181 -104
  181. {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/WHEEL +0 -0
@@ -0,0 +1,143 @@
1
+ /*
2
+ * Fatrop - A fast trajectory optimization solver
3
+ * Copyright (C) 2022 - 2024 Lander Vanroye, KU Leuven. All rights reserved.
4
+ *
5
+ * This file is part of Fatrop.
6
+ *
7
+ * Fatrop is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * Fatrop is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with Fatrop. If not, see <http://www.gnu.org/licenses/>. */
19
+ #ifndef FATROP_VECTOR_INCLUDED
20
+ #define FATROP_VECTOR_INCLUDED
21
+ #include <vector>
22
+ #include <assert.h>
23
+ #include <utility>
24
+ #include <functional>
25
+ #include <fatrop/auxiliary/Common.hpp>
26
+ namespace fatrop
27
+ {
28
+ // static polymorphism using CRTP
29
+ template <typename E, typename T>
30
+ class VecExpr
31
+ {
32
+ public:
33
+ T get(const fatrop_int ai) const { return static_cast<E const &>(*this).get(ai); };
34
+ fatrop_int size() const { return static_cast<E const &>(*this).size(); };
35
+ };
36
+
37
+ template <typename T, typename E1, typename E2>
38
+ class VecSum : public VecExpr<VecSum<T, E1, E2>, T>
39
+ {
40
+ public:
41
+ VecSum(const VecExpr<E1, T> &expr1, const VecExpr<E2, T> &expr2) : expr1_(expr1), expr2_(expr2)
42
+ {
43
+ assert(expr1.size() == expr2.size());
44
+ };
45
+ T get(const fatrop_int ai) const { return expr1_.get(ai) + expr2_.get(ai); };
46
+ fatrop_int size() const { return expr1_.size(); };
47
+
48
+ private:
49
+ const VecExpr<E1, T> &expr1_;
50
+ const VecExpr<E2, T> &expr2_;
51
+ };
52
+ template <typename T, typename E1>
53
+ class VecScalarSum : public VecExpr<VecScalarSum<T, E1>, T>
54
+ {
55
+ public:
56
+ VecScalarSum(const VecExpr<E1, T> &expr, const fatrop_int scalar) : expr_(expr), scalar_(scalar){};
57
+ T get(const fatrop_int ai) const { return expr_.get(ai) + scalar_; };
58
+ fatrop_int size() const { return expr_.size(); };
59
+
60
+ public:
61
+ const VecExpr<E1, T> &expr_;
62
+ T scalar_;
63
+ };
64
+ template <typename T, typename E1>
65
+ class VecRotate : public VecExpr<VecRotate<T, E1>, T>
66
+ {
67
+ public:
68
+ VecRotate(const VecExpr<E1, T> &expr, const fatrop_int shift) : expr_(expr), shift_(shift){};
69
+ T get(const fatrop_int ai) const { return expr_.get((ai + shift_ + (((ai + shift_) / size() + 1) * size())) % size()); };
70
+ fatrop_int size() const { return expr_.size(); };
71
+
72
+ public:
73
+ const VecExpr<E1, T> &expr_;
74
+ fatrop_int shift_;
75
+ };
76
+
77
+ template <typename T>
78
+ class FatropVector : public std::vector<T>, public VecExpr<FatropVector<T>, T>
79
+ {
80
+ public:
81
+ FatropVector() : std::vector<T>(){};
82
+ FatropVector(const fatrop_int size) : std::vector<T>(size){};
83
+ template <typename E>
84
+ FatropVector(const VecExpr<E, T> &vecexpr) : std::vector<T>(vecexpr.size())
85
+ {
86
+ // todo: vector is first initialized, initialize with iterator
87
+ for (fatrop_int i = 0; i < vecexpr.size(); i++)
88
+ {
89
+ std:: vector<T>::at(i) = vecexpr.get(i);
90
+ }
91
+ }
92
+ FatropVector(const std::vector<T> &vec) : std::vector<T>(vec){};
93
+ FatropVector(std::vector<T> &&vec) : std::vector<T>(std::move(vec)){};
94
+ T get(const fatrop_int ai) const { return std::vector<T>::at(ai); };
95
+ fatrop_int size() const { return std::vector<T>::size(); };
96
+ operator T *() { return this->data(); };
97
+ };
98
+ template <typename T, typename E1, typename E2>
99
+ VecSum<T, E1, E2> operator+(const VecExpr<E1, T> &expr1, const VecExpr<E2, T> &expr2)
100
+ {
101
+ return VecSum<T, E1, E2>(expr1, expr2);
102
+ }
103
+
104
+ template <typename T, typename E1>
105
+ VecScalarSum<T, E1> operator+(const VecExpr<E1, T> &expr1, const fatrop_int scalar)
106
+ {
107
+ return VecScalarSum<T, E1>(expr1, scalar);
108
+ }
109
+
110
+ template <typename T, typename E1>
111
+ VecScalarSum<T, E1> operator+(const fatrop_int scalar, const VecExpr<E1, T> &expr1)
112
+ {
113
+ return VecScalarSum<T, E1>(expr1, scalar);
114
+ }
115
+ template <typename T, typename E1>
116
+ T sum(const VecExpr<E1, T> &expr)
117
+ {
118
+ T res = 0;
119
+ for (fatrop_int i = 0; i < expr.size(); i++)
120
+ {
121
+ res += expr.get(i);
122
+ }
123
+ return res;
124
+ }
125
+ template <typename T, typename E1>
126
+ VecRotate<T, E1> rotate(const VecExpr<E1, T> &expr, const fatrop_int shift)
127
+ {
128
+ return VecRotate<T, E1>(expr, shift);
129
+ };
130
+ template <typename T>
131
+ std::vector<T> TransformRange(const fatrop_int begin, const fatrop_int end, const std::function<T(fatrop_int)>& func)
132
+ {
133
+ fatrop_int size = end - begin;
134
+ std::vector<T> res(size);
135
+ for (fatrop_int i = 0; i < size; i++)
136
+ {
137
+ res.at(i) = func(begin + i);
138
+ }
139
+ return res;
140
+ }
141
+ } // namespace fatrop
142
+
143
+ #endif // FATROP_VECTOR_INCLUDED
@@ -0,0 +1,88 @@
1
+ /*
2
+ * Fatrop - A fast trajectory optimization solver
3
+ * Copyright (C) 2022 - 2024 Lander Vanroye, KU Leuven. All rights reserved.
4
+ *
5
+ * This file is part of Fatrop.
6
+ *
7
+ * Fatrop is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * Fatrop is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with Fatrop. If not, see <http://www.gnu.org/licenses/>. */
19
+
20
+ /**
21
+ * @file LinearAlgebra.hpp
22
+ * This file contains some interface classes for use in linear algebra.
23
+ *
24
+ */
25
+ #ifndef FATROP_LA_INCLUDED
26
+ #define FATROP_LA_INCLUDED
27
+ #include <iostream>
28
+ #include "fatrop/auxiliary/Common.hpp"
29
+
30
+ namespace fatrop
31
+ {
32
+ struct MatrixInd
33
+ {
34
+ fatrop_int ai;
35
+ fatrop_int aj;
36
+ };
37
+ /** \brief Interface class for matrix representations */
38
+ class FatropMat
39
+ {
40
+ public:
41
+ /** \brief Copy of matrix element */
42
+ virtual double get_el(const fatrop_int ai, const fatrop_int aj) const = 0;
43
+ /** \brief Number of rows */
44
+ virtual fatrop_int nrows() const = 0;
45
+ /** \brief Number of cols */
46
+ virtual fatrop_int ncols() const = 0;
47
+ void print();
48
+ };
49
+ // special matrices
50
+ /** \brief Identity matrix */
51
+ class eye : public FatropMat
52
+ {
53
+ public:
54
+ /** \brief Constructor */
55
+ eye(fatrop_int dim) : dim_(dim){};
56
+ /** \brief Copy of matrix element */
57
+ inline double get_el(const fatrop_int ai, const fatrop_int aj) const
58
+ {
59
+ if (ai == aj)
60
+ {
61
+ return 1.0;
62
+ }
63
+ else
64
+ {
65
+ return 0.0;
66
+ }
67
+ };
68
+ /** \brief Number of rows */
69
+ fatrop_int nrows() const { return dim_; };
70
+ /** \brief Number of cols */
71
+ fatrop_int ncols() const { return dim_; };
72
+
73
+ private:
74
+ fatrop_int dim_;
75
+ };
76
+ /** \brief Interface class for matrix representations */
77
+ class FatropVec
78
+ {
79
+ public:
80
+ /** \brief Copy of matrix element */
81
+ virtual double get_el(const fatrop_int ai) const = 0;
82
+ /** \brief Number of elements */
83
+ virtual fatrop_int nels() const = 0;
84
+ void print() const;
85
+ };
86
+ } // namespace fatrop
87
+
88
+ #endif // FATROP_LA_INCLUDED
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Fatrop - A fast trajectory optimization solver
3
+ * Copyright (C) 2022 - 2024 Lander Vanroye, KU Leuven. All rights reserved.
4
+ *
5
+ * This file is part of Fatrop.
6
+ *
7
+ * Fatrop is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * Fatrop is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with Fatrop. If not, see <http://www.gnu.org/licenses/>. */
19
+ #ifndef FATROPAUXILIARYINCLUDED
20
+ #define FATROPAUXILIARYINCLUDED
21
+ #include <vector>
22
+ #include "FatropVector.hpp"
23
+ #include "fatrop/auxiliary/Common.hpp"
24
+ namespace fatrop
25
+ {
26
+ /** \brief function to cumulative sum integer vector, first element is zero */
27
+ template <typename T, typename E>
28
+ FatropVector<T> offsets(const VecExpr<E, T> &a)
29
+ {
30
+ const fatrop_int size_a = a.size();
31
+ FatropVector<T> res(size_a);
32
+ res.at(0) = 0;
33
+ for (fatrop_int i = 1; i < size_a; i++)
34
+ {
35
+ res.at(i) = a.get(i - 1) + res.get(i - 1);
36
+ }
37
+ return res;
38
+ }
39
+
40
+ /** \brief returns index of max el of VecExpr */
41
+ template <typename T, typename E>
42
+ fatrop_int maxel(const VecExpr<E, T> &a)
43
+ {
44
+ const fatrop_int size_a = a.size();
45
+ fatrop_int res = 0;
46
+ for (fatrop_int i = 0; i < size_a; i++)
47
+ {
48
+ fatrop_int ai = a.get(i);
49
+ res = ai > res ? ai : res;
50
+ }
51
+ return res;
52
+ }
53
+ }; // namespace fatrop
54
+ #endif // FATROPAUXINCLUDED