## CGAL::Incremental_neighbor_search<Traits, GeneralDistance, Splitter, SpatialTree>

### Definition

The class Incremental_neighbor_search<Traits, GeneralDistance, Splitter, SpatialTree> implements incremental nearest and furthest neighbor searching on a tree. The tree may have extended or unextended nodes.

#include <CGAL/Incremental_neighbor_search.h>

### Parameters

Expects for the first template argument a model of the concept SearchTraits, for example CGAL::Search_traits_2<CGAL::Cartesian<double> >.

Expects for the second template argument a model of the concept GeneralDistance. The default type is CGAL::Euclidean_distance<Traits>.

Expects for third template argument a model of the concept Splitter. The default type is CGAL::Sliding_midpoint<Traits>.

Expects for fourth template argument a model of the concept SpatialTree. The default type is CGAL::Kd_tree<Traits,Splitter,CGAL::Tag_false>. The template argument CGAL::Tag_false makes that the tree is built with unextended nodes.

### Types

Traits::Point_d | Point_d; | Point type.
Traits::NT | NT; | Number type.
std::pair<Point_d,NT>
| Point_with_transformed_distance;
|  | Pair of point and transformed distance.

Incremental_neighbor_search<Traits, GeneralDistance, Splitter, SpatialTree>::iterator
| Input iterator with value type Point_with_transformed_distance for enumerating approximate neighbors.

GeneralDistance::Query_item
| Query_item; | Query item type.
SpatialTree | Tree; | The tree type.

### Creation

Incremental_neighbor_search<Traits, GeneralDistance, Splitter, SpatialTree> s (
| Tree& tree, QueryItem q, NT eps=NT(0.0), bool search_nearest=true, GeneralDistance d=GeneralDistance());

| Constructor for incremental neighbor searching of the query item q in the points stored tree using a distance d and approximation factor eps.

### Operations

iterator | s.begin () | Returns an iterator to the approximate nearest or furthest neighbor.
iterator | s.end () | Past-the-end iterator.

| advanced |

std::ostream& | s.statistics ( std::ostream& s)
|  | Inserts statistics of the search process into the output stream s.

| advanced |

### See Also

CGAL::Orthogonal_incremental_neighbor_search<Traits, OrthogonalDistance, Splitter, SpatialTree>.