Compare commits

..

5 Commits

Author SHA1 Message Date
Gael Guennebaud
72ffb63165 fix compilation for old but not so old versions of glew 2011-03-18 10:26:21 +01:00
Benoit Jacob
67e24b85a4 bump 2011-03-18 05:13:34 -04:00
Gael Guennebaud
2359486129 disable testing of aligned members when aligned static allocation is not enabled (e.g., for gcc 3.4) 2011-03-15 09:53:23 +01:00
Gael Guennebaud
dd2e4be741 fix array_for_matrix unit test 2011-03-15 09:42:22 +01:00
Benoit Jacob
c5ef8f9027 Added tag 3.0-rc1 for changeset 4931a719f4 2011-03-14 14:10:12 -04:00
4 changed files with 21 additions and 14 deletions

View File

@@ -26,8 +26,8 @@
#ifndef EIGEN_MACROS_H
#define EIGEN_MACROS_H
#define EIGEN_WORLD_VERSION 2
#define EIGEN_MAJOR_VERSION 95
#define EIGEN_WORLD_VERSION 3
#define EIGEN_MAJOR_VERSION 0
#define EIGEN_MINOR_VERSION 0
#define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \

View File

@@ -57,10 +57,10 @@ template<typename MatrixType> void array_for_matrix(const MatrixType& m)
VERIFY_IS_APPROX(m3, (m1.array() - s1).matrix());
// reductions
VERIFY_IS_APPROX(m1.colwise().sum().sum(), m1.sum());
VERIFY_IS_APPROX(m1.rowwise().sum().sum(), m1.sum());
if (!internal::isApprox(m1.sum(), (m1+m2).sum()))
VERIFY_IS_NOT_APPROX(((m1+m2).rowwise().sum()).sum(), m1.sum());
VERIFY_IS_MUCH_SMALLER_THAN(m1.colwise().sum().sum() - m1.sum(), m1.cwiseAbs().maxCoeff());
VERIFY_IS_MUCH_SMALLER_THAN(m1.rowwise().sum().sum() - m1.sum(), m1.cwiseAbs().maxCoeff());
VERIFY_IS_MUCH_SMALLER_THAN(m1.colwise().sum() + m2.colwise().sum() - (m1+m2).colwise().sum(), (m1+m2).cwiseAbs().maxCoeff());
VERIFY_IS_MUCH_SMALLER_THAN(m1.rowwise().sum() - m2.rowwise().sum() - (m1-m2).rowwise().sum(), (m1-m2).cwiseAbs().maxCoeff());
VERIFY_IS_APPROX(m1.colwise().sum(), m1.colwise().redux(internal::scalar_sum_op<Scalar>()));
// vector-wise ops
@@ -158,27 +158,28 @@ template<typename VectorType> void lpNorm(const VectorType& v)
void test_array_for_matrix()
{
int maxsize = 40;
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( array_for_matrix(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2( array_for_matrix(Matrix2f()) );
CALL_SUBTEST_3( array_for_matrix(Matrix4d()) );
CALL_SUBTEST_4( array_for_matrix(MatrixXcf(3, 3)) );
CALL_SUBTEST_5( array_for_matrix(MatrixXf(8, 12)) );
CALL_SUBTEST_6( array_for_matrix(MatrixXi(8, 12)) );
CALL_SUBTEST_4( array_for_matrix(MatrixXcf(internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
CALL_SUBTEST_5( array_for_matrix(MatrixXf(internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
CALL_SUBTEST_6( array_for_matrix(MatrixXi(internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
}
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( comparisons(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2( comparisons(Matrix2f()) );
CALL_SUBTEST_3( comparisons(Matrix4d()) );
CALL_SUBTEST_5( comparisons(MatrixXf(8, 12)) );
CALL_SUBTEST_6( comparisons(MatrixXi(8, 12)) );
CALL_SUBTEST_5( comparisons(MatrixXf(internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
CALL_SUBTEST_6( comparisons(MatrixXi(internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
}
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( lpNorm(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2( lpNorm(Vector2f()) );
CALL_SUBTEST_7( lpNorm(Vector3d()) );
CALL_SUBTEST_8( lpNorm(Vector4f()) );
CALL_SUBTEST_5( lpNorm(VectorXf(16)) );
CALL_SUBTEST_4( lpNorm(VectorXcf(10)) );
CALL_SUBTEST_5( lpNorm(VectorXf(internal::random<int>(1,maxsize))) );
CALL_SUBTEST_4( lpNorm(VectorXcf(internal::random<int>(1,maxsize))) );
}
}

View File

@@ -120,11 +120,12 @@ void test_dynalloc()
}
// check static allocation, who knows ?
#if EIGEN_ALIGN_STATICALLY
{
MyStruct foo0; VERIFY(size_t(foo0.avec.data())%ALIGNMENT==0);
MyClassA fooA; VERIFY(size_t(fooA.avec.data())%ALIGNMENT==0);
}
// dynamic allocation, single object
for (int i=0; i<g_repeat*100; ++i)
{
@@ -143,5 +144,6 @@ void test_dynalloc()
delete[] foo0;
delete[] fooA;
}
#endif
}

View File

@@ -320,6 +320,7 @@ void test_openglsupport()
else
std::cerr << "Warning: opengl 3.0 was not tested\n";
#ifdef GLEW_ARB_gpu_shader_fp64
if(GLEW_ARB_gpu_shader_fp64)
{
#ifdef GL_ARB_gpu_shader_fp64
@@ -343,6 +344,9 @@ void test_openglsupport()
}
else
std::cerr << "Warning: GLEW_ARB_gpu_shader_fp64 was not tested\n";
#else
std::cerr << "Warning: GLEW_ARB_gpu_shader_fp64 was not tested\n";
#endif
}
}