Fix computation of CwiseUnaryOp::CoeffReadCost when the cost of the nested expression is Dynamic

This commit is contained in:
Gael Guennebaud 2015-10-27 22:22:02 +01:00
parent d0980c7706
commit 1eea595550

View File

@ -47,7 +47,7 @@ struct traits<CwiseUnaryOp<UnaryOp, XprType> >
Flags = _XprTypeNested::Flags & ( Flags = _XprTypeNested::Flags & (
HereditaryBits | LinearAccessBit | AlignedBit HereditaryBits | LinearAccessBit | AlignedBit
| (functor_traits<UnaryOp>::PacketAccess ? PacketAccessBit : 0)), | (functor_traits<UnaryOp>::PacketAccess ? PacketAccessBit : 0)),
CoeffReadCost = _XprTypeNested::CoeffReadCost + functor_traits<UnaryOp>::Cost CoeffReadCost = _XprTypeNested::CoeffReadCost==Dynamic ? Dynamic : (_XprTypeNested::CoeffReadCost + functor_traits<UnaryOp>::Cost)
}; };
}; };
} }