~ubuntu-branches/ubuntu/trusty/bmagic/trusty

« back to all changes in this revision

Viewing changes to html/a00109.html

  • Committer: Bazaar Package Importer
  • Author(s): Andres Salomon
  • Date: 2008-01-05 23:58:56 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080105235856-2kmxhxkz14qjy9ia
Tags: 3.5.0-1
* New upstream release.
* Add tcpp.dpatch.  This stops tests/stress/t.cpp from including
  ncbi_pch.hpp.  As far as I can tell, NCBI is not used at all, I have
  no idea where that came from..
* Silence some lintian warnings; binary-arch-rules-but-pkg-is-arch-indep
  and ancient-standards-version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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: bmvmin.h Source File</title>
 
3
<title>BitMagic: bm::operation_functions&lt; T &gt; Struct Template Reference</title>
4
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
5
5
</head><body>
6
6
<!-- Generated by Doxygen 1.4.1 -->
7
7
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;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&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="examples.html">Examples</a></div>
8
8
<div class="nav">
9
 
<a class="el" href="dir_000000.html">src</a></div>
10
 
<h1>bmvmin.h</h1><a href="a00081.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/*</span>
11
 
00002 <span class="comment">Copyright(c) 2002-2005 Anatoliy Kuznetsov(anatoliy_kuznetsov at yahoo.com)</span>
12
 
00003 <span class="comment"></span>
13
 
00004 <span class="comment">Permission is hereby granted, free of charge, to any person </span>
14
 
00005 <span class="comment">obtaining a copy of this software and associated documentation </span>
15
 
00006 <span class="comment">files (the "Software"), to deal in the Software without restriction, </span>
16
 
00007 <span class="comment">including without limitation the rights to use, copy, modify, merge, </span>
17
 
00008 <span class="comment">publish, distribute, sublicense, and/or sell copies of the Software, </span>
18
 
00009 <span class="comment">and to permit persons to whom the Software is furnished to do so, </span>
19
 
00010 <span class="comment">subject to the following conditions:</span>
20
 
00011 <span class="comment"></span>
21
 
00012 <span class="comment">The above copyright notice and this permission notice shall be included </span>
22
 
00013 <span class="comment">in all copies or substantial portions of the Software.</span>
23
 
00014 <span class="comment"></span>
24
 
00015 <span class="comment">THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, </span>
25
 
00016 <span class="comment">EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES </span>
26
 
00017 <span class="comment">OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. </span>
27
 
00018 <span class="comment">IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, </span>
28
 
00019 <span class="comment">DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, </span>
29
 
00020 <span class="comment">ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR </span>
30
 
00021 <span class="comment">OTHER DEALINGS IN THE SOFTWARE.</span>
31
 
00022 <span class="comment"></span>
32
 
00023 <span class="comment">For more information please visit:  http://bmagic.sourceforge.net</span>
33
 
00024 <span class="comment"></span>
34
 
00025 <span class="comment">*/</span>
35
 
00026 
36
 
00027 <span class="preprocessor">#ifndef BMVMIN__H__INCLUDED__</span>
37
 
00028 <span class="preprocessor"></span><span class="preprocessor">#define BMVMIN__H__INCLUDED__</span>
38
 
00029 <span class="preprocessor"></span>
39
 
00030 <span class="keyword">namespace </span>bm
40
 
