casadi 3.6.4__cp27-none-manylinux1_i686.whl → 3.6.6__cp27-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 (257) hide show
  1. casadi/_casadi.so +0 -0
  2. casadi/casadi.py +982 -498
  3. casadi/cbc +0 -0
  4. casadi/clp +0 -0
  5. casadi/cmake/casadi-config-version.cmake +1 -1
  6. casadi/include/casadi/casadi.i +33 -15
  7. casadi/include/casadi/casadi_c.h +2 -0
  8. casadi/include/casadi/config.h +8 -8
  9. casadi/include/casadi/core/casadi_common.hpp +1 -0
  10. casadi/include/casadi/core/casadi_misc.hpp +13 -0
  11. casadi/include/casadi/core/casadi_types.hpp +3 -2
  12. casadi/include/casadi/core/code_generator.hpp +59 -2
  13. casadi/include/casadi/core/core.hpp +1 -0
  14. casadi/include/casadi/core/generic_expression.hpp +1 -1
  15. casadi/include/casadi/core/generic_type.hpp +25 -1
  16. casadi/include/casadi/core/global_options.hpp +2 -0
  17. casadi/include/casadi/core/matrix_decl.hpp +15 -0
  18. casadi/include/casadi/core/mx.hpp +13 -3
  19. casadi/include/casadi/core/optistack.hpp +23 -0
  20. casadi/include/casadi/core/runtime/casadi_nlp.hpp +133 -6
  21. casadi/include/casadi/core/runtime/casadi_ocp_block.hpp +55 -0
  22. casadi/include/casadi/core/runtime/casadi_oracle.hpp +44 -0
  23. casadi/include/casadi/core/runtime/casadi_oracle_callback.hpp +39 -0
  24. casadi/include/casadi/core/runtime/casadi_runtime.hpp +4 -1
  25. casadi/include/casadi/core/runtime/casadi_scaled_copy.hpp +31 -0
  26. casadi/include/casadi/core/runtime/casadi_sqpmethod.hpp +11 -1
  27. casadi/include/casadi/core/serializing_stream.hpp +2 -2
  28. casadi/include/casadi/core/sparsity.hpp +12 -3
  29. casadi/include/casadi/core/tools.hpp +67 -0
  30. casadi/include/casadi/doc.i +2283 -1491
  31. casadi/include/casadi/doc_merged.i +1522 -1065
  32. casadi/include/casadi/mem.h +1 -0
  33. casadi/include/coin-or/IpAlgBuilder.hpp +417 -0
  34. casadi/include/coin-or/IpAlgStrategy.hpp +201 -0
  35. casadi/include/coin-or/IpAlgTypes.hpp +64 -0
  36. casadi/include/coin-or/IpAugSystemSolver.hpp +212 -0
  37. casadi/include/coin-or/IpBlas.hpp +426 -0
  38. casadi/include/coin-or/IpCachedResults.hpp +897 -0
  39. casadi/include/coin-or/IpCompoundMatrix.hpp +423 -0
  40. casadi/include/coin-or/IpCompoundSymMatrix.hpp +348 -0
  41. casadi/include/coin-or/IpCompoundVector.hpp +395 -0
  42. casadi/include/coin-or/IpConvCheck.hpp +97 -0
  43. casadi/include/coin-or/IpDebug.hpp +167 -0
  44. casadi/include/coin-or/IpDenseVector.hpp +626 -0
  45. casadi/include/coin-or/IpDiagMatrix.hpp +158 -0
  46. casadi/include/coin-or/IpEqMultCalculator.hpp +76 -0
  47. casadi/include/coin-or/IpException.hpp +156 -0
  48. casadi/include/coin-or/IpExpansionMatrix.hpp +245 -0
  49. casadi/include/coin-or/IpGenTMatrix.hpp +290 -0
  50. casadi/include/coin-or/IpHessianUpdater.hpp +73 -0
  51. casadi/include/coin-or/IpIdentityMatrix.hpp +167 -0
  52. casadi/include/coin-or/IpIpoptAlg.hpp +257 -0
  53. casadi/include/coin-or/IpIpoptApplication.hpp +367 -0
  54. casadi/include/coin-or/IpIpoptCalculatedQuantities.hpp +1009 -0
  55. casadi/include/coin-or/IpIpoptData.hpp +966 -0
  56. casadi/include/coin-or/IpIpoptNLP.hpp +328 -0
  57. casadi/include/coin-or/IpIterateInitializer.hpp +68 -0
  58. casadi/include/coin-or/IpIteratesVector.hpp +840 -0
  59. casadi/include/coin-or/IpIterationOutput.hpp +78 -0
  60. casadi/include/coin-or/IpJournalist.hpp +573 -0
  61. casadi/include/coin-or/IpLapack.hpp +227 -0
  62. casadi/include/coin-or/IpLibraryLoader.hpp +76 -0
  63. casadi/include/coin-or/IpLineSearch.hpp +106 -0
  64. casadi/include/coin-or/IpLinearSolvers.h +46 -0
  65. casadi/include/coin-or/IpMatrix.hpp +434 -0
  66. casadi/include/coin-or/IpMuUpdate.hpp +77 -0
  67. casadi/include/coin-or/IpNLP.hpp +306 -0
  68. casadi/include/coin-or/IpNLPScaling.hpp +582 -0
  69. casadi/include/coin-or/IpObserver.hpp +422 -0
  70. casadi/include/coin-or/IpOptionsList.hpp +412 -0
  71. casadi/include/coin-or/IpOrigIpoptNLP.hpp +603 -0
  72. casadi/include/coin-or/IpPDSystemSolver.hpp +137 -0
  73. casadi/include/coin-or/IpReferenced.hpp +262 -0
  74. casadi/include/coin-or/IpRegOptions.hpp +1152 -0
  75. casadi/include/coin-or/IpReturnCodes.h +23 -0
  76. casadi/include/coin-or/IpReturnCodes.hpp +18 -0
  77. casadi/include/coin-or/IpReturnCodes.inc +71 -0
  78. casadi/include/coin-or/IpReturnCodes_inc.h +45 -0
  79. casadi/include/coin-or/IpScaledMatrix.hpp +291 -0
  80. casadi/include/coin-or/IpSearchDirCalculator.hpp +72 -0
  81. casadi/include/coin-or/IpSmartPtr.hpp +865 -0
  82. casadi/include/coin-or/IpSolveStatistics.hpp +210 -0
  83. casadi/include/coin-or/IpSparseSymLinearSolverInterface.hpp +260 -0
  84. casadi/include/coin-or/IpStdAugSystemSolver.cpp +555 -0
  85. casadi/include/coin-or/IpStdCInterface.h +428 -0
  86. casadi/include/coin-or/IpSumSymMatrix.hpp +186 -0
  87. casadi/include/coin-or/IpSymLinearSolver.hpp +141 -0
  88. casadi/include/coin-or/IpSymMatrix.hpp +167 -0
  89. casadi/include/coin-or/IpSymScaledMatrix.hpp +255 -0
  90. casadi/include/coin-or/IpSymTMatrix.hpp +275 -0
  91. casadi/include/coin-or/IpTNLP.hpp +820 -0
  92. casadi/include/coin-or/IpTNLPAdapter.hpp +648 -0
  93. casadi/include/coin-or/IpTNLPReducer.hpp +274 -0
  94. casadi/include/coin-or/IpTaggedObject.hpp +128 -0
  95. casadi/include/coin-or/IpTimedTask.hpp +218 -0
  96. casadi/include/coin-or/IpTimingStatistics.hpp +323 -0
  97. casadi/include/coin-or/IpTripletHelper.hpp +308 -0
  98. casadi/include/coin-or/IpTypes.h +81 -0
  99. casadi/include/coin-or/IpTypes.hpp +30 -0
  100. casadi/include/coin-or/IpUtils.hpp +166 -0
  101. casadi/include/coin-or/IpVector.hpp +892 -0
  102. casadi/include/coin-or/IpZeroSymMatrix.hpp +155 -0
  103. casadi/include/coin-or/IpoptConfig.h +45 -0
  104. casadi/include/coin-or/SensAlgorithm.hpp +114 -0
  105. casadi/include/coin-or/SensApplication.hpp +188 -0
  106. casadi/include/coin-or/SensBacksolver.hpp +36 -0
  107. casadi/include/coin-or/SensMeasurement.hpp +56 -0
  108. casadi/include/coin-or/SensPCalculator.hpp +137 -0
  109. casadi/include/coin-or/SensRegOp.hpp +21 -0
  110. casadi/include/coin-or/SensSchurData.hpp +182 -0
  111. casadi/include/coin-or/SensSchurDriver.hpp +118 -0
  112. casadi/include/coin-or/SensSimpleBacksolver.hpp +49 -0
  113. casadi/include/coin-or/SensStepCalc.hpp +85 -0
  114. casadi/include/coin-or/SensUtils.hpp +63 -0
  115. casadi/include/coin-or/metis/defs.h +161 -0
  116. casadi/include/coin-or/metis/macros.h +143 -0
  117. casadi/include/coin-or/metis/metis.h +37 -0
  118. casadi/include/coin-or/metis/proto.h +505 -0
  119. casadi/include/coin-or/metis/rename.h +418 -0
  120. casadi/include/coin-or/metis/struct.h +251 -0
  121. casadi/include/coin-or/mumps/dmumps_c.h +142 -0
  122. casadi/include/coin-or/mumps/mumps_c_types.h +72 -0
  123. casadi/include/coin-or/mumps/mumps_compat.h +27 -0
  124. casadi/include/coin-or/mumps/mumps_int_def.h +11 -0
  125. casadi/include/coin-or/mumps/mumps_mpi.h +67 -0
  126. casadi/include/daqp/api.h +46 -0
  127. casadi/include/daqp/auxiliary.h +29 -0
  128. casadi/include/daqp/bnb.h +32 -0
  129. casadi/include/daqp/codegen.h +18 -0
  130. casadi/include/daqp/constants.h +92 -0
  131. casadi/include/daqp/daqp.h +22 -0
  132. casadi/include/daqp/daqp_prox.h +18 -0
  133. casadi/include/daqp/factorization.h +18 -0
  134. casadi/include/daqp/types.h +161 -0
  135. casadi/include/daqp/utils.h +44 -0
  136. casadi/include/licenses/daqp-external/LICENSE +21 -0
  137. casadi/include/osqp/constants.h +2 -3
  138. casadi/include/osqp/version.h +9 -0
  139. casadi/lib/libtinyxml2.a +0 -0
  140. casadi/libCbc.so +0 -0
  141. casadi/libCbc.so.3 +0 -0
  142. casadi/libCbc.so.3.10.11 +0 -0
  143. casadi/libCbcSolver.so +0 -0
  144. casadi/libCbcSolver.so.3 +0 -0
  145. casadi/libCbcSolver.so.3.10.11 +0 -0
  146. casadi/libCgl.so +0 -0
  147. casadi/libCgl.so.1 +0 -0
  148. casadi/libCgl.so.1.10.8 +0 -0
  149. casadi/libClp.so +0 -0
  150. casadi/libClp.so.1 +0 -0
  151. casadi/libClp.so.1.14.9 +0 -0
  152. casadi/libClpSolver.so +0 -0
  153. casadi/libClpSolver.so.1 +0 -0
  154. casadi/libClpSolver.so.1.14.9 +0 -0
  155. casadi/libCoinUtils.so +0 -0
  156. casadi/libCoinUtils.so.3 +0 -0
  157. casadi/libCoinUtils.so.3.11.10 +0 -0
  158. casadi/libOsi.so +0 -0
  159. casadi/libOsi.so.1 +0 -0
  160. casadi/libOsi.so.1.13.9 +0 -0
  161. casadi/libOsiCbc.so +0 -0
  162. casadi/libOsiCbc.so.3 +0 -0
  163. casadi/libOsiCbc.so.3.10.11 +0 -0
  164. casadi/libOsiClp.so +0 -0
  165. casadi/libOsiClp.so.1 +0 -0
  166. casadi/libOsiClp.so.1.14.9 +0 -0
  167. casadi/libOsiCommonTests.so +0 -0
  168. casadi/libOsiCommonTests.so.1 +0 -0
  169. casadi/libOsiCommonTests.so.1.13.9 +0 -0
  170. casadi/libbonmin.so +0 -0
  171. casadi/libbonmin.so.4 +0 -0
  172. casadi/libbonmin.so.4.8.9 +0 -0
  173. casadi/libcasadi.so +0 -0
  174. casadi/libcasadi.so.3.7 +0 -0
  175. casadi/libcasadi_conic_cbc.so +0 -0
  176. casadi/libcasadi_conic_cbc.so.3.7 +0 -0
  177. casadi/libcasadi_conic_clp.so +0 -0
  178. casadi/libcasadi_conic_clp.so.3.7 +0 -0
  179. casadi/libcasadi_conic_daqp.so +0 -0
  180. casadi/libcasadi_conic_daqp.so.3.7 +0 -0
  181. casadi/libcasadi_conic_gurobi.so +0 -0
  182. casadi/libcasadi_conic_gurobi.so.3.7 +0 -0
  183. casadi/libcasadi_conic_ipqp.so +0 -0
  184. casadi/libcasadi_conic_ipqp.so.3.7 +0 -0
  185. casadi/libcasadi_conic_nlpsol.so +0 -0
  186. casadi/libcasadi_conic_nlpsol.so.3.7 +0 -0
  187. casadi/libcasadi_conic_osqp.so +0 -0
  188. casadi/libcasadi_conic_osqp.so.3.7 +0 -0
  189. casadi/libcasadi_conic_qpoases.so +0 -0
  190. casadi/libcasadi_conic_qpoases.so.3.7 +0 -0
  191. casadi/libcasadi_conic_qrqp.so +0 -0
  192. casadi/libcasadi_conic_qrqp.so.3.7 +0 -0
  193. casadi/libcasadi_conic_superscs.so +0 -0
  194. casadi/libcasadi_conic_superscs.so.3.7 +0 -0
  195. casadi/libcasadi_integrator_collocation.so +0 -0
  196. casadi/libcasadi_integrator_collocation.so.3.7 +0 -0
  197. casadi/libcasadi_integrator_cvodes.so +0 -0
  198. casadi/libcasadi_integrator_cvodes.so.3.7 +0 -0
  199. casadi/libcasadi_integrator_idas.so +0 -0
  200. casadi/libcasadi_integrator_idas.so.3.7 +0 -0
  201. casadi/libcasadi_integrator_rk.so +0 -0
  202. casadi/libcasadi_integrator_rk.so.3.7 +0 -0
  203. casadi/libcasadi_nlpsol_ampl.so +0 -0
  204. casadi/libcasadi_nlpsol_ampl.so.3.7 +0 -0
  205. casadi/libcasadi_nlpsol_blocksqp.so +0 -0
  206. casadi/libcasadi_nlpsol_blocksqp.so.3.7 +0 -0
  207. casadi/libcasadi_nlpsol_bonmin.so +0 -0
  208. casadi/libcasadi_nlpsol_bonmin.so.3.7 +0 -0
  209. casadi/libcasadi_nlpsol_feasiblesqpmethod.so +0 -0
  210. casadi/libcasadi_nlpsol_feasiblesqpmethod.so.3.7 +0 -0
  211. casadi/libcasadi_nlpsol_ipopt.so +0 -0
  212. casadi/libcasadi_nlpsol_ipopt.so.3.7 +0 -0
  213. casadi/libcasadi_nlpsol_knitro.so +0 -0
  214. casadi/libcasadi_nlpsol_knitro.so.3.7 +0 -0
  215. casadi/libcasadi_nlpsol_madnlp.so +0 -0
  216. casadi/libcasadi_nlpsol_madnlp.so.3.7 +0 -0
  217. casadi/libcasadi_nlpsol_qrsqp.so +0 -0
  218. casadi/libcasadi_nlpsol_qrsqp.so.3.7 +0 -0
  219. casadi/libcasadi_nlpsol_scpgen.so +0 -0
  220. casadi/libcasadi_nlpsol_scpgen.so.3.7 +0 -0
  221. casadi/libcasadi_nlpsol_snopt.so +0 -0
  222. casadi/libcasadi_nlpsol_snopt.so.3.7 +0 -0
  223. casadi/libcasadi_nlpsol_sqpmethod.so +0 -0
  224. casadi/libcasadi_nlpsol_sqpmethod.so.3.7 +0 -0
  225. casadi/libcasadi_nlpsol_worhp.so +0 -0
  226. casadi/libcasadi_nlpsol_worhp.so.3.7 +0 -0
  227. casadi/libcasadi_rootfinder_fast_newton.so +0 -0
  228. casadi/libcasadi_rootfinder_fast_newton.so.3.7 +0 -0
  229. casadi/libcasadi_rootfinder_kinsol.so +0 -0
  230. casadi/libcasadi_rootfinder_kinsol.so.3.7 +0 -0
  231. casadi/libcasadi_rootfinder_newton.so +0 -0
  232. casadi/libcasadi_rootfinder_newton.so.3.7 +0 -0
  233. casadi/libcasadi_rootfinder_nlpsol.so +0 -0
  234. casadi/libcasadi_rootfinder_nlpsol.so.3.7 +0 -0
  235. casadi/libcasadi_sundials_common.so +0 -0
  236. casadi/libcasadi_sundials_common.so.3.7 +0 -0
  237. casadi/libdaqp.so +0 -0
  238. casadi/libdaqpstat.a +0 -0
  239. casadi/libindirect.a +0 -0
  240. casadi/libipopt.so +0 -0
  241. casadi/libipopt.so.3 +0 -0
  242. casadi/libipopt.so.3.14.11 +0 -0
  243. casadi/liblinsys.a +0 -0
  244. casadi/libmatlab_ipc.so +0 -0
  245. casadi/libosqp.a +0 -0
  246. casadi/libosqp.so +0 -0
  247. casadi/libqdldl.a +0 -0
  248. casadi/libsipopt.so +0 -0
  249. casadi/libsipopt.so.3 +0 -0
  250. casadi/libsipopt.so.3.14.11 +0 -0
  251. casadi/libsuperscs.a +0 -0
  252. casadi/pkgconfig/casadi.pc +1 -1
  253. casadi/tools/__init__.py +4 -0
  254. casadi/tools/bounds.py +3 -3
  255. {casadi-3.6.4.dist-info → casadi-3.6.6.dist-info}/METADATA +12 -4
  256. {casadi-3.6.4.dist-info → casadi-3.6.6.dist-info}/RECORD +257 -140
  257. {casadi-3.6.4.dist-info → casadi-3.6.6.dist-info}/WHEEL +0 -0
