From f52d119b9c4f9b6dfbb91183de08143fdf3cc94c Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 3 Sep 2008 00:32:56 +0000 Subject: Solve a big issue with data alignment and dynamic allocation: * add a WithAlignedOperatorNew class with overloaded operator new * make Matrix (and Quaternion, Transform, Hyperplane, etc.) use it if needed such that "*(new Vector4) = xpr" does not failed anymore. * Please: make sure your classes having fixed size Eigen's vector or matrice attributes inherit WithAlignedOperatorNew * add a ei_new_allocator STL memory allocator to use with STL containers. This allocator really calls operator new on your types (unlike GCC's new_allocator). Example: std::vector data(10); will segfault if the vectorization is enabled, instead use: std::vector > data(10); NOTE: you only have to worry if you deal with fixed-size matrix types with "sizeof(matrix_type)%16==0"... --- Eigen/src/Geometry/Translation.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Eigen/src/Geometry/Translation.h') diff --git a/Eigen/src/Geometry/Translation.h b/Eigen/src/Geometry/Translation.h index 056fd2818..a322205a4 100644 --- a/Eigen/src/Geometry/Translation.h +++ b/Eigen/src/Geometry/Translation.h @@ -41,6 +41,9 @@ */ template class Translation + #ifdef EIGEN_VECTORIZE + : public ei_with_aligned_operator_new<_Scalar,_Dim> + #endif { public: /** dimension of the space */ -- cgit v1.2.3