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,87 @@
1
+ #pragma once
2
+ #include <vector>
3
+ #include <memory>
4
+ #ifndef casadi_real_capi
5
+ #define casadi_real_capi double
6
+ #endif
7
+
8
+ #ifndef casadi_int_capi
9
+ #define casadi_int_capi long long int
10
+ #endif
11
+ // c++ stuff here
12
+ // TODO: this can become part of the default fatrop API as well. It has no dependency on casadi.
13
+ // forward declaration of OCPApplication
14
+ namespace fatrop
15
+ {
16
+ class OCPAbstractApplication;
17
+ namespace spectool
18
+ {
19
+
20
+ struct C_api_userdata
21
+ {
22
+ // constructor
23
+ C_api_userdata(const std::shared_ptr<fatrop::OCPAbstractApplication> &app);
24
+ const std::shared_ptr<fatrop::OCPAbstractApplication> app_;
25
+ std::vector<std::vector<casadi_int_capi>> sparsity_in;
26
+ std::vector<std::vector<casadi_int_capi>> sparsity_out;
27
+ std::vector<double> arg_initial_vars;
28
+ std::vector<double> arg_stage_parameters;
29
+ std::vector<double> arg_global_parameters;
30
+ int n_vars;
31
+ int n_stage_params;
32
+ int n_global_params;
33
+ int ref_count = 0;
34
+ };
35
+ }
36
+ }
37
+
38
+ #ifdef __cplusplus
39
+ extern "C"
40
+ {
41
+ #endif
42
+
43
+ /* How to prefix internal symbols */
44
+ #ifdef CASADI_CODEGEN_PREFIX
45
+ #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID)
46
+ #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS##ID
47
+ #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID)
48
+ #else
49
+ #undef CASADI_PREFIX
50
+ #define CASADI_PREFIX(ID) f_##ID
51
+ #endif
52
+
53
+ /* Symbol visibility in DLLs */
54
+ #ifndef CASADI_SYMBOL_EXPORT
55
+ #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
56
+ #if defined(STATIC_LINKED)
57
+ #define CASADI_SYMBOL_EXPORT
58
+ #else
59
+ #define CASADI_SYMBOL_EXPORT __declspec(dllexport)
60
+ #endif
61
+ #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
62
+ #define CASADI_SYMBOL_EXPORT __attribute__((visibility("default")))
63
+ #else
64
+ #define CASADI_SYMBOL_EXPORT
65
+ #endif
66
+ #endif
67
+
68
+ CASADI_SYMBOL_EXPORT int fatrop_func(const casadi_real_capi **arg, casadi_real_capi **res, casadi_int_capi *iw, casadi_real_capi *w, int mem, void *user_data);
69
+ CASADI_SYMBOL_EXPORT int fatrop_func_alloc_mem(void *user_data);
70
+ CASADI_SYMBOL_EXPORT int fatrop_func_init_mem(int mem, void *user_data);
71
+ CASADI_SYMBOL_EXPORT void fatrop_func_free_mem(int mem, void *user_data);
72
+ CASADI_SYMBOL_EXPORT int fatrop_func_checkout(void *user_data);
73
+ CASADI_SYMBOL_EXPORT void fatrop_func_release(int mem, void *user_data);
74
+ CASADI_SYMBOL_EXPORT void fatrop_func_incref(void *user_data);
75
+ CASADI_SYMBOL_EXPORT void fatrop_func_decref(void *user_data);
76
+ CASADI_SYMBOL_EXPORT casadi_int_capi fatrop_func_n_in(void *user_data);
77
+ CASADI_SYMBOL_EXPORT casadi_int_capi fatrop_func_n_out(void *user_data);
78
+ CASADI_SYMBOL_EXPORT casadi_real_capi fatrop_func_default_in(casadi_int_capi i, void *user_data);
79
+ CASADI_SYMBOL_EXPORT const char *fatrop_func_name_in(casadi_int_capi i, void *user_data);
80
+ CASADI_SYMBOL_EXPORT const char *fatrop_func_name_out(casadi_int_capi i, void *user_data);
81
+ CASADI_SYMBOL_EXPORT const casadi_int_capi *fatrop_func_sparsity_in(casadi_int_capi i, void *user_data);
82
+ CASADI_SYMBOL_EXPORT const casadi_int_capi *fatrop_func_sparsity_out(casadi_int_capi i, void *user_data);
83
+ CASADI_SYMBOL_EXPORT int fatrop_func_work(casadi_int_capi *sz_arg, casadi_int_capi *sz_res, casadi_int_capi *sz_iw, casadi_int_capi *sz_w, void *user_data);
84
+
85
+ #ifdef __cplusplus
86
+ } /* extern "C" */
87
+ #endif
@@ -0,0 +1,38 @@
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 DUINFEVALINCLUDED
20
+ #define DUINFEVALINCLUDED
21
+ #include "fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp"
22
+ #include "OCPKKT.hpp"
23
+ #include "fatrop/auxiliary/Common.hpp"
24
+ namespace fatrop
25
+ {
26
+ #define OCPMACRO(type, name, suffix) type name##suffix = ((type)OCP->name)
27
+ class DuInfEvaluator
28
+ {
29
+ public:
30
+ fatrop_int evaluate(
31
+ OCPKKTMemory *OCP,
32
+ double obj_scale,
33
+ const FatropVecBF &lam,
34
+ const FatropVecBF &grad,
35
+ FatropVecBF &du_inf);
36
+ };
37
+ }
38
+ #endif // DUINFEVALINCLUDED
@@ -0,0 +1,161 @@
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 OCPALGINCLUDED
20
+ #define OCPALGINCLUDED
21
+ #include "fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp"
22
+ #include "fatrop/templates/NLPAlg.hpp"
23
+ #include "OCPKKT.hpp"
24
+ #include "OCPLinearSolver.hpp"
25
+ #include "OCPScalingMethod.hpp"
26
+ #include "DuInfEvaluator.hpp"
27
+ #include "OCPInitializer.hpp"
28
+ #include "fatrop/solver/FatropPrinter.hpp"
29
+ // #include "fatrop/ocp/LineSearchDDP.hpp"
30
+ // #include "sparse/SparseOCP.hpp"
31
+ #include "OCP.hpp"
32
+ #include <memory>
33
+ #include "fatrop/auxiliary/Common.hpp"
34
+ #include "OCPLSScaler.hpp"
35
+ // #include <unistd.h>
36
+ namespace fatrop
37
+ {
38
+ class FatropOCP : public FatropNLP
39
+ {
40
+ public:
41
+ // FatropOCP();
42
+ FatropOCP(
43
+ const std::shared_ptr<OCP> &ocp,
44
+ const std::shared_ptr<OCPLinearSolver> &ls,
45
+ const std::shared_ptr<OCPScalingMethod> &scaler, const std::shared_ptr<FatropOptions> &options, const std::shared_ptr<FatropPrinter> &printer);
46
+ fatrop_int eval_lag_hess(
47
+ double obj_scale,
48
+ const FatropVecBF &primal_vars,
49
+ const FatropVecBF &slack_vars,
50
+ const FatropVecBF &lam) override;
51
+ fatrop_int eval_constr_jac(
52
+ const FatropVecBF &primal_vars,
53
+ const FatropVecBF &slack_vars) override;
54
+ fatrop_int solve_pd_sys(
55
+ const double inertia_correction_w,
56
+ const double inertia_correction_c,
57
+ const FatropVecBF &ux,
58
+ const FatropVecBF &lam,
59
+ const FatropVecBF &delta_s,
60
+ const FatropVecBF &sigma_total,
61
+ const FatropVecBF &gradb_total) override;
62
+ fatrop_int solve_soc_rhs(
63
+ const FatropVecBF &ux,
64
+ const FatropVecBF &lam,
65
+ const FatropVecBF &delta_s,
66
+ const FatropVecBF &constraint_violation) override;
67
+ fatrop_int compute_scalings(
68
+ double &obj_scale,
69
+ FatropVecBF &x_scales,
70
+ FatropVecBF &lam_scales,
71
+ const FatropVecBF &grad_curr_x, const FatropVecBF& grad_curr_s) override;
72
+ fatrop_int eval_constraint_viol(
73
+ const FatropVecBF &primal_vars,
74
+ const FatropVecBF &slack_vars,
75
+ FatropVecBF &constraint_violation) override;
76
+ fatrop_int eval_obj_grad(
77
+ double obj_scale,
78
+ const FatropVecBF &primal_vars,
79
+ const FatropVecBF &slack_vars,
80
+ FatropVecBF &gradient_x,FatropVecBF &gradient_s) override;
81
+ fatrop_int eval_obj(
82
+ double obj_scale,
83
+ const FatropVecBF &primal_vars,
84
+ const FatropVecBF &slack_vars,
85
+ double &res) override;
86
+ fatrop_int eval_dual_inf(
87
+ double obj_scale,
88
+ const FatropVecBF &lam,
89
+ const FatropVecBF &grad_x,
90
+ const FatropVecBF &grad_s,
91
+ FatropVecBF &du_inf_x, FatropVecBF& du_inf_s) override;
92
+ fatrop_int initialize_slacks(double mu0,
93
+ FatropVecBF &s_curr) override;
94
+ fatrop_int initialize_dual(
95
+ const FatropVecBF &grad_x,
96
+ const FatropVecBF &grad_s,
97
+ FatropVecBF &dlam,
98
+ const FatropVecBF &zL,
99
+ const FatropVecBF &zU) override;
100
+
101
+ fatrop_int get_bounds(
102
+ FatropVecBF &lower,
103
+ FatropVecBF &upper) const override
104
+ {
105
+ return ocp_->get_bounds(lower, upper);
106
+ };
107
+ fatrop_int get_initial_sol_guess(
108
+ FatropVecBF &initial) const override
109
+ {
110
+ return ocp_->get_initial_sol_guess(initial);
111
+ };
112
+ // int GetDefaultParams(
113
+ // FatropOptions &params) const override
114
+ // {
115
+ // return ocp_->GetDefaultParams(params);
116
+ // };
117
+ NLPDims get_nlp_dims() const override;
118
+ void finalize() override;
119
+ void reset() override;
120
+
121
+ public:
122
+ std::shared_ptr<OCP> ocp_;
123
+ OCPDims dims_;
124
+ NLPDims nlpdims_;
125
+ std::shared_ptr<OCPLinearSolver> ls_;
126
+ std::shared_ptr<OCPScalingMethod> scaler_;
127
+ std::shared_ptr<FatropOptions> options_;
128
+ std::shared_ptr<FatropPrinter> printer_;
129
+ DuInfEvaluator duinfevaluator_;
130
+ OCPKKTMemory ocpkktmemory_;
131
+ OCPInitializer OCPInitializer_;
132
+ FatropMemoryVecBF s_memvec;
133
+ FatropMemoryVecBF ux_memvec;
134
+ FatropVecBF sigma;
135
+ FatropVecBF gradb;
136
+ FatropVecBF s_dummy;
137
+ FatropVecBF s_zero;
138
+ FatropVecBF ux_dummy;
139
+ FatropMemoryVecBF rhs_rq;
140
+ FatropMemoryVecBF rhs_b;
141
+ FatropMemoryVecBF rhs_g;
142
+ FatropMemoryVecBF rhs_g_ineq;
143
+ FatropMemoryVecBF rhs_gradb;
144
+ FatropMemoryVecBF rhs_rq2;
145
+ FatropMemoryVecBF rhs_b2;
146
+ FatropMemoryVecBF rhs_g2;
147
+ FatropMemoryVecBF rhs_g_ineq2;
148
+ FatropMemoryVecBF rhs_gradb2;
149
+ FatropMemoryVecBF gradb_total_cache;
150
+ FatropMemoryVecBF sigma_total_cache;
151
+ FatropMemoryVecBF ux_test;
152
+ FatropMemoryVecBF lam_test;
153
+ FatropMemoryVecBF delta_s_test;
154
+ double inertia_correction_w_cache;
155
+ double inertia_correction_c_cache;
156
+ bool it_ref;
157
+ bool ls_scaling;
158
+ OCPLSScaler lsscaler_;
159
+ };
160
+ } // namespace fatrop
161
+ #endif // OCPALGINCLUDED
@@ -0,0 +1,52 @@
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 FATROPOCPBUILDERINCLUDED
20
+ #define FATROPOCPBUILDERINCLUDED
21
+ #include "fatrop/ocp/OCP.hpp"
22
+ #include "fatrop/ocp/FatropOCP.hpp"
23
+ #include "fatrop/ocp/OCPAbstract.hpp"
24
+ #include "fatrop/ocp/OCPAdapter.hpp"
25
+ #include "fatrop/ocp/OCPLSRiccati.hpp"
26
+ #include "fatrop/ocp/OCPNoScaling.hpp"
27
+ namespace fatrop
28
+ {
29
+ class FatropOCPBuilder
30
+ {
31
+ public:
32
+ FatropOCPBuilder(const std::shared_ptr<OCP> &ocp, const std::shared_ptr<FatropOptions> &fatropparams, const std::shared_ptr<FatropPrinter> &printer) : ocp_(ocp), fatropoptions_(fatropparams), fatropprinter_(printer)
33
+ {
34
+ }
35
+ std::shared_ptr<FatropOCP> build()
36
+ {
37
+ return build(ocp_);
38
+ }
39
+
40
+ std::shared_ptr<FatropOCP> build(const std::shared_ptr<OCP> &ocp)
41
+ {
42
+ return std::make_shared<FatropOCP>(ocp, std::make_shared<OCPLSRiccati>(ocp->get_ocp_dims(), fatropoptions_, fatropprinter_), std::make_shared<OCPNoScaling>(fatropoptions_), fatropoptions_, fatropprinter_);
43
+ }
44
+
45
+ private:
46
+ const std::shared_ptr<OCP> ocp_;
47
+ const std::shared_ptr<FatropOptions> fatropoptions_;
48
+ const std::shared_ptr<FatropPrinter> fatropprinter_;
49
+ };
50
+ }
51
+
52
+ #endif // !OCPALGBUILDERINCLUDED
@@ -0,0 +1,299 @@
1
+ #pragma once
2
+ #include "FatropOCP.hpp"
3
+ #include "fatrop/solver/FatropOptions.hpp"
4
+ #include <memory>
5
+ namespace fatrop
6
+ {
7
+ class FatropOCPResto : public FatropNLP
8
+ {
9
+ public:
10
+ FatropOCPResto(const std::shared_ptr<FatropOCP> &orig, const std::shared_ptr<FatropOptions> &opts) : orig_(orig), orig_dims_(orig->get_nlp_dims()), lower_(orig_dims_.nineqs), upper_(orig_dims_.nineqs), x_start_(orig_dims_.nvars), s_start_(orig_dims_.nineqs), x_tmp_(orig_dims_.nvars), s_tmp_(orig_dims_.nineqs), upper_bounded_(orig_dims_.nineqs), lower_bounded_(orig_dims_.nineqs), slack_dummy_(orig_dims_.nineqs), sigma_dummy_(orig_dims_.nineqs), gradb_dummy_(orig_dims_.nineqs), zl_dummy_(orig_dims_.nineqs), zu_dummy_(orig_dims_.nineqs), sigma_cache_(orig_dims_.nineqs * 3), gradb_cache_(orig_dims_.nineqs * 3)
11
+ {
12
+ opts->register_option(DoubleOption::lower_bounded("resto_rho", "Resto L1 penalty parameter", &rho, 1000., 0.0));
13
+ opts->register_option(DoubleOption::lower_bounded("resto_xi", "Resto xi parameter", &xi, 1., 0.0));
14
+ auto lower_v = lower_[0];
15
+ auto upper_v = upper_[0];
16
+ orig_->get_bounds(lower_v, upper_v);
17
+ n_p = orig_dims_.nineqs;
18
+ n_n = orig_dims_.nineqs;
19
+ for (fatrop_int i = 0; i < orig_dims_.nineqs; ++i)
20
+ {
21
+ bool lower_bounded = !std::isinf(lower_v.at(i));
22
+ bool upper_bounded = !std::isinf(upper_v.at(i));
23
+ upper_bounded_[i] = upper_bounded;
24
+ lower_bounded_[i] = lower_bounded;
25
+ }
26
+ this_dims_.nvars = orig_dims_.nvars;
27
+ this_dims_.nineqs = orig_dims_.nineqs + n_n + n_p;
28
+ this_dims_.neqs = orig_dims_.neqs;
29
+ }
30
+ virtual void pre_solve(const FatropVecBF &x_init, const FatropVecBF &s_init) override
31
+ {
32
+ x_start_[0].copy(x_init);
33
+ s_start_[0].copy(s_init.block(0, orig_dims_.nineqs));
34
+ };
35
+ virtual fatrop_int eval_lag_hess(
36
+ double obj_scale,
37
+ const FatropVecBF &primal_vars,
38
+ const FatropVecBF &slack_vars,
39
+ const FatropVecBF &lam) override
40
+ {
41
+ FatropVecBF slack_dummy_v = slack_dummy_[0];
42
+ update_slack_vars(slack_vars, slack_dummy_v);
43
+ orig_->eval_lag_hess(0.0, primal_vars, slack_dummy_v, lam);
44
+ // compute delta's
45
+ axpby(xi, primal_vars, -xi, x_start_[0], x_tmp_[0]);
46
+ axpby(xi, slack_vars.block(0, orig_dims_.nineqs), -xi, s_start_[0], s_tmp_[0]);
47
+ // iterate over all RSQrq's
48
+
49
+ {
50
+ OCPKKTMemory* OCP =&this->orig_->ocpkktmemory_;
51
+ // horizon length
52
+ fatrop_int K = OCP->K;
53
+ // offsets
54
+ const fatrop_int *offs_ux = (const fatrop_int *)OCP->aux.ux_offs.data();
55
+ OCPMACRO(MAT *, RSQrqt, _p);
56
+ VEC* x_tmp_p = (VEC*) x_tmp_[0];
57
+ OCPMACRO(fatrop_int *, nu, _p);
58
+ OCPMACRO(fatrop_int *, nx, _p);
59
+ for (fatrop_int k = 0; k < K; k++)
60
+ {
61
+ fatrop_int nu_k = nu_p[k];
62
+ fatrop_int nx_k = nx_p[k];
63
+ fatrop_int offs_ux_k = offs_ux[k];
64
+ // add xi to RSQrq diagonal
65
+ DIARE(nx_k + nu_k, xi, RSQrqt_p + k, 0, 0);
66
+ // add gradient to rq
67
+ ROWAD(nu_k + nx_k, 1.0, x_tmp_p, offs_ux_k, RSQrqt_p+k, nu_k + nx_k, 0);
68
+ }
69
+ }
70
+ return 0;
71
+ };
72
+
73
+ virtual fatrop_int eval_constr_jac(
74
+ const FatropVecBF &primal_vars,
75
+ const FatropVecBF &slack_vars) override
76
+ {
77
+ FatropVecBF slack_dummy_v = slack_dummy_[0];
78
+ update_slack_vars(slack_vars, slack_dummy_v);
79
+ orig_->eval_constr_jac(primal_vars, slack_dummy_v);
80
+ return 0;
81
+ };
82
+ void update_slack_vars(const FatropVecBF &slack_vars, FatropVecBF &slack_dummy)
83
+ {
84
+ fatrop_int offs_n = orig_dims_.nineqs;
85
+ fatrop_int offs_p = orig_dims_.nineqs + n_n;
86
+ for (fatrop_int i = 0; i < orig_dims_.nineqs; ++i)
87
+ {
88
+ slack_dummy.at(i) = slack_vars.at(i) - slack_vars.at(i + offs_n) + slack_vars.at(i + offs_p);
89
+ }
90
+ }
91
+ virtual fatrop_int eval_constraint_viol(
92
+ const FatropVecBF &primal_vars,
93
+ const FatropVecBF &slack_vars,
94
+ FatropVecBF &constraint_violation) override
95
+ {
96
+ FatropVecBF slack_dummy_v = slack_dummy_[0];
97
+ update_slack_vars(slack_vars, slack_dummy_v);
98
+ orig_->eval_constraint_viol(primal_vars, slack_dummy_v, constraint_violation);
99
+ return 0;
100
+ };
101
+ virtual fatrop_int eval_obj_grad(
102
+ double obj_scale,
103
+ const FatropVecBF &primal_vars,
104
+ const FatropVecBF &slack_vars,
105
+ FatropVecBF &gradient_x,
106
+ FatropVecBF &gradient_s) override
107
+ {
108
+ // compute delta's
109
+ axpby(xi, primal_vars, -xi, x_start_[0], gradient_x);
110
+ axpby(xi, slack_vars.block(0, orig_dims_.nineqs), -xi, s_start_[0], gradient_s.block(0, orig_dims_.nineqs));
111
+ gradient_s.block(orig_dims_.nineqs, n_n + n_p) = rho;
112
+ return 0;
113
+ };
114
+ virtual fatrop_int eval_obj(
115
+ double obj_scale,
116
+ const FatropVecBF &primal_vars,
117
+ const FatropVecBF &slack_vars,
118
+ double &res) override
119
+ {
120
+ // compute delta's
121
+ axpby(1.0, primal_vars, -1.0, x_start_[0], x_tmp_[0]);
122
+ axpby(1.0, slack_vars.block(0, orig_dims_.nineqs), -1.0, s_start_[0], s_tmp_[0]);
123
+ res = 0.5*xi*(sumsqr(x_tmp_[0]) + sumsqr(s_tmp_[0]));
124
+ res += rho * sum(slack_vars.block(orig_dims_.nineqs, n_n + n_p));
125
+ return 0;
126
+ };
127
+ void get_initialization(const FatropVecBF &primal_vars_orig, FatropVecBF &intialization)
128
+ {
129
+ intialization.block(0, orig_dims_.nvars).copy(primal_vars_orig.block(0, orig_dims_.nvars));
130
+ }
131
+ virtual fatrop_int eval_dual_inf(
132
+ double obj_scale,
133
+ const FatropVecBF &lam,
134
+ const FatropVecBF &grad_x,
135
+ const FatropVecBF &grad_s,
136
+ FatropVecBF &du_inf_x, FatropVecBF &du_inf_s_wo_z) override
137
+ {
138
+ auto du_inf_s_wo_z_or = du_inf_s_wo_z.block(0, orig_dims_.nineqs);
139
+ orig_->eval_dual_inf(obj_scale, lam, grad_x, grad_s, du_inf_x, du_inf_s_wo_z_or);
140
+ auto lam_I = lam.block(orig_dims_.neqs - orig_dims_.nineqs, orig_dims_.nineqs);
141
+ axpby(1.0, lam_I, 1.0, grad_s.block(orig_dims_.nineqs, n_n), du_inf_s_wo_z.block(orig_dims_.nineqs, n_n));
142
+ axpby(-1.0, lam_I, 1.0, grad_s.block(orig_dims_.nineqs + n_n, n_p), du_inf_s_wo_z.block(orig_dims_.nineqs + n_n, n_p));
143
+ return 0;
144
+ }
145
+ void update_sigma_gradb(double inertia, const FatropVecBF &sigma_s, const FatropVecBF &sigma_n, const FatropVecBF &sigma_p, const FatropVecBF &gradb_s, const FatropVecBF &gradb_n, const FatropVecBF &gradb_p, const FatropVecBF &sigma_update, const FatropVecBF &gradb_update)
146
+ {
147
+ for (int i = 0; i < orig_dims_.nineqs; ++i)
148
+ {
149
+ double sigma_updt = 1.0 / (1.0 / (sigma_s.at(i) + inertia + xi) + 1.0 / (sigma_n.at(i) + inertia) + 1.0 / (sigma_p.at(i) + inertia));
150
+ sigma_update.at(i) = sigma_updt - inertia;
151
+ gradb_update.at(i) = ((gradb_s.at(i)) / (sigma_s.at(i) + inertia + xi) - (gradb_n.at(i)) / (sigma_n.at(i) + inertia) + (gradb_p.at(i)) / (sigma_p.at(i) + inertia)) * sigma_updt;
152
+ }
153
+ }
154
+ void update_delta_snp(double inertia, const FatropVecBF &sigma_s, const FatropVecBF &sigma_n, const FatropVecBF &sigma_p, const FatropVecBF &gradb_s, const FatropVecBF &gradb_n, const FatropVecBF &gradb_p, const FatropVecBF &lam_I, const FatropVecBF &delta_s, const FatropVecBF &delta_n, const FatropVecBF &delta_p)
155
+ {
156
+ for (int i = 0; i < orig_dims_.nineqs; ++i)
157
+ {
158
+ double lam_I_i = lam_I.at(i);
159
+ delta_s.at(i) = (-gradb_s.at(i) + lam_I_i) / (sigma_s.at(i) + inertia+xi);
160
+ delta_n.at(i) = (-gradb_n.at(i) - lam_I_i) / (sigma_n.at(i) + inertia);
161
+ delta_p.at(i) = (-gradb_p.at(i) + lam_I_i) / (sigma_p.at(i) + inertia);
162
+ }
163
+ }
164
+
165
+ virtual fatrop_int solve_pd_sys(
166
+ const double inertia_correction_w,
167
+ const double inertia_correction_c,
168
+ const FatropVecBF &ux,
169
+ const FatropVecBF &lam,
170
+ const FatropVecBF &delta_s,
171
+ const FatropVecBF &sigma_total,
172
+ const FatropVecBF &gradb_total) override
173
+ {
174
+ // (todo) check if quadratic penalty on delta s is treated right
175
+ inertia_correction_w_cache = inertia_correction_w;
176
+ sigma_cache_[0].copy(sigma_total);
177
+ gradb_cache_[0].copy(gradb_total);
178
+ auto lam_I = lam.block(orig_dims_.neqs - orig_dims_.nineqs, orig_dims_.nineqs);
179
+ auto sigma_s = sigma_total.block(0, orig_dims_.nineqs);
180
+ auto sigma_n = sigma_total.block(orig_dims_.nineqs, n_n);
181
+ auto sigma_p = sigma_total.block(orig_dims_.nineqs + n_n, n_p);
182
+ auto gradb_s = gradb_total.block(0, orig_dims_.nineqs);
183
+ auto gradb_n = gradb_total.block(orig_dims_.nineqs, n_n);
184
+ auto gradb_p = gradb_total.block(orig_dims_.nineqs + n_n, n_p);
185
+ auto delta_s_or = delta_s.block(0, orig_dims_.nineqs);
186
+ auto delta_n = delta_s.block(orig_dims_.nineqs, n_n);
187
+ auto delta_p = delta_s.block(orig_dims_.nineqs + n_n, n_p);
188
+ update_sigma_gradb(inertia_correction_w, sigma_s, sigma_n, sigma_p, gradb_s, gradb_n, gradb_p, sigma_dummy_[0], gradb_dummy_[0]);
189
+ int ret = orig_->solve_pd_sys(inertia_correction_w, inertia_correction_c, ux, lam, delta_s.block(0, orig_dims_.nineqs), sigma_dummy_[0], gradb_dummy_[0]);
190
+ update_delta_snp(inertia_correction_w, sigma_s, sigma_n, sigma_p, gradb_s, gradb_n, gradb_p, lam_I, delta_s_or, delta_n, delta_p);
191
+ return ret;
192
+ };
193
+ virtual fatrop_int solve_soc_rhs(
194
+ const FatropVecBF &ux,
195
+ const FatropVecBF &lam,
196
+ const FatropVecBF &delta_s,
197
+ const FatropVecBF &cosntraint_violation) override
198
+ {
199
+ auto lam_I = lam.block(orig_dims_.neqs - orig_dims_.nineqs, orig_dims_.nineqs);
200
+ auto sigma_s = sigma_cache_[0].block(0, orig_dims_.nineqs);
201
+ auto sigma_n = sigma_cache_[0].block(orig_dims_.nineqs, n_n);
202
+ auto sigma_p = sigma_cache_[0].block(orig_dims_.nineqs + n_n, n_p);
203
+ auto gradb_s = gradb_cache_[0].block(0, orig_dims_.nineqs);
204
+ auto gradb_n = gradb_cache_[0].block(orig_dims_.nineqs, n_n);
205
+ auto gradb_p = gradb_cache_[0].block(orig_dims_.nineqs + n_n, n_p);
206
+ auto delta_s_or = delta_s.block(0, orig_dims_.nineqs);
207
+ auto delta_n = delta_s.block(orig_dims_.nineqs, n_n);
208
+ auto delta_p = delta_s.block(orig_dims_.nineqs + n_n, n_p);
209
+ int ret = orig_->solve_soc_rhs(ux, lam, delta_s.block(0, orig_dims_.nineqs), cosntraint_violation);
210
+ update_delta_snp(inertia_correction_w_cache + xi, sigma_s, sigma_n, sigma_p, gradb_s, gradb_n, gradb_p, lam_I, delta_s_or, delta_n, delta_p);
211
+ return ret;
212
+ }
213
+ virtual NLPDims get_nlp_dims() const override { return this_dims_; };
214
+ virtual fatrop_int compute_scalings(
215
+ double &obj_scale,
216
+ FatropVecBF &x_scales,
217
+ FatropVecBF &lam_scales,
218
+ const FatropVecBF &grad_curr_x, const FatropVecBF &grad_curr_s) override
219
+ {
220
+ return orig_->compute_scalings(obj_scale, x_scales, lam_scales, grad_curr_x, grad_curr_s);
221
+ };
222
+ virtual fatrop_int initialize_slacks(double mu0,
223
+ FatropVecBF &s_curr) override
224
+ {
225
+ auto s_curr_or = s_curr.block(0, orig_dims_.nineqs);
226
+ auto n_curr = s_curr.block(orig_dims_.nineqs, n_n);
227
+ auto p_curr = s_curr.block(orig_dims_.nineqs + n_n, n_p);
228
+ FatropVecBF ineq_viol = s_tmp_[0];
229
+ int ret = orig_->initialize_slacks(mu0, ineq_viol);
230
+ for (int i = 0; i < orig_dims_.nineqs; i++)
231
+ {
232
+ double viol = 0.0;
233
+ viol = (ineq_viol.at(i));
234
+ double n_init = (mu0 - rho * viol) / (2 * rho) + std::sqrt(std::pow((mu0 - rho * viol) / (2 * rho), 2) + mu0 * viol / (2 * rho));
235
+ // if viol >>>> 0 -> n_init = 0 if viol <<< 0 n_init = viol
236
+ n_curr.at(i) = n_init;
237
+ p_curr.at(i) = viol + n_init;
238
+ }
239
+ return 0;
240
+ }
241
+ virtual fatrop_int initialize_dual(
242
+ const FatropVecBF &grad_x,
243
+ const FatropVecBF &grad_s,
244
+ FatropVecBF &dlam,
245
+ const FatropVecBF &zL,
246
+ const FatropVecBF &zU) override
247
+ {
248
+ // todo check if this is correct
249
+ // return orig_->initialize_dual(grad_x, grad_s, dlam, zL.block(0, orig_dims_.nineqs), zU.block(0, orig_dims_.nineqs));
250
+ return 0;
251
+ };
252
+ virtual fatrop_int get_bounds(
253
+ FatropVecBF &lower,
254
+ FatropVecBF &upper) const override
255
+ {
256
+ orig_->get_bounds(lower, upper);
257
+ lower.block(orig_dims_.nineqs, n_n) = 0.0;
258
+ lower.block(orig_dims_.nineqs + n_n, n_p) = 0.0;
259
+ upper.block(orig_dims_.nineqs, n_n) = std::numeric_limits<double>::infinity();
260
+ upper.block(orig_dims_.nineqs + n_n, n_p) = std::numeric_limits<double>::infinity();
261
+ return 0;
262
+ };
263
+ virtual fatrop_int get_initial_sol_guess(
264
+ FatropVecBF &initial) const override
265
+ {
266
+ orig_->get_initial_sol_guess(initial);
267
+ return 0;
268
+ }
269
+ virtual void update_mu(double mu) override
270
+ {
271
+ xi = std::sqrt(mu);
272
+ orig_->update_mu(mu);
273
+ };
274
+ virtual void reset() override
275
+ {
276
+ orig_->reset();
277
+ };
278
+ std::shared_ptr<FatropOCP> orig_;
279
+ NLPDims orig_dims_;
280
+ NLPDims this_dims_;
281
+ FatropMemoryVecBF lower_, upper_;
282
+ FatropMemoryVecBF x_start_, s_start_;
283
+ FatropMemoryVecBF x_tmp_, s_tmp_;
284
+ std::vector<bool> upper_bounded_;
285
+ std::vector<bool> lower_bounded_;
286
+ fatrop_int n_p = 0;
287
+ fatrop_int n_n = 0;
288
+ FatropMemoryVecBF slack_dummy_;
289
+ FatropMemoryVecBF sigma_dummy_;
290
+ FatropMemoryVecBF gradb_dummy_;
291
+ FatropMemoryVecBF zl_dummy_;
292
+ FatropMemoryVecBF zu_dummy_;
293
+ double inertia_correction_w_cache = 0.0;
294
+ FatropMemoryVecBF sigma_cache_;
295
+ FatropMemoryVecBF gradb_cache_;
296
+ double rho = 1e4;
297
+ double xi = 1.0;
298
+ };
299
+ };