Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

LightVector_set_intersection_Test.cpp

Go to the documentation of this file.
00001 // LightVector_set_intersection_Test.cpp
00002 
00003 #include "datastructures/vector/LightVector.hpp"
00004 #include "datastructures/vector/LightVector_set_intersection.hpp"
00005 #include <iostream>
00006 using namespace std;
00007 
00013 int main(int argc, char** argv) {
00014 
00015 
00016   int values[] = { 1, 3, 5, 7, 9 };
00017   int len = 5;
00018   int values2[] = { 1, 2, 4, 6, 7, 9 };
00019   int len2 = 6;
00020 
00021   const LightVector<int> x(values, len), y(values2, len2);
00022   LightVector<int>* res = LightVector<int>::create(10, 0);
00023 
00024   cout << "x = " << x << endl;
00025   cout << "y = " << y << endl;
00026 #if DEBUG_LEVEL > 0
00027   cout << "res.capacity = " << res->capacity() << endl;
00028 #endif
00029 
00030   set_intersection<false>(*res, x, y);
00031   cout << "set_intersection<false>(x,y) = " << *res << endl;
00032 
00033   bool hasMinimalLength = set_intersection<true>(*res, x, y, 4);
00034   cout << "set_intersection<true>(x,y,4) = " << *res << ", hasMinimalLength = " << hasMinimalLength<< endl;
00035 
00036                                                          
00037 
00038 }

Generated on Sun Sep 17 17:50:39 2006 for FIM environment by  doxygen 1.4.4