ADD: added other eigen lib
This commit is contained in:
@@ -29,8 +29,8 @@ template<int Alignment,typename VectorType> void map_class_vector(const VectorTy
|
||||
map = v;
|
||||
for(int i = 0; i < size; ++i)
|
||||
{
|
||||
VERIFY(array[3*i] == v[i]);
|
||||
VERIFY(map[i] == v[i]);
|
||||
VERIFY_IS_EQUAL(array[3*i], v[i]);
|
||||
VERIFY_IS_EQUAL(map[i], v[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@ template<int Alignment,typename VectorType> void map_class_vector(const VectorTy
|
||||
map = v;
|
||||
for(int i = 0; i < size; ++i)
|
||||
{
|
||||
VERIFY(array[2*i] == v[i]);
|
||||
VERIFY(map[i] == v[i]);
|
||||
VERIFY_IS_EQUAL(array[2*i], v[i]);
|
||||
VERIFY_IS_EQUAL(map[i], v[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,10 +65,13 @@ template<int Alignment,typename MatrixType> void map_class_matrix(const MatrixTy
|
||||
|
||||
Scalar a_array2[256];
|
||||
Scalar* array2 = a_array2;
|
||||
if(Alignment!=Aligned)
|
||||
if(Alignment!=Aligned) {
|
||||
array2 = (Scalar*)(internal::IntPtr(a_array2) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real)));
|
||||
else
|
||||
array2 = (Scalar*)(((internal::UIntPtr(a_array2)+EIGEN_MAX_ALIGN_BYTES-1)/EIGEN_MAX_ALIGN_BYTES)*EIGEN_MAX_ALIGN_BYTES);
|
||||
} else {
|
||||
// In case there is no alignment, default to pointing to the start.
|
||||
constexpr int alignment = (std::max<int>)(EIGEN_MAX_ALIGN_BYTES, 1);
|
||||
array2 = (Scalar*)(((internal::UIntPtr(a_array2)+alignment-1)/alignment)*alignment);
|
||||
}
|
||||
Index maxsize2 = a_array2 - array2 + 256;
|
||||
|
||||
// test no inner stride and some dynamic outer stride
|
||||
@@ -84,8 +87,8 @@ template<int Alignment,typename MatrixType> void map_class_matrix(const MatrixTy
|
||||
for(int i = 0; i < m.outerSize(); ++i)
|
||||
for(int j = 0; j < m.innerSize(); ++j)
|
||||
{
|
||||
VERIFY(array[map.outerStride()*i+j] == m.coeffByOuterInner(i,j));
|
||||
VERIFY(map.coeffByOuterInner(i,j) == m.coeffByOuterInner(i,j));
|
||||
VERIFY_IS_EQUAL(array[map.outerStride()*i+j], m.coeffByOuterInner(i,j));
|
||||
VERIFY_IS_EQUAL(map.coeffByOuterInner(i,j), m.coeffByOuterInner(i,j));
|
||||
}
|
||||
VERIFY_IS_APPROX(s1*map,s1*m);
|
||||
map *= s1;
|
||||
@@ -111,8 +114,8 @@ template<int Alignment,typename MatrixType> void map_class_matrix(const MatrixTy
|
||||
for(int i = 0; i < m.outerSize(); ++i)
|
||||
for(int j = 0; j < m.innerSize(); ++j)
|
||||
{
|
||||
VERIFY(array[map.outerStride()*i+j] == m.coeffByOuterInner(i,j));
|
||||
VERIFY(map.coeffByOuterInner(i,j) == m.coeffByOuterInner(i,j));
|
||||
VERIFY_IS_EQUAL(array[map.outerStride()*i+j], m.coeffByOuterInner(i,j));
|
||||
VERIFY_IS_EQUAL(map.coeffByOuterInner(i,j), m.coeffByOuterInner(i,j));
|
||||
}
|
||||
VERIFY_IS_APPROX(s1*map,s1*m);
|
||||
map *= s1;
|
||||
@@ -133,8 +136,8 @@ template<int Alignment,typename MatrixType> void map_class_matrix(const MatrixTy
|
||||
for(int i = 0; i < m.outerSize(); ++i)
|
||||
for(int j = 0; j < m.innerSize(); ++j)
|
||||
{
|
||||
VERIFY(array[map.outerStride()*i+map.innerStride()*j] == m.coeffByOuterInner(i,j));
|
||||
VERIFY(map.coeffByOuterInner(i,j) == m.coeffByOuterInner(i,j));
|
||||
VERIFY_IS_EQUAL(array[map.outerStride()*i+map.innerStride()*j], m.coeffByOuterInner(i,j));
|
||||
VERIFY_IS_EQUAL(map.coeffByOuterInner(i,j), m.coeffByOuterInner(i,j));
|
||||
}
|
||||
VERIFY_IS_APPROX(s1*map,s1*m);
|
||||
map *= s1;
|
||||
@@ -154,8 +157,8 @@ template<int Alignment,typename MatrixType> void map_class_matrix(const MatrixTy
|
||||
for(int i = 0; i < m.outerSize(); ++i)
|
||||
for(int j = 0; j < m.innerSize(); ++j)
|
||||
{
|
||||
VERIFY(array[map.innerSize()*i*2+j*2] == m.coeffByOuterInner(i,j));
|
||||
VERIFY(map.coeffByOuterInner(i,j) == m.coeffByOuterInner(i,j));
|
||||
VERIFY_IS_EQUAL(array[map.innerSize()*i*2+j*2], m.coeffByOuterInner(i,j));
|
||||
VERIFY_IS_EQUAL(map.coeffByOuterInner(i,j), m.coeffByOuterInner(i,j));
|
||||
}
|
||||
VERIFY_IS_APPROX(s1*map,s1*m);
|
||||
map *= s1;
|
||||
|
||||
Reference in New Issue
Block a user