00031 {
41
 
00032 
42
 
00033 
43
 
<a name="l00034"></a><a class="code" href="a00081.html#a0">00034</a> <span class="preprocessor">#define BM_MINISET_GAPLEN (bm::gap_len_table&lt;true&gt;::_len[0])</span>
44
 
<a name="l00035"></a><a class="code" href="a00081.html#a1">00035</a> <span class="preprocessor"></span><span class="preprocessor">#define BM_MINISET_ARRSIZE(x) ((x / 32) + ( (x % 32) &amp;&amp; 1 ))</span>
45
 
00036 <span class="preprocessor"></span><span class="comment"></span>
46
 
00037 <span class="comment">/*! @defgroup mset Small sets functionality</span>
47
 
00038 <span class="comment"> *  Templates in this group are used to keep block types in BM library.</span>
48
 
00039 <span class="comment"> *  Classes of this group can tune bvector template (MS parameter)</span>
49
 
00040 <span class="comment"> *  for best performance or minimal memory usage.</span>
50
 
00041 <span class="comment"> *  @ingroup bmagic</span>
51
 
00042 <span class="comment"> *  @{</span>
52
 
00043 <span class="comment"> */</span>
53
 
00044 
54
 
00045 <span class="comment"></span>
55
 
00046 <span class="comment">/*!</span>
56
 
00047 <span class="comment">    @brief Template class implements memory saving set functionality</span>
57
 
00048 <span class="comment">    </span>
58
 
00049 <span class="comment">    Template can be used as template parameter for bvector if we </span>
59
 
00050 <span class="comment">    want to tune bvector for minimal memory consumption.</span>
60
 
00051 <span class="comment"></span>
61
 
00052 <span class="comment">    @sa bvmini</span>
62
 
00053 <span class="comment">*/</span>
63
 
<a name="l00054"></a><a class="code" href="a00072.html">00054</a> <span class="keyword">template</span> &lt;<span class="keyword">class</span> A, size_t N&gt; <span class="keyword">class </span><a class="code" href="a00072.html">miniset</a>
64
 
00055 {
65
 
00056 <span class="keyword">public</span>:
66
 
00057 
67
 
<a name="l00058"></a><a class="code" href="a00072.html#a0">00058</a>     <a class="code" href="a00072.html#a0">miniset</a>() 
68
 
00059         : m_buf(0),
69
 
00060           m_type(1)
70
 
00061     {}
71
 
00062 
72
 
<a name="l00063"></a><a class="code" href="a00072.html#a1">00063</a>     <a class="code" href="a00072.html#a0">miniset</a>(<span class="keyword">const</span> <a class="code" href="a00072.html">miniset</a>&amp; mset)
73
 
00064     {
74
 
00065         <span class="keywordflow">if</span> (mset.m_buf)
75
 
00066         {
76
 
00067             <span class="keywordflow">if</span> (mset.m_type)
77
 
00068                 init_gapbuf(mset.m_buf);
78
 
00069             <span class="keywordflow">else</span>
79
 
00070                 init_bitbuf(mset.m_buf);
80
 
00071         }
81
 
00072         <span class="keywordflow">else</span>
82
 
00073         {
83
 
00074             m_type = mset.m_type;
84
 
00075             m_buf = 0;
85
 
00076         }
86
 
00077     }
87
 
00078 
88
 
<a name="l00079"></a><a class="code" href="a00072.html#a2">00079</a>     <a class="code" href="a00072.html#a2">~miniset</a>()
89
 
00080     {
90
 
00081         <span class="keywordflow">if</span> (m_buf)
91
 
00082         {
92
 
00083             A::deallocate(m_buf, m_type ? 
93
 
00084                 (<a class="code" href="a00081.html#a0">BM_MINISET_GAPLEN</a> / (<span class="keyword">sizeof</span>(bm::word_t) / <span class="keyword">sizeof</span>(bm::gap_word_t)))
94
 
00085                 : 
95
 
00086                 (<a class="code" href="a00081.html#a1">BM_MINISET_ARRSIZE</a>(N)));
96
 
00087         }
97
 
00088     }
98
 
00089 <span class="comment"></span>
99
 
00090 <span class="comment">    /// Checks if bit pos 1 or 0. Returns 0 if 0 and non zero otherwise.</span>
100
 
<a name="l00091"></a><a class="code" href="a00072.html#a3">00091</a> <span class="comment"></span>    <span class="keywordtype">unsigned</span> <a class="code" href="a00072.html#a3">test</a>(bm::id_t n)<span class="keyword"> const </span>
101
 
00092 <span class="keyword">    </span>{ 
102
 
00093         <span class="keywordflow">return</span>
103
 
00094             !m_buf ? 0 
104
 
00095             :
105
 
00096             m_type ? 
106
 
00097               <a class="code" href="a00096.html#ga0">gap_test</a>((<a class="code" href="a00092.html#a19">gap_word_t</a>*)m_buf, n)
107
 
00098               : 
108
 
00099               m_buf[n&gt;&gt;bm::set_word_shift] &amp; (1&lt;&lt;(n &amp; bm::set_word_mask));
109
 
00100     }
110
 
00101 
111
 
<a name="l00102"></a><a class="code" href="a00072.html#a4">00102</a>     <span class="keywordtype">void</span> <a class="code" href="a00072.html#a4">set</a>(bm::id_t n, <span class="keywordtype">bool</span> val=<span class="keyword">true</span>)
112
 
00103     {
113
 
00104         <span class="keywordflow">if</span> (m_type == 0)
114
 
00105         {
115
 
00106             <span class="keywordflow">if</span> (!m_buf)
116
 
00107             {
117
 
00108                 <span class="keywordflow">if</span> (!val) <span class="keywordflow">return</span>;
118
 
00109                 init_bitbuf(0);
119
 
00110             }
120
 
00111 
121
 
00112             <span class="keywordtype">unsigned</span> nword  = n &gt;&gt; bm::set_word_shift; 
122
 
00113             <span class="keywordtype">unsigned</span> mask = unsigned(1) &lt;&lt; (n &amp; bm::set_word_mask);
123
 
00114 
124
 
00115             val ? (m_buf[nword] |= mask) : (m_buf[nword] &amp;= ~mask);
125
 
00116         }
126
 
00117         <span class="keywordflow">else</span>
127
 
00118         {
128
 
00119             <span class="keywordflow">if</span> (!m_buf)
129
 
00120             {
130
 
00121                 <span class="keywordflow">if</span> (!val) <span class="keywordflow">return</span>;
131
 
00122                 init_gapbuf(0);
132
 
00123             }
133
 
00124             
134
 
00125             <span class="keywordtype">unsigned</span> is_set;
135
 
00126             <span class="keywordtype">unsigned</span> new_block_len = 
136
 
00127                 <a class="code" href="a00096.html#ga4">gap_set_value</a>(val, (<a class="code" href="a00092.html#a19">gap_word_t</a>*)m_buf, n, &amp;is_set);
137
 
00128 
138
 
00129             <span class="keywordflow">if</span> (new_block_len &gt; <span class="keywordtype">unsigned</span>(<a class="code" href="a00081.html#a0">BM_MINISET_GAPLEN</a>-4))
139
 
00130             {
140
 
00131                 convert_buf();
141
 
00132             }
142
 
00133         }
143
 
00134     }
144
 
00135 
145
 
<a name="l00136"></a><a class="code" href="a00072.html#a5">00136</a>     <span class="keywordtype">unsigned</span> <a class="code" href="a00072.html#a5">mem_used</a>()<span class="keyword"> const</span>
146
 
00137 <span class="keyword">    </span>{
147
 
00138         <span class="keywordflow">return</span> <span class="keyword">sizeof</span>(*this) +
148
 
00139                m_buf ? 
149
 
00140                  (m_type ? (<a class="code" href="a00081.html#a0">BM_MINISET_GAPLEN</a> * <span class="keyword">sizeof</span>(<a class="code" href="a00092.html#a19">gap_word_t</a>))
150
 
00141                         : (<a class="code" href="a00081.html#a1">BM_MINISET_ARRSIZE</a>(N) * <span class="keyword">sizeof</span>(bm::word_t)))
151
 
00142                 : 0; 
152
 
00143     }
153
 
00144 
154
 
<a name="l00145"></a><a class="code" href="a00072.html#a6">00145</a>     <span class="keywordtype">void</span> <a class="code" href="a00072.html#a6">swap</a>(<a class="code" href="a00072.html">miniset</a>&amp; mset)
155
 
00146     {
156
 
00147         bm::word_t* buftmp = m_buf;
157
 
00148         m_buf = mset.m_buf;
158
 
00149         mset.m_buf = buftmp;
159
 
00150         <span class="keywordtype">unsigned</span> typetmp = m_type;
160
 
00151         m_type = mset.m_type;
161
 
00152         mset.m_type = typetmp;
162
 
00153     }
163
 
00154 
164
 
00155 
165
 
00156 <span class="keyword">private</span>:
166
 
00157 
167
 
00158     <span class="keywordtype">void</span> init_bitbuf(bm::word_t* buf)
168
 
00159     {
169
 
00160         <span class="keywordtype">unsigned</span> arr_size = <a class="code" href="a00081.html#a1">BM_MINISET_ARRSIZE</a>(N);
170
 
00161         m_buf = A::allocate(arr_size, 0);
171
 
00162         <span class="keywordflow">if</span> (buf)
172
 
00163         {
173
 
00164             ::memcpy(m_buf, buf, arr_size * <span class="keyword">sizeof</span>(bm::word_t));
174
 
00165         }
175
 
00166         <span class="keywordflow">else</span>
176
 
00167         {
177
 
00168             ::memset(m_buf, 0, arr_size * <span class="keyword">sizeof</span>(bm::word_t));
178
 
00169         }
179
 
00170         m_type = 0;
180
 
00171     }
181
 
00172 
182
 
00173     <span class="keywordtype">void</span> init_gapbuf(bm::word_t* buf)
183
 
00174     {
184
 
00175         <span class="keywordtype">unsigned</span> arr_size = 
185
 
00176             <a class="code" href="a00081.html#a0">BM_MINISET_GAPLEN</a> / (<span class="keyword">sizeof</span>(bm::word_t) / <span class="keyword">sizeof</span>(bm::gap_word_t));
186
 
00177         m_buf = A::allocate(arr_size, 0);
187
 
00178         <span class="keywordflow">if</span> (buf)
188
 
00179         {
189
 
00180             ::memcpy(m_buf, buf, arr_size * <span class="keyword">sizeof</span>(bm::word_t));
190
 
00181         }
191
 
00182         <span class="keywordflow">else</span>
192
 
00183         {
193
 
00184             *m_buf = 0;
194
 
00185             <a class="code" href="a00096.html#ga14">gap_set_all</a>((gap_word_t*)m_buf, bm::gap_max_bits, 0);
195
 
00186         }
196
 
00187         m_type = 1;
197
 
00188     }
198
 
00189 
199
 
00190     <span class="keywordtype">void</span> convert_buf()
200
 
00191     {
201
 
00192         <span class="keywordtype">unsigned</span> arr_size = <a class="code" href="a00081.html#a1">BM_MINISET_ARRSIZE</a>(N);
202
 
00193         bm::word_t* buf = A::allocate(arr_size, 0);
203
 
00194 
204
 
00195         <a class="code" href="a00096.html#ga10">gap_convert_to_bitset</a>(buf, (gap_word_t*) m_buf, arr_size);
205
 
00196         arr_size = 
206
 
00197             <a class="code" href="a00081.html#a0">BM_MINISET_GAPLEN</a> / (<span class="keyword">sizeof</span>(bm::word_t) / <span class="keyword">sizeof</span>(bm::gap_word_t));
207
 
00198         A::deallocate(m_buf, arr_size);
208
 
00199         m_buf = buf;
209
 
00200         m_type = 0;
210
 
00201     }
211
 
00202 
212
 
00203 <span class="keyword">private</span>:
213
 
00204     bm::word_t*   m_buf;      <span class="comment">//!&lt; Buffer pointer</span>
214
 
00205 <span class="comment"></span>    <span class="keywordtype">unsigned</span>      m_type;     <span class="comment">//!&lt; buffer type (0-bit, 1-gap)</span>
215
 
00206 <span class="comment"></span>};
216
 
00207 
217
 
00208 <span class="comment"></span>
218
 
00209 <span class="comment">/*!</span>
219
 
00210 <span class="comment">    @brief Mini bitvector used in bvector template to keep block type flags</span>
220
 
00211 <span class="comment">    </span>
221
 
00212 <span class="comment">    Template is used as a default template parameter MS for bvector  </span>
222
 
00213 <span class="comment">    Offers maximum performance comparing to miniset.</span>
223
 
00214 <span class="comment"></span>
224
 
00215 <span class="comment">    @sa miniset</span>
225
 
00216 <span class="comment">*/</span>
226
 
<a name="l00217"></a><a class="code" href="a00059.html">00217</a> <span class="keyword">template</span>&lt;size_t N&gt; <span class="keyword">class </span><a class="code" href="a00059.html">bvmini</a>
227
 
00218 {
228
 
00219 <span class="keyword">public</span>:
229
 
00220 
230
 
<a name="l00221"></a><a class="code" href="a00059.html#a0">00221</a>     <a class="code" href="a00059.html#a0">bvmini</a>(<span class="keywordtype">int</span> start_strategy = 0) 
231
 
00222     {
232
 
00223         ::memset(m_buf, 0, <span class="keyword">sizeof</span>(m_buf));
233
 
00224     }
234
 
00225 
235
 
<a name="l00226"></a><a class="code" href="a00059.html#a1">00226</a>     <a class="code" href="a00059.html#a0">bvmini</a>(<span class="keyword">const</span> <a class="code" href="a00059.html">bvmini</a>&amp; mset)
236
 
00227     {
237
 
00228         ::memcpy(m_buf, mset.m_buf, <span class="keyword">sizeof</span>(m_buf));
238
 
00229     }
239
 
00230 
240
 
00231 <span class="comment"></span>
241
 
00232 <span class="comment">    /// Checks if bit pos 1 or 0. Returns 0 if 0 and non zero otherwise.</span>
242
 
<a name="l00233"></a><a class="code" href="a00059.html#a2">00233</a> <span class="comment"></span>    <span class="keywordtype">unsigned</span> <a class="code" href="a00059.html#a2">test</a>(bm::id_t n)<span class="keyword"> const </span>
243
 
00234 <span class="keyword">    </span>{ 
244
 
00235         <span class="keywordflow">return</span> m_buf[n&gt;&gt;bm::set_word_shift] &amp; (1&lt;&lt;(n &amp; bm::set_word_mask));
245
 
00236     }
246
 
00237 
247
 
<a name="l00238"></a><a class="code" href="a00059.html#a3">00238</a>     <span class="keywordtype">void</span> <a class="code" href="a00059.html#a3">set</a>(bm::id_t n, <span class="keywordtype">bool</span> val=<span class="keyword">true</span>)
248
 
00239     {
249
 
00240         <span class="keywordtype">unsigned</span> nword  = n &gt;&gt; bm::set_word_shift; 
250
 
00241         <span class="keywordtype">unsigned</span> mask = unsigned(1) &lt;&lt; (n &amp; bm::set_word_mask);
251
 
00242 
252
 
00243         val ? (m_buf[nword] |= mask) : (m_buf[nword] &amp;= ~mask);
253
 
00244     }
254
 
00245 
255
 
<a name="l00246"></a><a class="code" href="a00059.html#a4">00246</a>     <span class="keywordtype">unsigned</span> <a class="code" href="a00059.html#a4">mem_used</a>()<span class="keyword"> const</span>
256
 
00247 <span class="keyword">    </span>{
257
 
00248         <span class="keywordflow">return</span> <span class="keyword">sizeof</span>(*this);
258
 
00249     }
259
 
00250 
260
 
<a name="l00251"></a><a class="code" href="a00059.html#a5">00251</a>     <span class="keywordtype">void</span> <a class="code" href="a00059.html#a5">swap</a>(<a class="code" href="a00059.html">bvmini</a>&amp; mset)
261
 
00252     {
262
 
00253         <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> i = 0; i &lt; <a class="code" href="a00081.html#a1">BM_MINISET_ARRSIZE</a>(N); ++i)
263
 
00254         {
264
 
00255             bm::word_t tmp = m_buf[i];
265
 
00256             m_buf[i] = mset.m_buf[i];
266
 
00257             mset.m_buf[i] = tmp;
267
 
00258         }
268
 
00259     }
269
 
00260 
270
 
00261 <span class="keyword">private</span>:
271
 
00262     bm::word_t   m_buf[<a class="code" href="a00081.html#a1">BM_MINISET_ARRSIZE</a>(N)];
272
 
00263 };
273
 
