aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/util/Meta.h
diff options
context:
space:
mode:
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