aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/CwiseUnaryView.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-05-08 13:42:41 -0400
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-05-08 13:42:41 -0400
commitd03779f75f3a29b6cc76299f511aefc902771e4c (patch)
tree800e04627c350f680c14561601e550381e53e097 /Eigen/src/Core/CwiseUnaryView.h
parent2d74f1ac9292dab56cf725ba9c09e22a77f5fb10 (diff)
fix CwiseUnaryView: it shouldn't have the AlignedBit, but it should have the DirectAccessBit and corresponding strides API.
Diffstat (limited to 'Eigen/src/Core/CwiseUnaryView.h')
-rw-r--r--Eigen/src/Core/CwiseUnaryView.h19
1 files 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<CwiseUnaryView<ViewOp, MatrixType> >
typedef typename MatrixType::Nested MatrixTypeNested;
typedef typename ei_cleantype<MatrixTypeNested>::type _MatrixTypeNested;
enum {
- Flags = (ei_traits<_MatrixTypeNested>::Flags & (HereditaryBits | LinearAccessBit | AlignedBit)),
- CoeffReadCost = ei_traits<_MatrixTypeNested>::CoeffReadCost + ei_functor_traits<ViewOp>::Cost
+ Flags = (ei_traits<_MatrixTypeNested>::Flags & (HereditaryBits | LinearAccessBit | DirectAccessBit)),
+ CoeffReadCost = ei_traits<_MatrixTypeNested>::CoeffReadCost + ei_functor_traits<ViewOp>::Cost,
+ MatrixTypeInnerStride = ei_inner_stride_at_compile_time<MatrixType>::ret,
+ InnerStrideAtCompileTime = MatrixTypeInnerStride == Dynamic
+ ? Dynamic
+ : MatrixTypeInnerStride * sizeof(typename ei_traits<MatrixType>::Scalar) / sizeof(Scalar),
+ OuterStrideAtCompileTime = ei_outer_stride_at_compile_time<MatrixType>::ret
};
};
@@ -97,6 +102,16 @@ class CwiseUnaryViewImpl<ViewOp,MatrixType,Dense>
public:
+ inline int innerStride() const
+ {
+ return derived().nestedExpression().innerStride() * sizeof(typename ei_traits<MatrixType>::Scalar) / sizeof(Scalar);
+ }
+
+ inline int outerStride() const
+ {
+ return derived().nestedExpression().outerStride();
+ }
+
typedef typename ei_dense_xpr_base<CwiseUnaryView<ViewOp, MatrixType> >::type Base;
EIGEN_DENSE_PUBLIC_INTERFACE(Derived)