diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index 7e68a5724..18aaba341 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -330,9 +330,10 @@ template<> struct ei_gemv_selector * RhsBlasTraits::extractScalarFactor(prod.rhs()); enum { - EvalToDest = (ei_packet_traits::size==1) - ||((Dest::Flags&ActualPacketAccessBit) && (!(Dest::Flags & RowMajorBit))) + // FIXME find a way to allow an inner stride on the result if ei_packet_traits::size==1 + EvalToDest = (Dest::Flags&ActualPacketAccessBit) && (Dest::InnerStrideAtCompileTime==1) }; + Scalar* EIGEN_RESTRICT actualDest; if (EvalToDest) actualDest = &dest.coeffRef(0); diff --git a/test/product.h b/test/product.h index 5365a7dc6..804ce131d 100644 --- a/test/product.h +++ b/test/product.h @@ -45,7 +45,7 @@ template void product(const MatrixType& m) typedef Matrix RowSquareMatrixType; typedef Matrix ColSquareMatrixType; typedef Matrix OtherMajorMatrixType; + MatrixType::Flags&RowMajorBit?ColMajor:RowMajor> OtherMajorMatrixType; Index rows = m.rows(); Index cols = m.cols(); @@ -152,6 +152,9 @@ template void product(const MatrixType& m) VERIFY(areNotApprox(res2,square2 + m2.transpose() * m1)); } + VERIFY_IS_APPROX(res.col(r).noalias() = square.adjoint() * square.col(r), (square.adjoint() * square.col(r)).eval()); + VERIFY_IS_APPROX(res.col(r).noalias() = square * square.col(r), (square * square.col(r)).eval()); + // inner product Scalar x = square2.row(c) * square2.col(c2); VERIFY_IS_APPROX(x, square2.row(c).transpose().cwiseProduct(square2.col(c2)).sum()); diff --git a/test/product_large.cpp b/test/product_large.cpp index e5f6e12aa..2d36c5a92 100644 --- a/test/product_large.cpp +++ b/test/product_large.cpp @@ -30,7 +30,7 @@ void test_product_large() CALL_SUBTEST_1( product(MatrixXf(ei_random(1,320), ei_random(1,320))) ); CALL_SUBTEST_2( product(MatrixXd(ei_random(1,320), ei_random(1,320))) ); CALL_SUBTEST_3( product(MatrixXi(ei_random(1,320), ei_random(1,320))) ); - CALL_SUBTEST_4( product(MatrixXcf(ei_random(1,50), ei_random(1,50))) ); + CALL_SUBTEST_4( product(MatrixXcf(ei_random(1,150), ei_random(1,150))) ); CALL_SUBTEST_5( product(Matrix(ei_random(1,320), ei_random(1,320))) ); }