From 060e835ee9f7a3abb9ff3d9f2522027bf2f98efe Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 18 Sep 2014 17:30:21 +0200 Subject: Add evaluator for the experimental AlignedVector3 --- unsupported/Eigen/AlignedVector3 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'unsupported/Eigen/AlignedVector3') diff --git a/unsupported/Eigen/AlignedVector3 b/unsupported/Eigen/AlignedVector3 index 7b45e6cce..cd5f49edb 100644 --- a/unsupported/Eigen/AlignedVector3 +++ b/unsupported/Eigen/AlignedVector3 @@ -57,6 +57,9 @@ template class AlignedVector3 inline Index rows() const { return 3; } inline Index cols() const { return 1; } + + Scalar* data() { return m_coeffs.data(); } + const Scalar* data() const { return m_coeffs.data(); } inline const Scalar& coeff(Index row, Index col) const { return m_coeffs.coeff(row, col); } @@ -183,6 +186,29 @@ template class AlignedVector3 } }; +namespace internal { + +template +struct evaluator > + : evaluator,Aligned> >::type +{ + typedef AlignedVector3 XprType; + typedef Map,Aligned> MapType; + 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; +}; + +} + //@} } -- cgit v1.2.3