@@ -1117,6 +1117,12 @@ noalias_mul_add(MatrixViewMut<T, colmajor> dst,
11171117 return ;
11181118 }
11191119
1120+ #if !EIGEN_VERSION_AT_LEAST(3, 3, 8)
1121+ #define LAZY_PRODUCT (a, b ) a.lazyProduct(b)
1122+ #else
1123+ #define LAZY_PRODUCT (a, b ) a.operator *(b)
1124+ #endif
1125+
11201126 if (dst.cols == 1 && dst.rows == 1 ) {
11211127 // dot
11221128 auto rhs_col = rhs.col (0 );
@@ -1133,7 +1139,7 @@ noalias_mul_add(MatrixViewMut<T, colmajor> dst,
11331139 auto rhs_col = rhs.col (0 );
11341140 auto dst_col = dst.col (0 );
11351141 dst_col.to_eigen ().noalias ().operator +=(
1136- factor * (lhs.to_eigen (). operator *( rhs_col.to_eigen () )));
1142+ factor * LAZY_PRODUCT (lhs.to_eigen (), rhs_col.to_eigen ()));
11371143 }
11381144
11391145#if !EIGEN_VERSION_AT_LEAST(3, 3, 8)
@@ -1150,19 +1156,21 @@ noalias_mul_add(MatrixViewMut<T, colmajor> dst,
11501156 MapMut (dst.data , dst.rows , dst.cols , Stride (dst.outer_stride ))
11511157 .noalias ()
11521158 .
1153- operator +=(factor *
1154- Map (lhs. data , lhs. rows , lhs. cols , Stride (lhs. outer_stride ))
1155- .
1156- operator *( Map (
1157- rhs.data , rhs.rows , rhs.cols , Stride (rhs.outer_stride ))));
1159+ operator +=(
1160+ factor *
1161+ LAZY_PRODUCT (
1162+ Map (lhs. data , lhs. rows , lhs. cols , Stride (lhs. outer_stride )),
1163+ Map ( rhs.data , rhs.rows , rhs.cols , Stride (rhs.outer_stride ))));
11581164 }
11591165#endif
11601166
11611167 else {
11621168 // gemm
11631169 dst.to_eigen ().noalias ().operator +=(
1164- factor * lhs.to_eigen (). operator *( rhs.to_eigen ()));
1170+ factor * LAZY_PRODUCT ( lhs.to_eigen (), rhs.to_eigen ()));
11651171 }
1172+
1173+ #undef LAZY_PRODUCT
11661174}
11671175
11681176template <typename T>
0 commit comments