12#ifndef EIGEN_MATRIXSTORAGE_H
13#define EIGEN_MATRIXSTORAGE_H
15#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
16 #define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(X) X; EIGEN_DENSE_STORAGE_CTOR_PLUGIN;
18 #define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(X)
21#include "./InternalHeaderCheck.h"
27struct constructor_without_unaligned_array_assert {};
29template<
typename T,
int Size>
31void check_static_allocation_size()
34 #if EIGEN_STACK_ALLOCATION_LIMIT
35 EIGEN_STATIC_ASSERT(Size *
sizeof(T) <= EIGEN_STACK_ALLOCATION_LIMIT, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG);
43template <
typename T,
int Size,
int MatrixOrArrayOptions,
44 int Alignment = (MatrixOrArrayOptions&
DontAlign) ? 0
45 : compute_default_alignment<T,Size>::value >
53 check_static_allocation_size<T,Size>();
57 plain_array(constructor_without_unaligned_array_assert)
59 check_static_allocation_size<T,Size>();
63#if defined(EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT)
64 #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask)
69 template<
typename PtrType>
70 EIGEN_ALWAYS_INLINE PtrType eigen_unaligned_array_assert_workaround_gcc47(PtrType array) {
return array; }
71 #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) \
72 eigen_assert((internal::UIntPtr(eigen_unaligned_array_assert_workaround_gcc47(array)) & (sizemask)) == 0 \
73 && "this assertion is explained here: " \
74 "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" \
75 " **** READ THIS WEB PAGE !!! ****");
77 #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) \
78 eigen_assert((internal::UIntPtr(array) & (sizemask)) == 0 \
79 && "this assertion is explained here: " \
80 "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" \
81 " **** READ THIS WEB PAGE !!! ****");
84template <
typename T,
int Size,
int MatrixOrArrayOptions>
85struct plain_array<T, Size, MatrixOrArrayOptions, 8>
87 EIGEN_ALIGN_TO_BOUNDARY(8) T array[Size];
92 EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(7);
93 check_static_allocation_size<T,Size>();
97 plain_array(constructor_without_unaligned_array_assert)
99 check_static_allocation_size<T,Size>();
103template <
typename T,
int Size,
int MatrixOrArrayOptions>
104struct plain_array<T, Size, MatrixOrArrayOptions, 16>
106 EIGEN_ALIGN_TO_BOUNDARY(16) T array[Size];
111 EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(15);
112 check_static_allocation_size<T,Size>();
116 plain_array(constructor_without_unaligned_array_assert)
118 check_static_allocation_size<T,Size>();
122template <
typename T,
int Size,
int MatrixOrArrayOptions>
123struct plain_array<T, Size, MatrixOrArrayOptions, 32>
125 EIGEN_ALIGN_TO_BOUNDARY(32) T array[Size];
130 EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(31);
131 check_static_allocation_size<T,Size>();
135 plain_array(constructor_without_unaligned_array_assert)
137 check_static_allocation_size<T,Size>();
141template <
typename T,
int Size,
int MatrixOrArrayOptions>
142struct plain_array<T, Size, MatrixOrArrayOptions, 64>
144 EIGEN_ALIGN_TO_BOUNDARY(64) T array[Size];
149 EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(63);
150 check_static_allocation_size<T,Size>();
154 plain_array(constructor_without_unaligned_array_assert)
156 check_static_allocation_size<T,Size>();
160template <
typename T,
int MatrixOrArrayOptions,
int Alignment>
161struct plain_array<T, 0, MatrixOrArrayOptions, Alignment>
164 EIGEN_DEVICE_FUNC plain_array() {}
165 EIGEN_DEVICE_FUNC plain_array(constructor_without_unaligned_array_assert) {}
168struct plain_array_helper {
169 template<
typename T,
int Size,
int MatrixOrArrayOptions,
int Alignment>
170 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
171 static void copy(
const plain_array<T, Size, MatrixOrArrayOptions, Alignment>& src,
const Eigen::Index size,
172 plain_array<T, Size, MatrixOrArrayOptions, Alignment>& dst) {
173 smart_copy(src.array, src.array + size, dst.array);
176 template<
typename T,
int Size,
int MatrixOrArrayOptions,
int Alignment>
177 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
178 static void swap(plain_array<T, Size, MatrixOrArrayOptions, Alignment>& a,
const Eigen::Index a_size,
179 plain_array<T, Size, MatrixOrArrayOptions, Alignment>& b,
const Eigen::Index b_size) {
180 if (a_size < b_size) {
181 std::swap_ranges(b.array, b.array + a_size, a.array);
182 smart_move(b.array + a_size, b.array + b_size, a.array + a_size);
183 }
else if (a_size > b_size) {
184 std::swap_ranges(a.array, a.array + b_size, b.array);
185 smart_move(a.array + b_size, a.array + a_size, b.array + b_size);
187 std::swap_ranges(a.array, a.array + a_size, b.array);
206template<
typename T,
int Size,
int Rows_,
int Cols_,
int Options_>
class DenseStorage;
209template<
typename T,
int Size,
int Rows_,
int Cols_,
int Options_>
class DenseStorage
211 internal::plain_array<T,Size,Options_> m_data;
213 EIGEN_DEVICE_FUNC DenseStorage() {
214 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(
Index size = Size)
217 explicit DenseStorage(internal::constructor_without_unaligned_array_assert)
218 : m_data(internal::constructor_without_unaligned_array_assert()) {}
219#if defined(EIGEN_DENSE_STORAGE_CTOR_PLUGIN)
221 DenseStorage(
const DenseStorage& other) : m_data(other.m_data) {
222 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(
Index size = Size)
225 EIGEN_DEVICE_FUNC DenseStorage(
const DenseStorage&) =
default;
227 EIGEN_DEVICE_FUNC DenseStorage& operator=(
const DenseStorage&) =
default;
228 EIGEN_DEVICE_FUNC DenseStorage(DenseStorage&&) =
default;
229 EIGEN_DEVICE_FUNC DenseStorage& operator=(DenseStorage&&) =
default;
231 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
232 eigen_internal_assert(size==rows*cols && rows==Rows_ && cols==Cols_);
233 EIGEN_UNUSED_VARIABLE(size);
234 EIGEN_UNUSED_VARIABLE(rows);
235 EIGEN_UNUSED_VARIABLE(cols);
237 EIGEN_DEVICE_FUNC
void swap(DenseStorage& other) {
238 numext::swap(m_data, other.m_data);
240 EIGEN_DEVICE_FUNC
static EIGEN_CONSTEXPR
Index rows(
void) EIGEN_NOEXCEPT {
return Rows_;}
241 EIGEN_DEVICE_FUNC
static EIGEN_CONSTEXPR
Index cols(
void) EIGEN_NOEXCEPT {
return Cols_;}
244 EIGEN_DEVICE_FUNC
const T *data()
const {
return m_data.array; }
245 EIGEN_DEVICE_FUNC T *data() {
return m_data.array; }
249template<
typename T,
int Rows_,
int Cols_,
int Options_>
class DenseStorage<T, 0, Rows_, Cols_, Options_>
252 EIGEN_DEVICE_FUNC DenseStorage() {}
253 EIGEN_DEVICE_FUNC
explicit DenseStorage(internal::constructor_without_unaligned_array_assert) {}
254 EIGEN_DEVICE_FUNC DenseStorage(
const DenseStorage&) {}
255 EIGEN_DEVICE_FUNC DenseStorage& operator=(
const DenseStorage&) {
return *
this; }
257 EIGEN_DEVICE_FUNC
void swap(DenseStorage& ) {}
258 EIGEN_DEVICE_FUNC
static EIGEN_CONSTEXPR
Index rows(
void) EIGEN_NOEXCEPT {
return Rows_;}
259 EIGEN_DEVICE_FUNC
static EIGEN_CONSTEXPR
Index cols(
void) EIGEN_NOEXCEPT {
return Cols_;}
262 EIGEN_DEVICE_FUNC
const T *data()
const {
return 0; }
263 EIGEN_DEVICE_FUNC T *data() {
return 0; }
267template<
typename T,
int Options_>
class DenseStorage<T, 0, Dynamic, Dynamic, Options_>
268:
public DenseStorage<T, 0, 0, 0, Options_> { };
270template<
typename T,
int Rows_,
int Options_>
class DenseStorage<T, 0, Rows_, Dynamic, Options_>
271:
public DenseStorage<T, 0, 0, 0, Options_> { };
273template<
typename T,
int Cols_,
int Options_>
class DenseStorage<T, 0, Dynamic, Cols_, Options_>
274:
public DenseStorage<T, 0, 0, 0, Options_> { };
277template<
typename T,
int Size,
int Options_>
class DenseStorage<T, Size, Dynamic, Dynamic, Options_>
279 internal::plain_array<T,Size,Options_> m_data;
283 EIGEN_DEVICE_FUNC DenseStorage() : m_rows(0), m_cols(0) {}
284 EIGEN_DEVICE_FUNC
explicit DenseStorage(internal::constructor_without_unaligned_array_assert)
285 : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(0), m_cols(0) {}
286 EIGEN_DEVICE_FUNC DenseStorage(
const DenseStorage& other)
287 : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(other.m_rows), m_cols(other.m_cols)
289 internal::plain_array_helper::copy(other.m_data, m_rows * m_cols, m_data);
291 EIGEN_DEVICE_FUNC DenseStorage& operator=(
const DenseStorage& other)
295 m_rows = other.m_rows;
296 m_cols = other.m_cols;
297 internal::plain_array_helper::copy(other.m_data, m_rows * m_cols, m_data);
301 EIGEN_DEVICE_FUNC DenseStorage(
Index,
Index rows,
Index cols) : m_rows(rows), m_cols(cols) {}
302 EIGEN_DEVICE_FUNC
void swap(DenseStorage& other)
304 internal::plain_array_helper::swap(m_data, m_rows * m_cols, other.m_data, other.m_rows * other.m_cols);
305 numext::swap(m_rows,other.m_rows);
306 numext::swap(m_cols,other.m_cols);
308 EIGEN_DEVICE_FUNC
Index rows()
const {
return m_rows;}
309 EIGEN_DEVICE_FUNC
Index cols()
const {
return m_cols;}
310 EIGEN_DEVICE_FUNC
void conservativeResize(
Index,
Index rows,
Index cols) { m_rows = rows; m_cols = cols; }
311 EIGEN_DEVICE_FUNC
void resize(
Index,
Index rows,
Index cols) { m_rows = rows; m_cols = cols; }
312 EIGEN_DEVICE_FUNC
const T *data()
const {
return m_data.array; }
313 EIGEN_DEVICE_FUNC T *data() {
return m_data.array; }
317template<
typename T,
int Size,
int Cols_,
int Options_>
class DenseStorage<T, Size, Dynamic, Cols_, Options_>
319 internal::plain_array<T,Size,Options_> m_data;
322 EIGEN_DEVICE_FUNC DenseStorage() : m_rows(0) {}
323 EIGEN_DEVICE_FUNC
explicit DenseStorage(internal::constructor_without_unaligned_array_assert)
324 : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(0) {}
325 EIGEN_DEVICE_FUNC DenseStorage(
const DenseStorage& other)
326 : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(other.m_rows)
328 internal::plain_array_helper::copy(other.m_data, m_rows * Cols_, m_data);
331 EIGEN_DEVICE_FUNC DenseStorage& operator=(
const DenseStorage& other)
335 m_rows = other.m_rows;
336 internal::plain_array_helper::copy(other.m_data, m_rows * Cols_, m_data);
340 EIGEN_DEVICE_FUNC DenseStorage(
Index,
Index rows,
Index) : m_rows(rows) {}
341 EIGEN_DEVICE_FUNC
void swap(DenseStorage& other)
343 internal::plain_array_helper::swap(m_data, m_rows * Cols_, other.m_data, other.m_rows * Cols_);
344 numext::swap(m_rows, other.m_rows);
346 EIGEN_DEVICE_FUNC
Index rows(
void)
const EIGEN_NOEXCEPT {
return m_rows;}
347 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
Index cols(
void)
const EIGEN_NOEXCEPT {
return Cols_;}
348 EIGEN_DEVICE_FUNC
void conservativeResize(
Index,
Index rows,
Index) { m_rows = rows; }
349 EIGEN_DEVICE_FUNC
void resize(
Index,
Index rows,
Index) { m_rows = rows; }
350 EIGEN_DEVICE_FUNC
const T *data()
const {
return m_data.array; }
351 EIGEN_DEVICE_FUNC T *data() {
return m_data.array; }
355template<
typename T,
int Size,
int Rows_,
int Options_>
class DenseStorage<T, Size, Rows_, Dynamic, Options_>
357 internal::plain_array<T,Size,Options_> m_data;
360 EIGEN_DEVICE_FUNC DenseStorage() : m_cols(0) {}
361 EIGEN_DEVICE_FUNC
explicit DenseStorage(internal::constructor_without_unaligned_array_assert)
362 : m_data(internal::constructor_without_unaligned_array_assert()), m_cols(0) {}
363 EIGEN_DEVICE_FUNC DenseStorage(
const DenseStorage& other)
364 : m_data(internal::constructor_without_unaligned_array_assert()), m_cols(other.m_cols)
366 internal::plain_array_helper::copy(other.m_data, Rows_ * m_cols, m_data);
368 EIGEN_DEVICE_FUNC DenseStorage& operator=(
const DenseStorage& other)
372 m_cols = other.m_cols;
373 internal::plain_array_helper::copy(other.m_data, Rows_ * m_cols, m_data);
377 EIGEN_DEVICE_FUNC DenseStorage(
Index,
Index,
Index cols) : m_cols(cols) {}
378 EIGEN_DEVICE_FUNC
void swap(DenseStorage& other) {
379 internal::plain_array_helper::swap(m_data, Rows_ * m_cols, other.m_data, Rows_ * other.m_cols);
380 numext::swap(m_cols, other.m_cols);
382 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
Index rows(
void)
const EIGEN_NOEXCEPT {
return Rows_;}
383 EIGEN_DEVICE_FUNC
Index cols(
void)
const EIGEN_NOEXCEPT {
return m_cols;}
384 EIGEN_DEVICE_FUNC
void conservativeResize(
Index,
Index,
Index cols) { m_cols = cols; }
385 EIGEN_DEVICE_FUNC
void resize(
Index,
Index,
Index cols) { m_cols = cols; }
386 EIGEN_DEVICE_FUNC
const T *data()
const {
return m_data.array; }
387 EIGEN_DEVICE_FUNC T *data() {
return m_data.array; }
391template<
typename T,
int Options_>
class DenseStorage<T, Dynamic, Dynamic, Dynamic, Options_>
397 EIGEN_DEVICE_FUNC DenseStorage() : m_data(0), m_rows(0), m_cols(0) {}
398 EIGEN_DEVICE_FUNC
explicit DenseStorage(internal::constructor_without_unaligned_array_assert)
399 : m_data(0), m_rows(0), m_cols(0) {}
401 : m_data(internal::conditional_aligned_new_auto<T,(Options_&
DontAlign)==0>(size)), m_rows(rows), m_cols(cols)
403 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
404 eigen_internal_assert(size==rows*cols && rows>=0 && cols >=0);
406 EIGEN_DEVICE_FUNC DenseStorage(
const DenseStorage& other)
407 : m_data(internal::conditional_aligned_new_auto<T,(Options_&
DontAlign)==0>(other.m_rows*other.m_cols))
408 , m_rows(other.m_rows)
409 , m_cols(other.m_cols)
411 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(
Index size = m_rows*m_cols)
412 internal::smart_copy(other.m_data, other.m_data+other.m_rows*other.m_cols, m_data);
414 EIGEN_DEVICE_FUNC DenseStorage& operator=(
const DenseStorage& other)
418 DenseStorage tmp(other);
424 DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT
425 : m_data(std::move(other.m_data))
426 , m_rows(std::move(other.m_rows))
427 , m_cols(std::move(other.m_cols))
429 other.m_data =
nullptr;
434 DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT
436 numext::swap(m_data, other.m_data);
437 numext::swap(m_rows, other.m_rows);
438 numext::swap(m_cols, other.m_cols);
441 EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, m_rows*m_cols); }
442 EIGEN_DEVICE_FUNC
void swap(DenseStorage& other)
444 numext::swap(m_data,other.m_data);
445 numext::swap(m_rows,other.m_rows);
446 numext::swap(m_cols,other.m_cols);
448 EIGEN_DEVICE_FUNC
Index rows(
void)
const EIGEN_NOEXCEPT {
return m_rows;}
449 EIGEN_DEVICE_FUNC
Index cols(
void)
const EIGEN_NOEXCEPT {
return m_cols;}
452 m_data = internal::conditional_aligned_realloc_new_auto<T,(Options_&DontAlign)==0>(m_data, size, m_rows*m_cols);
458 if(size != m_rows*m_cols)
460 internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, m_rows*m_cols);
462 m_data = internal::conditional_aligned_new_auto<T,(Options_&DontAlign)==0>(size);
465 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
470 EIGEN_DEVICE_FUNC
const T *data()
const {
return m_data; }
471 EIGEN_DEVICE_FUNC T *data() {
return m_data; }
475template<
typename T,
int Rows_,
int Options_>
class DenseStorage<T, Dynamic, Rows_, Dynamic, Options_>
480 EIGEN_DEVICE_FUNC DenseStorage() : m_data(0), m_cols(0) {}
481 explicit DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(0), m_cols(0) {}
482 EIGEN_DEVICE_FUNC DenseStorage(
Index size,
Index rows,
Index cols) : m_data(internal::conditional_aligned_new_auto<T,(Options_&
DontAlign)==0>(size)), m_cols(cols)
484 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
485 eigen_internal_assert(size==rows*cols && rows==Rows_ && cols >=0);
486 EIGEN_UNUSED_VARIABLE(rows);
488 EIGEN_DEVICE_FUNC DenseStorage(
const DenseStorage& other)
489 : m_data(internal::conditional_aligned_new_auto<T,(Options_&
DontAlign)==0>(Rows_*other.m_cols))
490 , m_cols(other.m_cols)
492 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(
Index size = m_cols*Rows_)
493 internal::smart_copy(other.m_data, other.m_data+Rows_*m_cols, m_data);
495 EIGEN_DEVICE_FUNC DenseStorage& operator=(
const DenseStorage& other)
499 DenseStorage tmp(other);
505 DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT
506 : m_data(std::move(other.m_data))
507 , m_cols(std::move(other.m_cols))
509 other.m_data =
nullptr;
513 DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT
515 numext::swap(m_data, other.m_data);
516 numext::swap(m_cols, other.m_cols);
519 EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, Rows_*m_cols); }
520 EIGEN_DEVICE_FUNC
void swap(DenseStorage& other) {
521 numext::swap(m_data,other.m_data);
522 numext::swap(m_cols,other.m_cols);
524 EIGEN_DEVICE_FUNC
static EIGEN_CONSTEXPR
Index rows(
void) EIGEN_NOEXCEPT {
return Rows_;}
525 EIGEN_DEVICE_FUNC
Index cols(
void)
const EIGEN_NOEXCEPT {
return m_cols;}
526 EIGEN_DEVICE_FUNC
void conservativeResize(
Index size,
Index,
Index cols)
528 m_data = internal::conditional_aligned_realloc_new_auto<T,(Options_&DontAlign)==0>(m_data, size, Rows_*m_cols);
531 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void resize(
Index size,
Index,
Index cols)
533 if(size != Rows_*m_cols)
535 internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, Rows_*m_cols);
537 m_data = internal::conditional_aligned_new_auto<T,(Options_&DontAlign)==0>(size);
540 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
544 EIGEN_DEVICE_FUNC
const T *data()
const {
return m_data; }
545 EIGEN_DEVICE_FUNC T *data() {
return m_data; }
549template<
typename T,
int Cols_,
int Options_>
class DenseStorage<T, Dynamic, Dynamic, Cols_, Options_>
554 EIGEN_DEVICE_FUNC DenseStorage() : m_data(0), m_rows(0) {}
555 explicit DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(0), m_rows(0) {}
556 EIGEN_DEVICE_FUNC DenseStorage(
Index size,
Index rows,
Index cols) : m_data(internal::conditional_aligned_new_auto<T,(Options_&
DontAlign)==0>(size)), m_rows(rows)
558 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
559 eigen_internal_assert(size==rows*cols && rows>=0 && cols == Cols_);
560 EIGEN_UNUSED_VARIABLE(cols);
562 EIGEN_DEVICE_FUNC DenseStorage(
const DenseStorage& other)
563 : m_data(internal::conditional_aligned_new_auto<T,(Options_&
DontAlign)==0>(other.m_rows*Cols_))
564 , m_rows(other.m_rows)
566 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(
Index size = m_rows*Cols_)
567 internal::smart_copy(other.m_data, other.m_data+other.m_rows*Cols_, m_data);
569 EIGEN_DEVICE_FUNC DenseStorage& operator=(
const DenseStorage& other)
573 DenseStorage tmp(other);
579 DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT
580 : m_data(std::move(other.m_data))
581 , m_rows(std::move(other.m_rows))
583 other.m_data =
nullptr;
587 DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT
589 numext::swap(m_data, other.m_data);
590 numext::swap(m_rows, other.m_rows);
593 EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, Cols_*m_rows); }
594 EIGEN_DEVICE_FUNC
void swap(DenseStorage& other) {
595 numext::swap(m_data,other.m_data);
596 numext::swap(m_rows,other.m_rows);
598 EIGEN_DEVICE_FUNC
Index rows(
void)
const EIGEN_NOEXCEPT {
return m_rows;}
599 EIGEN_DEVICE_FUNC
static EIGEN_CONSTEXPR
Index cols(
void) {
return Cols_;}
602 m_data = internal::conditional_aligned_realloc_new_auto<T,(Options_&DontAlign)==0>(m_data, size, m_rows*Cols_);
605 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void resize(
Index size,
Index rows,
Index)
607 if(size != m_rows*Cols_)
609 internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, Cols_*m_rows);
611 m_data = internal::conditional_aligned_new_auto<T,(Options_&DontAlign)==0>(size);
614 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
618 EIGEN_DEVICE_FUNC
const T *data()
const {
return m_data; }
619 EIGEN_DEVICE_FUNC T *data() {
return m_data; }
@ DontAlign
Definition: Constants.h:327
Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:59