From d177c1f3aca150d36d17c8116504e3ea1e7b30cf Mon Sep 17 00:00:00 2001 From: Hauke Heibel Date: Thu, 15 Oct 2009 21:07:14 +0200 Subject: [PATCH] Inlining fixes + fixed typo. Removed ei_assert in presence of static assert. --- Eigen/src/Core/CwiseNullaryOp.h | 1 - Eigen/src/Core/Redux.h | 12 +++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Eigen/src/Core/CwiseNullaryOp.h b/Eigen/src/Core/CwiseNullaryOp.h index 61ce51885..7c1984be6 100644 --- a/Eigen/src/Core/CwiseNullaryOp.h +++ b/Eigen/src/Core/CwiseNullaryOp.h @@ -147,7 +147,6 @@ EIGEN_STRONG_INLINE const CwiseNullaryOp MatrixBase::NullaryExpr(int size, const CustomNullaryOp& func) { EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) - ei_assert(IsVectorAtCompileTime); if(RowsAtCompileTime == 1) return CwiseNullaryOp(1, size, func); else return CwiseNullaryOp(size, 1, func); } diff --git a/Eigen/src/Core/Redux.h b/Eigen/src/Core/Redux.h index f437208c0..0df095750 100644 --- a/Eigen/src/Core/Redux.h +++ b/Eigen/src/Core/Redux.h @@ -112,6 +112,16 @@ struct ei_redux_novec_unroller } }; +// This is actually dead code and will never be called. It is required +// to prevent false warnings regarding failed inlining though +// for 0 length run() will never be called at all. +template +struct ei_redux_novec_unroller +{ + typedef typename Derived::Scalar Scalar; + EIGEN_STRONG_INLINE static Scalar run(const Derived&, const Func&) { return Scalar(); } +}; + /*** vectorization ***/ template @@ -297,7 +307,7 @@ struct ei_redux_impl /** \returns the result of a full redux operation on the whole matrix or vector using \a func * * The template parameter \a BinaryOp is the type of the functor \a func which must be - * an assiociative operator. Both current STL and TR1 functor styles are handled. + * an associative operator. Both current STL and TR1 functor styles are handled. * * \sa MatrixBase::sum(), MatrixBase::minCoeff(), MatrixBase::maxCoeff(), MatrixBase::colwise(), MatrixBase::rowwise() */