58 cout <<
"<EMPTY SET>";
60 for(;first != last; ++first)
61 cout << *first <<
";";
76 cout <<
"Source set:";
81 vector<bm_size_type> vect;
82 vect.resize(bv.
count());
83 std::copy(bv.
first(), bv.
end(), vect.begin());
91 list<bm_size_type> lst;
92 std::copy(bv.
first(), bv.
end(), std::back_inserter(lst));
98 vector<bm_size_type> vect;
99 vector<bm_size_type> res1, res2, res3;
105 cout <<
"Argument vector for set operations:";
109 std::sort(vect.begin(), vect.end());
112 std::set_union(bv.
first(), bv.
end(),
113 vect.begin(), vect.end(),
114 std::back_inserter(res1));
115 cout <<
"Set union:" << endl;
118 std::set_intersection(bv.
first(), bv.
end(),
119 vect.begin(), vect.end(),
120 std::back_inserter(res2));
121 cout <<
"Set intersection:" << endl;
124 vector<bm_size_type>::const_iterator it1 = vect.begin();
125 vector<bm_size_type>::const_iterator it2 = vect.end();
129 std::set_difference(en, en2,
131 std::back_inserter(res3));
133 cout <<
"Set diff:" << endl;
141 std::vector<bm_size_type> vect;
148 cout << endl <<
"Source vector:";
154 std::copy(vect.begin(), vect.end(), bv1.
inserter());
160 catch(std::exception& ex)
162 std::cerr << ex.what() << std::endl;
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
insert_iterator inserter()
enumerator first() const
Returns enumerator pointing on the first non-zero bit.
size_type count() const
population cout (count of ON bits)
enumerator end() const
Returns enumerator pointing on the next bit after the last.
Constant iterator designed to enumerate "ON" bits.
void Print(bm::bvector<>::size_type n)
void PrintContainer(T first, T last)
bm::bvector ::size_type bm_size_type