Struct rv::dist::Crp[][src]

pub struct Crp {
    pub alpha: f64,
    pub n: usize,
}

Chinese Restaurant Process

Example

extern crate rand;

use::rv::prelude::*;

let mut rng = rand::thread_rng();

let crp = Crp::new(1.0, 10).expect("Invalid parameters");
let partition = crp.draw(&mut rng);

assert_eq!(partition.len(), 10);

Fields

Discount parameter

number of items in the partition

Methods

impl Crp
[src]

Create an empty Crp with parameter alpha

Trait Implementations

impl Debug for Crp
[src]

Formats the value using the given formatter. Read more

impl Clone for Crp
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Rv<Partition> for Crp
[src]

Un-normalized probability function Read more

The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

Single draw from the Rv Read more

Un-normalized probability function Read more

The constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

Multiple draws of the Rv Read more

impl Support<Partition> for Crp
[src]

Returns true if x is in the support of the Rv Read more

Auto Trait Implementations

impl Send for Crp

impl Sync for Crp