From 9facdaf7b9fa65d7f669af0bfabd34e23698f446 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 10 Dec 2009 22:15:22 +0100 Subject: [PATCH] some compilation fixes --- Eigen/src/Core/products/TriangularMatrixVector.h | 2 +- test/nomalloc.cpp | 2 +- test/product.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h index 291177445..fc3188cd8 100644 --- a/Eigen/src/Core/products/TriangularMatrixVector.h +++ b/Eigen/src/Core/products/TriangularMatrixVector.h @@ -95,7 +95,7 @@ struct ei_product_triangular_vector_selector0) - res.coeffRef(i) += alpha * (cjLhs.row(i).segment(s,r).cwise() * cjRhs.segment(s,r).transpose()).sum(); + res.coeffRef(i) += alpha * (cjLhs.row(i).segment(s,r).cwiseProduct(cjRhs.segment(s,r).transpose())).sum(); if (HasUnitDiag) res.coeffRef(i) += alpha * cjRhs.coeff(i); } diff --git a/test/nomalloc.cpp b/test/nomalloc.cpp index 1a917192b..12b09efa2 100644 --- a/test/nomalloc.cpp +++ b/test/nomalloc.cpp @@ -64,7 +64,7 @@ template void nomalloc(const MatrixType& m) VERIFY_IS_APPROX((m1+m2)*s1, s1*m1+s1*m2); VERIFY_IS_APPROX((m1+m2)(r,c), (m1(r,c))+(m2(r,c))); - VERIFY_IS_APPROX(m1.cwise() * m1.block(0,0,rows,cols), m1.cwise() * m1); + VERIFY_IS_APPROX(m1.cwise() * m1.block(0,0,rows,cols), m1.array()*m1); if (MatrixType::RowsAtCompileTime bool areNotApprox(const MatrixBase& m1, const MatrixBase& m2, typename Derived1::RealScalar epsilon = precision()) { - return !((m1-m2).cwise().abs2().maxCoeff() < epsilon * epsilon - * std::max(m1.cwise().abs2().maxCoeff(), m2.cwise().abs2().maxCoeff())); + return !((m1-m2).cwiseAbs2().maxCoeff() < epsilon * epsilon + * std::max(m1.cwiseAbs2().maxCoeff(), m2.cwiseAbs2().maxCoeff())); } template void product(const MatrixType& m)