mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-10-14 17:11:29 +08:00
Fix computation of outer-stride when calling .real() or .imag()
(transplanted from 63135a735069aec658ccfb2424670b6ed585db5e )
This commit is contained in:
parent
7df8b57770
commit
de25881056
@ -44,9 +44,10 @@ struct traits<CwiseUnaryView<ViewOp, MatrixType> >
|
|||||||
// "error: no integral type can represent all of the enumerator values
|
// "error: no integral type can represent all of the enumerator values
|
||||||
InnerStrideAtCompileTime = MatrixTypeInnerStride == Dynamic
|
InnerStrideAtCompileTime = MatrixTypeInnerStride == Dynamic
|
||||||
? int(Dynamic)
|
? int(Dynamic)
|
||||||
: int(MatrixTypeInnerStride)
|
: int(MatrixTypeInnerStride) * int(sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar)),
|
||||||
* int(sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar)),
|
OuterStrideAtCompileTime = outer_stride_at_compile_time<MatrixType>::ret == Dynamic
|
||||||
OuterStrideAtCompileTime = outer_stride_at_compile_time<MatrixType>::ret
|
? int(Dynamic)
|
||||||
|
: outer_stride_at_compile_time<MatrixType>::ret * int(sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar))
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -106,7 +107,7 @@ class CwiseUnaryViewImpl<ViewOp,MatrixType,Dense>
|
|||||||
|
|
||||||
inline Index outerStride() const
|
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
|
EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user