00264 
274
 
00265 <span class="comment"></span>
275
 
00266 <span class="comment">/*!@} */</span>
276
 
00267 <span class="comment"></span>
277
 
00268 <span class="comment">/*!</span>
278
 
00269 <span class="comment">    @brief Bitvector class with very limited functionality.</span>
279
 
00270 <span class="comment"></span>
280
 
00271 <span class="comment">    Class implements simple bitset and used for internal </span>
281
 
00272 <span class="comment">    and testing purposes. </span>
282
 
00273 <span class="comment">*/</span>
283
 
<a name="l00274"></a><a class="code" href="a00058.html">00274</a> <span class="keyword">template</span>&lt;<span class="keyword">class</span> A&gt; <span class="keyword">class </span><a class="code" href="a00058.html">bvector_mini</a>
284
 
00275 {
285
 
00276 <span class="keyword">public</span>:
286
 
<a name="l00277"></a><a class="code" href="a00058.html#a0">00277</a>     <a class="code" href="a00058.html#a0">bvector_mini</a>(<span class="keywordtype">unsigned</span> size) 
287
 
00278       : m_buf(0),
288
 
00279         m_size(size)
289
 
00280     {
290
 
00281         <span class="keywordtype">unsigned</span> arr_size = (size / 32) + 1; 
291
 
00282         m_buf = A::allocate(arr_size, 0);
292
 
00283         ::memset(m_buf, 0, arr_size * <span class="keyword">sizeof</span>(unsigned));
293
 
00284     }
294
 
<a name="l00285"></a><a class="code" href="a00058.html#a1">00285</a>     <a class="code" href="a00058.html#a0">bvector_mini</a>(<span class="keyword">const</span> <a class="code" href="a00058.html">bvector_mini</a>&amp; <a class="code" href="a00048.html">bvect</a>)
295
 
00286        : m_size(<a class="code" href="a00048.html">bvect</a>.m_size)
296
 
00287     {
297
 
00288         <span class="keywordtype">unsigned</span> arr_size = (m_size / 32) + 1;
298
 
00289         m_buf = A::allocate(arr_size, 0);
299
 
00290         ::memcpy(m_buf, <a class="code" href="a00048.html">bvect</a>.m_buf, arr_size * <span class="keyword">sizeof</span>(unsigned));        
300
 
00291     }
301
 
00292 
302
 
<a name="l00293"></a><a class="code" href="a00058.html#a2">00293</a>     <a class="code" href="a00058.html#a2">~bvector_mini</a>()
303
 
00294     {
304
 
00295         A::deallocate(m_buf, (m_size / 32) + 1); 
305
 
00296     }
306
 
00297 <span class="comment"></span>
307
 
00298 <span class="comment">    /// Checks if bit pos 1 or 0. Returns 0 if 0 and non zero otherwise.</span>
308
 
<a name="l00299"></a><a class="code" href="a00058.html#a3">00299</a> <span class="comment"></span>    <span class="keywordtype">int</span> <a class="code" href="a00058.html#a3">is_bit_true</a>(<span class="keywordtype">unsigned</span> pos)<span class="keyword"> const</span>
309
 
00300 <span class="keyword">    </span>{
310
 
00301         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>  mask = (<span class="keywordtype">unsigned</span> char)((char)0x1 &lt;&lt; (pos &amp; 7));
311
 
00302         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* offs = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)m_buf + (pos &gt;&gt; 3); <span class="comment">// m_buf + (pos/8)</span>
312
 
00303 
313
 
00304         <span class="keywordflow">return</span> (*offs) &amp; mask;
314
 
00305     }
315
 
