Fix regressions in redux_evaluator flags and evaluator<Block> flags

This commit is contained in:
Gael Guennebaud 2014-03-12 18:14:08 +01:00
parent 5e26b7cf9d
commit f74ed34539
3 changed files with 15 additions and 15 deletions

View File

@ -98,7 +98,7 @@ struct traits<Block<XprType, BlockRows, BlockCols, InnerPanel> > : traits<XprTyp
MaskAlignedBit), MaskAlignedBit),
Flags = Flags0 | FlagsLinearAccessBit | FlagsLvalueBit | FlagsRowMajorBit Flags = Flags0 | FlagsLinearAccessBit | FlagsLvalueBit | FlagsRowMajorBit
#else #else
// FIXME, this traits is rather specialized for dense object... // FIXME, this traits is rather specialized for dense object and it needs to be cleaned further
FlagsLvalueBit = is_lvalue<XprType>::value ? LvalueBit : 0, FlagsLvalueBit = is_lvalue<XprType>::value ? LvalueBit : 0,
FlagsRowMajorBit = IsRowMajor ? RowMajorBit : 0, FlagsRowMajorBit = IsRowMajor ? RowMajorBit : 0,
Flags = (traits<XprType>::Flags & DirectAccessBit) | FlagsLvalueBit | FlagsRowMajorBit // FIXME DirectAccessBit should not be handled by expressions Flags = (traits<XprType>::Flags & DirectAccessBit) | FlagsLvalueBit | FlagsRowMajorBit // FIXME DirectAccessBit should not be handled by expressions

View File

@ -756,23 +756,23 @@ struct evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel> >
enum { enum {
CoeffReadCost = evaluator<ArgType>::CoeffReadCost, CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
RowsAtCompileTime = traits<ArgType>::RowsAtCompileTime, RowsAtCompileTime = traits<XprType>::RowsAtCompileTime,
ColsAtCompileTime = traits<ArgType>::ColsAtCompileTime, ColsAtCompileTime = traits<XprType>::ColsAtCompileTime,
MaxRowsAtCompileTime = traits<ArgType>::MaxRowsAtCompileTime, MaxRowsAtCompileTime = traits<XprType>::MaxRowsAtCompileTime,
MaxColsAtCompileTime = traits<ArgType>::MaxColsAtCompileTime, MaxColsAtCompileTime = traits<XprType>::MaxColsAtCompileTime,
XprTypeIsRowMajor = (int(traits<ArgType>::Flags)&RowMajorBit) != 0, ArgTypeIsRowMajor = (int(evaluator<ArgType>::Flags)&RowMajorBit) != 0,
IsRowMajor = (MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1) ? 1 IsRowMajor = (MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1) ? 1
: (MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1) ? 0 : (MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1) ? 0
: XprTypeIsRowMajor, : ArgTypeIsRowMajor,
HasSameStorageOrderAsXprType = (IsRowMajor == XprTypeIsRowMajor), HasSameStorageOrderAsArgType = (IsRowMajor == ArgTypeIsRowMajor),
InnerSize = IsRowMajor ? int(ColsAtCompileTime) : int(RowsAtCompileTime), InnerSize = IsRowMajor ? int(ColsAtCompileTime) : int(RowsAtCompileTime),
InnerStrideAtCompileTime = HasSameStorageOrderAsXprType InnerStrideAtCompileTime = HasSameStorageOrderAsArgType
? int(inner_stride_at_compile_time<XprType>::ret) ? int(inner_stride_at_compile_time<ArgType>::ret)
: int(outer_stride_at_compile_time<XprType>::ret), : int(outer_stride_at_compile_time<ArgType>::ret),
OuterStrideAtCompileTime = HasSameStorageOrderAsXprType OuterStrideAtCompileTime = HasSameStorageOrderAsArgType
? int(outer_stride_at_compile_time<XprType>::ret) ? int(outer_stride_at_compile_time<ArgType>::ret)
: int(inner_stride_at_compile_time<XprType>::ret), : int(inner_stride_at_compile_time<ArgType>::ret),
MaskPacketAccessBit = (InnerSize == Dynamic || (InnerSize % packet_traits<Scalar>::size) == 0) MaskPacketAccessBit = (InnerSize == Dynamic || (InnerSize % packet_traits<Scalar>::size) == 0)
&& (InnerStrideAtCompileTime == 1) && (InnerStrideAtCompileTime == 1)
? PacketAccessBit : 0, ? PacketAccessBit : 0,

View File

@ -351,7 +351,7 @@ public:
MaxRowsAtCompileTime = XprType::MaxRowsAtCompileTime, MaxRowsAtCompileTime = XprType::MaxRowsAtCompileTime,
MaxColsAtCompileTime = XprType::MaxColsAtCompileTime, MaxColsAtCompileTime = XprType::MaxColsAtCompileTime,
// TODO we should not remove DirectAccessBit and rather find an elegant way to query the alignment offset at runtime from the evaluator // TODO we should not remove DirectAccessBit and rather find an elegant way to query the alignment offset at runtime from the evaluator
Flags = XprType::Flags & ~DirectAccessBit, Flags = evaluator<XprType>::Flags & ~DirectAccessBit,
IsRowMajor = XprType::IsRowMajor, IsRowMajor = XprType::IsRowMajor,
SizeAtCompileTime = XprType::SizeAtCompileTime, SizeAtCompileTime = XprType::SizeAtCompileTime,
InnerSizeAtCompileTime = XprType::InnerSizeAtCompileTime, InnerSizeAtCompileTime = XprType::InnerSizeAtCompileTime,