From e70506dd8f63241d92ebc3df2d9c01c9af5564c8 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 18 Sep 2014 22:46:46 +0200 Subject: Fix inner-stride of AlignedVector3 --- unsupported/Eigen/AlignedVector3 | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'unsupported/Eigen/AlignedVector3') diff --git a/unsupported/Eigen/AlignedVector3 b/unsupported/Eigen/AlignedVector3 index cd5f49edb..35493e87b 100644 --- a/unsupported/Eigen/AlignedVector3 +++ b/unsupported/Eigen/AlignedVector3 @@ -60,6 +60,7 @@ template class AlignedVector3 Scalar* data() { return m_coeffs.data(); } const Scalar* data() const { return m_coeffs.data(); } + Index innerStride() const { return 1; } inline const Scalar& coeff(Index row, Index col) const { return m_coeffs.coeff(row, col); } @@ -184,27 +185,24 @@ template class AlignedVector3 { return m_coeffs.template head<3>().isApprox(other,eps); } + + CoeffType& coeffs() { return m_coeffs; } + const CoeffType& coeffs() const { return m_coeffs; } }; namespace internal { template struct evaluator > - : evaluator,Aligned> >::type + : evaluator >::type { typedef AlignedVector3 XprType; - typedef Map,Aligned> MapType; - typedef typename evaluator::type Base; + typedef typename evaluator >::type Base; typedef evaluator type; typedef evaluator nestedType; - evaluator(const XprType &m) : Base(MapType(m.data())), m_map(m.data()) - { - ::new (static_cast(this)) Base(m_map); - } - - const MapType m_map; + evaluator(const XprType &m) : Base(m.coeffs()) {} }; } -- cgit v1.2.3