00306 <span class="comment"></span>
316
 
00307 <span class="comment">    /// Sets bit number pos to 1</span>
317
 
<a name="l00308"></a><a class="code" href="a00058.html#a4">00308</a> <span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="a00058.html#a4">set_bit</a>(<span class="keywordtype">unsigned</span> pos)
318
 
00309     {
319
 
00310         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>  mask = (<span class="keywordtype">unsigned</span> char)(0x1 &lt;&lt; (pos &amp; 7));
320
 
00311         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* offs = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)m_buf + (pos &gt;&gt; 3); 
321
 
00312         *offs |= mask;
322
 
00313     }
323
 
00314 
324
 
00315 <span class="comment"></span>
325
 
00316 <span class="comment">    /// Sets bit number pos to 0</span>
326
 
<a name="l00317"></a><a class="code" href="a00058.html#a5">00317</a> <span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="a00058.html#a5">clear_bit</a>(<span class="keywordtype">unsigned</span> pos)
327
 
00318     {
328
 
00319         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>  mask = (<span class="keywordtype">unsigned</span> char)(0x1 &lt;&lt; (pos &amp; 7));
329
 
00320         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* offs = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)m_buf + (pos &gt;&gt; 3); 
330
 
00321 
331
 
00322         *offs &amp;= ~mask;
332
 
00323     }
333
 
00324 <span class="comment"></span>
334
 
00325 <span class="comment">    /// Counts number of bits ON </span>
335
 
<a name="l00326"></a><a class="code" href="a00058.html#a6">00326</a> <span class="comment"></span>    <span class="keywordtype">unsigned</span> <a class="code" href="a00058.html#a6">bit_count</a>()<span class="keyword"> const</span>
336
 
00327 <span class="keyword">    </span>{
337
 
00328         <span class="keyword">register</span> <span class="keywordtype">unsigned</span> count = 0;
338
 
00329         <span class="keyword">const</span> <span class="keywordtype">unsigned</span>* end = m_buf + (m_size / 32)+1;    
339
 
00330 
340
 
00331         <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span>* start = m_buf; start &lt; end; ++start)
341
 
