aboutsummaryrefslogtreecommitdiff
path: root/src/distribution.h
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-11-07 03:20:46 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-11-07 04:21:37 +0000
commit556fea05affe6fe8866557d42b6c1ef6559d7880 (patch)
treef8de5473f16e65fcbe10f280b4cf54ee7e32b5b7 /src/distribution.h
downloadlab-01-05-master.tar.gz
publishHEADmaster
Diffstat (limited to 'src/distribution.h')
-rw-r--r--src/distribution.h22
1 files changed, 22 insertions, 0 deletions
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 @@
1#ifndef INCLUDED_DISTRIBUTION_H
2#define INCLUDED_DISTRIBUTION_H
3
4// Multivariate Pólya distribution
5typedef struct distribution
6{
7 unsigned int n;
8 unsigned int b;
9 unsigned int r;
10 int c;
11 double p0;
12}* DISTRIBUTION;
13
14void distribution_init (DISTRIBUTION dist,
15 unsigned int n,
16 unsigned int b,
17 unsigned int r,
18 int c);
19int distribution_rand (DISTRIBUTION dist);
20double distribution_nrand (DISTRIBUTION dist);
21
22#endif