Trait spaces::Space [−][src]
pub trait Space { type Value: Debug + Clone; fn dim(&self) -> usize; fn card(&self) -> Card; fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Self::Value; }
Trait for defining geometric spaces.
Associated Types
Required Methods
fn dim(&self) -> usize
Return the number of dimensions in the space.
fn card(&self) -> Card
Return the number of elements in the set composing the space.
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Self::Value
Generate a random sample from the space.
Implementations on Foreign Types
impl<D: Space> Space for Box<D>
[src]
impl<D: Space> Space for Box<D>
impl<'a, D: Space> Space for &'a D
[src]
impl<'a, D: Space> Space for &'a D
Implementors
impl Space for Reals type Value = f64;
impl Space for Interval type Value = f64;
impl Space for Binary type Value = bool;
impl Space for Discrete type Value = usize;
impl Space for Naturals type Value = u64;
impl Space for Partition type Value = usize;
impl<D1: Space, D2: Space> Space for PairSpace<D1, D2> type Value = (D1::Value, D2::Value);
impl<D: Space> Space for RegularSpace<D> type Value = Vec<D::Value>;
impl<D: Space> Space for NamedSpace<D> type Value = HashMap<String, D::Value>;