From 1510d41c4b13fcd767287f472cd1e5813f19eb31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 26 Sep 2020 21:43:35 +0200 Subject: [PATCH] Math: this is also wrongly grouped. --- src/Magnum/Math/Functions.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Magnum/Math/Functions.h b/src/Magnum/Math/Functions.h index db44f62e5..f0d0216ba 100644 --- a/src/Magnum/Math/Functions.h +++ b/src/Magnum/Math/Functions.h @@ -79,6 +79,20 @@ template inline std::pair div(Integral x, In return {result.quot, result.rem}; } +/** +@brief [Binomial coefficient](https://en.wikipedia.org/wiki/Binomial_coefficient). +@m_since_latest + +Returns the number of combinations of @f$ n @f$ things taken @f$ k @f$ at a +time, with @f$ n \ge k \ge 0 @f$: @f[ + \begin{pmatrix} n \\ k \end{pmatrix} = + \frac{n! (n - k)!}{k!} = + \frac{n (n - 1) (n - 2) ~ \cdots ~ (n - (k - 1))}{k (k - 1) ~ \cdots ~ 1} = + \prod_{i=1}^k \frac{n + 1 - i}{i} +@f] +*/ +UnsignedLong MAGNUM_EXPORT binomialCoefficient(UnsignedInt n, UnsignedInt k); + /** @{ @name Trigonometric functions @@ -411,20 +425,6 @@ template inline Vector ceil(const Vector