diff options
-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 |