22 Scalar* a_array = internal::aligned_new<Scalar>(arraysize+1);
23 Scalar*
array = a_array;
57 Scalar s1 = internal::random<Scalar>();
61 Scalar* a_array1 = internal::aligned_new<Scalar>(arraysize+1);
62 Scalar* array1 = a_array1;
67 Scalar* array2 = a_array2;
72 Index maxsize2 = a_array2 - array2 + 256;
75 for(
int k=0; k<2; ++k)
77 if(k==1 && (m.innerSize()+1)*m.outerSize() > maxsize2)
79 Scalar*
array = (k==0 ? array1 : array2);
84 for(
int i = 0;
i < m.outerSize(); ++
i)
85 for(
int j = 0;
j < m.innerSize(); ++
j)
88 VERIFY(map.coeffByOuterInner(
i,
j) == m.coeffByOuterInner(
i,
j));
97 for(
int k=0; k<2; ++k)
99 if(k==1 && (m.innerSize()+4)*m.outerSize() > maxsize2)
101 Scalar*
array = (k==0 ? array1 : array2);
104 InnerSize = MatrixType::InnerSizeAtCompileTime,
105 OuterStrideAtCompileTime = InnerSize==
Dynamic ?
Dynamic : InnerSize+4
111 for(
int i = 0;
i < m.outerSize(); ++
i)
112 for(
int j = 0;
j < m.innerSize(); ++
j)
115 VERIFY(map.coeffByOuterInner(
i,
j) == m.coeffByOuterInner(
i,
j));
123 for(
int k=0; k<2; ++k)
125 if(k==1 && (2*m.innerSize()+1)*(m.outerSize()*2) > maxsize2)
127 Scalar*
array = (k==0 ? array1 : array2);
133 for(
int i = 0;
i < m.outerSize(); ++
i)
134 for(
int j = 0;
j < m.innerSize(); ++
j)
137 VERIFY(map.coeffByOuterInner(
i,
j) == m.coeffByOuterInner(
i,
j));
145 for(
int k=0; k<2; ++k)
147 if(k==1 && (m.innerSize()*2)*m.outerSize() > maxsize2)
149 Scalar*
array = (k==0 ? array1 : array2);
154 for(
int i = 0;
i < m.outerSize(); ++
i)
155 for(
int j = 0;
j < m.innerSize(); ++
j)
157 VERIFY(array[map.innerSize()*
i*2+
j*2] == m.coeffByOuterInner(
i,
j));
158 VERIFY(map.coeffByOuterInner(
i,
j) == m.coeffByOuterInner(
i,
j));
168 Index outerstride = m.innerSize()+4;
169 Scalar*
array = array1;
174 if(MatrixType::IsRowMajor)
VERIFY_IS_APPROX(map1.colwise().reverse(), map2);
198 const int data[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
236 CALL_SUBTEST_4( map_class_vector<Aligned>(VectorXcf(internal::random<int>(1,maxn))) );
237 CALL_SUBTEST_4( map_class_vector<Unaligned>(VectorXcf(internal::random<int>(1,maxn))) );
238 CALL_SUBTEST_5( map_class_vector<Aligned>(VectorXi(internal::random<int>(1,maxn))) );
239 CALL_SUBTEST_5( map_class_vector<Unaligned>(VectorXi(internal::random<int>(1,maxn))) );
249 CALL_SUBTEST_4( map_class_matrix<Aligned>(MatrixXcf(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
250 CALL_SUBTEST_4( map_class_matrix<Unaligned>(MatrixXcf(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
251 CALL_SUBTEST_5( map_class_matrix<Aligned>(MatrixXi(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
252 CALL_SUBTEST_5( map_class_matrix<Unaligned>(MatrixXi(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
253 CALL_SUBTEST_6( map_class_matrix<Aligned>(MatrixXcd(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
254 CALL_SUBTEST_6( map_class_matrix<Unaligned>(MatrixXcd(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
#define CALL_SUBTEST_6(FUNC)
#define CALL_SUBTEST_4(FUNC)
A matrix or vector expression mapping an existing array of data.
#define CALL_SUBTEST_3(FUNC)
EIGEN_DEVICE_FUNC void aligned_delete(T *ptr, std::size_t size)
Holds strides information for Map.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
void map_class_matrix(const MatrixType &_m)
#define VERIFY_IS_APPROX(a, b)
#define CALL_SUBTEST_1(FUNC)
Convenience specialization of Stride to specify only an inner stride See class Map for some examples...
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Array< int, Dynamic, 1 > v
#define TEST_SET_BUT_UNUSED_VARIABLE(X)
#define CALL_SUBTEST_5(FUNC)
#define CALL_SUBTEST_2(FUNC)
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerStride() const
The matrix class, also used for vectors and row-vectors.
Convenience specialization of Stride to specify only an outer stride See class Map for some examples...
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerStride() const
Derived & setRandom(Index size)
void map_class_vector(const VectorType &m)
EIGEN_DECLARE_TEST(mapstride)