00332         {
342
 
00333             <span class="keyword">register</span> <span class="keywordtype">unsigned</span> value = *start;
343
 
00334             <span class="keywordflow">for</span> (count += (value!=0); value &amp;= value - 1; ++count);
344
 
00335         }
345
 
00336         <span class="keywordflow">return</span> count;
346
 
00337     }
347
 
00338 <span class="comment"></span>
348
 
00339 <span class="comment">    /// Comparison.</span>
349
 
<a name="l00340"></a><a class="code" href="a00058.html#a7">00340</a> <span class="comment"></span>    <span class="keywordtype">int</span> <a class="code" href="a00058.html#a7">compare</a>(<span class="keyword">const</span> <a class="code" href="a00058.html">bvector_mini</a>&amp; <a class="code" href="a00048.html">bvect</a>)
350
 
00341     {
351
 
00342         <span class="keywordtype">unsigned</span> cnt1 = <a class="code" href="a00058.html#a6">bit_count</a>();
352
 
00343         <span class="keywordtype">unsigned</span> cnt2 = <a class="code" href="a00048.html">bvect</a>.bit_count();
353
 
00344 
354
 
00345         <span class="keywordflow">if</span> (!cnt1 &amp;&amp; !cnt2) <span class="keywordflow">return</span> 0;
355
 
00346 
356
 
00347         <span class="keywordtype">unsigned</span> cnt_min = cnt1 &lt; cnt2 ? cnt1 : cnt2;
357
 
00348 
358
 
00349         <span class="keywordflow">if</span> (!cnt_min) <span class="keywordflow">return</span> cnt1 ? 1 : -1;
359
 
00350 
360
 
00351         <span class="keywordtype">unsigned</span> idx1 = <a class="code" href="a00058.html#a8">get_first</a>();
361
 
00352         <span class="keywordtype">unsigned</span> idx2 = <a class="code" href="a00048.html">bvect</a>.get_first();
362
 
00353 
363
 
00354         <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> i = 0; i &lt; cnt_min; ++i)
364
 
00355         {
365
 
00356             <span class="keywordflow">if</span> (idx1 != idx2)
366
 
00357             {
367
 
00358                 <span class="keywordflow">return</span> idx1 &lt; idx2 ? 1 : -1;
368
 
00359             }
369
 
00360             idx1 = <a class="code" href="a00058.html#a9">get_next</a>(idx1);
370
 
00361             idx2 = <a class="code" href="a00048.html">bvect</a>.get_next(idx2);
371
 
00362         }
372
 
00363 
373
 
00364         <a class="code" href="a00077.html#a0">BM_ASSERT</a>(idx1==0 || idx2==0);
374
 
00365 
375
 
00366         <span class="keywordflow">if</span> (idx1 != idx2)
376
 
00367         {
377
 
00368             <span class="keywordflow">if</span> (!idx1) <span class="keywordflow">return</span> -1;
378
 
00369             <span class="keywordflow">if</span> (!idx2) <span class="keywordflow">return</span>  1;
379
 
00370             <span class="keywordflow">return</span> idx1 &lt; idx2 ? 1 : -1;
380
 
00371         }
381
 
00372 
382
 
00373         <span class="keywordflow">return</span> 0;
383
 
00374     }
384
 
00375 
385
 
00376 <span class="comment"></span>
386
 
00377 <span class="comment">    /// Returns index of the first ON bit</span>
387
 
<a name="l00378"></a><a class="code" href="a00058.html#a8">00378</a> <span class="comment"></span>    <span class="keywordtype">unsigned</span> <a class="code" href="a00058.html#a8">get_first</a>()<span class="keyword"> const</span>
388
 
00379 <span class="keyword">    </span>{
389
 
00380         <span class="keywordtype">unsigned</span> pos = 0;
390
 
00381         <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* ptr = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*) m_buf;
391
 
00382 
392
 
00383         <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> i = 0; i &lt; (m_size/8)+1; ++i)
393
 
00384         {
394
 
00385             <span class="keyword">register</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> w = ptr[i];
395
 
00386 
396
 
00387 
397
 
00388             <span class="keywordflow">if</span> (w != 0)
398
 
00389             {
399
 
00390                 <span class="keywordflow">while</span> ((w &amp; 1) == 0)
400
 
00391                 {
401
 
00392                     w &gt;&gt;= 1;
402
 
00393                     ++pos;
403
 
00394                 }
404
 
00395                 <span class="keywordflow">return</span> pos;
405
 
00396             }
406
 
00397             pos += <span class="keyword">sizeof</span>(<span class="keywordtype">unsigned</span> char) * 8;
407
 
00398         }
408
 
00399         <span class="keywordflow">return</span> 0;
409
 
00400     }
410
 
00401 
411
 
00402 <span class="comment"></span>
412
 
00403 <span class="comment">    /// Returns index of next bit, which is ON</span>
413
 
<a name="l00404"></a><a class="code" href="a00058.html#a9">00404</a> <span class="comment"></span>    <span class="keywordtype">unsigned</span> <a class="code" href="a00058.html#a9">get_next</a>(<span class="keywordtype">unsigned</span> idx)<span class="keyword"> const</span>
414
 
00405 <span class="keyword">    </span>{
415
 
00406         <span class="keyword">register</span> <span class="keywordtype">unsigned</span> i;
416
 
00407 
417
 
00408         <span class="keywordflow">for</span> (i = idx+1; i &lt; m_size; ++i)
418
 
00409         {
419
 
00410             <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* offs = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)m_buf + (i &gt;&gt; 3); 
420
 
00411             <span class="keywordflow">if</span> (*offs)
421
 
00412             {
422
 
00413                 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> mask = (<span class="keywordtype">unsigned</span> char)((char)0x1 &lt;&lt; (i &amp; 7));
423
 
00414 
424
 
00415                 <span class="keywordflow">if</span> (*offs &amp; mask)
425
 
00416                 {
426
 
00417                     <span class="keywordflow">return</span> i;
427
 
00418                 }
428
 
00419             }
429
 
00420             <span class="keywordflow">else</span>
430
 
00421             {
431
 
00422                 i += 7;
432
 
00423             }
433
 
00424         }
434
 
00425         <span class="keywordflow">return</span> 0;
435
 
00426     }
436
 
00427 
437
 
00428 
438
 
<a name="l00429"></a><a class="code" href="a00058.html#a10">00429</a>     <span class="keywordtype">void</span> <a class="code" href="a00058.html#a10">combine_and</a>(<span class="keyword">const</span> <a class="code" href="a00058.html">bvector_mini</a>&amp; <a class="code" href="a00048.html">bvect</a>)
439
 
