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,423 @@
1
+ // Copyright (C) 2004, 2009 International Business Machines and others.
2
+ // All Rights Reserved.
3
+ // This code is published under the Eclipse Public License.
4
+ //
5
+ // Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
6
+
7
+ #ifndef __IPCOMPOUNDMATRIX_HPP__
8
+ #define __IPCOMPOUNDMATRIX_HPP__
9
+
10
+ #include "IpUtils.hpp"
11
+ #include "IpMatrix.hpp"
12
+
13
+ namespace Ipopt
14
+ {
15
+
16
+ /* forward declarations */
17
+ class CompoundMatrixSpace;
18
+
19
+ /** Class for Matrices consisting of other matrices.
20
+ *
21
+ * This matrix is
22
+ * a matrix that consists of zero, one or more Matrices's which are
23
+ * arranged like this: \f$ M_{\rm compound} =
24
+ * \left(\begin{array}{cccc}M_{00} & M_{01} & \ldots & M_{0,{\rm
25
+ * ncomp\_cols}-1} \\ \dots &&&\dots \\ M_{{\rm ncomp\_rows}-1,0} &
26
+ * M_{{\rm ncomp\_rows}-1,1} & \dots & M_{{\rm ncomp\_rows}-1,{\rm
27
+ * ncomp\_cols}-1}\end{array}\right)\f$. The individual components
28
+ * can be associated to different MatrixSpaces. The individual
29
+ * components can also be const and non-const Matrices. If a
30
+ * component is not set (i.e., it's pointer is NULL), then this
31
+ * components is treated like a zero-matrix of appropriate
32
+ * dimensions.
33
+ */
34
+ class IPOPTLIB_EXPORT CompoundMatrix: public Matrix
35
+ {
36
+ public:
37
+
38
+ /**@name Constructors / Destructors */
39
+ ///@{
40
+ /** Constructor, taking the owner_space.
41
+ *
42
+ * The owner_space has to
43
+ * be defined, so that at each block row and column contain at
44
+ * least one non-NULL component. The individual components can
45
+ * be set afterwards with the SeteComp and SetCompNonConst
46
+ * methods.
47
+ */
48
+ CompoundMatrix(
49
+ const CompoundMatrixSpace* owner_space
50
+ );
51
+
52
+ /** Destructor */
53
+ virtual ~CompoundMatrix();
54
+ ///@}
55
+
56
+ /** Method for setting an individual component at position (irow,
57
+ * icol) in the compound matrix.
58
+ *
59
+ * The counting of indices starts at 0.
60
+ */
61
+ void SetComp(
62
+ Index irow,
63
+ Index jcol,
64
+ const Matrix& matrix
65
+ );
66
+
67
+ /** Method to set a non-const Matrix entry */
68
+ void SetCompNonConst(
69
+ Index irow,
70
+ Index jcol,
71
+ Matrix& matrix
72
+ );
73
+
74
+ /** Method to create a new matrix from the space for this block */
75
+ void CreateBlockFromSpace(
76
+ Index irow,
77
+ Index jcol
78
+ );
79
+
80
+ /** Method for retrieving one block from the compound matrix as a
81
+ * const Matrix.
82
+ */
83
+ SmartPtr<const Matrix> GetComp(
84
+ Index irow,
85
+ Index jcol
86
+ ) const
87
+ {
88
+ return ConstComp(irow, jcol);
89
+ }
90
+
91
+ /** Method for retrieving one block from the compound matrix as a
92
+ * non-const Matrix.
93
+ *
94
+ * Note that calling this method with mark the
95
+ * CompoundMatrix as changed. Therefore, only use this method if
96
+ * you are intending to change the Matrix that you receive.
97
+ */
98
+ SmartPtr<Matrix> GetCompNonConst(
99
+ Index irow,
100
+ Index jcol
101
+ )
102
+ {
103
+ ObjectChanged();
104
+ return Comp(irow, jcol);
105
+ }
106
+
107
+ /** Number of block rows of this compound matrix. */
108
+ inline Index NComps_Rows() const;
109
+
110
+ /** Number of block colmuns of this compound matrix. */
111
+ inline Index NComps_Cols() const;
112
+
113
+ protected:
114
+ /**@name Methods overloaded from Matrix */
115
+ ///@{
116
+ virtual void MultVectorImpl(
117
+ Number alpha,
118
+ const Vector& x,
119
+ Number beta,
120
+ Vector& y
121
+ ) const;
122
+
123
+ virtual void TransMultVectorImpl(
124
+ Number alpha,
125
+ const Vector& x,
126
+ Number beta,
127
+ Vector& y
128
+ ) const;
129
+
130
+ virtual void AddMSinvZImpl(
131
+ Number alpha,
132
+ const Vector& S,
133
+ const Vector& Z,
134
+ Vector& X
135
+ ) const;
136
+
137
+ virtual void SinvBlrmZMTdBrImpl(
138
+ Number alpha,
139
+ const Vector& S,
140
+ const Vector& R,
141
+ const Vector& Z,
142
+ const Vector& D,
143
+ Vector& X
144
+ ) const;
145
+
146
+ virtual bool HasValidNumbersImpl() const;
147
+
148
+ virtual void ComputeRowAMaxImpl(
149
+ Vector& rows_norms,
150
+ bool init
151
+ ) const;
152
+
153
+ virtual void ComputeColAMaxImpl(
154
+ Vector& cols_norms,
155
+ bool init
156
+ ) const;
157
+
158
+ virtual void PrintImpl(
159
+ const Journalist& jnlst,
160
+ EJournalLevel level,
161
+ EJournalCategory category,
162
+ const std::string& name,
163
+ Index indent,
164
+ const std::string& prefix
165
+ ) const;
166
+ ///@}
167
+
168
+ private:
169
+ /**@name Default Compiler Generated Methods
170
+ * (Hidden to avoid implicit creation/calling).
171
+ * These methods are not implemented and
172
+ * we do not want the compiler to implement
173
+ * them for us, so we declare them private
174
+ * and do not define them. This ensures that
175
+ * they will not be implicitly created/called. */
176
+ ///@{
177
+ /** Default Constructor */
178
+ CompoundMatrix();
179
+
180
+ /** Copy Constructor */
181
+ CompoundMatrix(
182
+ const CompoundMatrix&);
183
+
184
+ /** Default Assignment Operator */
185
+ void operator=(
186
+ const CompoundMatrix&);
187
+ ///@}
188
+
189
+ /** Matrix of matrix's containing the components */
190
+ std::vector<std::vector<SmartPtr<Matrix> > > comps_;
191
+
192
+ /** Matrix of const matrix's containing the components */
193
+ std::vector<std::vector<SmartPtr<const Matrix> > > const_comps_;
194
+
195
+ /** Copy of the owner_space ptr as a CompoundMatrixSpace instead
196
+ * of MatrixSpace
197
+ */
198
+ const CompoundMatrixSpace* owner_space_;
199
+
200
+ /** boolean indicating if the compound matrix is in a "valid" state */
201
+ mutable bool matrices_valid_;
202
+
203
+ /** Method to check whether or not the matrices are valid */
204
+ bool MatricesValid() const;
205
+
206
+ inline const Matrix* ConstComp(
207
+ Index irow,
208
+ Index jcol
209
+ ) const;
210
+
211
+ inline Matrix* Comp(
212
+ Index irow,
213
+ Index jcol
214
+ );
215
+ };
216
+
217
+ /** This is the matrix space for CompoundMatrix. Before a CompoundMatrix
218
+ * can be created, at least one MatrixSpace has to be set per block
219
+ * row and column. Individual component MatrixSpace's can be set
220
+ * with the SetComp method.
221
+ */
222
+ class IPOPTLIB_EXPORT CompoundMatrixSpace: public MatrixSpace
223
+ {
224
+ public:
225
+ /** @name Constructors / Destructors */
226
+ ///@{
227
+ /** Constructor, given the number of row and columns blocks, as
228
+ * well as the totel number of rows and columns.
229
+ */
230
+ CompoundMatrixSpace(
231
+ Index ncomps_rows,
232
+ Index ncomps_cols,
233
+ Index total_nRows,
234
+ Index total_nCols
235
+ );
236
+
237
+ /** Destructor */
238
+ ~CompoundMatrixSpace()
239
+ { }
240
+ ///@}
241
+
242
+ /** @name Methods for setting information about the components. */
243
+ ///@{
244
+ /** Set the number nrows of rows in row-block number irow. */
245
+ void SetBlockRows(
246
+ Index irow,
247
+ Index nrows
248
+ );
249
+
250
+ /** Set the number ncols of columns in column-block number jcol. */
251
+ void SetBlockCols(
252
+ Index jcol,
253
+ Index ncols
254
+ );
255
+
256
+ /** Get the number nrows of rows in row-block number irow. */
257
+ Index GetBlockRows(
258
+ Index irow
259
+ ) const;
260
+
261
+ /** Set the number ncols of columns in column-block number jcol. */
262
+ Index GetBlockCols(
263
+ Index jcol
264
+ ) const;
265
+
266
+ /** Set the component MatrixSpace.
267
+ *
268
+ * If auto_allocate is true, then
269
+ * a new CompoundMatrix created later with MakeNew will have this
270
+ * component automatically created with the Matrix's MakeNew.
271
+ * Otherwise, the corresponding component will be NULL and has to
272
+ * be set with the SetComp methods of the CompoundMatrix.
273
+ */
274
+ void SetCompSpace(
275
+ Index irow,
276
+ Index jcol,
277
+ const MatrixSpace& mat_space,
278
+ bool auto_allocate = false
279
+ );
280
+ ///@}
281
+
282
+ /** Obtain the component MatrixSpace in block row irow and block
283
+ * column jcol.
284
+ */
285
+ SmartPtr<const MatrixSpace> GetCompSpace(
286
+ Index irow,
287
+ Index jcol
288
+ ) const
289
+ {
290
+ DBG_ASSERT(irow < NComps_Rows());
291
+ DBG_ASSERT(jcol < NComps_Cols());
292
+ return comp_spaces_[irow][jcol];
293
+ }
294
+
295
+ /** @name Accessor methods */
296
+ ///@{
297
+ /** Number of block rows */
298
+ Index NComps_Rows() const
299
+ {
300
+ return ncomps_rows_;
301
+ }
302
+
303
+ /** Number of block columns */
304
+ Index NComps_Cols() const
305
+ {
306
+ return ncomps_cols_;
307
+ }
308
+
309
+ /** True if the blocks lie on the diagonal - can make some operations faster */
310
+ bool Diagonal() const
311
+ {
312
+ return diagonal_;
313
+ }
314
+ ///@}
315
+
316
+ /** Method for creating a new matrix of this specific type. */
317
+ CompoundMatrix* MakeNewCompoundMatrix() const;
318
+
319
+ virtual Matrix* MakeNew() const
320
+ {
321
+ return MakeNewCompoundMatrix();
322
+ }
323
+
324
+ private:
325
+ /**@name Default Compiler Generated Methods
326
+ * (Hidden to avoid implicit creation/calling).
327
+ * These methods are not implemented and
328
+ * we do not want the compiler to implement
329
+ * them for us, so we declare them private
330
+ * and do not define them. This ensures that
331
+ * they will not be implicitly created/called. */
332
+ ///@{
333
+ /** Default constructor */
334
+ CompoundMatrixSpace();
335
+
336
+ /** Copy Constructor */
337
+ CompoundMatrixSpace(
338
+ const CompoundMatrixSpace&);
339
+
340
+ /** Default Assignment Operator */
341
+ CompoundMatrixSpace& operator=(
342
+ const CompoundMatrixSpace&
343
+ );
344
+ ///@}
345
+
346
+ /** Number of block rows */
347
+ Index ncomps_rows_;
348
+
349
+ /** Number of block columns */
350
+ Index ncomps_cols_;
351
+
352
+ /** Store whether or not the dimensions are valid */
353
+ mutable bool dimensions_set_;
354
+
355
+ /** 2-dim std::vector of matrix spaces for the components */
356
+ std::vector<std::vector<SmartPtr<const MatrixSpace> > > comp_spaces_;
357
+
358
+ /** 2-dim std::vector of booleans deciding whether to
359
+ * allocate a new matrix for the blocks automagically
360
+ */
361
+ std::vector<std::vector<bool> > allocate_block_;
362
+
363
+ /** Vector of the number of rows in each comp column */
364
+ std::vector<Index> block_rows_;
365
+
366
+ /** Vector of the number of cols in each comp row */
367
+ std::vector<Index> block_cols_;
368
+
369
+ /** true if the CompoundMatrixSpace only has Matrix spaces along the diagonal.
370
+ *
371
+ * This means that the CompoundMatrix will only have matrices along the
372
+ * diagonal and it could make some operations more efficient.
373
+ */
374
+ bool diagonal_;
375
+
376
+ /** Auxiliary function for debugging to set if all block
377
+ * dimensions have been set.
378
+ */
379
+ bool DimensionsSet() const;
380
+ };
381
+
382
+ /* inline methods */
383
+ inline Index CompoundMatrix::NComps_Rows() const
384
+ {
385
+ return owner_space_->NComps_Rows();
386
+ }
387
+
388
+ inline Index CompoundMatrix::NComps_Cols() const
389
+ {
390
+ return owner_space_->NComps_Cols();
391
+ }
392
+
393
+ inline const Matrix* CompoundMatrix::ConstComp(
394
+ Index irow,
395
+ Index jcol
396
+ ) const
397
+ {
398
+ DBG_ASSERT(irow < NComps_Rows());
399
+ DBG_ASSERT(jcol < NComps_Cols());
400
+ if( IsValid(comps_[irow][jcol]) )
401
+ {
402
+ return GetRawPtr(comps_[irow][jcol]);
403
+ }
404
+ else if( IsValid(const_comps_[irow][jcol]) )
405
+ {
406
+ return GetRawPtr(const_comps_[irow][jcol]);
407
+ }
408
+
409
+ return NULL;
410
+ }
411
+
412
+ inline Matrix* CompoundMatrix::Comp(
413
+ Index irow,
414
+ Index jcol
415
+ )
416
+ {
417
+ DBG_ASSERT(irow < NComps_Rows());
418
+ DBG_ASSERT(jcol < NComps_Cols());
419
+ return GetRawPtr(comps_[irow][jcol]);
420
+ }
421
+
422
+ } // namespace Ipopt
423
+ #endif