diff options
author | Gael Guennebaud <g.gael@free.fr> | 2016-08-31 08:17:15 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2016-08-31 08:17:15 +0200 |
commit | 34562474372246805794fd0939044a133a8ad8dd (patch) | |
tree | e4eb731afaf04ce7e80ea3b1134e3ee0fe3d0d44 /Eigen/src/Core | |
parent | 8c48d425309821c17e2543c1e0106f308731f8be (diff) |
bug #1283: quick fix for products involving uncommon general block access to vectors.
Diffstat (limited to 'Eigen/src/Core')
-rw-r--r-- | Eigen/src/Core/ProductEvaluators.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Eigen/src/Core/ProductEvaluators.h b/Eigen/src/Core/ProductEvaluators.h index a64bda394..b8f92a3dc 100644 --- a/Eigen/src/Core/ProductEvaluators.h +++ b/Eigen/src/Core/ProductEvaluators.h @@ -530,8 +530,8 @@ struct product_evaluator<Product<Lhs, Rhs, LazyProduct>, ProductTag, DenseShape, */ EIGEN_DEVICE_FUNC const CoeffReturnType coeff(Index index) const { - const Index row = RowsAtCompileTime == 1 ? 0 : index; - const Index col = RowsAtCompileTime == 1 ? index : 0; + const Index row = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? 0 : index; + const Index col = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? index : 0; 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> const PacketType packet(Index index) const { - const Index row = RowsAtCompileTime == 1 ? 0 : index; - const Index col = RowsAtCompileTime == 1 ? index : 0; + const Index row = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? 0 : index; + const Index col = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? index : 0; return packet<LoadMode,PacketType>(row,col); } |