Trait acacia::partition::Partition [] [src]

pub trait Partition<T>: Subdivide + Sized {
    fn contains(&self, elem: &T) -> bool;

    fn dispatch(&self, elem: &T) -> usize { ... }
}

A type describing a partition of some space

In addition to this trait signature an implementation is required to satisfy prop_is_total.

Required Methods

Does the partition contain an element?

Provided Methods

Dispatch an element to the correct subpartition

The default implementation works, if the totality proposition is fulfilled. However, note that its performance is not optimal, as it checks for all subpartitions whether they contain the element, until one is found that does.

Implementors