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
Provided Methods
fn dispatch(&self, elem: &T) -> usize
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
impl<T: Mid + PartialOrd + Copy> Partition<T> for Interval<T>
impl<T: Mid + PartialOrd + Copy> Partition<Vector2<T>> for Box2<T>
impl<T: Mid + PartialOrd + Copy> Partition<Vector3<T>> for Box3<T>
impl<P, S> Partition<P> for Ncube<P, S> where P: Dimension + Index<usize, Output=S> + IndexMut<usize, Output=S> + Copy, S: BaseFloat + PartialOrd + NumCast
impl<T: BaseFloat + NumCast + Float> Partition<Vector2<T>> for UnitQuad
impl<T: BaseFloat + PartialOrd + NumCast + Float> Partition<Vector3<T>> for Quad
impl<T: BaseFloat + PartialOrd + NumCast + Float> Partition<Vector3<T>> for CubeMap