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

LightVector_set_difference_Test.cpp

Go to the documentation of this file.
00001 // LightVector_set_difference_Test.cpp
00002 
00003 #include "datastructures/vector/LightVector.hpp"
00004 #include "datastructures/vector/set_difference.hpp"
00005 #include <iostream>
00006 using namespace std;
00007 
00013 int main(int argc, char** argv) {
00014 
00015   int values[] = { 1, 3, 5, 7, 9, 11, 13 };
00016   int len = 7;
00017   int values2[] = { 1, 2, 4, 6, 7, 9 };
00018   int len2 = 6;
00019 
00020   const LightVector<int> x(values, len), y(values2, len2);
00021   LightVector<int>* res = LightVector<int>::create(10, 0);
00022 
00023   cout << "x = " << x << endl;
00024   cout << "y = " << y << endl;
00025 #if DEBUG_LEVEL > 0
00026   cout << "res.capacity = " << res->capacity() << endl;
00027 #endif
00028 
00029   // 1. ordinary set difference:
00030   set_difference(x, y, *res);
00031   cout << "set_difference(x,y) = " << *res << endl;
00032 
00033   // 2. with lower or upper size bounds:
00034   bool isBelowUpperSizeBound = set_difference_upper_size_bound(x, y, *res, 3);
00035   cout << "set_difference_upper_size_bound(x,y,3) = " << *res << ", isBelowUpperSizeBound = " << isBelowUpperSizeBound << endl;
00036 
00037   bool isBelowUpperSizeBound2 = set_difference_upper_size_bound(x, y, *res, 4);
00038   cout << "set_difference_upper_size_bound(x,y,4) = " << *res << ", isBelowUpperSizeBound = " << isBelowUpperSizeBound2 << endl;
00039 
00040   bool isAboveLowerSizeBound = set_difference_lower_size_bound(x, y, *res, 5);
00041   cout << "set_difference_lower_size_bound(x,y,5) = " << *res << ", isAboveLowerSizeBound = " << isAboveLowerSizeBound << endl;
00042 
00043   bool isAboveLowerSizeBound2 = set_difference_lower_size_bound(x, y, *res, 4);
00044   cout << "set_difference_lower_size_bound(x,y,4) = " << *res << ", isAboveLowerSizeBound = " << isAboveLowerSizeBound2 << endl;
00045 
00046   // 3. just result sizes:
00047   cout << "|set_difference(x,y)| = " << size_of_set_difference(x, y) << endl;
00048 
00049   cout << "|set_difference_upper_size_bound(x,y,3)| = " << size_of_set_difference_upper_size_bound(x, y, 3) << endl;
00050   cout << "|set_difference_upper_size_bound(x,y,4)| = " << size_of_set_difference_upper_size_bound(x, y, 4) << endl;
00051   cout << "|set_difference_lower_size_bound(x,y,5)| = " << size_of_set_difference_lower_size_bound(x, y, 5) << endl;
00052   cout << "|set_difference_lower_size_bound(x,y,4)| = " << size_of_set_difference_lower_size_bound(x, y, 4) << endl;
00053 
00054 
00055 }

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