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

Nearest neighbor engine designed for metric spaces. More...

#include <NN_metric_tree.hpp>

Public Types

enum  ANN_query_type { ANN_BY_K , ANN_BY_RANGE }
 
typedef T_NN_metric_tree< DistanceFunction, SplitterFunction > Self
 
typedef DistanceFunction Distance
 
typedef SplitterFunction Splitter
 
typedef DistanceFunction::FT FT
 
typedef DistanceFunction::Point Point
 
typedef std::list< unsigned > Point_container
 

Public Member Functions

 T_NN_metric_tree (Self *parent=NULL)
 
 T_NN_metric_tree (Distance &distance, Self *parent=NULL)
 
 T_NN_metric_tree (const Self &other)
 
 ~T_NN_metric_tree (void)
 
void insert (const Point &p)
 
template<class InputIterator >
void insert (InputIterator begin, InputIterator end)
 
void clear_all_buckets (void)
 
void clear (void)
 
void reset (void)
 
unsigned get_bucket_size (void) const
 
const Pointget_point (unsigned i) const
 
unsigned get_number_of_points (void) const
 
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
 

Static Public Member Functions

static void set_bucket_maximal_size (unsigned k)
 
static void set_query_type (ANN_query_type query_type)
 
static void set_number_of_neighbors (unsigned k)
 
static void set_range (const FT &range)
 
static void set_unbalanced_ratio (double d)
 
static unsigned get_bucket_maximal_size (void)
 
static unsigned get_number_of_neighbors (void)
 
static const FTget_range (void)
 
static double get_unbalanced_ratio (void)
 

Detailed Description

template<class DistanceFunction, class SplitterFunction = T_Splitter_default<DistanceFunction>>
class SBL::GT::T_NN_metric_tree< DistanceFunction, SplitterFunction >

Nearest neighbor engine designed for metric spaces.

...

Member Typedef Documentation

◆ Distance

typedef DistanceFunction Distance

◆ FT

typedef DistanceFunction::FT FT

◆ Point

typedef DistanceFunction::Point Point

◆ Point_container

typedef std::list<unsigned> Point_container

◆ Self

typedef T_NN_metric_tree<DistanceFunction, SplitterFunction> Self

◆ Splitter

typedef SplitterFunction Splitter

Member Enumeration Documentation

◆ ANN_query_type

Enumerator
ANN_BY_K 
ANN_BY_RANGE 

Constructor & Destructor Documentation

◆ T_NN_metric_tree() [1/3]

T_NN_metric_tree ( Self parent = NULL)
inline

◆ T_NN_metric_tree() [2/3]

T_NN_metric_tree ( Distance distance,
Self parent = NULL 
)
inline

◆ T_NN_metric_tree() [3/3]

T_NN_metric_tree ( const Self other)
inline

◆ ~T_NN_metric_tree()

~T_NN_metric_tree ( void  )
inline

Member Function Documentation

◆ clear()

void clear ( void  )
inline

◆ clear_all_buckets()

void clear_all_buckets ( void  )
inline

◆ get_bucket_maximal_size()

unsigned get_bucket_maximal_size ( void  )
inlinestatic

◆ get_bucket_size()

unsigned get_bucket_size ( void  ) 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  )
inlinestatic

◆ get_number_of_points()

unsigned get_number_of_points ( void  ) const
inline

◆ get_point()

const T_NN_metric_tree< DistanceFunction, SplitterFunction >::Point & get_point ( unsigned  i) const
inline

◆ get_range()

const DistanceFunction::FT & get_range ( void  )
inlinestatic

◆ get_unbalanced_ratio()

double get_unbalanced_ratio ( void  )
inlinestatic

◆ 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_bucket_maximal_size()

void set_bucket_maximal_size ( unsigned  k)
inlinestatic

◆ set_number_of_neighbors()

void set_number_of_neighbors ( unsigned  k)
inlinestatic

◆ set_query_type()

void set_query_type ( ANN_query_type  query_type)
inlinestatic

◆ set_range()

void set_range ( const FT range)
inlinestatic

◆ set_unbalanced_ratio()

void set_unbalanced_ratio ( double  d)
inlinestatic