59 cout <<
"<EMPTY SET>";
61 for(;first != last; ++first)
62 cout << *first <<
";";
77 cout <<
"Source set:";
82 vector<bm_size_type> vect;
83 vect.resize(bv.
count());
84 std::copy(bv.
first(), bv.
end(), vect.begin());
92 list<bm_size_type> lst;
93 std::copy(bv.
first(), bv.
end(), std::back_inserter(lst));
99 vector<bm_size_type> vect;
100 vector<bm_size_type> res1, res2, res3;
106 cout <<
"Argument vector for set operations:";
110 std::sort(vect.begin(), vect.end());
113 std::set_union(bv.
first(), bv.
end(),
114 vect.begin(), vect.end(),
115 std::back_inserter(res1));
116 cout <<
"Set union:" << endl;
119 std::set_intersection(bv.
first(), bv.
end(),
120 vect.begin(), vect.end(),
121 std::back_inserter(res2));
122 cout <<
"Set intersection:" << endl;
125 vector<bm_size_type>::const_iterator it1 = vect.begin();
126 vector<bm_size_type>::const_iterator it2 = vect.end();
130 std::set_difference(en, en2,
132 std::back_inserter(res3));
134 cout <<
"Set diff:" << endl;
142 std::vector<bm_size_type> vect;
149 cout << endl <<
"Source vector:";
155 std::copy(vect.begin(), vect.end(), bv1.
inserter());
161 catch(std::exception& ex)
163 std::cerr << ex.what() << std::endl;
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
pre-processor un-defines to avoid global space pollution (internal)
Constant iterator designed to enumerate "ON" bits.
Bitvector Bit-vector container with runtime compression of bits.
size_type count() const BMNOEXCEPT
population count (count of ON bits)
insert_iterator inserter()
bvector_size_type size_type
enumerator first() const
Returns enumerator pointing on the first non-zero bit.
enumerator end() const
Returns enumerator pointing on the next bit after the last.
bm::bvector ::size_type bm_size_type
void PrintContainer(T first, T last)
void Print(bm::bvector<>::size_type n)