#[macro_use]
pub mod macros {
macro_rules! domain( ($requirement:expr) => (debug_assert!($requirement));
($requirement:expr, $code:expr) => (debug_assert!($code, stringify!($requirement)));
);
}
pub trait DistQuant {
fn cdf(&self, x: f64) -> f64;
fn pdf(&self, x: f64) -> f64;
fn quantile(&self, x: f64) -> f64;
fn random(&self, seed: RandomSeed) -> f64;
}
pub enum RandomSeed {
Empty,
Seed(u64),
}
impl Default for RandomSeed {
fn default() -> Self {
RandomSeed::Empty
}
}
impl RandomSeed {
pub fn get_seed(&self) -> Option<u64> {
match self {
RandomSeed::Empty => None,
RandomSeed::Seed(val) => Some(*val),
}
}
}