diff options
author | Gael Guennebaud <g.gael@free.fr> | 2013-02-26 15:08:50 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2013-02-26 15:08:50 +0100 |
commit | 63135a735069aec658ccfb2424670b6ed585db5e (patch) | |
tree | a1023388dc133ed198caa3febe473c20a1f711b3 /Eigen | |
parent | e8ccd07671185e2514c0e6e77e1f5c98d85eff06 (diff) |
Fix computation of outer-stride when calling .real() or .imag()
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/CwiseUnaryView.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Eigen/src/Core/CwiseUnaryView.h b/Eigen/src/Core/CwiseUnaryView.h index 107cbeb2e..9f9d4972d 100644 --- a/Eigen/src/Core/CwiseUnaryView.h +++ b/Eigen/src/Core/CwiseUnaryView.h @@ -44,9 +44,10 @@ struct traits<CwiseUnaryView<ViewOp, MatrixType> > // "error: no integral type can represent all of the enumerator values InnerStrideAtCompileTime = MatrixTypeInnerStride == Dynamic ? int(Dynamic) - : int(MatrixTypeInnerStride) - * int(sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar)), - OuterStrideAtCompileTime = outer_stride_at_compile_time<MatrixType>::ret + : int(MatrixTypeInnerStride) * int(sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar)), + OuterStrideAtCompileTime = outer_stride_at_compile_time<MatrixType>::ret == Dynamic + ? int(Dynamic) + : outer_stride_at_compile_time<MatrixType>::ret * int(sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar)) }; }; } @@ -109,7 +110,7 @@ class CwiseUnaryViewImpl<ViewOp,MatrixType,Dense> inline Index outerStride() const { - return derived().nestedExpression().outerStride(); + return derived().nestedExpression().outerStride() * sizeof(typename internal::traits<MatrixType>::Scalar) / sizeof(Scalar); } EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const |