IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
IMP::misc::MetricClosePairsFinder< LowerBound, UpperBound > Class Template Reference

#include <IMP/misc/MetricClosePairsFinder.h>

Inheritance diagram for IMP::misc::MetricClosePairsFinder< LowerBound, UpperBound >:

Detailed Description

template<class LowerBound, class UpperBound>
class IMP::misc::MetricClosePairsFinder< LowerBound, UpperBound >

A close pairs finder that only depends on metrics on the underlying particles. As a result, it should be usable with weird metrics (eg ones that include symmetry).

The LowerBound and UpperBound templates should be functors that bound the distance between two particles. For example the LowerBound distance between two balls is the center distance minus the radii, and the UpperBound distance is the center distance plus the radii. The signature should be double operator()(Model *m, const ParticleIndexPair &pip) const

The algorithm works by building an index using sqrt(n) of the n input particles, assigning each particle to a bucket based on the closest index particle, and then checking for close pairs in buckets such that they can be close enough.

If we need something more involved, we can try this paper

Definition at line 44 of file MetricClosePairsFinder.h.

Public Member Functions

 MetricClosePairsFinder (LowerBound lb, UpperBound ub, std::string name="MetricClosePairsFinder%1%")
virtual ModelObjectsTemp do_get_inputs (Model *m, const ParticleIndexes &pis) const override
 Overload this method to specify the inputs.
virtual IntPairs get_close_pairs (const algebra::BoundingBox3Ds &) const override
virtual IntPairs get_close_pairs (const algebra::BoundingBox3Ds &, const algebra::BoundingBox3Ds &) const override
virtual ParticleIndexPairs get_close_pairs (Model *m, const ParticleIndexes &pc) const override
 return all close pairs among pc in model m
virtual ParticleIndexPairs get_close_pairs (Model *m, const ParticleIndexes &pca, const ParticleIndexes &pcb) const override
 return all close pairs among pc in model m
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.
Public Member Functions inherited from IMP::core::ClosePairsFinder
 ClosePairsFinder (std::string name)
void remove_pair_filter (PairPredicate *d)
void remove_pair_filters (const PairPredicates &d)
void set_pair_filters (const PairPredicates &ps)
void set_pair_filters_order (const PairPredicates &objs)
unsigned int add_pair_filter (PairPredicate *obj)
void add_pair_filters (const PairPredicates &objs)
void clear_pair_filters ()
unsigned int get_number_of_pair_filters () const
bool get_has_pair_filters ()
PairPredicate * get_pair_filter (unsigned int i) const
PairPredicates get_pair_filters () const
void erase_pair_filter (unsigned int i)
void reserve_pair_filters (unsigned int sz)
virtual void set_distance (double d)
double get_distance () const
Public Member Functions inherited from IMP::ParticleInputs
ModelObjectsTemp get_inputs (Model *m, const ParticleIndexes &pis) const
 Get the ModelObjects read when the given list of particles is used.
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

list pair_filters
 A Python list of PairFilters.
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

◆ MetricClosePairsFinder()

template<class LowerBound, class UpperBound>
IMP::misc::MetricClosePairsFinder< LowerBound, UpperBound >::MetricClosePairsFinder ( LowerBound lb,
UpperBound ub,
std::string name = "MetricClosePairsFinder< LowerBound, UpperBound >%1%" )

Definition at line 155 of file MetricClosePairsFinder.h.

◆ ~MetricClosePairsFinder()

template<class LowerBound, class UpperBound>
virtual IMP::misc::MetricClosePairsFinder< LowerBound, UpperBound >::~MetricClosePairsFinder ( )
virtual

Definition at line 192 of file MetricClosePairsFinder.h.

Member Function Documentation

◆ do_get_inputs()

template<class LowerBound, class UpperBound>
virtual ModelObjectsTemp IMP::misc::MetricClosePairsFinder< LowerBound, UpperBound >::do_get_inputs ( Model * m,
const ParticleIndexes & pis ) const
overridevirtual

Overload this method to specify the inputs.

Implements IMP::ParticleInputs.

Definition at line 186 of file MetricClosePairsFinder.h.

Here is the call graph for this function:

◆ get_close_pairs() [1/4]

template<class LowerBound, class UpperBound>
virtual IntPairs IMP::misc::MetricClosePairsFinder< LowerBound, UpperBound >::get_close_pairs ( const algebra::BoundingBox3Ds & ) const
overridevirtual

Not supported.

Implements IMP::core::ClosePairsFinder.

Definition at line 159 of file MetricClosePairsFinder.h.

◆ get_close_pairs() [2/4]

template<class LowerBound, class UpperBound>
virtual IntPairs IMP::misc::MetricClosePairsFinder< LowerBound, UpperBound >::get_close_pairs ( const algebra::BoundingBox3Ds & ,
const algebra::BoundingBox3Ds &  ) const
overridevirtual

Not supported.

Implements IMP::core::ClosePairsFinder.

Definition at line 164 of file MetricClosePairsFinder.h.

◆ get_close_pairs() [3/4]

template<class LowerBound, class UpperBound>
virtual ParticleIndexPairs IMP::misc::MetricClosePairsFinder< LowerBound, UpperBound >::get_close_pairs ( Model * m,
const ParticleIndexes & pc ) const
overridevirtual

return all close pairs among pc in model m

Implements IMP::core::ClosePairsFinder.

Definition at line 170 of file MetricClosePairsFinder.h.

◆ get_close_pairs() [4/4]

template<class LowerBound, class UpperBound>
virtual ParticleIndexPairs IMP::misc::MetricClosePairsFinder< LowerBound, UpperBound >::get_close_pairs ( Model * m,
const ParticleIndexes & pca,
const ParticleIndexes & pcb ) const
overridevirtual

return all close pairs among pc in model m

Implements IMP::core::ClosePairsFinder.

Definition at line 177 of file MetricClosePairsFinder.h.

◆ get_type_name()

template<class LowerBound, class UpperBound>
virtual std::string IMP::misc::MetricClosePairsFinder< LowerBound, UpperBound >::get_type_name ( ) const
overridevirtual

Reimplemented from IMP::Object.

Definition at line 192 of file MetricClosePairsFinder.h.

◆ get_version_info()

template<class LowerBound, class UpperBound>
virtual ::IMP::VersionInfo IMP::misc::MetricClosePairsFinder< LowerBound, UpperBound >::get_version_info ( ) const
overridevirtual

Get information about the module and version of the object.

Reimplemented from IMP::Object.

Definition at line 192 of file MetricClosePairsFinder.h.


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