1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
pub mod dirichlet_process;
pub use dirichlet_process::*;
use crate::{Distribution, RandomVariable};
use std::collections::HashSet;
#[derive(Clone, Debug)]
pub struct BaselineMeasure<D, T>
where
D: Distribution<Value = T, Condition = ()>,
T: RandomVariable,
{
pub distr: D,
}
impl<D, T> BaselineMeasure<D, T>
where
D: Distribution<Value = T, Condition = ()>,
T: RandomVariable,
{
pub fn new(distr: D) -> Self {
Self { distr }
}
}
pub type DiscreteMeasurableSpace = HashSet<usize>;
pub trait DiscreteMeasure {
fn measure(&self, a: DiscreteMeasurableSpace) -> f64;
}