Trait cogset::RegionQuery [-] [+] [src]

pub trait RegionQuery: Points {
    type Neighbours: Iterator<Item=(f64, Self::Point)>;

    fn neighbours(&self, point: &Self::Point, epsilon: f64) -> Self::Neighbours;
}

Collections of points that can be queried to find nearby points.

Associated Types

type Neighbours: Iterator<Item=(f64, Self::Point)>

An iterator over the nearby points and their distances of a given one.

Required Methods

fn neighbours(&self, point: &Self::Point, epsilon: f64) -> Self::Neighbours

Return an iterator over points in self with distance from point less than or equal to epsilon.

It is expected that this includes point itself if `epsilon

= 0`.

The behaviour is unspecified if point is not in self, and if epsilon < 0 (although it is strongly recommended that the iterator is empty in this case).

Implementors