This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build a Python extension module using pybind11 | |
# pybindings_add_module(<module>) | |
# Here <module> should be the fully qualified name for the module, | |
# e.g. pybindings_add_module(foo.bar._baz) | |
# <module> becomes the target name in case you wish to do something to it later | |
# The source for the binding *must* be placed in src/pybindings/{relpath}/py{name}.cc | |
# E.g. for module=foo.bar._baz -> src/pybindings/bar/py_baz.cc | |
function(pybindings_add_module module) | |
set(target_name ${module}) | |
string(REPLACE "." "/" modpath ${module}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import numpy as np | |
import numpy.testing as nt | |
import scipy.misc | |
def multinomial(n, K): | |
nom = scipy.misc.factorial(n) | |
den = np.product([scipy.misc.factorial(k) for k in K]) | |
return nom / den |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.