1
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
2
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3
<title>BitMagic: sample3.cpp File Reference</title>
3
<title>BitMagic: bm::bvector< Alloc, MS >::counted_enumerator Class Reference</title>
4
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
6
6
<!-- Generated by Doxygen 1.4.1 -->
7
7
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="examples.html">Examples</a></div>
9
<a class="el" href="dir_000001.html">samples</a> / <a class="el" href="dir_000004.html">sample3</a></div>
10
<h1>sample3.cpp File Reference</h1><code>#include <stdlib.h></code><br>
11
<code>#include <iostream></code><br>
12
<code>#include "<a class="el" href="a00102.html">bm.h</a>"</code><br>
15
Include dependency graph for sample3.cpp:<p><center><img src="a00146.png" border="0" usemap="#sample3.cpp_map" alt=""></center>
16
<map name="sample3.cpp_map">
17
<area href="a00074.html" shape="rect" coords="163,305,203,327" alt="">
18
<area href="a00076.html" shape="rect" coords="264,192,333,213" alt="">
19
<area href="a00077.html" shape="rect" coords="271,237,327,259" alt="">
20
<area href="a00079.html" shape="rect" coords="267,283,331,304" alt="">
21
<area href="a00078.html" shape="rect" coords="267,373,331,395" alt="">
22
<area href="a00081.html" shape="rect" coords="265,419,332,440" alt="">
23
<area href="a00082.html" shape="rect" coords="263,464,335,485" alt="">
24
<area href="a00080.html" shape="rect" coords="263,600,335,621" alt="">
28
<a href="a00113.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
9
<a class="el" href="a00129.html">bm</a>::<a class="el" href="a00084.html">bvector</a>::<a class="el" href="a00085.html">counted_enumerator</a></div>
10
<h1>bm::bvector< Alloc, MS >::counted_enumerator Class Reference<br>
12
[<a class="el" href="a00132.html">The Main bvector<> Group</a>]</small>
13
</h1>Constant input iterator designed to enumerate "ON" bits <a class="el" href="a00085.html">counted_enumerator</a> keeps bitcount, ie number of ON bits starting from the position 0 in the bit string up to the currently enumerated bit.
14
<a href="#_details">More...</a>
16
<code>#include <<a class="el" href="a00137.html">bm.h</a>></code>
18
Inheritance diagram for bm::bvector< Alloc, MS >::counted_enumerator:<p><center><img src="a00197.png" border="0" usemap="#a00198" alt="Inheritance graph"></center>
20
<area href="a00086.html" shape="rect" coords="32,85,261,106" alt="">
21
<area href="a00088.html" shape="rect" coords="28,16,265,37" alt="">
23
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for bm::bvector< Alloc, MS >::counted_enumerator:<p><center><img src="a00199.png" border="0" usemap="#a00200" alt="Collaboration graph"></center>
25
<area href="a00086.html" shape="rect" coords="220,269,449,291" alt="">
26
<area href="a00088.html" shape="rect" coords="216,197,453,219" alt="">
27
<area href="a00090.html" shape="rect" coords="179,107,491,128" alt="">
28
<area href="a00091.html" shape="rect" coords="7,16,319,37" alt="">
29
<area href="a00089.html" shape="rect" coords="343,16,671,37" alt="">
31
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><table border="0" cellpadding="0" cellspacing="0">
30
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
31
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00085.html#a1">fill_bvector</a> (<a class="el" href="a00048.html">bm::bvector</a><> *bv1, <a class="el" href="a00048.html">bm::bvector</a><> *bv2)</td></tr>
33
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00085.html#a2">print_statistics</a> (const <a class="el" href="a00048.html">bm::bvector</a><> &bv)</td></tr>
35
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00085.html#a3">main</a> (void)</td></tr>
37
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
38
<tr><td class="memItemLeft" nowrap align="right" valign="top">const unsigned </td><td class="memItemRight" valign="bottom"><a class="el" href="a00085.html#a0">MAX_VALUE</a> = 1000000</td></tr>
41
<hr><h2>Function Documentation</h2>
42
<a class="anchor" name="a1" doxytag="sample3.cpp::fill_bvector"></a><p>
43
<table class="mdTable" cellpadding="2" cellspacing="0">
46
<table cellpadding="0" cellspacing="0" border="0">
48
<td class="md" nowrap valign="top">void fill_bvector </td>
49
<td class="md" valign="top">( </td>
50
<td class="md" nowrap valign="top"><a class="el" href="a00048.html">bm::bvector</a><> * </td>
51
<td class="mdname" nowrap> <em>bv1</em>, </td>
54
<td class="md" nowrap align="right"></td>
56
<td class="md" nowrap><a class="el" href="a00048.html">bm::bvector</a><> * </td>
57
<td class="mdname" nowrap> <em>bv2</em></td>
61
<td class="md">) </td>
62
<td class="md" colspan="2"></td>
68
<table cellspacing="5" cellpadding="0" border="0">
76
<dl compact><dt><b>Examples: </b></dt><dd>
77
<a class="el" href="a00036.html#a12">sample3.cpp</a>, and <a class="el" href="a00037.html#a18">sample4.cpp</a>.</dl>
79
Definition at line <a class="el" href="a00113.html#l00049">49</a> of file <a class="el" href="a00113.html">sample3.cpp</a>.
81
References <a class="el" href="a00113.html#l00043">MAX_VALUE</a>.
83
Referenced by <a class="el" href="a00113.html#l00075">main()</a>. </td>
86
<a class="anchor" name="a3" doxytag="sample3.cpp::main"></a><p>
87
<table class="mdTable" cellpadding="2" cellspacing="0">
90
<table cellpadding="0" cellspacing="0" border="0">
92
<td class="md" nowrap valign="top">int main </td>
93
<td class="md" valign="top">( </td>
94
<td class="md" nowrap valign="top">void </td>
95
<td class="mdname1" valign="top" nowrap> </td>
96
<td class="md" valign="top"> ) </td>
97
<td class="md" nowrap></td>
103
<table cellspacing="5" cellpadding="0" border="0">
113
Definition at line <a class="el" href="a00113.html#l00075">75</a> of file <a class="el" href="a00113.html">sample3.cpp</a>.
115
References <a class="el" href="a00113.html#l00049">fill_bvector()</a>, <a class="el" href="a00102.html#l01790">bm::bvector< Alloc, MS >::optimize()</a>, <a class="el" href="a00113.html#l00062">print_statistics()</a>, and <a class="el" href="a00102.html#l01294">bm::bvector< Alloc, MS >::set_new_blocks_strat()</a>. </td>
118
<a class="anchor" name="a2" doxytag="sample3.cpp::print_statistics"></a><p>
119
<table class="mdTable" cellpadding="2" cellspacing="0">
122
<table cellpadding="0" cellspacing="0" border="0">
124
<td class="md" nowrap valign="top">void print_statistics </td>
125
<td class="md" valign="top">( </td>
126
<td class="md" nowrap valign="top">const <a class="el" href="a00048.html">bm::bvector</a><> & </td>
127
<td class="mdname1" valign="top" nowrap> <em>bv</em> </td>
128
<td class="md" valign="top"> ) </td>
129
<td class="md" nowrap></td>
135
<table cellspacing="5" cellpadding="0" border="0">
143
<dl compact><dt><b>Examples: </b></dt><dd>
144
<a class="el" href="a00036.html#a14">sample3.cpp</a>, and <a class="el" href="a00037.html#a20">sample4.cpp</a>.</dl>
146
Definition at line <a class="el" href="a00113.html#l00062">62</a> of file <a class="el" href="a00113.html">sample3.cpp</a>.
148
Referenced by <a class="el" href="a00113.html#l00075">main()</a>. </td>
151
<hr><h2>Variable Documentation</h2>
152
<a class="anchor" name="a0" doxytag="sample3.cpp::MAX_VALUE"></a><p>
153
<table class="mdTable" cellpadding="2" cellspacing="0">
156
<table cellpadding="0" cellspacing="0" border="0">
158
<td class="md" nowrap valign="top">const unsigned <a class="el" href="a00086.html#a0">MAX_VALUE</a> = 1000000 </td>
164
<table cellspacing="5" cellpadding="0" border="0">
174
Definition at line <a class="el" href="a00113.html#l00043">43</a> of file <a class="el" href="a00113.html">sample3.cpp</a>.
176
Referenced by <a class="el" href="a00113.html#l00049">fill_bvector()</a>. </td>
179
<hr size="1"><address style="align: right;"><small>Generated on Thu Apr 20 13:29:05 2006 for BitMagic by
33
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
34
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef std::input_iterator_tag </td><td class="memItemRight" valign="bottom"><a class="el" href="a00085.html#w0">iterator_category</a></td></tr>
36
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
37
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00085.html#a0">counted_enumerator</a> ()</td></tr>
39
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00085.html#a1">counted_enumerator</a> (const <a class="el" href="a00086.html">enumerator</a> &en)</td></tr>
41
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00085.html">counted_enumerator</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="a00085.html#a2">operator=</a> (const <a class="el" href="a00086.html">enumerator</a> &en)</td></tr>
43
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00085.html">counted_enumerator</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="a00085.html#a3">operator++</a> ()</td></tr>
45
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00085.html">counted_enumerator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00085.html#a4">operator++</a> (int)</td></tr>
47
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00129.html#a26">bm::id_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00085.html#a5">count</a> () const </td></tr>
49
<tr><td class="mdescLeft"> </td><td class="mdescRight">Number of bits ON starting from the . <a href="#a5"></a><br></td></tr>
51
<hr><a name="_details"></a><h2>Detailed Description</h2>
52
<h3>template<class Alloc, class MS><br>
53
class bm::bvector< Alloc, MS >::counted_enumerator</h3>
55
Constant input iterator designed to enumerate "ON" bits <a class="el" href="a00085.html">counted_enumerator</a> keeps bitcount, ie number of ON bits starting from the position 0 in the bit string up to the currently enumerated bit.
57
When increment operator called current position is increased by 1.
61
Definition at line <a class="el" href="a00137.html#l00720">720</a> of file <a class="el" href="a00137.html">bm.h</a>.<hr><h2>Member Typedef Documentation</h2>
62
<a class="anchor" name="w0" doxytag="bm::bvector::counted_enumerator::iterator_category"></a><p>
63
<table class="mdTable" cellpadding="2" cellspacing="0">
66
<table cellpadding="0" cellspacing="0" border="0">
68
<td class="mdPrefix" colspan="4">
69
template<class Alloc, class MS> </td>
72
<td class="md" nowrap valign="top">typedef std::input_iterator_tag <a class="el" href="a00084.html">bm::bvector</a>< Alloc, MS >::<a class="el" href="a00085.html#w0">counted_enumerator::iterator_category</a> </td>
78
<table cellspacing="5" cellpadding="0" border="0">
88
Reimplemented from <a class="el" href="a00086.html#w0">bm::bvector< Alloc, MS >::enumerator</a>.
90
Definition at line <a class="el" href="a00137.html#l00724">724</a> of file <a class="el" href="a00137.html">bm.h</a>. </td>
93
<hr><h2>Constructor & Destructor Documentation</h2>
94
<a class="anchor" name="a0" doxytag="bm::bvector::counted_enumerator::counted_enumerator"></a><p>
95
<table class="mdTable" cellpadding="2" cellspacing="0">
98
<table cellpadding="0" cellspacing="0" border="0">
100
<td class="mdPrefix" colspan="4">
101
template<class Alloc, class MS> </td>
104
<td class="md" nowrap valign="top"><a class="el" href="a00084.html">bm::bvector</a>< Alloc, MS >::counted_enumerator::counted_enumerator </td>
105
<td class="md" valign="top">( </td>
106
<td class="mdname1" valign="top" nowrap> </td>
107
<td class="md" valign="top"> ) </td>
108
<td class="md" nowrap><code> [inline]</code></td>
114
<table cellspacing="5" cellpadding="0" border="0">
124
Definition at line <a class="el" href="a00137.html#l00726">726</a> of file <a class="el" href="a00137.html">bm.h</a>. </td>
127
<a class="anchor" name="a1" doxytag="bm::bvector::counted_enumerator::counted_enumerator"></a><p>
128
<table class="mdTable" cellpadding="2" cellspacing="0">
131
<table cellpadding="0" cellspacing="0" border="0">
133
<td class="mdPrefix" colspan="4">
134
template<class Alloc, class MS> </td>
137
<td class="md" nowrap valign="top"><a class="el" href="a00084.html">bm::bvector</a>< Alloc, MS >::counted_enumerator::counted_enumerator </td>
138
<td class="md" valign="top">( </td>
139
<td class="md" nowrap valign="top">const <a class="el" href="a00086.html">enumerator</a> & </td>
140
<td class="mdname1" valign="top" nowrap> <em>en</em> </td>
141
<td class="md" valign="top"> ) </td>
142
<td class="md" nowrap><code> [inline]</code></td>
148
<table cellspacing="5" cellpadding="0" border="0">
158
Definition at line <a class="el" href="a00137.html#l00728">728</a> of file <a class="el" href="a00137.html">bm.h</a>. </td>
161
<hr><h2>Member Function Documentation</h2>
162
<a class="anchor" name="a5" doxytag="bm::bvector::counted_enumerator::count"></a><p>
163
<table class="mdTable" cellpadding="2" cellspacing="0">
166
<table cellpadding="0" cellspacing="0" border="0">
168
<td class="mdPrefix" colspan="4">
169
template<class Alloc, class MS> </td>
172
<td class="md" nowrap valign="top"><a class="el" href="a00129.html#a26">bm::id_t</a> <a class="el" href="a00084.html">bm::bvector</a>< Alloc, MS >::counted_enumerator::count </td>
173
<td class="md" valign="top">( </td>
174
<td class="mdname1" valign="top" nowrap> </td>
175
<td class="md" valign="top"> ) </td>
176
<td class="md" nowrap> const<code> [inline]</code></td>
182
<table cellspacing="5" cellpadding="0" border="0">
190
Number of bits ON starting from the .
192
Method returns number of ON bits fromn the bit 0 to the current bit For the first bit in bitvector it is 1, for the second 2
194
Definition at line <a class="el" href="a00137.html#l00766">766</a> of file <a class="el" href="a00137.html">bm.h</a>. </td>
197
<a class="anchor" name="a4" doxytag="bm::bvector::counted_enumerator::operator++"></a><p>
198
<table class="mdTable" cellpadding="2" cellspacing="0">
201
<table cellpadding="0" cellspacing="0" border="0">
203
<td class="mdPrefix" colspan="4">
204
template<class Alloc, class MS> </td>
207
<td class="md" nowrap valign="top"><a class="el" href="a00085.html">counted_enumerator</a> <a class="el" href="a00084.html">bm::bvector</a>< Alloc, MS >::counted_enumerator::operator++ </td>
208
<td class="md" valign="top">( </td>
209
<td class="md" nowrap valign="top">int </td>
210
<td class="mdname1" valign="top" nowrap> </td>
211
<td class="md" valign="top"> ) </td>
212
<td class="md" nowrap><code> [inline]</code></td>
218
<table cellspacing="5" cellpadding="0" border="0">
228
Reimplemented from <a class="el" href="a00086.html#a4">bm::bvector< Alloc, MS >::enumerator</a>.
230
Definition at line <a class="el" href="a00137.html#l00752">752</a> of file <a class="el" href="a00137.html">bm.h</a>.
232
References <a class="el" href="a00137.html#l00487">bm::bvector< Alloc, MS >::enumerator::go_up()</a>. </td>
235
<a class="anchor" name="a3" doxytag="bm::bvector::counted_enumerator::operator++"></a><p>
236
<table class="mdTable" cellpadding="2" cellspacing="0">
239
<table cellpadding="0" cellspacing="0" border="0">
241
<td class="mdPrefix" colspan="4">
242
template<class Alloc, class MS> </td>
245
<td class="md" nowrap valign="top"><a class="el" href="a00085.html">counted_enumerator</a>& <a class="el" href="a00084.html">bm::bvector</a>< Alloc, MS >::counted_enumerator::operator++ </td>
246
<td class="md" valign="top">( </td>
247
<td class="mdname1" valign="top" nowrap> </td>
248
<td class="md" valign="top"> ) </td>
249
<td class="md" nowrap><code> [inline]</code></td>
255
<table cellspacing="5" cellpadding="0" border="0">
265
Reimplemented from <a class="el" href="a00086.html#a3">bm::bvector< Alloc, MS >::enumerator</a>.
267
Definition at line <a class="el" href="a00137.html#l00744">744</a> of file <a class="el" href="a00137.html">bm.h</a>.
269
References <a class="el" href="a00137.html#l00487">bm::bvector< Alloc, MS >::enumerator::go_up()</a>. </td>
272
<a class="anchor" name="a2" doxytag="bm::bvector::counted_enumerator::operator="></a><p>
273
<table class="mdTable" cellpadding="2" cellspacing="0">
276
<table cellpadding="0" cellspacing="0" border="0">
278
<td class="mdPrefix" colspan="4">
279
template<class Alloc, class MS> </td>
282
<td class="md" nowrap valign="top"><a class="el" href="a00085.html">counted_enumerator</a>& <a class="el" href="a00084.html">bm::bvector</a>< Alloc, MS >::counted_enumerator::operator= </td>
283
<td class="md" valign="top">( </td>
284
<td class="md" nowrap valign="top">const <a class="el" href="a00086.html">enumerator</a> & </td>
285
<td class="mdname1" valign="top" nowrap> <em>en</em> </td>
286
<td class="md" valign="top"> ) </td>
287
<td class="md" nowrap><code> [inline]</code></td>
293
<table cellspacing="5" cellpadding="0" border="0">
303
Definition at line <a class="el" href="a00137.html#l00735">735</a> of file <a class="el" href="a00137.html">bm.h</a>. </td>
306
<hr>The documentation for this class was generated from the following file:<ul>
307
<li><a class="el" href="a00137.html">bm.h</a></ul>
308
<hr size="1"><address style="align: right;"><small>Generated on Sun Aug 5 14:12:38 2007 for BitMagic by
180
309
<a href="http://www.doxygen.org/index.html">
181
310
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.1 </small></address>