00430     {
440
 
00431         <span class="keyword">const</span> <span class="keywordtype">unsigned</span>* end = m_buf + (m_size / 32)+1;
441
 
00432     
442
 
00433         <span class="keyword">const</span> <span class="keywordtype">unsigned</span>* src = <a class="code" href="a00048.html">bvect</a>.get_buf();
443
 
00434 
444
 
00435         <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span>* start = m_buf; start &lt; end; ++start)
445
 
00436         {
446
 
00437             *start &amp;= *src++;
447
 
00438         }
448
 
00439     }
449
 
00440 
450
 
<a name="l00441"></a><a class="code" href="a00058.html#a11">00441</a>     <span class="keywordtype">void</span> <a class="code" href="a00058.html#a11">combine_xor</a>(<span class="keyword">const</span> <a class="code" href="a00058.html">bvector_mini</a>&amp; <a class="code" href="a00048.html">bvect</a>)
451
 
00442     {
452
 
00443         <span class="keyword">const</span> <span class="keywordtype">unsigned</span>* end = m_buf + (m_size / 32)+1;
453
 
00444     
454
 
00445         <span class="keyword">const</span> <span class="keywordtype">unsigned</span>* src = <a class="code" href="a00048.html">bvect</a>.get_buf();
455
 
00446 
456
 
00447         <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span>* start = m_buf; start &lt; end; ++start)
457
 
00448         {
458
 
00449             *start ^= *src++;
459
 
00450         }
460
 
00451     }
461
 
00452 
462
 
00453 
463
 
<a name="l00454"></a><a class="code" href="a00058.html#a12">00454</a>     <span class="keywordtype">void</span> <a class="code" href="a00058.html#a12">combine_or</a>(<span class="keyword">const</span> <a class="code" href="a00058.html">bvector_mini</a>&amp; <a class="code" href="a00048.html">bvect</a>)
464
 
00455     {
465
 
00456         <span class="keyword">const</span> <span class="keywordtype">unsigned</span>* end = m_buf + (m_size / 32)+1;
466
 
00457     
467
 
00458         <span class="keyword">const</span> <span class="keywordtype">unsigned</span>* src = <a class="code" href="a00048.html">bvect</a>.get_buf();
468
 
00459 
469
 
00460         <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span>* start = m_buf; start &lt; end; ++start)
470
 
00461         {
471
 
00462             *start |= *src++;
472
 
00463         }
473
 
00464     }
474
 
00465 
475
 
<a name="l00466"></a><a class="code" href="a00058.html#a13">00466</a>     <span class="keywordtype">void</span> <a class="code" href="a00058.html#a13">combine_sub</a>(<span class="keyword">const</span> <a class="code" href="a00058.html">bvector_mini</a>&amp; <a class="code" href="a00048.html">bvect</a>)
476
 
00467     {
477
 
00468         <span class="keyword">const</span> <span class="keywordtype">unsigned</span>* end = m_buf + (m_size / 32)+1;
478
 
00469     
479
 
00470         <span class="keyword">const</span> <span class="keywordtype">unsigned</span>* src = <a class="code" href="a00048.html">bvect</a>.get_buf();
480
 
00471 
481
 
00472         <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span>* start = m_buf; start &lt; end; ++start)
482
 
00473         {
483
 
00474             *start &amp;= ~(*src++);
484
 
00475         }
485
 
00476     }
486
 
00477 
487
 
<a name="l00478"></a><a class="code" href="a00058.html#a14">00478</a>     <span class="keyword">const</span> <span class="keywordtype">unsigned</span>* <a class="code" href="a00058.html#a14">get_buf</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_buf; }
488
 
<a name="l00479"></a><a class="code" href="a00058.html#a15">00479</a>     <span class="keywordtype">unsigned</span> <a class="code" href="a00058.html#a15">mem_used</a>()<span class="keyword"> const</span>
489
 
00480 <span class="keyword">    </span>{
490
 
00481         <span class="keywordflow">return</span> <span class="keyword">sizeof</span>(<a class="code" href="a00058.html">bvector_mini</a>) + (m_size / 32) + 1;
491
 
00482     }
492
 
00483 
493
 
<a name="l00484"></a><a class="code" href="a00058.html#a16">00484</a>     <span class="keywordtype">void</span> <a class="code" href="a00058.html#a16">swap</a>(<a class="code" href="a00058.html">bvector_mini</a>&amp; bvm)
494
 
00485     {
495
 
00486         <a class="code" href="a00077.html#a0">BM_ASSERT</a>(m_size == bvm.m_size);
496
 
00487         bm::word_t* buftmp = m_buf;
497
 
00488         m_buf = bvm.m_buf;
498
 
00489         bvm.m_buf = buftmp;
499
 
00490     }
500
 
00491 
501
 
00492 <span class="keyword">private</span>:
502
 
00493     bm::word_t*   m_buf;
503
 
00494     <span class="keywordtype">unsigned</span>      m_size;
504
 
00495 };
505
 
00496 
506
 
00497 
507
 
00498 
508
 
00499 } <span class="comment">// namespace bm</span>
509
 
00500 
510
 
00501 <span class="preprocessor">#endif</span>
511
 
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu Apr 20 13:28:46 2006 for BitMagic by&nbsp;
 
9
<a class="el" href="a00129.html">bm</a>::<a class="el" href="a00109.html">operation_functions</a></div>
 
10
<h1>bm::operation_functions&lt; T &gt; Struct Template Reference</h1><code>#include &lt;<a class="el" href="a00141.html">bmfunc.h</a>&gt;</code>
 
11
<p>
 
12
<table border="0" cellpadding="0" cellspacing="0">
 
13
<tr><td></td></tr>
 
14
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
 
15
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="a00129.html#a1">gap_operation_to_bitset_func_type</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00109.html#e0">gap_op_to_bit</a> (unsigned i)</td></tr>
 
16
 
 
17
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="a00129.html#a2">gap_operation_func_type</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00109.html#e1">gap_operation</a> (unsigned i)</td></tr>
 
18
 
 
19
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="a00129.html#a3">bit_operation_count_func_type</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00109.html#e2">bit_operation_count</a> (unsigned i)</td></tr>
 
20
 
 
21
<tr><td colspan="2"><br><h2>Static Public Attributes</h2></td></tr>
 
22
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="a00129.html#a1">gap_operation_to_bitset_func_type</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00109.html#s0">gap2bit_table_</a> [bm::set_END]</td></tr>
 
