CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/RecoTracker/TkMSParametrization/interface/rangesIntersect.h

Go to the documentation of this file.
00001 #ifndef rangesIntersect_H
00002 #define rangesIntersect_H
00003 
00013 template <class Range>
00014 inline bool rangesIntersect( const Range& a, const Range& b) {
00015   if ( a.first > b.second || b.first > a.second) return false;
00016   else return true;
00017 }
00018 
00019 template <class Range, class Less>
00020 inline bool rangesIntersect( const Range& a, const Range& b, 
00021                              const Less& less) {
00022   if ( less(b.second,a.first) || less(a.second,b.first)) return false;
00023   else return true;
00024 }
00025 #endif