From d03779f75f3a29b6cc76299f511aefc902771e4c Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Sat, 8 May 2010 13:42:41 -0400 Subject: [PATCH] fix CwiseUnaryView: it shouldn't have the AlignedBit, but it should have the DirectAccessBit and corresponding strides API. --- Eigen/src/Core/CwiseUnaryView.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Eigen/src/Core/CwiseUnaryView.h b/Eigen/src/Core/CwiseUnaryView.h index 1f11e109a..036bff8fb 100644 --- a/Eigen/src/Core/CwiseUnaryView.h +++ b/Eigen/src/Core/CwiseUnaryView.h @@ -47,8 +47,13 @@ struct ei_traits > typedef typename MatrixType::Nested MatrixTypeNested; typedef typename ei_cleantype::type _MatrixTypeNested; enum { - Flags = (ei_traits<_MatrixTypeNested>::Flags & (HereditaryBits | LinearAccessBit | AlignedBit)), - CoeffReadCost = ei_traits<_MatrixTypeNested>::CoeffReadCost + ei_functor_traits::Cost + Flags = (ei_traits<_MatrixTypeNested>::Flags & (HereditaryBits | LinearAccessBit | DirectAccessBit)), + CoeffReadCost = ei_traits<_MatrixTypeNested>::CoeffReadCost + ei_functor_traits::Cost, + MatrixTypeInnerStride = ei_inner_stride_at_compile_time::ret, + InnerStrideAtCompileTime = MatrixTypeInnerStride == Dynamic + ? Dynamic + : MatrixTypeInnerStride * sizeof(typename ei_traits::Scalar) / sizeof(Scalar), + OuterStrideAtCompileTime = ei_outer_stride_at_compile_time::ret }; }; @@ -97,6 +102,16 @@ class CwiseUnaryViewImpl public: + inline int innerStride() const + { + return derived().nestedExpression().innerStride() * sizeof(typename ei_traits::Scalar) / sizeof(Scalar); + } + + inline int outerStride() const + { + return derived().nestedExpression().outerStride(); + } + typedef typename ei_dense_xpr_base >::type Base; EIGEN_DENSE_PUBLIC_INTERFACE(Derived)