2
Copyright(c) 2002-2005 Anatoliy Kuznetsov(anatoliy_kuznetsov at yahoo.com)
4
Permission is hereby granted, free of charge, to any person
5
obtaining a copy of this software and associated documentation
6
files (the "Software"), to deal in the Software without restriction,
7
including without limitation the rights to use, copy, modify, merge,
8
publish, distribute, sublicense, and/or sell copies of the Software,
9
and to permit persons to whom the Software is furnished to do so,
10
subject to the following conditions:
12
The above copyright notice and this permission notice shall be included
13
in all copies or substantial portions of the Software.
15
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
19
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21
OTHER DEALINGS IN THE SOFTWARE.
24
/** \example sample2.cpp
25
Example demonstrates using set operations AND, OR, XOR, etc.
26
For more information please visit: http://bmagic.sourceforge.net
36
void print_bvector(const bm::bvector<>& bv)
38
unsigned value = bv.get_first();
42
value = bv.get_next(value);
69
// Logical AND operation on bv2 (bv1 is the argument)
75
bv2 &= bv1; // You also can use: bv2.bit_and(bv1);
83
bv2 |= bv1; // You can also use: bv2.bit_or(bv1);
87
bv1.set(1000000, false);
94
bv2 -= bv1; // You can also use: bv2.bit_sub(bv1);
102
bv2 ^= bv1; // You can also use: bv2.bit_xor(bv1);
105
// For lexicographical comparison there is set of overloaded
106
// operators and function compare.
110
cerr << "Equivalent. Comparison result = "
111
<< bv2.compare(bv3) << endl;
115
cout << "Error." << endl;
2
Copyright(c) 2002-2005 Anatoliy Kuznetsov(anatoliy_kuznetsov at yahoo.com)
4
Permission is hereby granted, free of charge, to any person
5
obtaining a copy of this software and associated documentation
6
files (the "Software"), to deal in the Software without restriction,
7
including without limitation the rights to use, copy, modify, merge,
8
publish, distribute, sublicense, and/or sell copies of the Software,
9
and to permit persons to whom the Software is furnished to do so,
10
subject to the following conditions:
12
The above copyright notice and this permission notice shall be included
13
in all copies or substantial portions of the Software.
15
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
19
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21
OTHER DEALINGS IN THE SOFTWARE.
24
/** \example sample2.cpp
25
Example demonstrates using set operations AND, OR, XOR, etc.
26
For more information please visit: http://bmagic.sourceforge.net
36
void print_bvector(const bm::bvector<>& bv)
38
unsigned value = bv.get_first();
42
value = bv.get_next(value);
69
// Logical AND operation on bv2 (bv1 is the argument)
75
bv2 &= bv1; // You also can use: bv2.bit_and(bv1);
83
bv2 |= bv1; // You can also use: bv2.bit_or(bv1);
87
bv1.set(1000000, false);
94
bv2 -= bv1; // You can also use: bv2.bit_sub(bv1);
102
bv2 ^= bv1; // You can also use: bv2.bit_xor(bv1);
105
// For lexicographical comparison there is set of overloaded
106
// operators and function compare.
110
cerr << "Equivalent. Comparison result = "
111
<< bv2.compare(bv3) << endl;
115
cout << "Error." << endl;