Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
T_NN_linear_scan< DistanceFunction > Class Template Reference

Naive algorithm looking for the nearest neighbors of a point in a database w.r.t a metric space Naive algorithm looking for the nearest neighbors of a point in a database w.r.t a metric space. More...

#include <NN_linear_scan.hpp>

Public Types

enum  NN_query_type { ANN_BY_K , ANN_BY_RANGE }
 
typedef T_NN_linear_scan< DistanceFunction > Self
 
typedef DistanceFunction Distance
 
typedef DistanceFunction::FT FT
 
typedef DistanceFunction::Point Point
 
typedef std::vector< PointPoint_container
 

Public Member Functions

 T_NN_linear_scan (void)
 
 T_NN_linear_scan (Distance &distance)
 
 T_NN_linear_scan (const Self &other)
 
 ~T_NN_linear_scan (void)
 
void insert (const Point &p)
 
template<class InputIterator >
void insert (InputIterator begin, InputIterator end)
 
void clear (void)
 
void reset (void)
 
void set_query_type (NN_query_type query_type)
 
void set_number_of_neighbors (unsigned k)
 
void set_range (const FT &range)
 
template<class OutputIterator >
OutputIterator get_database (OutputIterator out) const
 
const Pointget_point (unsigned int i) const
 
Pointget_point (unsigned int i)
 
unsigned get_number_of_points (void) const
 
unsigned get_number_of_neighbors (void) const
 
const FTget_range (void)
 
FT get_distance (const Point &p, const Point &q) const
 
int get_nearest_neighbor (const Point &p, bool self_allowed) const
 
const Pointoperator() (const Point &p, bool self_allowed) const
 
template<class OutputIterator >
OutputIterator operator() (const Point &p, bool self_allowed, OutputIterator out) const
 

Detailed Description

template<class DistanceFunction>
class SBL::GT::T_NN_linear_scan< DistanceFunction >

Naive algorithm looking for the nearest neighbors of a point in a database w.r.t a metric space Naive algorithm looking for the nearest neighbors of a point in a database w.r.t a metric space.

Member Typedef Documentation

◆ Distance

typedef DistanceFunction Distance

◆ FT

typedef DistanceFunction::FT FT

◆ Point

typedef DistanceFunction::Point Point

◆ Point_container

typedef std::vector<Point> Point_container

◆ Self

typedef T_NN_linear_scan<DistanceFunction> Self

Member Enumeration Documentation

◆ NN_query_type

Enumerator
ANN_BY_K 
ANN_BY_RANGE 

Constructor & Destructor Documentation

◆ T_NN_linear_scan() [1/3]

T_NN_linear_scan ( void  )
inline

◆ T_NN_linear_scan() [2/3]

T_NN_linear_scan ( Distance distance)
inline

◆ T_NN_linear_scan() [3/3]

T_NN_linear_scan ( const Self other)
inline

◆ ~T_NN_linear_scan()

~T_NN_linear_scan ( void  )
inline

Member Function Documentation

◆ clear()

void clear ( void  )
inline

◆ get_database()

OutputIterator get_database ( OutputIterator  out) const
inline

◆ get_distance()

DistanceFunction::FT get_distance ( const Point p,
const Point q 
) const
inline

◆ get_nearest_neighbor()

int get_nearest_neighbor ( const Point p,
bool  self_allowed 
) const
inline

◆ get_number_of_neighbors()

unsigned get_number_of_neighbors ( void  ) const
inline

◆ get_number_of_points()

unsigned get_number_of_points ( void  ) const
inline

◆ get_point() [1/2]

T_NN_linear_scan< DistanceFunction >::Point & get_point ( unsigned int  i)
inline

◆ get_point() [2/2]

const T_NN_linear_scan< DistanceFunction >::Point & get_point ( unsigned int  i) const
inline

◆ get_range()

const DistanceFunction::FT & get_range ( void  )
inline

◆ insert() [1/2]

void insert ( const Point p)
inline

◆ insert() [2/2]

void insert ( InputIterator  begin,
InputIterator  end 
)
inline

◆ operator()() [1/2]

const DistanceFunction::Point & operator() ( const Point p,
bool  self_allowed 
) const
inline

◆ operator()() [2/2]

OutputIterator operator() ( const Point p,
bool  self_allowed,
OutputIterator  out 
) const
inline

◆ reset()

void reset ( void  )
inline

◆ set_number_of_neighbors()

void set_number_of_neighbors ( unsigned  k)
inline

◆ set_query_type()

void set_query_type ( NN_query_type  query_type)
inline

◆ set_range()

void set_range ( const FT range)
inline