* but not of any interest to the user of the library. */
/*
- * GiNaC Copyright (C) 1999-2017 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2020 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "ex.h"
#include "numeric.h"
-#include "operators.h"
#include "utils.h"
#include "version.h"
* n = p1+p2+...+pk, i.e. p is a partition of n.
*/
const numeric
-multinomial_coefficient(const std::vector<int> & p)
+multinomial_coefficient(const std::vector<unsigned> & p)
{
numeric n = 0, d = 1;
for (auto & it : p) {
- n += numeric(it);
- d *= factorial(numeric(it));
+ n = n.add(numeric(it));
+ d = d.mul(factorial(numeric(it)));
}
- return factorial(n) / d;
+ return factorial(n).div(d);
}
//////////