IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
IMP::algebra::NearestNeighborD< D > Class Template Reference

Build a structure for finding nearest neighbors. More...

#include <IMP/algebra/vector_search.h>

Inheritance diagram for IMP::algebra::NearestNeighborD< D >:

Detailed Description

template<int D>
class IMP::algebra::NearestNeighborD< D >

Build a structure for finding nearest neighbors.

Different implementations are used depending on what optional dependencies are available. The class NearestNeighborD uses CGAL in order to improve its functionality. It will fall back on less good code without it. The class NearestNeighborD uses ANN in order to improve its functionality. It will fall back on less good code without it.

Definition at line 55 of file vector_search.h.

Public Member Functions

 NearestNeighborD (const Vector< VectorD< D > > &vs, double epsilon=0)
template<class It>
 NearestNeighborD (It b, It e, double epsilon=0)
Ints get_in_ball (const VectorD< D > &pt, double distance) const
 Find all points within the provided distance.
Ints get_in_ball (unsigned int i, double distance) const
 Find all points within the provided distance.
unsigned int get_nearest_neighbor (const VectorD< D > &q) const
unsigned int get_nearest_neighbor (unsigned int i) const
 Search using the ith point in the input set.
Ints get_nearest_neighbors (const algebra::VectorD< D > &v, unsigned int k) const
Ints get_nearest_neighbors (unsigned int i, unsigned int k) const
 Search using the ith point in the input set.
virtual std::string get_type_name () const override
virtual ::IMP::VersionInfo get_version_info () const override
 Get information about the module and version of the object.
void set_query_log (std::string fname)
 Log the points and queries to a file for performance studies.
Public Member Functions inherited from IMP::Object
CheckLevel get_check_level () const
 get_derived_object (self)
 Return this object cast to the most derived subclass.
LogLevel get_log_level () const
void set_check_level (CheckLevel l)
void set_log_level (LogLevel l)
 Set the logging level used in this object.
const std::string & get_name () const
 Get the (not necessarily unique) name of this object.
void set_name (std::string name)
void set_was_used (bool tf) const
void show (std::ostream &out=std::cout) const
virtual void clear_caches ()

Additional Inherited Members

Protected Member Functions inherited from IMP::Object
 Object (std::string name)
 Construct an object with the given name.
virtual void do_destroy ()

Constructor & Destructor Documentation

◆ NearestNeighborD() [1/2]

template<int D>
template<class It>
IMP::algebra::NearestNeighborD< D >::NearestNeighborD ( It b,
It e,
double epsilon = 0 )

Definition at line 73 of file vector_search.h.

◆ NearestNeighborD() [2/2]

template<int D>
IMP::algebra::NearestNeighborD< D >::NearestNeighborD ( const Vector< VectorD< D > > & vs,
double epsilon = 0 )

Definition at line 77 of file vector_search.h.

◆ ~NearestNeighborD()

template<int D>
virtual IMP::algebra::NearestNeighborD< D >::~NearestNeighborD ( )
virtual

Definition at line 180 of file vector_search.h.

Member Function Documentation

◆ get_in_ball() [1/2]

template<int D>
Ints IMP::algebra::NearestNeighborD< D >::get_in_ball ( const VectorD< D > & pt,
double distance ) const

Find all points within the provided distance.

Definition at line 173 of file vector_search.h.

Here is the call graph for this function:

◆ get_in_ball() [2/2]

template<int D>
Ints IMP::algebra::NearestNeighborD< D >::get_in_ball ( unsigned int i,
double distance ) const

Find all points within the provided distance.

Definition at line 162 of file vector_search.h.

Here is the call graph for this function:

◆ get_nearest_neighbor() [1/2]

template<int D>
unsigned int IMP::algebra::NearestNeighborD< D >::get_nearest_neighbor ( const VectorD< D > & q) const

Definition at line 97 of file vector_search.h.

◆ get_nearest_neighbor() [2/2]

template<int D>
unsigned int IMP::algebra::NearestNeighborD< D >::get_nearest_neighbor ( unsigned int i) const

Search using the ith point in the input set.

Definition at line 110 of file vector_search.h.

Here is the call graph for this function:

◆ get_nearest_neighbors() [1/2]

template<int D>
Ints IMP::algebra::NearestNeighborD< D >::get_nearest_neighbors ( const algebra::VectorD< D > & v,
unsigned int k ) const

Definition at line 146 of file vector_search.h.

◆ get_nearest_neighbors() [2/2]

template<int D>
Ints IMP::algebra::NearestNeighborD< D >::get_nearest_neighbors ( unsigned int i,
unsigned int k ) const

Search using the ith point in the input set.

Returns
the k nearest neighbors.

Definition at line 124 of file vector_search.h.

Here is the call graph for this function:

◆ get_type_name()

template<int D>
virtual std::string IMP::algebra::NearestNeighborD< D >::get_type_name ( ) const
overridevirtual

Reimplemented from IMP::Object.

Definition at line 180 of file vector_search.h.

◆ get_version_info()

template<int D>
virtual ::IMP::VersionInfo IMP::algebra::NearestNeighborD< D >::get_version_info ( ) const
overridevirtual

Get information about the module and version of the object.

Reimplemented from IMP::Object.

Definition at line 180 of file vector_search.h.

◆ set_query_log()

template<int D>
void IMP::algebra::NearestNeighborD< D >::set_query_log ( std::string fname)

Log the points and queries to a file for performance studies.

Definition at line 84 of file vector_search.h.

Here is the call graph for this function:

The documentation for this class was generated from the following file: