Trait gst::gst::GstKey
[−]
[src]
pub trait GstKey: Sized + Clone + Eq { fn consistent(&self, k: &Self) -> bool; fn expand(&self, k: &Self) -> Self; fn penalty(bounds: &[Self], t: &Self) -> (usize, f32); fn pick_split(bounds: &[Self], min_split_size: usize) -> Vec<usize>; fn union(items: &[Self]) -> Option<Self> { ... } }
GstKey
represents a the Generalized Search Tree.
See http://gist.cs.berkeley.edu/libgist-2.0/
The rename from GiST
to Gst is because it conflicts with github gists and no one knows what the
'i' stands for anyway.
Required Methods
fn consistent(&self, k: &Self) -> bool
Return true if self contains (or overlaps) k.
fn expand(&self, k: &Self) -> Self
Expand the Key to cover k.
fn penalty(bounds: &[Self], t: &Self) -> (usize, f32)
Return a float representing the cost of inserting T into the Key. Also return a score so the machinations can compare scores from orphaned children.
fn pick_split(bounds: &[Self], min_split_size: usize) -> Vec<usize>
Given a slice of Self, return a vector of indices of items that should be carved off into their own node. Assumes that the leaf was inserted in some kind of ordering.
Provided Methods
fn union(items: &[Self]) -> Option<Self>
Given a slice of T, make a Self that contains them. Return None if the slice was empty.
Implementors
impl GstKey for Rect