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

Box_d_Box_d_batch_allpair.C

00001 #include <utility>
00002 #include <iterator>
00003 
00004 
00005 namespace CEP {
00006     namespace intersection {
00007 
00008 
00009 // Naive O(n^2) brute force algorithm
00010 template <class BoxInIter, class BoxPairOutIter>
00011 void Box_d_Box_d_batch_allpair( BoxInIter begin1,
00012                                 BoxInIter end1,
00013                                 BoxInIter begin2,
00014                                 BoxInIter end2,
00015                                 BoxPairOutIter out )
00016 {
00017     typedef typename std::iterator_traits<BoxInIter>::value_type  Box_;
00018     typedef std::pair<Box_,Box_>                                  Box_pair;
00019 
00020     for( BoxInIter i1 = begin1; i1 != end1; ++i1 ) {
00021         for( BoxInIter i2 = begin2; i2 != end2; ++i2 ) {
00022             if (do_intersect( *i1, *i2 )) {
00023                 *out++ = Box_pair(*i1,*i2);
00024             }
00025         }
00026     }
00027 }
00028 
00029 
00030 
00031 }
00032 }

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