From 63eb0f6fe6c7223c3bb2a2ea9495fddcc1e4b6f2 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 18 Feb 2015 15:49:05 +0100 Subject: Clean a bit computeProductBlockingSizes (use Index type, remove CEIL macro) --- Eigen/src/Core/util/Meta.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Eigen/src/Core/util/Meta.h') diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index f3bafd5af..3be9e6ca5 100644 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -284,6 +284,14 @@ template EIGEN_DEVICE_FUNC void swap(T &a, T &b) { T tmp = b; b = template EIGEN_STRONG_INLINE void swap(T &a, T &b) { std::swap(a,b); } #endif +// Integer division with rounding up. +// T is assumed to be an integer type with a>=0, and b>0 +template +T div_ceil(const T &a, const T &b) +{ + return (a+b-1) / b; +} + } // end namespace numext } // end namespace Eigen -- cgit v1.2.3