Main Page   Modules   Namespace List   Compound List   File List   Namespace Members   Compound Members  

Box_d_Box_d_batch
[Batch Intersections]

Compute set of pairwise intersections in batch mode. More...

Functions

template<class BoxInIter, class BoxPairOutIter> void Box_d_Box_d_batch_allpair (BoxInIter begin1, BoxInIter end1, BoxInIter begin2, BoxInIter end2, BoxPairOutIter out)
 Test all pairs for intersection.

template<class BoxInIter, class BoxPairOutIter> void Box_d_Box_d_batch_scan (BoxInIter begin1, BoxInIter end1, BoxInIter begin2, BoxInIter end2, BoxPairOutIter out)
 Sort and scan along one axis.

template<class BoxInIter, class BoxPairOutIter> void Box_d_Box_d_batch_stream (BoxInIter begin1, BoxInIter end1, BoxInIter begin2, BoxInIter end2, BoxPairOutIter out)
 Use the streaming approach of Edelsbrunner and Overmars.

template<class BoxInIter, class BoxPairOutIter> void Box_d_Box_d_batch (BoxInIter begin1, BoxInIter end1, BoxInIter begin2, BoxInIter end2, BoxPairOutIter out)
 Use best intersection approach.


Detailed Description

Compute set of pairwise intersections in batch mode.

The batch intersection problem is the following.

Precondition:
BoxInIter is input iterator with value type Box_d

BoxPairOutIter is output iterator with value type std::pair<Box_d,Box_d>

[begin1, end1) is a valid sequence of Box_d

[begin2, end2) is a valid sequence of Box_d

Postcondition:
All intersecting pairs (b1,b2) where b1 is a box of set boxes1, and b2 belongs to the set boxes2 have been inserted into output container.
The algorithms assume the two sets of boxes are distinct. If they are the same set, you must filter the output to discard the self-intersections.

The current implementations may report box pairs multiple times, so you need to filter the output to remove duplicates.

Warning:
The ordering of the input sequences may not be preserved.

Function Documentation

template<class BoxInIter, class BoxPairOutIter>
void CEP::intersection::Box_d_Box_d_batch_allpair (  BoxInIter    begin1,
BoxInIter    end1,
BoxInIter    begin2,
BoxInIter    end2,
BoxPairOutIter    out
) 
 

Test all pairs for intersection.

This is the brute force approach, with O(N^2) time complexity.

Definition at line 11 of file Box_d_Box_d_batch_allpair.C.

References CEP::intersection::do_intersect().

template<class BoxInIter, class BoxPairOutIter>
void CEP::intersection::Box_d_Box_d_batch_scan (  BoxInIter    begin1,
BoxInIter    end1,
BoxInIter    begin2,
BoxInIter    end2,
BoxPairOutIter    out
) 
 

Sort and scan along one axis.

This useful for one-dimensional boxes, and for small numbers of boxes.

Definition at line 126 of file Box_d_Box_d_batch_scan.C.

template<class BoxInIter, class BoxPairOutIter>
void CEP::intersection::Box_d_Box_d_batch_stream (  BoxInIter    begin1,
BoxInIter    end1,
BoxInIter    begin2,
BoxInIter    end2,
BoxPairOutIter    out
) 
 

Use the streaming approach of Edelsbrunner and Overmars.

This is the method to use for large numbers of boxes.

Definition at line 213 of file Box_d_Box_d_batch_stream.C.

Referenced by CEP::intersection::Box_d_Box_d_batch().


Generated on Sun Jun 8 17:38:22 2003 for CEP::intersection by doxygen1.3-rc3