@@ -0,0 +1,137 @@
1
+ // Copyright 2009, 2011 Hans Pirnay
2
+ // All Rights Reserved.
3
+ // This code is published under the Eclipse Public License.
4
+ //
5
+ // Date : 2009-05-06
6
+
7
+ #ifndef __ASPCALCULATOR_HPP__
8
+ #define __ASPCALCULATOR_HPP__
9
+
10
+ #include "IpAlgStrategy.hpp"
11
+ #include "SensSimpleBacksolver.hpp"
12
+ #include "SensSchurData.hpp"
13
+
14
+ namespace Ipopt
15
+ {
16
+
17
+ /** This class is the interface for implementations of any class that calculates the matrix \f$P =K^{-1}A\f$
18
+ * of the following matrix:
19
+ * \f[
20
+ * \left(\begin{array}{cc}
21
+ * K & A\\
22
+ * B & 0
23
+ * \end{array}\right)
24
+ * \f]
25
+ */
26
+ class SIPOPTLIB_EXPORT PCalculator: public AlgorithmStrategyObject
27
+ {
28
+ public:
29
+ PCalculator(
30
+ SmartPtr<SensBacksolver> backsolver,
31
+ SmartPtr<SchurData> A_data
32
+ )
33
+ : backsolver_(backsolver),
34
+ data_A_init(ConstPtr(A_data->MakeNewSchurDataCopy())),
35
+ data_A_(A_data)
36
+ { }
37
+
38
+ virtual ~PCalculator()
39
+ { }
40
+
41
+ /* Overloaded from AlgorithmStrategyObject */
42
+ virtual bool InitializeImpl(
43
+ const OptionsList& /*options*/,
44
+ const std::string& /*prefix*/
45
+ )
46
+ {
47
+ return true;
48
+ }
49
+
50
+ /** Function to start the computation of P from E_0 and KKT*/
51
+ virtual bool ComputeP() = 0;
52
+
53
+ /** Function to extract a SchurMatrix corresponding to $B K^{-1} A$.
54
+ *
55
+ * If B==NULL, use A=B.
56
+ */
57
+ virtual bool GetSchurMatrix(
58
+ const SmartPtr<const SchurData>& B,
59
+ SmartPtr<Matrix>& S
60
+ ) = 0;
61
+
62
+ virtual void PrintImpl(
63
+ const Journalist& jnlst,
64
+ EJournalLevel level,
65
+ EJournalCategory category,
66
+ const std::string& name,
67
+ Index indent,
68
+ const std::string& prefix
69
+ ) const = 0;
70
+
71
+ void Print(
72
+ const Journalist& jnlst,
73
+ EJournalLevel level,
74
+ EJournalCategory category,
75
+ const std::string& name,
76
+ Index indent = 0,
77
+ const std::string& prefix = ""
78
+ ) const
79
+ {
80
+ if( jnlst.ProduceOutput(level, category) )
81
+ {
82
+ PrintImpl(jnlst, level, category, name, indent, prefix);
83
+ }
84
+ }
85
+
86
+ void Print(
87
+ SmartPtr<const Journalist> jnlst,
88
+ EJournalLevel level,
89
+ EJournalCategory category,
90
+ const std::string& name,
91
+ Index indent,
92
+ const std::string& prefix
93
+ ) const
94
+ {
95
+ if( IsValid(jnlst) && jnlst->ProduceOutput(level, category) )
96
+ {
97
+ PrintImpl(*jnlst, level, category, name, indent, prefix);
98
+ }
99
+ }
100
+
101
+ /** Accessor methods for data and backsolver.
102
+ *
103
+ * This unconstness seems
104
+ * kind of dangerous but I don't think there is a way around it. Anyway,
105
+ * there is no difference between this and the IpData() method of AlgStrategy.
106
+ */
107
+ SmartPtr<SensBacksolver> Solver() const
108
+ {
109
+ return backsolver_;
110
+ }
111
+
112
+ SmartPtr<const SchurData> data_A() const
113
+ {
114
+ return ConstPtr(data_A_);
115
+ }
116
+
117
+ SmartPtr<SchurData> data_A_nonconst() const
118
+ {
119
+ return data_A_;
120
+ }
121
+
122
+ void reset_data_A()
123
+ {
124
+ data_A_ = data_A_init->MakeNewSchurDataCopy();
125
+ }
126
+
127
+ private:
128
+
129
+ SmartPtr<SensBacksolver> backsolver_;
130
+
131
+ SmartPtr<const SchurData> data_A_init;
132
+ SmartPtr<SchurData> data_A_;
133
+ };
134
+
135
+ }
136
+
137
+ #endif
@@ -0,0 +1,21 @@
1
+ // Copyright 2009, 2011 Hans Pirnay
2
+ // All Rights Reserved.
3
+ // This code is published under the Eclipse Public License.
4
+
5
+ #ifndef __SENSREGOP_HPP__
6
+ #define __SENSREGOP_HPP__
7
+
8
+ #include "IpSmartPtr.hpp"
9
+
10
+ namespace Ipopt
11
+ {
12
+
13
+ class RegisteredOptions;
14
+
15
+ SIPOPTLIB_EXPORT void RegisterOptions_sIPOPT(
16
+ const SmartPtr<RegisteredOptions>& roptions
17
+ );
18
+
19
+ } // namespace Ipopt
20
+
21
+ #endif
@@ -0,0 +1,182 @@
1
+ // Copyright 2009, 2011 Hans Pirnay
2
+ // All Rights Reserved.
3
+ // This code is published under the Eclipse Public License.
4
+ //
5
+ // Date : 2009-05-06
6
+
7
+ #ifndef __ASSCHURDATA_HPP__
8
+ #define __ASSCHURDATA_HPP__
9
+
10
+ #include "IpVector.hpp"
11
+ #include "IpIteratesVector.hpp"
12
+ #include <vector>
13
+
14
+ namespace Ipopt
15
+ {
16
+
17
+ /** This interface serves as a reference point for multiple classes
18
+ * that need to use SchurData (PCalculator, SchurDriver).
19
+ *
20
+ * It declares as little as possible, so that SchurData implementations
21
+ * can be very special and fast.
22
+ *
23
+ * I have not decided yet if there are certain ways I want to impose
24
+ * that SchurData can be set. I will figure this out as soon as I
25
+ * write the upstream classes that need to do that
26
+ *
27
+ * Nomenclature in this program is based on Victor Zavalas thesis.
28
+ */
29
+ class SIPOPTLIB_EXPORT SchurData: public ReferencedObject
30
+ {
31
+ public:
32
+ SchurData()
33
+ : initialized_(false),
34
+ nrows_(0)
35
+ { }
36
+
37
+ virtual ~SchurData()
38
+ { }
39
+
40
+ virtual SmartPtr<SchurData> MakeNewSchurDataCopy() const = 0;
41
+
42
+ /* Functions to set the Schurdata. At least one must be overloaded */
43
+
44
+ /** Set Data to one for given indices. Size of vector is ipopt_x_<full_x_ */
45
+ virtual void SetData_Flag(
46
+ Index dim,
47
+ const Index* flags,
48
+ Number v = 1.0
49
+ ) = 0;
50
+
51
+ /** Set Data to corresponing Number */
52
+ virtual void SetData_Flag(
53
+ Index dim,
54
+ const Index* flags,
55
+ const Number* values
56
+ ) = 0;
57
+
58
+ virtual Index SetData_Index(
59
+ Index dim,
60
+ const Index* flags,
61
+ Number v = 1.0
62
+ ) = 0;
63
+
64
+ virtual void SetData_List(
65
+ const std::vector<Index>& list,
66
+ Number v = 1.0
67
+ ) = 0;
68
+
69
+ virtual void AddData_List(
70
+ std::vector<Index> cols,
71
+ std::vector<Index>& delta_u_sort,
72
+ Index& new_du_size,
73
+ Index v
74
+ ) = 0;
75
+
76
+ /** Returns number of rows/columns in schur matrix */
77
+ virtual Index GetNRowsAdded() const
78
+ {
79
+ return nrows_;
80
+ }
81
+
82
+ virtual bool Is_Initialized() const
83
+ {
84
+ return initialized_;
85
+ }
86
+
87
+ /** Returns the i-th column vector of the matrix */
88
+ virtual void GetRow(
89
+ Index i,
90
+ IteratesVector& v
91
+ ) const = 0;
92
+
93
+ /** Returns two vectors that are needed for matrix-vector
94
+ * multiplication of B and P.
95
+ *
96
+ * The index is the row, the first vector are the indices
97
+ * of non-zero components, in this row of B,
98
+ * the second vector gives the numbers in B(row,indices)/
99
+ */
100
+ virtual void GetMultiplyingVectors(
101
+ Index row,
102
+ std::vector<Index>& indices,
103
+ std::vector<Number>& factors
104
+ ) const = 0;
105
+
106
+ /** Computes B*v with B in R(mxn) */
107
+ virtual void Multiply(
108
+ const IteratesVector& v,
109
+ Vector& u
110
+ ) const = 0;
111
+
112
+ /** Computes A*u with A in R(nxm), KKT in R(n,n) */
113
+ virtual void TransMultiply(
114
+ const Vector& u,
115
+ IteratesVector& v
116
+ ) const = 0;
117
+
118
+ virtual void PrintImpl(
119
+ const Journalist& jnlst,
120
+ EJournalLevel level,
121
+ EJournalCategory category,
122
+ const std::string& name,
123
+ Index indent,
124
+ const std::string& prefix
125
+ ) const = 0;
126
+
127
+ void Print(
128
+ const Journalist& jnlst,
129
+ EJournalLevel level,
130
+ EJournalCategory category,
131
+ const std::string& name,
132
+ Index indent = 0,
133
+ const std::string& prefix = ""
134
+ ) const
135
+ {
136
+ if( jnlst.ProduceOutput(level, category) )
137
+ {
138
+ PrintImpl(jnlst, level, category, name, indent, prefix);
139
+ }
140
+ }
141
+
142
+ void Print(
143
+ SmartPtr<const Journalist> jnlst,
144
+ EJournalLevel level,
145
+ EJournalCategory category,
146
+ const std::string& name,
147
+ Index indent,
148
+ const std::string& prefix
149
+ ) const
150
+ {
151
+ if( IsValid(jnlst) && jnlst->ProduceOutput(level, category) )
152
+ {
153
+ PrintImpl(*jnlst, level, category, name, indent, prefix);
154
+ }
155
+ }
156
+
157
+ protected:
158
+
159
+ virtual void Set_Initialized()
160
+ {
161
+ initialized_ = true;
162
+ }
163
+
164
+ virtual void Set_NRows(
165
+ Index nrows
166
+ )
167
+ {
168
+ nrows_ = nrows;
169
+ }
170
+
171
+ private:
172
+
173
+ /** Makes sure that data is not set twice accidentially */
174
+ bool initialized_;
175
+
176
+ /** Number of columns/rows of corresponding Schur Matrix*/
177
+ Index nrows_;
178
+ };
179
+
180
+ }
181
+
182
+ #endif
@@ -0,0 +1,118 @@
1
+ // Copyright 2009, 2011 Hans Pirnay
2
+ // All Rights Reserved.
3
+ // This code is published under the Eclipse Public License.
4
+ //
5
+ // Date : 2009-05-06
6
+
7
+ #ifndef __ASSCHURDRIVER_HPP__
8
+ #define __ASSCHURDRIVER_HPP__
9
+
10
+ #include "SensSchurData.hpp"
11
+ #include "SensPCalculator.hpp"
12
+ #include "IpVector.hpp"
13
+ #include "IpIteratesVector.hpp"
14
+
15
+ namespace Ipopt
16
+ {
17
+
18
+ /** This class is the interface for any class that deals with the Schur matrix
19
+ * from the point when it is constructed by the PCalculator to the solution
20
+ * against one vector.
21
+ *
22
+ * Specific implementations may also incorporate the
23
+ * treatment of adding rows/cols (like QPSchur).
24
+ *
25
+ * The computations done by this class are
26
+ * 1. Solve \f$S \Delta\nu = r_s\f$
27
+ * 2. Solve \f$K\Delta s = ... - \Delta nu\f$ (really?)
28
+ */
29
+ class SIPOPTLIB_EXPORT SchurDriver: public AlgorithmStrategyObject
30
+ {
31
+ public:
32
+
33
+ SchurDriver(
34
+ SmartPtr<PCalculator> pcalc,
35
+ SmartPtr<SchurData> data_B
36
+ )
37
+ : pcalc_(pcalc),
38
+ data_B_(data_B)
39
+ { }
40
+
41
+ virtual ~SchurDriver()
42
+ { }
43
+
44
+ virtual bool InitializeImpl(
45
+ const OptionsList& /*options*/,
46
+ const std::string& /*prefix*/
47
+ )
48
+ {
49
+ return true;
50
+ }
51
+
52
+ /** Const accessor methods to the SchurData for for the derived classes */
53
+ virtual SmartPtr<const SchurData> data_A() const
54
+ {
55
+ return pcalc_->data_A();
56
+ }
57
+
58
+ virtual SmartPtr<const SchurData> data_B() const
59
+ {
60
+ return ConstPtr(data_B_);
61
+ }
62
+
63
+ virtual SmartPtr<SchurData> data_A_nonconst()
64
+ {
65
+ return pcalc_->data_A_nonconst();
66
+ }
67
+
68
+ virtual SmartPtr<SchurData> data_B_nonconst()
69
+ {
70
+ return data_B_;
71
+ }
72
+
73
+ virtual SmartPtr<const PCalculator> pcalc() const
74
+ {
75
+ return ConstPtr(pcalc_);
76
+ }
77
+
78
+ virtual SmartPtr<PCalculator> pcalc_nonconst()
79
+ {
80
+ return pcalc_;
81
+ }
82
+
83
+ /* Sets the Data for which this SchurMatrix will be built. */
84
+
85
+ /** Creates the SchurMatrix from B and P */
86
+ virtual bool SchurBuild() = 0;
87
+
88
+ /** Calls the factorization routine for the SchurMatrix */
89
+ virtual bool SchurFactorize() = 0;
90
+
91
+ /** Performs a backsolve on S and K
92
+ *
93
+ * sol is the vector K^(-1)*r_s which usually should have been computed before
94
+ */
95
+ virtual bool SchurSolve(
96
+ SmartPtr<IteratesVector> lhs,
97
+ SmartPtr<const IteratesVector> rhs,
98
+ SmartPtr<Vector> delta_u,
99
+ SmartPtr<IteratesVector> sol = NULL
100
+ ) = 0;
101
+
102
+ /* Performs a backsolve on S and K; calls the latter with sol=K^(-1)*r_s=0
103
+ virtual bool SchurSolve(SmartPtr<IteratesVector> lhs,
104
+ SmartPtr<const IteratesVector> rhs,
105
+ SmartPtr<Vector> delta_u) =0;
106
+ */
107
+ private:
108
+ SchurDriver()
109
+ { }
110
+
111
+ SmartPtr<PCalculator> pcalc_;
112
+
113
+ SmartPtr<SchurData> data_B_;
114
+ };
115
+
116
+ }
117
+
118
+ #endif
@@ -0,0 +1,49 @@
1
+ // Copyright 2009, 2011 Hans Pirnay
2
+ // All Rights Reserved.
3
+ // This code is published under the Eclipse Public License.
4
+ //
5
+ // Date : 2009-04-06
6
+ //
7
+ // Purpose : This is the same as IpSensitivityCalculator.hpp
8
+ // It implements the SensBacksolver Interface.
9
+
10
+ #ifndef __ASSIMPLEBACKSOLVER_HPP__
11
+ #define __ASSIMPLEBACKSOLVER_HPP__
12
+
13
+ #include "IpPDSystemSolver.hpp"
14
+ #include "SensBacksolver.hpp"
15
+
16
+ namespace Ipopt
17
+ {
18
+
19
+ class SIPOPTLIB_EXPORT SimpleBacksolver: public SensBacksolver
20
+ {
21
+ public:
22
+
23
+ SimpleBacksolver(
24
+ SmartPtr<PDSystemSolver> pd_solver
25
+ );
26
+
27
+ ~SimpleBacksolver()
28
+ { }
29
+
30
+ bool InitializeImpl(
31
+ const OptionsList& options,
32
+ const std::string& prefix
33
+ );
34
+
35
+ bool Solve(
36
+ SmartPtr<IteratesVector> delta_lhs,
37
+ SmartPtr<const IteratesVector> delta_rhs
38
+ );
39
+
40
+ private:
41
+ SimpleBacksolver();
42
+
43
+ SmartPtr<PDSystemSolver> pd_solver_;
44
+ bool allow_inexact_;
45
+ };
46
+
47
+ }
48
+
49
+ #endif
@@ -0,0 +1,85 @@
1
+ // Copyright 2009, 2011 Hans Pirnay
2
+ // All Rights Reserved.
3
+ // This code is published under the Eclipse Public License.
4
+ //
5
+ // Date : 2009-05-14
6
+
7
+ #ifndef __ASSENSSTEPCALC_HPP__
8
+ #define __ASSENSSTEPCALC_HPP__
9
+
10
+ #include "IpAlgStrategy.hpp"
11
+ #include "SensSchurDriver.hpp"
12
+
13
+ namespace Ipopt
14
+ {
15
+ /* Forward declarations */
16
+ class DenseVector;
17
+ class IteratesVector;
18
+
19
+ /** This is the interface for the classes that perform the actual step. */
20
+ class SIPOPTLIB_EXPORT SensitivityStepCalculator: public AlgorithmStrategyObject
21
+ {
22
+ public:
23
+ SensitivityStepCalculator()
24
+ : driver_(NULL),
25
+ do_boundcheck_(false)
26
+ { }
27
+
28
+ virtual ~SensitivityStepCalculator()
29
+ { }
30
+
31
+ virtual bool InitializeImpl(
32
+ const OptionsList& options,
33
+ const std::string& prefix
34
+ )
35
+ {
36
+ options.GetBoolValue("sens_boundcheck", do_boundcheck_, prefix);
37
+ return true;
38
+ }
39
+
40
+ bool Do_Boundcheck() const
41
+ {
42
+ return do_boundcheck_;
43
+ }
44
+
45
+ void SetSchurDriver(
46
+ SmartPtr<SchurDriver> driver
47
+ )
48
+ {
49
+ DBG_ASSERT(IsValid(driver));
50
+
51
+ driver_ = driver;
52
+ if( IsValid(driver_->pcalc_nonconst()) )
53
+ {
54
+ driver_->pcalc_nonconst()->reset_data_A();
55
+ // when the schurdriver is set, the data in the pcalculator has to be reset to its data?
56
+ }
57
+ }
58
+
59
+ SmartPtr<SchurDriver> Driver() // this should be const or protected
60
+ {
61
+ DBG_ASSERT(IsValid(driver_));
62
+
63
+ return driver_;
64
+ }
65
+
66
+ /** This is the main algorithmic function of this class.
67
+ *
68
+ * It calculates a step using its SchurDriver, checks bounds, and returns it
69
+ */
70
+ virtual bool Step(
71
+ DenseVector& delta_u,
72
+ IteratesVector& sol
73
+ ) = 0;
74
+
75
+ /** return the sensitivity vector */
76
+ virtual SmartPtr<IteratesVector> GetSensitivityVector() = 0;
77
+
78
+ private:
79
+ SmartPtr<SchurDriver> driver_;
80
+ bool do_boundcheck_;
81
+ };
82
+
83
+ }
84
+
85
+ #endif
@@ -0,0 +1,63 @@
1
+ // Copyright 2009, 2011 Hans Pirnay
2
+ // All Rights Reserved.
3
+ // This code is published under the Eclipse Public License.
4
+ //
5
+ // Date : 2009-05-14
6
+
7
+ #ifndef __SENSCUTILS_HPP__
8
+ #define __SENSCUTILS_HPP__
9
+
10
+ #include "IpUtils.hpp"
11
+ #include "IpAlgTypes.hpp"
12
+ #include "IpReturnCodes.hpp"
13
+
14
+ #include <string>
15
+
16
+ namespace Ipopt
17
+ {
18
+
19
+ /* This header file provides some definitions used throughout the program. */
20
+
21
+ enum SensAlgorithmExitStatus
22
+ {
23
+ SOLVE_SUCCESS,
24
+ FATAL_ERROR
25
+ };
26
+
27
+ SIPOPTLIB_EXPORT Index AsIndexMax(
28
+ Index length,
29
+ const Index* x,
30
+ Index Incr
31
+ );
32
+
33
+ SIPOPTLIB_EXPORT Index AsIndexSum(
34
+ Index length,
35
+ const Index* x,
36
+ Index Incr
37
+ );
38
+
39
+ SIPOPTLIB_EXPORT void append_Index(
40
+ std::string& str,
41
+ Index idx
42
+ );
43
+
44
+ SIPOPTLIB_EXPORT SolverReturn AppReturn2SolverReturn(
45
+ ApplicationReturnStatus ipopt_retval
46
+ );
47
+ }
48
+
49
+ // same as DECLARE_STD_EXCEPTION, but using SIPOPTLIB_EXPORT instead of IPOPTLIB_EXPORT
50
+ #define DECLARE_STD_SIPOPT_EXCEPTION(__except_type) \
51
+ class SIPOPTLIB_EXPORT __except_type : public Ipopt::IpoptException \
52
+ { \
53
+ public: \
54
+ __except_type(const std::string& msg, const std::string& fname, Ipopt::Index line) \
55
+ : Ipopt::IpoptException(msg,fname,line, #__except_type) {} \
56
+ __except_type(const __except_type& copy) \
57
+ : Ipopt::IpoptException(copy) {} \
58
+ private: \
59
+ __except_type(); \
60
+ void operator=(const __except_type&); \
61
+ }
62
+
63
+ #endif