aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/util/Meta.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2015-02-18 15:49:05 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2015-02-18 15:49:05 +0100
commit63eb0f6fe6c7223c3bb2a2ea9495fddcc1e4b6f2 (patch)
treed3085e2a3ea81ff54342f23069db0c19a6f21b2f /Eigen/src/Core/util/Meta.h
parentfc5c3e85e2a59a3b366970793195538969462a64 (diff)
Clean a bit computeProductBlockingSizes (use Index type, remove CEIL macro)
Diffstat (limited to 'Eigen/src/Core/util/Meta.h')
-rw-r--r--Eigen/src/Core/util/Meta.h8
1 files changed, 8 insertions, 0 deletions
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<typename T> EIGEN_DEVICE_FUNC void swap(T &a, T &b) { T tmp = b; b =
template<typename T> 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<typename T>
+T div_ceil(const T &a, const T &b)
+{
+ return (a+b-1) / b;
+}
+
} // end namespace numext
} // end namespace Eigen