/src/eigen/Eigen/src/Core/DenseStorage.h
Line | Count | Source (jump to first uncovered line) |
1 | | // This file is part of Eigen, a lightweight C++ template library |
2 | | // for linear algebra. |
3 | | // |
4 | | // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr> |
5 | | // Copyright (C) 2006-2009 Benoit Jacob <jacob.benoit.1@gmail.com> |
6 | | // Copyright (C) 2010-2013 Hauke Heibel <hauke.heibel@gmail.com> |
7 | | // |
8 | | // This Source Code Form is subject to the terms of the Mozilla |
9 | | // Public License v. 2.0. If a copy of the MPL was not distributed |
10 | | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. |
11 | | |
12 | | #ifndef EIGEN_MATRIXSTORAGE_H |
13 | | #define EIGEN_MATRIXSTORAGE_H |
14 | | |
15 | | #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN |
16 | | #define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(X) \ |
17 | | X; \ |
18 | | EIGEN_DENSE_STORAGE_CTOR_PLUGIN; |
19 | | #else |
20 | | #define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(X) |
21 | | #endif |
22 | | |
23 | | // IWYU pragma: private |
24 | | #include "./InternalHeaderCheck.h" |
25 | | |
26 | | namespace Eigen { |
27 | | |
28 | | namespace internal { |
29 | | |
30 | | struct constructor_without_unaligned_array_assert {}; |
31 | | |
32 | | template <typename T, int Size> |
33 | | EIGEN_DEVICE_FUNC constexpr void check_static_allocation_size() { |
34 | | // if EIGEN_STACK_ALLOCATION_LIMIT is defined to 0, then no limit |
35 | | #if EIGEN_STACK_ALLOCATION_LIMIT |
36 | | EIGEN_STATIC_ASSERT(Size * sizeof(T) <= EIGEN_STACK_ALLOCATION_LIMIT, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG); |
37 | | #endif |
38 | | } |
39 | | |
40 | | /** \internal |
41 | | * Static array. If the MatrixOrArrayOptions require auto-alignment, the array will be automatically aligned: |
42 | | * to 16 bytes boundary if the total size is a multiple of 16 bytes. |
43 | | */ |
44 | | template <typename T, int Size, int MatrixOrArrayOptions, |
45 | | int Alignment = (MatrixOrArrayOptions & DontAlign) ? 0 : compute_default_alignment<T, Size>::value> |
46 | | struct plain_array { |
47 | | T array[Size]; |
48 | | |
49 | | EIGEN_DEVICE_FUNC constexpr plain_array() { check_static_allocation_size<T, Size>(); } |
50 | | |
51 | | EIGEN_DEVICE_FUNC constexpr plain_array(constructor_without_unaligned_array_assert) { |
52 | | check_static_allocation_size<T, Size>(); |
53 | | } |
54 | | }; |
55 | | |
56 | | #if defined(EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT) |
57 | | #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) |
58 | | #else |
59 | | #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) \ |
60 | | eigen_assert((internal::is_constant_evaluated() || (std::uintptr_t(array) & (sizemask)) == 0) && \ |
61 | | "this assertion is explained here: " \ |
62 | | "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" \ |
63 | | " **** READ THIS WEB PAGE !!! ****"); |
64 | | #endif |
65 | | |
66 | | template <typename T, int Size, int MatrixOrArrayOptions> |
67 | | struct plain_array<T, Size, MatrixOrArrayOptions, 8> { |
68 | | EIGEN_ALIGN_TO_BOUNDARY(8) T array[Size]; |
69 | | |
70 | | EIGEN_DEVICE_FUNC constexpr plain_array() { |
71 | | EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(7); |
72 | | check_static_allocation_size<T, Size>(); |
73 | | } |
74 | | |
75 | | EIGEN_DEVICE_FUNC constexpr plain_array(constructor_without_unaligned_array_assert) { |
76 | | check_static_allocation_size<T, Size>(); |
77 | | } |
78 | | }; |
79 | | |
80 | | template <typename T, int Size, int MatrixOrArrayOptions> |
81 | | struct plain_array<T, Size, MatrixOrArrayOptions, 16> { |
82 | | EIGEN_ALIGN_TO_BOUNDARY(16) T array[Size]; |
83 | | |
84 | | EIGEN_DEVICE_FUNC constexpr plain_array() { |
85 | | EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(15); |
86 | | check_static_allocation_size<T, Size>(); |
87 | | } |
88 | | |
89 | | EIGEN_DEVICE_FUNC constexpr plain_array(constructor_without_unaligned_array_assert) { |
90 | | check_static_allocation_size<T, Size>(); |
91 | | } |
92 | | }; |
93 | | |
94 | | template <typename T, int Size, int MatrixOrArrayOptions> |
95 | | struct plain_array<T, Size, MatrixOrArrayOptions, 32> { |
96 | | EIGEN_ALIGN_TO_BOUNDARY(32) T array[Size]; |
97 | | |
98 | | EIGEN_DEVICE_FUNC constexpr plain_array() { |
99 | | EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(31); |
100 | | check_static_allocation_size<T, Size>(); |
101 | | } |
102 | | |
103 | | EIGEN_DEVICE_FUNC constexpr plain_array(constructor_without_unaligned_array_assert) { |
104 | | check_static_allocation_size<T, Size>(); |
105 | | } |
106 | | }; |
107 | | |
108 | | template <typename T, int Size, int MatrixOrArrayOptions> |
109 | | struct plain_array<T, Size, MatrixOrArrayOptions, 64> { |
110 | | EIGEN_ALIGN_TO_BOUNDARY(64) T array[Size]; |
111 | | |
112 | | EIGEN_DEVICE_FUNC constexpr plain_array() { |
113 | | EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(63); |
114 | | check_static_allocation_size<T, Size>(); |
115 | | } |
116 | | |
117 | | EIGEN_DEVICE_FUNC constexpr plain_array(constructor_without_unaligned_array_assert) { |
118 | | check_static_allocation_size<T, Size>(); |
119 | | } |
120 | | }; |
121 | | |
122 | | template <typename T, int MatrixOrArrayOptions, int Alignment> |
123 | | struct plain_array<T, 0, MatrixOrArrayOptions, Alignment> { |
124 | | T array[1]; |
125 | | EIGEN_DEVICE_FUNC constexpr plain_array() {} |
126 | | EIGEN_DEVICE_FUNC constexpr plain_array(constructor_without_unaligned_array_assert) {} |
127 | | }; |
128 | | |
129 | | struct plain_array_helper { |
130 | | template <typename T, int Size, int MatrixOrArrayOptions, int Alignment> |
131 | | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE static void copy( |
132 | | const plain_array<T, Size, MatrixOrArrayOptions, Alignment>& src, const Eigen::Index size, |
133 | | plain_array<T, Size, MatrixOrArrayOptions, Alignment>& dst) { |
134 | | smart_copy(src.array, src.array + size, dst.array); |
135 | | } |
136 | | |
137 | | template <typename T, int Size, int MatrixOrArrayOptions, int Alignment> |
138 | | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE static void swap(plain_array<T, Size, MatrixOrArrayOptions, Alignment>& a, |
139 | | const Eigen::Index a_size, |
140 | | plain_array<T, Size, MatrixOrArrayOptions, Alignment>& b, |
141 | | const Eigen::Index b_size) { |
142 | | if (a_size < b_size) { |
143 | | std::swap_ranges(b.array, b.array + a_size, a.array); |
144 | | smart_move(b.array + a_size, b.array + b_size, a.array + a_size); |
145 | | } else if (a_size > b_size) { |
146 | | std::swap_ranges(a.array, a.array + b_size, b.array); |
147 | | smart_move(a.array + b_size, a.array + a_size, b.array + b_size); |
148 | | } else { |
149 | | std::swap_ranges(a.array, a.array + a_size, b.array); |
150 | | } |
151 | | } |
152 | | }; |
153 | | |
154 | | } // end namespace internal |
155 | | |
156 | | /** \internal |
157 | | * |
158 | | * \class DenseStorage |
159 | | * \ingroup Core_Module |
160 | | * |
161 | | * \brief Stores the data of a matrix |
162 | | * |
163 | | * This class stores the data of fixed-size, dynamic-size or mixed matrices |
164 | | * in a way as compact as possible. |
165 | | * |
166 | | * \sa Matrix |
167 | | */ |
168 | | template <typename T, int Size, int Rows_, int Cols_, int Options_> |
169 | | class DenseStorage; |
170 | | |
171 | | // purely fixed-size matrix |
172 | | template <typename T, int Size, int Rows_, int Cols_, int Options_> |
173 | | class DenseStorage { |
174 | | internal::plain_array<T, Size, Options_> m_data; |
175 | | |
176 | | public: |
177 | | constexpr EIGEN_DEVICE_FUNC DenseStorage(){EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN( |
178 | | Index size = |
179 | | Size)} EIGEN_DEVICE_FUNC explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) |
180 | | : m_data(internal::constructor_without_unaligned_array_assert()) {} |
181 | | #if defined(EIGEN_DENSE_STORAGE_CTOR_PLUGIN) |
182 | | EIGEN_DEVICE_FUNC constexpr DenseStorage(const DenseStorage& other) |
183 | | : m_data(other.m_data){EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = Size)} |
184 | | #else |
185 | | EIGEN_DEVICE_FUNC constexpr DenseStorage(const DenseStorage&) = default; |
186 | | #endif |
187 | | EIGEN_DEVICE_FUNC constexpr DenseStorage |
188 | | & |
189 | | operator=(const DenseStorage&) = default; |
190 | | EIGEN_DEVICE_FUNC constexpr DenseStorage(DenseStorage&&) = default; |
191 | | EIGEN_DEVICE_FUNC constexpr DenseStorage& operator=(DenseStorage&&) = default; |
192 | | EIGEN_DEVICE_FUNC constexpr DenseStorage(Index size, Index rows, Index cols) { |
193 | | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) |
194 | | eigen_internal_assert(size == rows * cols && rows == Rows_ && cols == Cols_); |
195 | | EIGEN_UNUSED_VARIABLE(size); |
196 | | EIGEN_UNUSED_VARIABLE(rows); |
197 | | EIGEN_UNUSED_VARIABLE(cols); |
198 | | } |
199 | | EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { numext::swap(m_data, other.m_data); } |
200 | | EIGEN_DEVICE_FUNC static constexpr Index rows(void) EIGEN_NOEXCEPT { return Rows_; } |
201 | | EIGEN_DEVICE_FUNC static constexpr Index cols(void) EIGEN_NOEXCEPT { return Cols_; } |
202 | | EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index, Index, Index) {} |
203 | | EIGEN_DEVICE_FUNC constexpr void resize(Index, Index, Index) {} |
204 | | EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data.array; } |
205 | | EIGEN_DEVICE_FUNC constexpr T* data() { return m_data.array; } |
206 | | }; |
207 | | |
208 | | // null matrix |
209 | | template <typename T, int Rows_, int Cols_, int Options_> |
210 | | class DenseStorage<T, 0, Rows_, Cols_, Options_> { |
211 | | public: |
212 | | static_assert(Rows_ * Cols_ == 0, "The fixed number of rows times columns must equal the storage size."); |
213 | | EIGEN_DEVICE_FUNC constexpr DenseStorage() {} |
214 | | EIGEN_DEVICE_FUNC explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) {} |
215 | | EIGEN_DEVICE_FUNC constexpr DenseStorage(const DenseStorage&) {} |
216 | | EIGEN_DEVICE_FUNC constexpr DenseStorage& operator=(const DenseStorage&) { return *this; } |
217 | | EIGEN_DEVICE_FUNC constexpr DenseStorage(Index, Index, Index) {} |
218 | | EIGEN_DEVICE_FUNC constexpr void swap(DenseStorage&) {} |
219 | | EIGEN_DEVICE_FUNC static constexpr Index rows(void) EIGEN_NOEXCEPT { return Rows_; } |
220 | | EIGEN_DEVICE_FUNC static constexpr Index cols(void) EIGEN_NOEXCEPT { return Cols_; } |
221 | | EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index, Index, Index) {} |
222 | | EIGEN_DEVICE_FUNC constexpr void resize(Index, Index, Index) {} |
223 | | EIGEN_DEVICE_FUNC constexpr const T* data() const { return 0; } |
224 | | EIGEN_DEVICE_FUNC constexpr T* data() { return 0; } |
225 | | }; |
226 | | |
227 | | // more specializations for null matrices; these are necessary to resolve ambiguities |
228 | | template <typename T, int Options_> |
229 | | class DenseStorage<T, 0, Dynamic, Dynamic, Options_> { |
230 | | Index m_rows; |
231 | | Index m_cols; |
232 | | |
233 | | public: |
234 | | EIGEN_DEVICE_FUNC DenseStorage() : m_rows(0), m_cols(0) {} |
235 | | EIGEN_DEVICE_FUNC explicit DenseStorage(internal::constructor_without_unaligned_array_assert) : DenseStorage() {} |
236 | | EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) : m_rows(other.m_rows), m_cols(other.m_cols) {} |
237 | | EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) { |
238 | | m_rows = other.m_rows; |
239 | | m_cols = other.m_cols; |
240 | | return *this; |
241 | | } |
242 | | EIGEN_DEVICE_FUNC DenseStorage(Index, Index rows, Index cols) : m_rows(rows), m_cols(cols) { |
243 | | eigen_assert(m_rows * m_cols == 0 && "The number of rows times columns must equal the storage size."); |
244 | | } |
245 | | EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { |
246 | | numext::swap(m_rows, other.m_rows); |
247 | | numext::swap(m_cols, other.m_cols); |
248 | | } |
249 | | EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_rows; } |
250 | | EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_cols; } |
251 | | EIGEN_DEVICE_FUNC void conservativeResize(Index, Index rows, Index cols) { |
252 | | m_rows = rows; |
253 | | m_cols = cols; |
254 | | eigen_assert(m_rows * m_cols == 0 && "The number of rows times columns must equal the storage size."); |
255 | | } |
256 | | EIGEN_DEVICE_FUNC void resize(Index, Index rows, Index cols) { |
257 | | m_rows = rows; |
258 | | m_cols = cols; |
259 | | eigen_assert(m_rows * m_cols == 0 && "The number of rows times columns must equal the storage size."); |
260 | | } |
261 | | EIGEN_DEVICE_FUNC const T* data() const { return nullptr; } |
262 | | EIGEN_DEVICE_FUNC T* data() { return nullptr; } |
263 | | }; |
264 | | |
265 | | template <typename T, int Rows_, int Options_> |
266 | | class DenseStorage<T, 0, Rows_, Dynamic, Options_> { |
267 | | Index m_cols; |
268 | | |
269 | | public: |
270 | | EIGEN_DEVICE_FUNC DenseStorage() : m_cols(0) {} |
271 | | EIGEN_DEVICE_FUNC explicit DenseStorage(internal::constructor_without_unaligned_array_assert) : DenseStorage() {} |
272 | | EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) : m_cols(other.m_cols) {} |
273 | | EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) { |
274 | | m_cols = other.m_cols; |
275 | | return *this; |
276 | | } |
277 | | EIGEN_DEVICE_FUNC DenseStorage(Index, Index, Index cols) : m_cols(cols) { |
278 | | eigen_assert(Rows_ * m_cols == 0 && "The number of rows times columns must equal the storage size."); |
279 | | } |
280 | | EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { numext::swap(m_cols, other.m_cols); } |
281 | | EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index rows(void) EIGEN_NOEXCEPT { return Rows_; } |
282 | | EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols(void) const EIGEN_NOEXCEPT { return m_cols; } |
283 | | EIGEN_DEVICE_FUNC void conservativeResize(Index, Index, Index cols) { |
284 | | m_cols = cols; |
285 | | eigen_assert(Rows_ * m_cols == 0 && "The number of rows times columns must equal the storage size."); |
286 | | } |
287 | | EIGEN_DEVICE_FUNC void resize(Index, Index, Index cols) { |
288 | | m_cols = cols; |
289 | | eigen_assert(Rows_ * m_cols == 0 && "The number of rows times columns must equal the storage size."); |
290 | | } |
291 | | EIGEN_DEVICE_FUNC const T* data() const { return nullptr; } |
292 | | EIGEN_DEVICE_FUNC T* data() { return nullptr; } |
293 | | }; |
294 | | |
295 | | template <typename T, int Cols_, int Options_> |
296 | | class DenseStorage<T, 0, Dynamic, Cols_, Options_> { |
297 | | Index m_rows; |
298 | | |
299 | | public: |
300 | | EIGEN_DEVICE_FUNC DenseStorage() : m_rows(0) {} |
301 | | EIGEN_DEVICE_FUNC explicit DenseStorage(internal::constructor_without_unaligned_array_assert) : DenseStorage() {} |
302 | | EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) : m_rows(other.m_rows) {} |
303 | | EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) { |
304 | | m_rows = other.m_rows; |
305 | | return *this; |
306 | | } |
307 | | EIGEN_DEVICE_FUNC DenseStorage(Index, Index rows, Index) : m_rows(rows) { |
308 | | eigen_assert(m_rows * Cols_ == 0 && "The number of rows times columns must equal the storage size."); |
309 | | } |
310 | | EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { numext::swap(m_rows, other.m_rows); } |
311 | | EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows(void) const EIGEN_NOEXCEPT { return m_rows; } |
312 | | EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index cols(void) EIGEN_NOEXCEPT { return Cols_; } |
313 | | EIGEN_DEVICE_FUNC void conservativeResize(Index, Index rows, Index) { |
314 | | m_rows = rows; |
315 | | eigen_assert(m_rows * Cols_ == 0 && "The number of rows times columns must equal the storage size."); |
316 | | } |
317 | | EIGEN_DEVICE_FUNC void resize(Index, Index rows, Index) { |
318 | | m_rows = rows; |
319 | | eigen_assert(m_rows * Cols_ == 0 && "The number of rows times columns must equal the storage size."); |
320 | | } |
321 | | EIGEN_DEVICE_FUNC const T* data() const { return nullptr; } |
322 | | EIGEN_DEVICE_FUNC T* data() { return nullptr; } |
323 | | }; |
324 | | |
325 | | // dynamic-size matrix with fixed-size storage |
326 | | template <typename T, int Size, int Options_> |
327 | | class DenseStorage<T, Size, Dynamic, Dynamic, Options_> { |
328 | | internal::plain_array<T, Size, Options_> m_data; |
329 | | Index m_rows; |
330 | | Index m_cols; |
331 | | |
332 | | public: |
333 | | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(), m_rows(0), m_cols(0) {} |
334 | | EIGEN_DEVICE_FUNC explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) |
335 | | : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(0), m_cols(0) {} |
336 | | EIGEN_DEVICE_FUNC constexpr DenseStorage(const DenseStorage& other) |
337 | | : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(other.m_rows), m_cols(other.m_cols) { |
338 | | internal::plain_array_helper::copy(other.m_data, m_rows * m_cols, m_data); |
339 | | } |
340 | | EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) { |
341 | | if (this != &other) { |
342 | | m_rows = other.m_rows; |
343 | | m_cols = other.m_cols; |
344 | | internal::plain_array_helper::copy(other.m_data, m_rows * m_cols, m_data); |
345 | | } |
346 | | return *this; |
347 | | } |
348 | | EIGEN_DEVICE_FUNC constexpr DenseStorage(Index, Index rows, Index cols) : m_rows(rows), m_cols(cols) {} |
349 | | EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { |
350 | | internal::plain_array_helper::swap(m_data, m_rows * m_cols, other.m_data, other.m_rows * other.m_cols); |
351 | | numext::swap(m_rows, other.m_rows); |
352 | | numext::swap(m_cols, other.m_cols); |
353 | | } |
354 | | EIGEN_DEVICE_FUNC constexpr Index rows() const { return m_rows; } |
355 | | EIGEN_DEVICE_FUNC constexpr Index cols() const { return m_cols; } |
356 | | EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index, Index rows, Index cols) { |
357 | | m_rows = rows; |
358 | | m_cols = cols; |
359 | | } |
360 | | EIGEN_DEVICE_FUNC constexpr void resize(Index, Index rows, Index cols) { |
361 | | m_rows = rows; |
362 | | m_cols = cols; |
363 | | } |
364 | | EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data.array; } |
365 | | EIGEN_DEVICE_FUNC constexpr T* data() { return m_data.array; } |
366 | | }; |
367 | | |
368 | | // dynamic-size matrix with fixed-size storage and fixed width |
369 | | template <typename T, int Size, int Cols_, int Options_> |
370 | | class DenseStorage<T, Size, Dynamic, Cols_, Options_> { |
371 | | internal::plain_array<T, Size, Options_> m_data; |
372 | | Index m_rows; |
373 | | |
374 | | public: |
375 | | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_rows(0) {} |
376 | | EIGEN_DEVICE_FUNC explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) |
377 | | : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(0) {} |
378 | | EIGEN_DEVICE_FUNC constexpr DenseStorage(const DenseStorage& other) |
379 | | : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(other.m_rows) { |
380 | | internal::plain_array_helper::copy(other.m_data, m_rows * Cols_, m_data); |
381 | | } |
382 | | |
383 | | EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) { |
384 | | if (this != &other) { |
385 | | m_rows = other.m_rows; |
386 | | internal::plain_array_helper::copy(other.m_data, m_rows * Cols_, m_data); |
387 | | } |
388 | | return *this; |
389 | | } |
390 | | EIGEN_DEVICE_FUNC constexpr DenseStorage(Index, Index rows, Index) : m_rows(rows) {} |
391 | | EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { |
392 | | internal::plain_array_helper::swap(m_data, m_rows * Cols_, other.m_data, other.m_rows * Cols_); |
393 | | numext::swap(m_rows, other.m_rows); |
394 | | } |
395 | | EIGEN_DEVICE_FUNC constexpr Index rows(void) const EIGEN_NOEXCEPT { return m_rows; } |
396 | | EIGEN_DEVICE_FUNC constexpr Index cols(void) const EIGEN_NOEXCEPT { return Cols_; } |
397 | | EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index, Index rows, Index) { m_rows = rows; } |
398 | | EIGEN_DEVICE_FUNC constexpr void resize(Index, Index rows, Index) { m_rows = rows; } |
399 | | EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data.array; } |
400 | | EIGEN_DEVICE_FUNC constexpr T* data() { return m_data.array; } |
401 | | }; |
402 | | |
403 | | // dynamic-size matrix with fixed-size storage and fixed height |
404 | | template <typename T, int Size, int Rows_, int Options_> |
405 | | class DenseStorage<T, Size, Rows_, Dynamic, Options_> { |
406 | | internal::plain_array<T, Size, Options_> m_data; |
407 | | Index m_cols; |
408 | | |
409 | | public: |
410 | | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_cols(0) {} |
411 | | EIGEN_DEVICE_FUNC explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) |
412 | | : m_data(internal::constructor_without_unaligned_array_assert()), m_cols(0) {} |
413 | | EIGEN_DEVICE_FUNC constexpr DenseStorage(const DenseStorage& other) |
414 | | : m_data(internal::constructor_without_unaligned_array_assert()), m_cols(other.m_cols) { |
415 | | internal::plain_array_helper::copy(other.m_data, Rows_ * m_cols, m_data); |
416 | | } |
417 | | EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) { |
418 | | if (this != &other) { |
419 | | m_cols = other.m_cols; |
420 | | internal::plain_array_helper::copy(other.m_data, Rows_ * m_cols, m_data); |
421 | | } |
422 | | return *this; |
423 | | } |
424 | | EIGEN_DEVICE_FUNC DenseStorage(Index, Index, Index cols) : m_cols(cols) {} |
425 | | EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { |
426 | | internal::plain_array_helper::swap(m_data, Rows_ * m_cols, other.m_data, Rows_ * other.m_cols); |
427 | | numext::swap(m_cols, other.m_cols); |
428 | | } |
429 | | EIGEN_DEVICE_FUNC constexpr Index rows(void) const EIGEN_NOEXCEPT { return Rows_; } |
430 | | EIGEN_DEVICE_FUNC constexpr Index cols(void) const EIGEN_NOEXCEPT { return m_cols; } |
431 | | EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index, Index, Index cols) { m_cols = cols; } |
432 | | EIGEN_DEVICE_FUNC constexpr void resize(Index, Index, Index cols) { m_cols = cols; } |
433 | | EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data.array; } |
434 | | EIGEN_DEVICE_FUNC constexpr T* data() { return m_data.array; } |
435 | | }; |
436 | | |
437 | | // purely dynamic matrix. |
438 | | template <typename T, int Options_> |
439 | | class DenseStorage<T, Dynamic, Dynamic, Dynamic, Options_> { |
440 | | T* m_data; |
441 | | Index m_rows; |
442 | | Index m_cols; |
443 | | |
444 | | public: |
445 | 58.3k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_rows(0), m_cols(0) {} Eigen::DenseStorage<std::__1::complex<float>, -1, -1, -1, 0>::DenseStorage() Line | Count | Source | 445 | 14.5k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_rows(0), m_cols(0) {} |
Eigen::DenseStorage<int, -1, -1, -1, 0>::DenseStorage() Line | Count | Source | 445 | 11.6k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_rows(0), m_cols(0) {} |
Eigen::DenseStorage<std::__1::complex<double>, -1, -1, -1, 0>::DenseStorage() Line | Count | Source | 445 | 14.5k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_rows(0), m_cols(0) {} |
Eigen::DenseStorage<long double, -1, -1, -1, 0>::DenseStorage() Line | Count | Source | 445 | 11.6k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_rows(0), m_cols(0) {} |
Eigen::DenseStorage<float, -1, -1, -1, 0>::DenseStorage() Line | Count | Source | 445 | 2.91k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_rows(0), m_cols(0) {} |
Eigen::DenseStorage<double, -1, -1, -1, 0>::DenseStorage() Line | Count | Source | 445 | 2.91k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_rows(0), m_cols(0) {} |
|
446 | | EIGEN_DEVICE_FUNC explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) |
447 | | : m_data(0), m_rows(0), m_cols(0) {} |
448 | | EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) |
449 | | : m_data(internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size)), |
450 | | m_rows(rows), |
451 | | m_cols(cols) { |
452 | | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) |
453 | | eigen_internal_assert(size == rows * cols && rows >= 0 && cols >= 0); |
454 | | } |
455 | | EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) |
456 | | : m_data(internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(other.m_rows * other.m_cols)), |
457 | | m_rows(other.m_rows), |
458 | | m_cols(other.m_cols) { |
459 | | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = m_rows * m_cols) |
460 | | internal::smart_copy(other.m_data, other.m_data + other.m_rows * other.m_cols, m_data); |
461 | | } |
462 | | EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) { |
463 | | if (this != &other) { |
464 | | DenseStorage tmp(other); |
465 | | this->swap(tmp); |
466 | | } |
467 | | return *this; |
468 | | } |
469 | | EIGEN_DEVICE_FUNC DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT : m_data(std::move(other.m_data)), |
470 | | m_rows(std::move(other.m_rows)), |
471 | | m_cols(std::move(other.m_cols)) { |
472 | | other.m_data = nullptr; |
473 | | other.m_rows = 0; |
474 | | other.m_cols = 0; |
475 | | } |
476 | | EIGEN_DEVICE_FUNC DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT { |
477 | | numext::swap(m_data, other.m_data); |
478 | | numext::swap(m_rows, other.m_rows); |
479 | | numext::swap(m_cols, other.m_cols); |
480 | | return *this; |
481 | | } |
482 | 58.3k | EIGEN_DEVICE_FUNC ~DenseStorage() { |
483 | 58.3k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, m_rows * m_cols); |
484 | 58.3k | } Eigen::DenseStorage<std::__1::complex<float>, -1, -1, -1, 0>::~DenseStorage() Line | Count | Source | 482 | 14.5k | EIGEN_DEVICE_FUNC ~DenseStorage() { | 483 | 14.5k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, m_rows * m_cols); | 484 | 14.5k | } |
Eigen::DenseStorage<int, -1, -1, -1, 0>::~DenseStorage() Line | Count | Source | 482 | 11.6k | EIGEN_DEVICE_FUNC ~DenseStorage() { | 483 | 11.6k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, m_rows * m_cols); | 484 | 11.6k | } |
Eigen::DenseStorage<std::__1::complex<double>, -1, -1, -1, 0>::~DenseStorage() Line | Count | Source | 482 | 14.5k | EIGEN_DEVICE_FUNC ~DenseStorage() { | 483 | 14.5k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, m_rows * m_cols); | 484 | 14.5k | } |
Eigen::DenseStorage<long double, -1, -1, -1, 0>::~DenseStorage() Line | Count | Source | 482 | 11.6k | EIGEN_DEVICE_FUNC ~DenseStorage() { | 483 | 11.6k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, m_rows * m_cols); | 484 | 11.6k | } |
Eigen::DenseStorage<float, -1, -1, -1, 0>::~DenseStorage() Line | Count | Source | 482 | 2.91k | EIGEN_DEVICE_FUNC ~DenseStorage() { | 483 | 2.91k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, m_rows * m_cols); | 484 | 2.91k | } |
Eigen::DenseStorage<double, -1, -1, -1, 0>::~DenseStorage() Line | Count | Source | 482 | 2.91k | EIGEN_DEVICE_FUNC ~DenseStorage() { | 483 | 2.91k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, m_rows * m_cols); | 484 | 2.91k | } |
|
485 | | EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { |
486 | | numext::swap(m_data, other.m_data); |
487 | | numext::swap(m_rows, other.m_rows); |
488 | | numext::swap(m_cols, other.m_cols); |
489 | | } |
490 | 1.40M | EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT { return m_rows; } Eigen::DenseStorage<std::__1::complex<float>, -1, -1, -1, 0>::rows() const Line | Count | Source | 490 | 302k | EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT { return m_rows; } |
Eigen::DenseStorage<int, -1, -1, -1, 0>::rows() const Line | Count | Source | 490 | 300k | EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT { return m_rows; } |
Eigen::DenseStorage<std::__1::complex<double>, -1, -1, -1, 0>::rows() const Line | Count | Source | 490 | 340k | EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT { return m_rows; } |
Eigen::DenseStorage<long double, -1, -1, -1, 0>::rows() const Line | Count | Source | 490 | 363k | EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT { return m_rows; } |
Eigen::DenseStorage<float, -1, -1, -1, 0>::rows() const Line | Count | Source | 490 | 49.6k | EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT { return m_rows; } |
Eigen::DenseStorage<double, -1, -1, -1, 0>::rows() const Line | Count | Source | 490 | 49.6k | EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT { return m_rows; } |
|
491 | 625k | EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT { return m_cols; } Eigen::DenseStorage<std::__1::complex<float>, -1, -1, -1, 0>::cols() const Line | Count | Source | 491 | 137k | EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT { return m_cols; } |
Eigen::DenseStorage<int, -1, -1, -1, 0>::cols() const Line | Count | Source | 491 | 127k | EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT { return m_cols; } |
Eigen::DenseStorage<std::__1::complex<double>, -1, -1, -1, 0>::cols() const Line | Count | Source | 491 | 150k | EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT { return m_cols; } |
Eigen::DenseStorage<long double, -1, -1, -1, 0>::cols() const Line | Count | Source | 491 | 149k | EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT { return m_cols; } |
Eigen::DenseStorage<float, -1, -1, -1, 0>::cols() const Line | Count | Source | 491 | 30.4k | EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT { return m_cols; } |
Eigen::DenseStorage<double, -1, -1, -1, 0>::cols() const Line | Count | Source | 491 | 30.1k | EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT { return m_cols; } |
|
492 | | void conservativeResize(Index size, Index rows, Index cols) { |
493 | | m_data = |
494 | | internal::conditional_aligned_realloc_new_auto<T, (Options_ & DontAlign) == 0>(m_data, size, m_rows * m_cols); |
495 | | m_rows = rows; |
496 | | m_cols = cols; |
497 | | } |
498 | 58.3k | EIGEN_DEVICE_FUNC void resize(Index size, Index rows, Index cols) { |
499 | 58.3k | if (size != m_rows * m_cols) { |
500 | 58.3k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, m_rows * m_cols); |
501 | 58.3k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative |
502 | 58.3k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); |
503 | 0 | else |
504 | 0 | m_data = 0; |
505 | 58.3k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) |
506 | 58.3k | } |
507 | 58.3k | m_rows = rows; |
508 | 58.3k | m_cols = cols; |
509 | 58.3k | } Eigen::DenseStorage<std::__1::complex<float>, -1, -1, -1, 0>::resize(long, long, long) Line | Count | Source | 498 | 14.5k | EIGEN_DEVICE_FUNC void resize(Index size, Index rows, Index cols) { | 499 | 14.5k | if (size != m_rows * m_cols) { | 500 | 14.5k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, m_rows * m_cols); | 501 | 14.5k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative | 502 | 14.5k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); | 503 | 0 | else | 504 | 0 | m_data = 0; | 505 | 14.5k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) | 506 | 14.5k | } | 507 | 14.5k | m_rows = rows; | 508 | 14.5k | m_cols = cols; | 509 | 14.5k | } |
Eigen::DenseStorage<int, -1, -1, -1, 0>::resize(long, long, long) Line | Count | Source | 498 | 11.6k | EIGEN_DEVICE_FUNC void resize(Index size, Index rows, Index cols) { | 499 | 11.6k | if (size != m_rows * m_cols) { | 500 | 11.6k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, m_rows * m_cols); | 501 | 11.6k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative | 502 | 11.6k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); | 503 | 0 | else | 504 | 0 | m_data = 0; | 505 | 11.6k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) | 506 | 11.6k | } | 507 | 11.6k | m_rows = rows; | 508 | 11.6k | m_cols = cols; | 509 | 11.6k | } |
Eigen::DenseStorage<std::__1::complex<double>, -1, -1, -1, 0>::resize(long, long, long) Line | Count | Source | 498 | 14.5k | EIGEN_DEVICE_FUNC void resize(Index size, Index rows, Index cols) { | 499 | 14.5k | if (size != m_rows * m_cols) { | 500 | 14.5k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, m_rows * m_cols); | 501 | 14.5k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative | 502 | 14.5k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); | 503 | 0 | else | 504 | 0 | m_data = 0; | 505 | 14.5k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) | 506 | 14.5k | } | 507 | 14.5k | m_rows = rows; | 508 | 14.5k | m_cols = cols; | 509 | 14.5k | } |
Eigen::DenseStorage<long double, -1, -1, -1, 0>::resize(long, long, long) Line | Count | Source | 498 | 11.6k | EIGEN_DEVICE_FUNC void resize(Index size, Index rows, Index cols) { | 499 | 11.6k | if (size != m_rows * m_cols) { | 500 | 11.6k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, m_rows * m_cols); | 501 | 11.6k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative | 502 | 11.6k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); | 503 | 0 | else | 504 | 0 | m_data = 0; | 505 | 11.6k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) | 506 | 11.6k | } | 507 | 11.6k | m_rows = rows; | 508 | 11.6k | m_cols = cols; | 509 | 11.6k | } |
Eigen::DenseStorage<float, -1, -1, -1, 0>::resize(long, long, long) Line | Count | Source | 498 | 2.91k | EIGEN_DEVICE_FUNC void resize(Index size, Index rows, Index cols) { | 499 | 2.91k | if (size != m_rows * m_cols) { | 500 | 2.91k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, m_rows * m_cols); | 501 | 2.91k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative | 502 | 2.91k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); | 503 | 0 | else | 504 | 0 | m_data = 0; | 505 | 2.91k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) | 506 | 2.91k | } | 507 | 2.91k | m_rows = rows; | 508 | 2.91k | m_cols = cols; | 509 | 2.91k | } |
Eigen::DenseStorage<double, -1, -1, -1, 0>::resize(long, long, long) Line | Count | Source | 498 | 2.91k | EIGEN_DEVICE_FUNC void resize(Index size, Index rows, Index cols) { | 499 | 2.91k | if (size != m_rows * m_cols) { | 500 | 2.91k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, m_rows * m_cols); | 501 | 2.91k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative | 502 | 2.91k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); | 503 | 0 | else | 504 | 0 | m_data = 0; | 505 | 2.91k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) | 506 | 2.91k | } | 507 | 2.91k | m_rows = rows; | 508 | 2.91k | m_cols = cols; | 509 | 2.91k | } |
|
510 | 84.6k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } Eigen::DenseStorage<std::__1::complex<float>, -1, -1, -1, 0>::data() const Line | Count | Source | 510 | 20.4k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } |
Eigen::DenseStorage<int, -1, -1, -1, 0>::data() const Line | Count | Source | 510 | 13.1k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } |
Eigen::DenseStorage<std::__1::complex<double>, -1, -1, -1, 0>::data() const Line | Count | Source | 510 | 20.4k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } |
Eigen::DenseStorage<long double, -1, -1, -1, 0>::data() const Line | Count | Source | 510 | 13.1k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } |
Eigen::DenseStorage<float, -1, -1, -1, 0>::data() const Line | Count | Source | 510 | 8.75k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } |
Eigen::DenseStorage<double, -1, -1, -1, 0>::data() const Line | Count | Source | 510 | 8.75k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } |
|
511 | 335k | EIGEN_DEVICE_FUNC T* data() { return m_data; } Eigen::DenseStorage<std::__1::complex<float>, -1, -1, -1, 0>::data() Line | Count | Source | 511 | 69.3k | EIGEN_DEVICE_FUNC T* data() { return m_data; } |
Eigen::DenseStorage<int, -1, -1, -1, 0>::data() Line | Count | Source | 511 | 78.6k | EIGEN_DEVICE_FUNC T* data() { return m_data; } |
Eigen::DenseStorage<std::__1::complex<double>, -1, -1, -1, 0>::data() Line | Count | Source | 511 | 81.7k | EIGEN_DEVICE_FUNC T* data() { return m_data; } |
Eigen::DenseStorage<long double, -1, -1, -1, 0>::data() Line | Count | Source | 511 | 99.8k | EIGEN_DEVICE_FUNC T* data() { return m_data; } |
Eigen::DenseStorage<float, -1, -1, -1, 0>::data() Line | Count | Source | 511 | 2.91k | EIGEN_DEVICE_FUNC T* data() { return m_data; } |
Eigen::DenseStorage<double, -1, -1, -1, 0>::data() Line | Count | Source | 511 | 2.91k | EIGEN_DEVICE_FUNC T* data() { return m_data; } |
|
512 | | }; |
513 | | |
514 | | // matrix with dynamic width and fixed height (so that matrix has dynamic size). |
515 | | template <typename T, int Rows_, int Options_> |
516 | | class DenseStorage<T, Dynamic, Rows_, Dynamic, Options_> { |
517 | | T* m_data; |
518 | | Index m_cols; |
519 | | |
520 | | public: |
521 | 11.6k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_cols(0) {} Eigen::DenseStorage<std::__1::complex<float>, -1, 1, -1, 1>::DenseStorage() Line | Count | Source | 521 | 2.91k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_cols(0) {} |
Eigen::DenseStorage<int, -1, 1, -1, 1>::DenseStorage() Line | Count | Source | 521 | 2.91k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_cols(0) {} |
Eigen::DenseStorage<std::__1::complex<double>, -1, 1, -1, 1>::DenseStorage() Line | Count | Source | 521 | 2.91k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_cols(0) {} |
Eigen::DenseStorage<long double, -1, 1, -1, 1>::DenseStorage() Line | Count | Source | 521 | 2.91k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_cols(0) {} |
|
522 | | explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(0), m_cols(0) {} |
523 | | EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) |
524 | | : m_data(internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size)), m_cols(cols) { |
525 | | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) |
526 | | eigen_internal_assert(size == rows * cols && rows == Rows_ && cols >= 0); |
527 | | EIGEN_UNUSED_VARIABLE(rows); |
528 | | } |
529 | | EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) |
530 | | : m_data(internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(Rows_ * other.m_cols)), |
531 | | m_cols(other.m_cols) { |
532 | | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = m_cols * Rows_) |
533 | | internal::smart_copy(other.m_data, other.m_data + Rows_ * m_cols, m_data); |
534 | | } |
535 | | EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) { |
536 | | if (this != &other) { |
537 | | DenseStorage tmp(other); |
538 | | this->swap(tmp); |
539 | | } |
540 | | return *this; |
541 | | } |
542 | | EIGEN_DEVICE_FUNC DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT : m_data(std::move(other.m_data)), |
543 | | m_cols(std::move(other.m_cols)) { |
544 | | other.m_data = nullptr; |
545 | | other.m_cols = 0; |
546 | | } |
547 | | EIGEN_DEVICE_FUNC DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT { |
548 | | numext::swap(m_data, other.m_data); |
549 | | numext::swap(m_cols, other.m_cols); |
550 | | return *this; |
551 | | } |
552 | 11.6k | EIGEN_DEVICE_FUNC ~DenseStorage() { |
553 | 11.6k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Rows_ * m_cols); |
554 | 11.6k | } Eigen::DenseStorage<std::__1::complex<float>, -1, 1, -1, 1>::~DenseStorage() Line | Count | Source | 552 | 2.91k | EIGEN_DEVICE_FUNC ~DenseStorage() { | 553 | 2.91k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Rows_ * m_cols); | 554 | 2.91k | } |
Eigen::DenseStorage<int, -1, 1, -1, 1>::~DenseStorage() Line | Count | Source | 552 | 2.91k | EIGEN_DEVICE_FUNC ~DenseStorage() { | 553 | 2.91k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Rows_ * m_cols); | 554 | 2.91k | } |
Eigen::DenseStorage<std::__1::complex<double>, -1, 1, -1, 1>::~DenseStorage() Line | Count | Source | 552 | 2.91k | EIGEN_DEVICE_FUNC ~DenseStorage() { | 553 | 2.91k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Rows_ * m_cols); | 554 | 2.91k | } |
Eigen::DenseStorage<long double, -1, 1, -1, 1>::~DenseStorage() Line | Count | Source | 552 | 2.91k | EIGEN_DEVICE_FUNC ~DenseStorage() { | 553 | 2.91k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Rows_ * m_cols); | 554 | 2.91k | } |
|
555 | | EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { |
556 | | numext::swap(m_data, other.m_data); |
557 | | numext::swap(m_cols, other.m_cols); |
558 | | } |
559 | 40.8k | EIGEN_DEVICE_FUNC static constexpr Index rows(void) EIGEN_NOEXCEPT { return Rows_; } Eigen::DenseStorage<std::__1::complex<float>, -1, 1, -1, 1>::rows() Line | Count | Source | 559 | 10.2k | EIGEN_DEVICE_FUNC static constexpr Index rows(void) EIGEN_NOEXCEPT { return Rows_; } |
Eigen::DenseStorage<int, -1, 1, -1, 1>::rows() Line | Count | Source | 559 | 10.2k | EIGEN_DEVICE_FUNC static constexpr Index rows(void) EIGEN_NOEXCEPT { return Rows_; } |
Eigen::DenseStorage<std::__1::complex<double>, -1, 1, -1, 1>::rows() Line | Count | Source | 559 | 10.2k | EIGEN_DEVICE_FUNC static constexpr Index rows(void) EIGEN_NOEXCEPT { return Rows_; } |
Eigen::DenseStorage<long double, -1, 1, -1, 1>::rows() Line | Count | Source | 559 | 10.2k | EIGEN_DEVICE_FUNC static constexpr Index rows(void) EIGEN_NOEXCEPT { return Rows_; } |
|
560 | 40.8k | EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT { return m_cols; } Eigen::DenseStorage<std::__1::complex<float>, -1, 1, -1, 1>::cols() const Line | Count | Source | 560 | 10.2k | EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT { return m_cols; } |
Eigen::DenseStorage<int, -1, 1, -1, 1>::cols() const Line | Count | Source | 560 | 10.2k | EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT { return m_cols; } |
Eigen::DenseStorage<std::__1::complex<double>, -1, 1, -1, 1>::cols() const Line | Count | Source | 560 | 10.2k | EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT { return m_cols; } |
Eigen::DenseStorage<long double, -1, 1, -1, 1>::cols() const Line | Count | Source | 560 | 10.2k | EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT { return m_cols; } |
|
561 | | EIGEN_DEVICE_FUNC void conservativeResize(Index size, Index, Index cols) { |
562 | | m_data = |
563 | | internal::conditional_aligned_realloc_new_auto<T, (Options_ & DontAlign) == 0>(m_data, size, Rows_ * m_cols); |
564 | | m_cols = cols; |
565 | | } |
566 | 11.6k | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index, Index cols) { |
567 | 11.6k | if (size != Rows_ * m_cols) { |
568 | 11.6k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Rows_ * m_cols); |
569 | 11.6k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative |
570 | 11.6k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); |
571 | 0 | else |
572 | 0 | m_data = 0; |
573 | 11.6k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) |
574 | 11.6k | } |
575 | 11.6k | m_cols = cols; |
576 | 11.6k | } Eigen::DenseStorage<std::__1::complex<float>, -1, 1, -1, 1>::resize(long, long, long) Line | Count | Source | 566 | 2.91k | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index, Index cols) { | 567 | 2.91k | if (size != Rows_ * m_cols) { | 568 | 2.91k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Rows_ * m_cols); | 569 | 2.91k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative | 570 | 2.91k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); | 571 | 0 | else | 572 | 0 | m_data = 0; | 573 | 2.91k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) | 574 | 2.91k | } | 575 | 2.91k | m_cols = cols; | 576 | 2.91k | } |
Eigen::DenseStorage<int, -1, 1, -1, 1>::resize(long, long, long) Line | Count | Source | 566 | 2.91k | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index, Index cols) { | 567 | 2.91k | if (size != Rows_ * m_cols) { | 568 | 2.91k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Rows_ * m_cols); | 569 | 2.91k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative | 570 | 2.91k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); | 571 | 0 | else | 572 | 0 | m_data = 0; | 573 | 2.91k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) | 574 | 2.91k | } | 575 | 2.91k | m_cols = cols; | 576 | 2.91k | } |
Eigen::DenseStorage<std::__1::complex<double>, -1, 1, -1, 1>::resize(long, long, long) Line | Count | Source | 566 | 2.91k | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index, Index cols) { | 567 | 2.91k | if (size != Rows_ * m_cols) { | 568 | 2.91k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Rows_ * m_cols); | 569 | 2.91k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative | 570 | 2.91k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); | 571 | 0 | else | 572 | 0 | m_data = 0; | 573 | 2.91k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) | 574 | 2.91k | } | 575 | 2.91k | m_cols = cols; | 576 | 2.91k | } |
Eigen::DenseStorage<long double, -1, 1, -1, 1>::resize(long, long, long) Line | Count | Source | 566 | 2.91k | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index, Index cols) { | 567 | 2.91k | if (size != Rows_ * m_cols) { | 568 | 2.91k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Rows_ * m_cols); | 569 | 2.91k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative | 570 | 2.91k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); | 571 | 0 | else | 572 | 0 | m_data = 0; | 573 | 2.91k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) | 574 | 2.91k | } | 575 | 2.91k | m_cols = cols; | 576 | 2.91k | } |
|
577 | 17.5k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } Eigen::DenseStorage<std::__1::complex<float>, -1, 1, -1, 1>::data() const Line | Count | Source | 577 | 4.37k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } |
Eigen::DenseStorage<int, -1, 1, -1, 1>::data() const Line | Count | Source | 577 | 4.37k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } |
Eigen::DenseStorage<std::__1::complex<double>, -1, 1, -1, 1>::data() const Line | Count | Source | 577 | 4.37k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } |
Eigen::DenseStorage<long double, -1, 1, -1, 1>::data() const Line | Count | Source | 577 | 4.37k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } |
|
578 | | EIGEN_DEVICE_FUNC T* data() { return m_data; } |
579 | | }; |
580 | | |
581 | | // matrix with dynamic height and fixed width (so that matrix has dynamic size). |
582 | | template <typename T, int Cols_, int Options_> |
583 | | class DenseStorage<T, Dynamic, Dynamic, Cols_, Options_> { |
584 | | T* m_data; |
585 | | Index m_rows; |
586 | | |
587 | | public: |
588 | 17.5k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_rows(0) {} Eigen::DenseStorage<std::__1::complex<float>, -1, -1, 1, 0>::DenseStorage() Line | Count | Source | 588 | 4.37k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_rows(0) {} |
Eigen::DenseStorage<int, -1, -1, 1, 0>::DenseStorage() Line | Count | Source | 588 | 4.37k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_rows(0) {} |
Eigen::DenseStorage<std::__1::complex<double>, -1, -1, 1, 0>::DenseStorage() Line | Count | Source | 588 | 4.37k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_rows(0) {} |
Eigen::DenseStorage<long double, -1, -1, 1, 0>::DenseStorage() Line | Count | Source | 588 | 4.37k | EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_rows(0) {} |
|
589 | | explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(0), m_rows(0) {} |
590 | | EIGEN_DEVICE_FUNC constexpr DenseStorage(Index size, Index rows, Index cols) |
591 | | : m_data(internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size)), m_rows(rows) { |
592 | | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) |
593 | | eigen_internal_assert(size == rows * cols && rows >= 0 && cols == Cols_); |
594 | | EIGEN_UNUSED_VARIABLE(cols); |
595 | | } |
596 | | EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) |
597 | | : m_data(internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(other.m_rows * Cols_)), |
598 | | m_rows(other.m_rows) { |
599 | | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = m_rows * Cols_) |
600 | | internal::smart_copy(other.m_data, other.m_data + other.m_rows * Cols_, m_data); |
601 | | } |
602 | | EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) { |
603 | | if (this != &other) { |
604 | | DenseStorage tmp(other); |
605 | | this->swap(tmp); |
606 | | } |
607 | | return *this; |
608 | | } |
609 | | EIGEN_DEVICE_FUNC DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT : m_data(std::move(other.m_data)), |
610 | | m_rows(std::move(other.m_rows)) { |
611 | | other.m_data = nullptr; |
612 | | other.m_rows = 0; |
613 | | } |
614 | | EIGEN_DEVICE_FUNC DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT { |
615 | | numext::swap(m_data, other.m_data); |
616 | | numext::swap(m_rows, other.m_rows); |
617 | | return *this; |
618 | | } |
619 | 17.5k | EIGEN_DEVICE_FUNC ~DenseStorage() { |
620 | 17.5k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Cols_ * m_rows); |
621 | 17.5k | } Eigen::DenseStorage<std::__1::complex<float>, -1, -1, 1, 0>::~DenseStorage() Line | Count | Source | 619 | 4.37k | EIGEN_DEVICE_FUNC ~DenseStorage() { | 620 | 4.37k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Cols_ * m_rows); | 621 | 4.37k | } |
Eigen::DenseStorage<int, -1, -1, 1, 0>::~DenseStorage() Line | Count | Source | 619 | 4.37k | EIGEN_DEVICE_FUNC ~DenseStorage() { | 620 | 4.37k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Cols_ * m_rows); | 621 | 4.37k | } |
Eigen::DenseStorage<std::__1::complex<double>, -1, -1, 1, 0>::~DenseStorage() Line | Count | Source | 619 | 4.37k | EIGEN_DEVICE_FUNC ~DenseStorage() { | 620 | 4.37k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Cols_ * m_rows); | 621 | 4.37k | } |
Eigen::DenseStorage<long double, -1, -1, 1, 0>::~DenseStorage() Line | Count | Source | 619 | 4.37k | EIGEN_DEVICE_FUNC ~DenseStorage() { | 620 | 4.37k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Cols_ * m_rows); | 621 | 4.37k | } |
|
622 | | EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { |
623 | | numext::swap(m_data, other.m_data); |
624 | | numext::swap(m_rows, other.m_rows); |
625 | | } |
626 | 128k | EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT { return m_rows; } Eigen::DenseStorage<std::__1::complex<float>, -1, -1, 1, 0>::rows() const Line | Count | Source | 626 | 32.0k | EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT { return m_rows; } |
Eigen::DenseStorage<int, -1, -1, 1, 0>::rows() const Line | Count | Source | 626 | 32.0k | EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT { return m_rows; } |
Eigen::DenseStorage<std::__1::complex<double>, -1, -1, 1, 0>::rows() const Line | Count | Source | 626 | 32.0k | EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT { return m_rows; } |
Eigen::DenseStorage<long double, -1, -1, 1, 0>::rows() const Line | Count | Source | 626 | 32.0k | EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT { return m_rows; } |
|
627 | 122k | EIGEN_DEVICE_FUNC static constexpr Index cols(void) { return Cols_; } Eigen::DenseStorage<std::__1::complex<float>, -1, -1, 1, 0>::cols() Line | Count | Source | 627 | 30.6k | EIGEN_DEVICE_FUNC static constexpr Index cols(void) { return Cols_; } |
Eigen::DenseStorage<int, -1, -1, 1, 0>::cols() Line | Count | Source | 627 | 30.6k | EIGEN_DEVICE_FUNC static constexpr Index cols(void) { return Cols_; } |
Eigen::DenseStorage<std::__1::complex<double>, -1, -1, 1, 0>::cols() Line | Count | Source | 627 | 30.6k | EIGEN_DEVICE_FUNC static constexpr Index cols(void) { return Cols_; } |
Eigen::DenseStorage<long double, -1, -1, 1, 0>::cols() Line | Count | Source | 627 | 30.6k | EIGEN_DEVICE_FUNC static constexpr Index cols(void) { return Cols_; } |
|
628 | | void conservativeResize(Index size, Index rows, Index) { |
629 | | m_data = |
630 | | internal::conditional_aligned_realloc_new_auto<T, (Options_ & DontAlign) == 0>(m_data, size, m_rows * Cols_); |
631 | | m_rows = rows; |
632 | | } |
633 | 17.5k | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index rows, Index) { |
634 | 17.5k | if (size != m_rows * Cols_) { |
635 | 17.5k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Cols_ * m_rows); |
636 | 17.5k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative |
637 | 17.5k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); |
638 | 0 | else |
639 | 0 | m_data = 0; |
640 | 17.5k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) |
641 | 17.5k | } |
642 | 17.5k | m_rows = rows; |
643 | 17.5k | } Eigen::DenseStorage<std::__1::complex<float>, -1, -1, 1, 0>::resize(long, long, long) Line | Count | Source | 633 | 4.37k | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index rows, Index) { | 634 | 4.37k | if (size != m_rows * Cols_) { | 635 | 4.37k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Cols_ * m_rows); | 636 | 4.37k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative | 637 | 4.37k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); | 638 | 0 | else | 639 | 0 | m_data = 0; | 640 | 4.37k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) | 641 | 4.37k | } | 642 | 4.37k | m_rows = rows; | 643 | 4.37k | } |
Eigen::DenseStorage<int, -1, -1, 1, 0>::resize(long, long, long) Line | Count | Source | 633 | 4.37k | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index rows, Index) { | 634 | 4.37k | if (size != m_rows * Cols_) { | 635 | 4.37k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Cols_ * m_rows); | 636 | 4.37k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative | 637 | 4.37k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); | 638 | 0 | else | 639 | 0 | m_data = 0; | 640 | 4.37k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) | 641 | 4.37k | } | 642 | 4.37k | m_rows = rows; | 643 | 4.37k | } |
Eigen::DenseStorage<std::__1::complex<double>, -1, -1, 1, 0>::resize(long, long, long) Line | Count | Source | 633 | 4.37k | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index rows, Index) { | 634 | 4.37k | if (size != m_rows * Cols_) { | 635 | 4.37k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Cols_ * m_rows); | 636 | 4.37k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative | 637 | 4.37k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); | 638 | 0 | else | 639 | 0 | m_data = 0; | 640 | 4.37k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) | 641 | 4.37k | } | 642 | 4.37k | m_rows = rows; | 643 | 4.37k | } |
Eigen::DenseStorage<long double, -1, -1, 1, 0>::resize(long, long, long) Line | Count | Source | 633 | 4.37k | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index rows, Index) { | 634 | 4.37k | if (size != m_rows * Cols_) { | 635 | 4.37k | internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, Cols_ * m_rows); | 636 | 4.37k | if (size > 0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative | 637 | 4.37k | m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size); | 638 | 0 | else | 639 | 0 | m_data = 0; | 640 | 4.37k | EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) | 641 | 4.37k | } | 642 | 4.37k | m_rows = rows; | 643 | 4.37k | } |
|
644 | 87.5k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } Eigen::DenseStorage<std::__1::complex<float>, -1, -1, 1, 0>::data() const Line | Count | Source | 644 | 21.8k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } |
Eigen::DenseStorage<int, -1, -1, 1, 0>::data() const Line | Count | Source | 644 | 21.8k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } |
Eigen::DenseStorage<std::__1::complex<double>, -1, -1, 1, 0>::data() const Line | Count | Source | 644 | 21.8k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } |
Eigen::DenseStorage<long double, -1, -1, 1, 0>::data() const Line | Count | Source | 644 | 21.8k | EIGEN_DEVICE_FUNC const T* data() const { return m_data; } |
|
645 | 11.6k | EIGEN_DEVICE_FUNC T* data() { return m_data; } Eigen::DenseStorage<std::__1::complex<float>, -1, -1, 1, 0>::data() Line | Count | Source | 645 | 2.91k | EIGEN_DEVICE_FUNC T* data() { return m_data; } |
Eigen::DenseStorage<int, -1, -1, 1, 0>::data() Line | Count | Source | 645 | 2.91k | EIGEN_DEVICE_FUNC T* data() { return m_data; } |
Eigen::DenseStorage<std::__1::complex<double>, -1, -1, 1, 0>::data() Line | Count | Source | 645 | 2.91k | EIGEN_DEVICE_FUNC T* data() { return m_data; } |
Eigen::DenseStorage<long double, -1, -1, 1, 0>::data() Line | Count | Source | 645 | 2.91k | EIGEN_DEVICE_FUNC T* data() { return m_data; } |
|
646 | | }; |
647 | | |
648 | | } // end namespace Eigen |
649 | | |
650 | | #endif // EIGEN_MATRIX_H |