mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 19:59:05 +08:00
bug #1283: quick fix for products involving uncommon general block access to vectors.
This commit is contained in:
parent
8c48d42530
commit
3456247437
@ -530,8 +530,8 @@ struct product_evaluator<Product<Lhs, Rhs, LazyProduct>, ProductTag, DenseShape,
|
|||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC const CoeffReturnType coeff(Index index) const
|
EIGEN_DEVICE_FUNC const CoeffReturnType coeff(Index index) const
|
||||||
{
|
{
|
||||||
const Index row = RowsAtCompileTime == 1 ? 0 : index;
|
const Index row = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? 0 : index;
|
||||||
const Index col = RowsAtCompileTime == 1 ? index : 0;
|
const Index col = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? index : 0;
|
||||||
return (m_lhs.row(row).transpose().cwiseProduct( m_rhs.col(col) )).sum();
|
return (m_lhs.row(row).transpose().cwiseProduct( m_rhs.col(col) )).sum();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -549,8 +549,8 @@ struct product_evaluator<Product<Lhs, Rhs, LazyProduct>, ProductTag, DenseShape,
|
|||||||
template<int LoadMode, typename PacketType>
|
template<int LoadMode, typename PacketType>
|
||||||
const PacketType packet(Index index) const
|
const PacketType packet(Index index) const
|
||||||
{
|
{
|
||||||
const Index row = RowsAtCompileTime == 1 ? 0 : index;
|
const Index row = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? 0 : index;
|
||||||
const Index col = RowsAtCompileTime == 1 ? index : 0;
|
const Index col = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? index : 0;
|
||||||
return packet<LoadMode,PacketType>(row,col);
|
return packet<LoadMode,PacketType>(row,col);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user