Functions for determining the union or intersection of a set of (closed)
intervals of the real number line.
Usage
interv_union(M)
interv_intersect(M)
Arguments
M
matrix representing a set of intervals.
Value
Another matrix representing a set of intervals.
Details
Intersection is easy, as it is the interval from the maximum of left end
points to the minimum of the right end points (or NULL if the maximum is
greater than the minimum).
NEW: Vectorized according to an idea of William Dunlap on R-help 01-2012.
OLD: For the union, the intervals are first ordered by left endpoints,
then a simple loop checking intersection of two adjacent intervals.