From 556fea05affe6fe8866557d42b6c1ef6559d7880 Mon Sep 17 00:00:00 2001 From: Martin Michalec Date: Sat, 7 Nov 2026 06:20:46 +0300 Subject: publish --- src/distribution.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/distribution.h (limited to 'src/distribution.h') diff --git a/src/distribution.h b/src/distribution.h new file mode 100644 index 0000000..c4b20b9 --- /dev/null +++ b/src/distribution.h @@ -0,0 +1,22 @@ +#ifndef INCLUDED_DISTRIBUTION_H +#define INCLUDED_DISTRIBUTION_H + +// Multivariate Pólya distribution +typedef struct distribution +{ + unsigned int n; + unsigned int b; + unsigned int r; + int c; + double p0; +}* DISTRIBUTION; + +void distribution_init (DISTRIBUTION dist, + unsigned int n, + unsigned int b, + unsigned int r, + int c); +int distribution_rand (DISTRIBUTION dist); +double distribution_nrand (DISTRIBUTION dist); + +#endif -- cgit v1.3.1