Class that maintains a mapping from key -> value, where the key is a type with range semantics, for the purpose of finding the intersection of a range to a set of ranges. More...
#include <RangeIntersector.hpp>
Public Types | |
typedef std::map< TRange, TValue, Less > | MapType |
Public Member Functions | |
RangeIntersector (const Overlap &overlap=Overlap(), const Less &less=Less()) | |
Construct RangeIntersector. | |
void | put (const TRange &range, const TValue &value) |
Add a range to the set of ranges. | |
void | intersect (const TRange &range, std::vector< typename MapType::const_iterator > &result) const |
Find the intersection of the given range with all the ranges in the set. | |
bool | intersects (const TRange &range) const |
Returns true iff the given range intersects the set of ranges in this RangeIntersector. | |
size_t | getTreeCount () const |
Debugging function to find out how many trees were required for this RangeIntersector. |
Class that maintains a mapping from key -> value, where the key is a type with range semantics, for the purpose of finding the intersection of a range to a set of ranges.
The class requires the key have an overlap operator defined, and a less than operator defined, such that:
size_t cgatools::util::RangeIntersector< TRange, TValue, Overlap, Less >::getTreeCount | ( | ) | const [inline] |
Debugging function to find out how many trees were required for this RangeIntersector.
Generally, the more trees, the more expensive lookups are.
void cgatools::util::RangeIntersector< TRange, TValue, Overlap, Less >::intersect | ( | const TRange & | range, | |
std::vector< typename MapType::const_iterator > & | result | |||
) | const [inline] |
Find the intersection of the given range with all the ranges in the set.
bool cgatools::util::RangeIntersector< TRange, TValue, Overlap, Less >::intersects | ( | const TRange & | range | ) | const [inline] |
Returns true iff the given range intersects the set of ranges in this RangeIntersector.