FastJet 3.4.1
Classes | Public Member Functions | List of all members
fastjet::ClosestPair2D Class Reference

More...

#include <fastjet/internal/ClosestPair2D.hh>

Inheritance diagram for fastjet::ClosestPair2D:
Inheritance graph
[legend]
Collaboration diagram for fastjet::ClosestPair2D:
Collaboration graph
[legend]

Classes

class  Point
 

Public Member Functions

 ClosestPair2D (const std::vector< Coord2D > &positions, const Coord2D &left_corner, const Coord2D &right_corner)
 constructor from a vector of 2D positions – number of objects after insertion and deletion must never exceed positions.size(); objects are given IDs that correspond to their index in the vector of positions More...
 
 ClosestPair2D (const std::vector< Coord2D > &positions, const Coord2D &left_corner, const Coord2D &right_corner, const unsigned int max_size)
 constructor which allows structure to grow beyond positions.size(), up to max_size More...
 
void closest_pair (unsigned int &ID1, unsigned int &ID2, double &distance2) const
 provides the IDs of the closest pair as well as the distance between them More...
 
void remove (unsigned int ID)
 removes the entry labelled by ID from the object; More...
 
unsigned int insert (const Coord2D &)
 inserts the position into the closest pair structure and returns the ID that has been allocated for the object. More...
 
virtual unsigned int replace (unsigned int ID1, unsigned int ID2, const Coord2D &position)
 removes ID1 and ID2 and inserts position, returning the ID corresponding to position... More...
 
virtual void replace_many (const std::vector< unsigned int > &IDs_to_remove, const std::vector< Coord2D > &new_positions, std::vector< unsigned int > &new_IDs)
 replaces IDs_to_remove with points at the new_positions indicating the IDs allocated to the new points in new_IDs More...
 
void print_tree_depths (std::ostream &outdev) const
 
unsigned int size ()
 
virtual void closest_pair (unsigned int &ID1, unsigned int &ID2, double &distance2) const =0
 provides the IDs of the closest pair as well as the squared distance between them More...
 
virtual void remove (unsigned int ID)=0
 removes the entry labelled by ID from the object; More...
 
virtual unsigned int insert (const Coord2D &position)=0
 inserts the position into the closest pair structure and returns the ID that has been allocated for the object. More...
 
virtual unsigned int replace (unsigned int ID1, unsigned int ID2, const Coord2D &position)
 replaces the specified ID1 and ID2 with something at a new position assuming that ID1 and ID2 are in sequence wrt position; it returns the ID of the new object... More...
 
virtual void replace_many (const std::vector< unsigned int > &IDs_to_remove, const std::vector< Coord2D > &new_positions, std::vector< unsigned int > &new_IDs)
 replaces IDs_to_remove with points at the new_positions indicating the IDs allocated to the new points in new_IDs More...
 
virtual unsigned int size ()=0
 

Detailed Description

Definition at line 51 of file ClosestPair2D.hh.

Constructor & Destructor Documentation

◆ ClosestPair2D() [1/2]

fastjet::ClosestPair2D::ClosestPair2D ( const std::vector< Coord2D > &  positions,
const Coord2D left_corner,
const Coord2D right_corner 
)
inline

constructor from a vector of 2D positions – number of objects after insertion and deletion must never exceed positions.size(); objects are given IDs that correspond to their index in the vector of positions

Definition at line 57 of file ClosestPair2D.hh.

◆ ClosestPair2D() [2/2]

fastjet::ClosestPair2D::ClosestPair2D ( const std::vector< Coord2D > &  positions,
const Coord2D left_corner,
const Coord2D right_corner,
const unsigned int  max_size 
)
inline

constructor which allows structure to grow beyond positions.size(), up to max_size

Definition at line 64 of file ClosestPair2D.hh.

Member Function Documentation

◆ closest_pair()

void fastjet::ClosestPair2D::closest_pair ( unsigned int &  ID1,
unsigned int &  ID2,
double &  distance2 
) const
virtual

provides the IDs of the closest pair as well as the distance between them

Implements fastjet::ClosestPair2DBase.

Definition at line 181 of file ClosestPair2D.cc.

◆ remove()

void fastjet::ClosestPair2D::remove ( unsigned int  ID)
virtual

removes the entry labelled by ID from the object;

Implements fastjet::ClosestPair2DBase.

Definition at line 217 of file ClosestPair2D.cc.

◆ insert()

unsigned int fastjet::ClosestPair2D::insert ( const Coord2D new_coord)
virtual

inserts the position into the closest pair structure and returns the ID that has been allocated for the object.

Implements fastjet::ClosestPair2DBase.

Definition at line 349 of file ClosestPair2D.cc.

◆ replace()

unsigned int fastjet::ClosestPair2D::replace ( unsigned int  ID1,
unsigned int  ID2,
const Coord2D position 
)
virtual

removes ID1 and ID2 and inserts position, returning the ID corresponding to position...

Reimplemented from fastjet::ClosestPair2DBase.

Definition at line 371 of file ClosestPair2D.cc.

◆ replace_many()

void fastjet::ClosestPair2D::replace_many ( const std::vector< unsigned int > &  IDs_to_remove,
const std::vector< Coord2D > &  new_positions,
std::vector< unsigned int > &  new_IDs 
)
virtual

replaces IDs_to_remove with points at the new_positions indicating the IDs allocated to the new points in new_IDs

Reimplemented from fastjet::ClosestPair2DBase.

Definition at line 403 of file ClosestPair2D.cc.

◆ print_tree_depths()

void fastjet::ClosestPair2D::print_tree_depths ( std::ostream &  outdev) const
inline

Definition at line 94 of file ClosestPair2D.hh.

◆ size()

unsigned int fastjet::ClosestPair2D::size ( )
inlinevirtual

Implements fastjet::ClosestPair2DBase.

Definition at line 235 of file ClosestPair2D.hh.


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