mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-13 20:26:03 +08:00
Fix computation of outer-stride when calling .real() or .imag()
This commit is contained in:
parent
e8ccd07671
commit
63135a7350
@ -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))
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -109,7 +110,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