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

vector_set_difference_Test.cpp

Go to the documentation of this file.
00001 // LightVector_set_difference_Test.cpp
00002 
00003 #include "datastructures/vector/set_difference.hpp"
00004 #include <iostream>
00005 #include <iterator>
00006 #include <vector>
00007 using namespace std;
00008 
00014 int main(int argc, char** argv) {
00015 
00016   int values[] = { 1, 3, 5, 7, 9, 11, 13 };
00017   int values2[] = { 1, 2, 4, 6, 7, 9 };
00018 
00019   const vector<int> x(values, values+7), y(values2, values2+6);
00020   vector<int> res(10);
00021   res.resize(0);
00022 
00023   cout << "x = ";
00024   copy (x.begin(), x.end(), ostream_iterator<int>(cout, " "));
00025   cout << endl;
00026   cout << "y = ";
00027   copy (y.begin(), y.end(), ostream_iterator<int>(cout, " "));
00028   cout << endl;
00029 #if DEBUG_LEVEL > 0
00030   cout << "res.capacity = " << res.capacity() << endl;
00031 #endif
00032 
00033   set_difference(x, y, res);
00034   cout << "set_difference(x,y) = ";
00035   copy (res.begin(), res.end(), ostream_iterator<int>(cout, " "));
00036   cout << endl;
00037 
00038   bool isBelowUpperSizeBound = set_difference_upper_size_bound(x, y, res, 3);
00039   cout << "set_difference_upper_size_bound(x,y,3) = ";
00040   copy (res.begin(), res.end(), ostream_iterator<int>(cout, " "));
00041   cout << ", isBelowUpperSizeBound = " << isBelowUpperSizeBound << endl;
00042 
00043 }

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