23
 
 
24
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="a00129.html#a2">gap_operation_func_type</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00109.html#s1">gapop_table_</a> [bm::set_END]</td></tr>
 
25
 
 
26
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="a00129.html#a3">bit_operation_count_func_type</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00109.html#s2">bit_op_count_table_</a> [bm::set_END]</td></tr>
 
27
 
 
28
</table>
 
29
<h3>template&lt;bool T&gt;<br>
 
30
 struct bm::operation_functions&lt; T &gt;</h3>
 
31
 
 
32
<hr><h2>Member Function Documentation</h2>
 
33
<a class="anchor" name="e2" doxytag="bm::operation_functions::bit_operation_count"></a><p>
 
34
<table class="mdTable" cellpadding="2" cellspacing="0">
 
35
  <tr>
 
36
    <td class="mdRow">
 
37
      <table cellpadding="0" cellspacing="0" border="0">
 
38
        <tr>
 
39
          <td class="mdPrefix" colspan="4">
 
40
template&lt;bool T&gt; </td>
 
41
        </tr>
 
42
        <tr>
 
43
          <td class="md" nowrap valign="top">static <a class="el" href="a00129.html#a3">bit_operation_count_func_type</a> <a class="el" href="a00109.html">bm::operation_functions</a>&lt; T &gt;::bit_operation_count           </td>
 
