mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-22 01:29:35 +08:00
fix CwiseUnaryView: it shouldn't have the AlignedBit, but it should have the DirectAccessBit and corresponding strides API.
This commit is contained in:
parent
2d74f1ac92
commit
d03779f75f
@ -47,8 +47,13 @@ struct ei_traits<CwiseUnaryView<ViewOp, MatrixType> >
|
|||||||
typedef typename MatrixType::Nested MatrixTypeNested;
|
typedef typename MatrixType::Nested MatrixTypeNested;
|
||||||
typedef typename ei_cleantype<MatrixTypeNested>::type _MatrixTypeNested;
|
typedef typename ei_cleantype<MatrixTypeNested>::type _MatrixTypeNested;
|
||||||
enum {
|
enum {
|
||||||
Flags = (ei_traits<_MatrixTypeNested>::Flags & (HereditaryBits | LinearAccessBit | AlignedBit)),
|
Flags = (ei_traits<_MatrixTypeNested>::Flags & (HereditaryBits | LinearAccessBit | DirectAccessBit)),
|
||||||
CoeffReadCost = ei_traits<_MatrixTypeNested>::CoeffReadCost + ei_functor_traits<ViewOp>::Cost
|
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:
|
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;
|
typedef typename ei_dense_xpr_base<CwiseUnaryView<ViewOp, MatrixType> >::type Base;
|
||||||
EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
|
EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user