mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 11:49:02 +08:00
bug #1158: PartialReduxExpr is a vector expression, and it thus must expose the LinearAccessBit flag
This commit is contained in:
parent
9bcadb7fd1
commit
df15fbc452
@ -994,7 +994,7 @@ struct evaluator<PartialReduxExpr<ArgType, MemberOp, Direction> >
|
|||||||
CoeffReadCost = TraversalSize==Dynamic ? HugeCost
|
CoeffReadCost = TraversalSize==Dynamic ? HugeCost
|
||||||
: TraversalSize * evaluator<ArgType>::CoeffReadCost + int(CostOpType::value),
|
: TraversalSize * evaluator<ArgType>::CoeffReadCost + int(CostOpType::value),
|
||||||
|
|
||||||
Flags = (traits<XprType>::Flags&RowMajorBit) | (evaluator<ArgType>::Flags&(HereditaryBits&(~RowMajorBit))),
|
Flags = (traits<XprType>::Flags&RowMajorBit) | (evaluator<ArgType>::Flags&(HereditaryBits&(~RowMajorBit))) | LinearAccessBit,
|
||||||
|
|
||||||
Alignment = 0 // FIXME this will need to be improved once PartialReduxExpr is vectorized
|
Alignment = 0 // FIXME this will need to be improved once PartialReduxExpr is vectorized
|
||||||
};
|
};
|
||||||
|
@ -210,6 +210,9 @@ template<typename MatrixType> void vectorwiseop_matrix(const MatrixType& m)
|
|||||||
VERIFY_IS_APPROX(m1.cwiseAbs().colwise().maxCoeff(), m1.colwise().template lpNorm<Infinity>());
|
VERIFY_IS_APPROX(m1.cwiseAbs().colwise().maxCoeff(), m1.colwise().template lpNorm<Infinity>());
|
||||||
VERIFY_IS_APPROX(m1.cwiseAbs().rowwise().maxCoeff(), m1.rowwise().template lpNorm<Infinity>());
|
VERIFY_IS_APPROX(m1.cwiseAbs().rowwise().maxCoeff(), m1.rowwise().template lpNorm<Infinity>());
|
||||||
|
|
||||||
|
// regression for bug 1158
|
||||||
|
VERIFY_IS_APPROX(m1.cwiseAbs().colwise().sum().x(), m1.col(0).cwiseAbs().sum());
|
||||||
|
|
||||||
// test normalized
|
// test normalized
|
||||||
m2 = m1.colwise().normalized();
|
m2 = m1.colwise().normalized();
|
||||||
VERIFY_IS_APPROX(m2.col(c), m1.col(c).normalized());
|
VERIFY_IS_APPROX(m2.col(c), m1.col(c).normalized());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user