44
          <td class="md" valign="top">(&nbsp;</td>
 
45
          <td class="md" nowrap valign="top">unsigned&nbsp;</td>
 
46
          <td class="mdname1" valign="top" nowrap> <em>i</em>          </td>
 
47
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
 
48
          <td class="md" nowrap><code> [inline, static]</code></td>
 
49
        </tr>
 
50
      </table>
 
51
    </td>
 
52
  </tr>
 
53
</table>
 
54
<table cellspacing="5" cellpadding="0" border="0">
 
55
  <tr>
 
56
    <td>
 
57
      &nbsp;
 
58
    </td>
 
59
    <td>
 
60
 
 
61
<p>
 
62
 
 
63
<p>
 
64
Definition at line <a class="el" href="a00141.html#l04329">4329</a> of file <a class="el" href="a00141.html">bmfunc.h</a>.
 
65
<p>
 
66
References <a class="el" href="a00141.html#l04358">bm::operation_functions&lt; T &gt;::bit_op_count_table_</a>.    </td>
 
67
  </tr>
 
68
</table>
 
69
<a class="anchor" name="e0" doxytag="bm::operation_functions::gap_op_to_bit"></a><p>
 
70
<table class="mdTable" cellpadding="2" cellspacing="0">
 
71
  <tr>
 
72
    <td class="mdRow">
 
73
      <table cellpadding="0" cellspacing="0" border="0">
 
74
        <tr>
 
75
          <td class="mdPrefix" colspan="4">
 
76
template&lt;bool T&gt; </td>
 
77
        </tr>
 
78
        <tr>
 
79
          <td class="md" nowrap valign="top">static <a class="el" href="a00129.html#a1">gap_operation_to_bitset_func_type</a> <a class="el" href="a00109.html">bm::operation_functions</a>&lt; T &gt;::gap_op_to_bit           </td>
 
80
          <td class="md" valign="top">(&nbsp;</td>
 
81
          <td class="md" nowrap valign="top">unsigned&nbsp;</td>
 
82
          <td class="mdname1" valign="top" nowrap> <em>i</em>          </td>
 
83
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
 
84
          <td class="md" nowrap><code> [inline, static]</code></td>
 
85
        </tr>
 
86
      </table>
 
87
    </td>
 
88
  </tr>
 
89
</table>
 
90
<table cellspacing="5" cellpadding="0" border="0">
 
91
  <tr>
 
92
    <td>
 
93
      &nbsp;
 
94
    </td>
 
95
    <td>
 
96
 
 
97
<p>
 
98
 
 
99
<p>
 
100
Definition at line <a class="el" href="a00141.html#l04317">4317</a> of file <a class="el" href="a00141.html">bmfunc.h</a>.
 
101
<p>
 
102
References <a class="el" href="a00141.html#l04337">bm::operation_functions&lt; T &gt;::gap2bit_table_</a>.    </td>
 
103
  </tr>
 
104
</table>
 
105
<a class="anchor" name="e1" doxytag="bm::operation_functions::gap_operation"></a><p>
 
106
<table class="mdTable" cellpadding="2" cellspacing="0">
 
107
  <tr>
 
108
    <td class="mdRow">
 
109
      <table cellpadding="0" cellspacing="0" border="0">
 
110
        <tr>
 
111
          <td class="mdPrefix" colspan="4">
 
112
template&lt;bool T&gt; </td>
 
113
        </tr>
 
114
        <tr>
 
115
          <td class="md" nowrap valign="top">static <a class="el" href="a00129.html#a2">gap_operation_func_type</a> <a class="el" href="a00109.html">bm::operation_functions</a>&lt; T &gt;::gap_operation           </td>
 
116
          <td class="md" valign="top">(&nbsp;</td>
 
117
          <td class="md" nowrap valign="top">unsigned&nbsp;</td>
 
118
          <td class="mdname1" valign="top" nowrap> <em>i</em>          </td>
 
119
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
 
120
          <td class="md" nowrap><code> [inline, static]</code></td>
 
121
        </tr>
 
122
      </table>
 
123
    </td>
 
124
  </tr>
 
125
</table>
 
126
<table cellspacing="5" cellpadding="0" border="0">
 
127
  <tr>
 
128
    <td>
 
129
      &nbsp;
 
130
    </td>
 
131
    <td>
 
132
 
 
133
<p>
 
134
 
 
135
<p>
 
136
Definition at line <a class="el" href="a00141.html#l04323">4323</a> of file <a class="el" href="a00141.html">bmfunc.h</a>.
 
137
<p>
 
138
References <a class="el" href="a00141.html#l04347">bm::operation_functions&lt; T &gt;::gapop_table_</a>.    </td>
 
139
  </tr>
 
140
</table>
 
141
<hr><h2>Field Documentation</h2>
 
142
<a class="anchor" name="s2" doxytag="bm::operation_functions::bit_op_count_table_"></a><p>
 
143
<table class="mdTable" cellpadding="2" cellspacing="0">
 
144
  <tr>
 
145
    <td class="mdRow">
 
146
      <table cellpadding="0" cellspacing="0" border="0">
 
147
        <tr>
 
148
          <td class="mdPrefix" colspan="4">
 
149
template&lt;bool T&gt; </td>
 
150
        </tr>
 
151
        <tr>
 
152
          <td class="md" nowrap valign="top"><a class="el" href="a00129.html#a3">bit_operation_count_func_type</a> <a class="el" href="a00109.html">bm::operation_functions</a>&lt; T &gt;::<a class="el" href="a00109.html#s2">bit_op_count_table_</a><code> [static]</code>          </td>
 
153
        </tr>
 
154
      </table>
 
155
    </td>
 
156
  </tr>
 
157
</table>
 
158
<table cellspacing="5" cellpadding="0" border="0">
 
159
  <tr>
 
160
    <td>
 
161
      &nbsp;
 
162
    </td>
 
163
    <td>
 
164
 
 
165
<p>
 
166
<b>Initial value:</b><div class="fragment"><pre class="fragment"> {
 
167
    0,                            
 
168
    0,                            
 
169
    0,                            
 
170
    0,                            
 
171
    0,                            
 
172
    0,                            
 
173
    &amp;<a class="code" href="a00134.html#ga37">bit_operation_and_count</a>,     
 
174
    &amp;<a class="code" href="a00134.html#ga50">bit_operation_xor_count</a>,     
 
175
    &amp;<a class="code" href="a00134.html#ga42">bit_operation_or_count</a>,      
 
176
    &amp;<a class="code" href="a00134.html#ga39">bit_operation_sub_count</a>,     
 
177
    &amp;<a class="code" href="a00134.html#ga40">bit_operation_sub_count_inv</a>, 
 
178
    0,                            
 
179
    0,                            
 
180
}
 
181
</pre></div>
 
182
<p>
 
183
Definition at line <a class="el" href="a00141.html#l04358">4358</a> of file <a class="el" href="a00141.html">bmfunc.h</a>.
 
184
<p>
 
185
Referenced by <a class="el" href="a00141.html#l04329">bm::operation_functions&lt; T &gt;::bit_operation_count()</a>.    </td>
 
186
  </tr>
 
187
</table>
 
188
<a class="anchor" name="s0" doxytag="bm::operation_functions::gap2bit_table_"></a><p>
 
189
<table class="mdTable" cellpadding="2" cellspacing="0">
 
190
  <tr>
 
191
    <td class="mdRow">
 
192
      <table cellpadding="0" cellspacing="0" border="0">
 
193
        <tr>
 
194
          <td class="mdPrefix" colspan="4">
 
195
template&lt;bool T&gt; </td>
 
196
        </tr>
 
197
        <tr>
 
198
          <td class="md" nowrap valign="top"><a class="el" href="a00129.html#a1">gap_operation_to_bitset_func_type</a> <a class="el" href="a00109.html">bm::operation_functions</a>&lt; T &gt;::<a class="el" href="a00109.html#s0">gap2bit_table_</a><code> [static]</code>          </td>
 
199
        </tr>
 
200
      </table>
 
201
    </td>
 
202
  </tr>
 
203
</table>
 
204
<table cellspacing="5" cellpadding="0" border="0">
 
205
  <tr>
 
206
    <td>
 
207
      &nbsp;
 
208
    </td>
 
209
    <td>
 
210
 
 
211
<p>
 
212
<b>Initial value:</b><div class="fragment"><pre class="fragment"> {
 
213
    &amp;gap_and_to_bitset&lt;bm::gap_word_t&gt;,    
 
214
    &amp;gap_add_to_bitset&lt;bm::gap_word_t&gt;,    
 
215
    &amp;gap_sub_to_bitset&lt;bm::gap_word_t&gt;,    
 
216
    &amp;gap_xor_to_bitset&lt;bm::gap_word_t&gt;,    
 
217
    0
 
218
}
 
219
</pre></div>
 
220
<p>
 
221
Definition at line <a class="el" href="a00141.html#l04337">4337</a> of file <a class="el" href="a00141.html">bmfunc.h</a>.
 
222
<p>
 
223
Referenced by <a class="el" href="a00141.html#l04317">bm::operation_functions&lt; T &gt;::gap_op_to_bit()</a>.    </td>
 
224
  </tr>
 
225
</table>
 
226
<a class="anchor" name="s1" doxytag="bm::operation_functions::gapop_table_"></a><p>
 
227
<table class="mdTable" cellpadding="2" cellspacing="0">
 
228
  <tr>
 
229
    <td class="mdRow">
 
230
      <table cellpadding="0" cellspacing="0" border="0">
 
231
        <tr>
 
232
          <td class="mdPrefix" colspan="4">
 
233
template&lt;bool T&gt; </td>
 
234
        </tr>
 
235
        <tr>
 
236
          <td class="md" nowrap valign="top"><a class="el" href="a00129.html#a2">gap_operation_func_type</a> <a class="el" href="a00109.html">bm::operation_functions</a>&lt; T &gt;::<a class="el" href="a00109.html#s1">gapop_table_</a><code> [static]</code>          </td>
 
237
        </tr>
 
238
      </table>
 
239
    </td>
 
240
  </tr>
 
241
</table>
 
242
<table cellspacing="5" cellpadding="0" border="0">
 
243
  <tr>
 
244
    <td>
 
245
      &nbsp;
 
246
    </td>
 
247
    <td>
 
248
 
 
249
<p>
 
250
<b>Initial value:</b><div class="fragment"><pre class="fragment"> {
 
251
    &amp;<a class="code" href="a00133.html#ga29">gap_operation_and</a>,    
 
252
    &amp;<a class="code" href="a00133.html#ga33">gap_operation_or</a>,     
 
253
    &amp;<a class="code" href="a00133.html#ga34">gap_operation_sub</a>,    
 
254
    &amp;<a class="code" href="a00133.html#ga31">gap_operation_xor</a>,    
 
255
    0
 
256
}
 
257
</pre></div>
 
258
<p>
 
259
Definition at line <a class="el" href="a00141.html#l04347">4347</a> of file <a class="el" href="a00141.html">bmfunc.h</a>.
 
260
<p>
 
261
Referenced by <a class="el" href="a00141.html#l04323">bm::operation_functions&lt; T &gt;::gap_operation()</a>.    </td>
 
262
  </tr>
 
263
</table>
 
264
<hr>The documentation for this struct was generated from the following file:<ul>
 
265
<li><a class="el" href="a00141.html">bmfunc.h</a></ul>
 
266
<hr size="1"><address style="align: right;"><small>Generated on Sun Aug 5 14:12:40 2007 for BitMagic by&nbsp;
512
267
<a href="http://www.doxygen.org/index.html">
513
268
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.1 </small></address>
514
269
</body>