16 #if EIGEN_HAS_TYPE_TRAITS && EIGEN_HAS_CXX11
20 #if !defined(EIGEN_DENSE_STORAGE_CTOR_PLUGIN)
27 template <
typename T,
int Size,
int Rows,
int Cols>
36 raw_reference[
i] =
static_cast<T>(
i);
38 DenseStorageType copied_reference(
reference);
39 const T* raw_copied_reference = copied_reference.data();
44 template <
typename T,
int Size,
int Rows,
int Cols>
53 raw_reference[
i] =
static_cast<T>(
i);
55 DenseStorageType copied_reference;
57 const T* raw_copied_reference = copied_reference.data();
62 template <
typename T,
int Size,
int Rows,
int Cols>
67 const int size0 = rows0*cols0;
68 DenseStorageType
a(size0, rows0, cols0);
69 for (
int i=0;
i<size0; ++
i) {
70 a.data()[
i] =
static_cast<T>(
i);
73 const int size1 = rows1*cols1;
74 DenseStorageType
b(size1, rows1, cols1);
75 for (
int i=0;
i<size1; ++
i) {
76 b.data()[
i] =
static_cast<T>(-
i);
81 for (
int i=0;
i<size0; ++
i) {
85 for (
int i=0;
i<size1; ++
i) {
90 template<
typename T,
int Size, std::
size_t Alignment>
95 struct alignas(Alignment) Empty1 {};
98 struct EIGEN_ALIGN_TO_BOUNDARY(Alignment) Empty2 {};
101 struct Nested1 { EIGEN_ALIGN_TO_BOUNDARY(Alignment)
T data[Size]; };
104 VERIFY_IS_EQUAL( (std::alignment_of<internal::plain_array<T,Size,AutoAlign,Alignment> >::
value), Alignment);
119 dense_storage_copy<T,Dynamic,Dynamic,Dynamic>(4, 3);
120 dense_storage_copy<T,Dynamic,Dynamic,3>(4, 3);
121 dense_storage_copy<T,Dynamic,4,Dynamic>(4, 3);
123 dense_storage_copy<T,12,4,3>(4, 3);
124 dense_storage_copy<T,12,Dynamic,Dynamic>(4, 3);
125 dense_storage_copy<T,12,4,Dynamic>(4, 3);
126 dense_storage_copy<T,12,Dynamic,3>(4, 3);
128 dense_storage_copy<T,18,Dynamic,Dynamic>(4, 3);
129 dense_storage_copy<T,18,4,Dynamic>(4, 3);
130 dense_storage_copy<T,18,Dynamic,3>(4, 3);
133 dense_storage_assignment<T,Dynamic,Dynamic,Dynamic>(4, 3);
134 dense_storage_assignment<T,Dynamic,Dynamic,3>(4, 3);
135 dense_storage_assignment<T,Dynamic,4,Dynamic>(4, 3);
137 dense_storage_assignment<T,12,4,3>(4, 3);
138 dense_storage_assignment<T,12,Dynamic,Dynamic>(4, 3);
139 dense_storage_assignment<T,12,4,Dynamic>(4, 3);
140 dense_storage_assignment<T,12,Dynamic,3>(4, 3);
142 dense_storage_assignment<T,18,Dynamic,Dynamic>(4, 3);
143 dense_storage_assignment<T,18,4,Dynamic>(4, 3);
144 dense_storage_assignment<T,18,Dynamic,3>(4, 3);
147 dense_storage_swap<T,Dynamic,Dynamic,Dynamic>(4, 3, 4, 3);
148 dense_storage_swap<T,Dynamic,Dynamic,Dynamic>(4, 3, 2, 1);
149 dense_storage_swap<T,Dynamic,Dynamic,Dynamic>(2, 1, 4, 3);
150 dense_storage_swap<T,Dynamic,Dynamic,3>(4, 3, 4, 3);
151 dense_storage_swap<T,Dynamic,Dynamic,3>(4, 3, 2, 3);
152 dense_storage_swap<T,Dynamic,Dynamic,3>(2, 3, 4, 3);
153 dense_storage_swap<T,Dynamic,4,Dynamic>(4, 3, 4, 3);
154 dense_storage_swap<T,Dynamic,4,Dynamic>(4, 3, 4, 1);
155 dense_storage_swap<T,Dynamic,4,Dynamic>(4, 1, 4, 3);
157 dense_storage_swap<T,12,4,3>(4, 3, 4, 3);
158 dense_storage_swap<T,12,Dynamic,Dynamic>(4, 3, 4, 3);
159 dense_storage_swap<T,12,Dynamic,Dynamic>(4, 3, 2, 1);
160 dense_storage_swap<T,12,Dynamic,Dynamic>(2, 1, 4, 3);
161 dense_storage_swap<T,12,4,Dynamic>(4, 3, 4, 3);
162 dense_storage_swap<T,12,4,Dynamic>(4, 3, 4, 1);
163 dense_storage_swap<T,12,4,Dynamic>(4, 1, 4, 3);
164 dense_storage_swap<T,12,Dynamic,3>(4, 3, 4, 3);
165 dense_storage_swap<T,12,Dynamic,3>(4, 3, 2, 3);
166 dense_storage_swap<T,12,Dynamic,3>(2, 3, 4, 3);
168 dense_storage_swap<T,18,Dynamic,Dynamic>(4, 3, 4, 3);
169 dense_storage_swap<T,18,Dynamic,Dynamic>(4, 3, 2, 1);
170 dense_storage_swap<T,18,Dynamic,Dynamic>(2, 1, 4, 3);
171 dense_storage_swap<T,18,4,Dynamic>(4, 3, 4, 3);
172 dense_storage_swap<T,18,4,Dynamic>(4, 3, 4, 1);
173 dense_storage_swap<T,18,4,Dynamic>(4, 1, 4, 3);
174 dense_storage_swap<T,18,Dynamic,3>(4, 3, 4, 3);
175 dense_storage_swap<T,18,Dynamic,3>(4, 3, 2, 3);
176 dense_storage_swap<T,18,Dynamic,3>(2, 3, 4, 3);
178 dense_storage_alignment<T,16,8>();
179 dense_storage_alignment<T,16,16>();
180 dense_storage_alignment<T,16,32>();
181 dense_storage_alignment<T,16,64>();
186 dense_storage_tests<int>();
187 dense_storage_tests<float>();
188 dense_storage_tests<SafeScalar<float> >();
189 dense_storage_tests<AnnoyingScalar>();