CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
pat::OverlapDistance< Comparator > Struct Template Reference

#include <GenericOverlapFinder.h>

Public Member Functions

template<typename T1 , typename T2 >
double operator() (const T1 &t1, const T2 &t2) const
 
 OverlapDistance ()
 
 OverlapDistance (const Comparator &comp)
 

Private Attributes

Comparator comp_
 

Detailed Description

template<typename Comparator>
struct pat::OverlapDistance< Comparator >

Turn a comparator in a distance for uses of overlap comparator(x,y) = true <-> x and y overlap the associated distance would work as dist(x,y) = 1.0 - comparator(x,y) [0 if overlap, 1 otherwise] if the constructor of your Comparator does not need parameters, then the associated distance will not need parameters too.

Definition at line 24 of file GenericOverlapFinder.h.

Constructor & Destructor Documentation

template<typename Comparator >
pat::OverlapDistance< Comparator >::OverlapDistance ( )
inline

Definition at line 26 of file GenericOverlapFinder.h.

26 {}
template<typename Comparator >
pat::OverlapDistance< Comparator >::OverlapDistance ( const Comparator comp)
inline

Definition at line 27 of file GenericOverlapFinder.h.

27 : comp_(comp) {}

Member Function Documentation

template<typename Comparator >
template<typename T1 , typename T2 >
double pat::OverlapDistance< Comparator >::operator() ( const T1 &  t1,
const T2 &  t2 
) const
inline

Definition at line 29 of file GenericOverlapFinder.h.

References pat::OverlapDistance< Comparator >::comp_.

29  {
30  return 1.0 - comp_(t1,t2);
31  }

Member Data Documentation

template<typename Comparator >
Comparator pat::OverlapDistance< Comparator >::comp_
private