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: sample4.cpp Source File</title>
3
<title>BitMagic: bmdef.h File 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_000005.html">sample4</a></div>
10
<h1>sample4.cpp</h1><a href="a00086.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"></span>
33
00024 <span class="comment">/** \example sample4.cpp</span>
34
00025 <span class="comment"> Exmaple demonstrates bitvector serialization/deserialization.</span>
35
00026 <span class="comment"> </span>
36
00027 <span class="comment">For more information please visit: http://bmagic.sourceforge.net</span>
37
00028 <span class="comment"></span>
38
00029 <span class="comment"> \sa bm::serialize </span>
39
00030 <span class="comment"> \sa bm::deserialize </span>
40
00031 <span class="comment"></span>
41
00032 <span class="comment">*/</span>
43
00034 <span class="preprocessor">#include <stdlib.h></span>
44
00035 <span class="preprocessor">#include <iostream></span>
45
00036 <span class="preprocessor">#include "<a class="code" href="a00074.html">bm.h</a>"</span>
46
00037 <span class="preprocessor">#include "bmserial.h"</span>
48
00039 <span class="keyword">using</span> <span class="keyword">namespace </span>std;
51
00042 <span class="comment">// This exmaple demonstrates bitvector serialization/deserialization.</span>
55
<a name="l00046"></a><a class="code" href="a00086.html#a0">00046</a> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <a class="code" href="a00085.html#a0">MAX_VALUE</a> = 1000000;
57
00048 <span class="comment">// This procedure creates very dense bitvector.</span>
58
00049 <span class="comment">// The resulting set will consists mostly from ON (1) bits</span>
59
00050 <span class="comment">// interrupted with small gaps of 0 bits.</span>
61
<a name="l00052"></a><a class="code" href="a00086.html#a1">00052</a> <span class="keywordtype">void</span> <a class="code" href="a00085.html#a1">fill_bvector</a>(<a class="code" href="a00048.html">bm::bvector<></a>* bv)
63
00054 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> i = 0; i < <a class="code" href="a00085.html#a0">MAX_VALUE</a>; ++i)
65
00056 <span class="keywordflow">if</span> (rand() % 2500)
67
00058 bv->set_bit(i);
73
<a name="l00064"></a><a class="code" href="a00086.html#a2">00064</a> <span class="keywordtype">void</span> <a class="code" href="a00085.html#a2">print_statistics</a>(<span class="keyword">const</span> <a class="code" href="a00048.html">bm::bvector<></a>& bv)
75
00066 <a class="code" href="a00048.html">bm::bvector<></a>::statistics st;
76
00067 bv.calc_stat(&st);
78
00069 cout << <span class="stringliteral">"Bits count:"</span> << bv.count() << endl;
79
00070 cout << <span class="stringliteral">"Bit blocks:"</span> << st.bit_blocks << endl;
80
00071 cout << <span class="stringliteral">"GAP blocks:"</span> << st.gap_blocks << endl;
81
00072 cout << <span class="stringliteral">"Memory used:"</span><< st.memory_used << endl;
82
00073 cout << <span class="stringliteral">"Max.serialize mem.:"</span> << st.max_serialize_mem << endl << endl;;
86
<a name="l00077"></a><a class="code" href="a00086.html#a3">00077</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* <a class="code" href="a00086.html#a3">serialize_bvector</a>(<a class="code" href="a00048.html">bm::bvector<></a>& bv)
88
00079 <span class="comment">// It is reccomended to optimize vector before serialization.</span>
89
00080 bv.<a class="code" href="a00048.html#a53">optimize</a>();
91
00082 <a class="code" href="a00048.html">bm::bvector<></a>::statistics st;
92
00083 bv.<a class="code" href="a00048.html#a45">calc_stat</a>(&st);
94
00085 cout << <span class="stringliteral">"Bits count:"</span> << bv.<a class="code" href="a00048.html#a26">count</a>() << endl;
95
00086 cout << <span class="stringliteral">"Bit blocks:"</span> << st.bit_blocks << endl;
96
00087 cout << <span class="stringliteral">"GAP blocks:"</span> << st.gap_blocks << endl;
97
00088 cout << <span class="stringliteral">"Memory used:"</span><< st.memory_used << endl;
98
00089 cout << <span class="stringliteral">"Max.serialize mem.:"</span> << st.max_serialize_mem << endl;
100
00091 <span class="comment">// Allocate serialization buffer.</span>
102
00093 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* buf = <span class="keyword">new</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>[st.max_serialize_mem];
104
00095 <span class="comment">// Serialization to memory.</span>
106
00097 <span class="keywordtype">unsigned</span> len = bm::serialize(bv, buf);
108
00099 cout << <span class="stringliteral">"Serialized size:"</span> << len << endl << endl;
110
00101 <span class="keywordflow">return</span> buf;
114
<a name="l00105"></a><a class="code" href="a00086.html#a4">00105</a> <span class="keywordtype">int</span> <a class="code" href="a00083.html#a0">main</a>(<span class="keywordtype">void</span>)
116
00107 <a class="code" href="a00048.html">bm::bvector<></a> bv1;
117
00108 <a class="code" href="a00048.html">bm::bvector<></a> bv2;
119
00110 bv2.<a class="code" href="a00048.html#a50">set_new_blocks_strat</a>(bm::BM_GAP); <span class="comment">// set DGAP compression mode ON</span>
121
00112 <a class="code" href="a00085.html#a1">fill_bvector</a>(&bv1);
122
00113 <a class="code" href="a00085.html#a1">fill_bvector</a>(&bv2);
124
00115 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* buf1 = <a class="code" href="a00086.html#a3">serialize_bvector</a>(bv1);
125
00116 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* buf2 = <a class="code" href="a00086.html#a3">serialize_bvector</a>(bv2);
127
00118 <span class="comment">// Serialized bvectors (buf1 and buf2) now ready to be</span>
128
00119 <span class="comment">// saved to a database, file or send over a network.</span>
130
00121 <span class="comment">// ...</span>
132
00123 <span class="comment">// Deserialization.</span>
134
00125 <a class="code" href="a00048.html">bm::bvector<></a> bv3;
136
00127 <span class="comment">// As a result of desrialization bv3 will contain all bits from</span>
137
00128 <span class="comment">// bv1 and bv3:</span>
138
00129 <span class="comment">// bv3 = bv1 OR bv2</span>
140
00131 bm::deserialize(bv3, buf1);
141
00132 bm::deserialize(bv3, buf2);
143
00134 <a class="code" href="a00085.html#a2">print_statistics</a>(bv3);
145
00136 <span class="comment">// After a complex operation we can try to optimize bv3.</span>
147
00138 bv3.<a class="code" href="a00048.html#a53">optimize</a>();
149
00140 <a class="code" href="a00085.html#a2">print_statistics</a>(bv3);
151
00142 <span class="keyword">delete</span> [] buf1;
152
00143 <span class="keyword">delete</span> [] buf2;
154
00145 <span class="keywordflow">return</span> 0;
157
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu Apr 20 13:28:46 2006 for BitMagic by
9
<a class="el" href="dir_000000.html">src</a></div>
10
<h1>bmdef.h File Reference</h1><code>#include <assert.h></code><br>
13
Include dependency graph for bmdef.h:<p><center><img src="a00170.png" border="0" usemap="#bmdef.h_map" alt=""></center>
16
This graph shows which files directly or indirectly include this file:<p><center><img src="a00171.png" border="0" usemap="#bmdef.hdep_map" alt=""></center>
17
<map name="bmdef.hdep_map">
18
<area href="a00111.html" shape="rect" coords="124,192,164,214" alt="">
19
<area href="a00112.html" shape="rect" coords="224,6,288,27" alt="">
20
<area href="a00128.html" shape="rect" coords="348,30,436,51" alt="">
21
<area href="a00120.html" shape="rect" coords="213,102,299,123" alt="">
22
<area href="a00121.html" shape="rect" coords="213,147,299,168" alt="">
23
<area href="a00122.html" shape="rect" coords="212,192,300,214" alt="">
24
<area href="a00123.html" shape="rect" coords="213,238,299,259" alt="">
25
<area href="a00124.html" shape="rect" coords="212,283,300,304" alt="">
26
<area href="a00125.html" shape="rect" coords="213,328,299,350" alt="">
27
<area href="a00126.html" shape="rect" coords="213,374,299,395" alt="">
28
<area href="a00127.html" shape="rect" coords="212,419,300,440" alt="">
32
<a href="a00140.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
34
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
35
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00114.html#a0">BM_ASSERT</a> assert</td></tr>
37
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00114.html#a1">FULL_BLOCK_ADDR</a> all_set<true>::_block._p</td></tr>
39
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00114.html#a2">IS_VALID_ADDR</a>(addr) (addr && (addr != FULL_BLOCK_ADDR))</td></tr>
41
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00114.html#a3">IS_FULL_BLOCK</a>(addr) (addr == FULL_BLOCK_ADDR)</td></tr>
43
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00114.html#a4">IS_EMPTY_BLOCK</a>(addr) (addr == 0)</td></tr>
45
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00114.html#a5">BMPTR_SETBIT0</a>(ptr) ( ((<a class="el" href="a00129.html#a25">bm::id64_t</a>)ptr) | 1 )</td></tr>
47
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00114.html#a6">BMPTR_CLEARBIT0</a>(ptr) ( ((<a class="el" href="a00129.html#a25">bm::id64_t</a>)ptr) & ~(<a class="el" href="a00129.html#a25">bm::id64_t</a>)1 )</td></tr>
49
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00114.html#a7">BMPTR_TESTBIT0</a>(ptr) ( ((<a class="el" href="a00129.html#a25">bm::id64_t</a>)ptr) & 1 )</td></tr>
51
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00114.html#a8">BMGAP_PTR</a>(ptr) ((<a class="el" href="a00129.html#a36">bm::gap_word_t</a>*)BMPTR_CLEARBIT0(ptr))</td></tr>
53
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00114.html#a9">BMSET_PTRGAP</a>(ptr) ptr = (<a class="el" href="a00129.html#a27">bm::word_t</a>*)BMPTR_SETBIT0(ptr)</td></tr>
55
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00114.html#a10">BM_IS_GAP</a>(obj, ptr, idx) ( BMPTR_TESTBIT0(ptr)!=0 )</td></tr>
57
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00114.html#a11">BMRESTRICT</a></td></tr>
59
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00114.html#a12">BMFORCEINLINE</a> inline</td></tr>
61
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00114.html#a13">BM_SET_MMX_GUARD</a> sse2_empty_guard bm_mmx_guard_;</td></tr>
64
<hr><h2>Define Documentation</h2>
65
<a class="anchor" name="a0" doxytag="bmdef.h::BM_ASSERT"></a><p>
66
<table class="mdTable" cellpadding="2" cellspacing="0">
69
<table cellpadding="0" cellspacing="0" border="0">
71
<td class="md" nowrap valign="top">#define BM_ASSERT assert </td>
77
<table cellspacing="5" cellpadding="0" border="0">
87
Definition at line <a class="el" href="a00140.html#l00014">14</a> of file <a class="el" href="a00140.html">bmdef.h</a>.
89
Referenced by <a class="el" href="a00141.html#l02622">bm::bit_block_any_range()</a>, <a class="el" href="a00141.html#l02373">bm::bit_block_calc_count()</a>, <a class="el" href="a00141.html#l02465">bm::bit_block_calc_count_change()</a>, <a class="el" href="a00141.html#l02553">bm::bit_block_calc_count_range()</a>, <a class="el" href="a00141.html#l02172">bm::bit_convert_to_gap()</a>, <a class="el" href="a00141.html#l03837">bm::bit_find_head_tail()</a>, <a class="el" href="a00141.html#l03256">bm::bit_operation_and()</a>, <a class="el" href="a00141.html#l03551">bm::bit_operation_or()</a>, <a class="el" href="a00141.html#l03649">bm::bit_operation_sub()</a>, <a class="el" href="a00141.html#l03745">bm::bit_operation_xor()</a>, <a class="el" href="a00141.html#l02138">bm::bitcmp()</a>, <a class="el" href="a00141.html#l00421">bm::globals< T >::bo::bo()</a>, <a class="el" href="a00137.html#l02612">bm::bvector< Alloc, MS >::combine_operation()</a>, <a class="el" href="a00144.html#l00340">bm::bvector_mini< A >::compare()</a>, <a class="el" href="a00137.html#l01678">bm::bvector< Alloc, MS >::count_range()</a>, <a class="el" href="a00141.html#l01399">bm::gap_add_to_bitset()</a>, <a class="el" href="a00141.html#l01431">bm::gap_and_to_bitset()</a>, <a class="el" href="a00141.html#l00469">bm::gap_bfind()</a>, <a class="el" href="a00141.html#l00691">bm::gap_bit_count_range()</a>, <a class="el" href="a00141.html#l01500">bm::gap_bitset_and_any()</a>, <a class="el" href="a00141.html#l01464">bm::gap_bitset_and_count()</a>, <a class="el" href="a00141.html#l01739">bm::gap_bitset_or_any()</a>, <a class="el" href="a00141.html#l01692">bm::gap_bitset_or_count()</a>, <a class="el" href="a00141.html#l01572">bm::gap_bitset_sub_any()</a>, <a class="el" href="a00141.html#l01539">bm::gap_bitset_sub_count()</a>, <a class="el" href="a00141.html#l01649">bm::gap_bitset_xor_any()</a>, <a class="el" href="a00141.html#l01610">bm::gap_bitset_xor_count()</a>, <a class="el" href="a00141.html#l02099">bm::gap_calc_level()</a>, <a class="el" href="a00141.html#l01867">bm::gap_control_sum()</a>, <a class="el" href="a00141.html#l01119">bm::gap_find_in_block()</a>, <a class="el" href="a00141.html#l01919">bm::gap_init_range_block()</a>, <a class="el" href="a00141.html#l03949">bm::gap_overhead()</a>, <a class="el" href="a00141.html#l01898">bm::gap_set_all()</a>, <a class="el" href="a00141.html#l01027">bm::gap_set_value()</a>, <a class="el" href="a00141.html#l01335">bm::gap_sub_to_bitset()</a>, <a class="el" href="a00141.html#l00497">bm::gap_test()</a>, <a class="el" href="a00141.html#l01367">bm::gap_xor_to_bitset()</a>, <a class="el" href="a00137.html#l01796">bm::bvector< Alloc, MS >::get_bit()</a>, <a class="el" href="a00137.html#l00422">bm::bvector< Alloc, MS >::enumerator::go_first()</a>, <a class="el" href="a00137.html#l00487">bm::bvector< Alloc, MS >::enumerator::go_up()</a>, <a class="el" href="a00141.html#l03977">bm::improve_gap_levels()</a>, <a class="el" href="a00137.html#l00344">bm::bvector< Alloc, MS >::insert_iterator::operator=()</a>, <a class="el" href="a00137.html#l00866">bm::bvector< Alloc, MS >::operator[]()</a>, <a class="el" href="a00137.html#l00946">bm::bvector< Alloc, MS >::set_bit()</a>, <a class="el" href="a00137.html#l00958">bm::bvector< Alloc, MS >::set_bit_and()</a>, <a class="el" href="a00137.html#l00971">bm::bvector< Alloc, MS >::set_bit_conditional()</a>, <a class="el" href="a00141.html#l02082">bm::set_gap_level()</a>, <a class="el" href="a00137.html#l01615">bm::bvector< Alloc, MS >::set_range()</a>, <a class="el" href="a00141.html#l00294">bm::setop2op()</a>, <a class="el" href="a00144.html#l00484">bm::bvector_mini< A >::swap()</a>, and <a class="el" href="a00141.html#l00329">bm::xor_swap()</a>. </td>
92
<a class="anchor" name="a10" doxytag="bmdef.h::BM_IS_GAP"></a><p>
93
<table class="mdTable" cellpadding="2" cellspacing="0">
96
<table cellpadding="0" cellspacing="0" border="0">
98
<td class="md" nowrap valign="top">#define BM_IS_GAP </td>
99
<td class="md" valign="top">( </td>
100
<td class="md" nowrap valign="top">obj, <tr>
101
<td class="md" nowrap align="right"></td>
103
<td class="md" nowrap>ptr, <tr>
104
<td class="md" nowrap align="right"></td>
106
<td class="md" nowrap>idx </td>
107
<td class="mdname1" valign="top" nowrap> </td>
108
<td class="md" valign="top"> ) </td>
109
<td class="md" nowrap> ( BMPTR_TESTBIT0(ptr)!=0 )</td>
115
<table cellspacing="5" cellpadding="0" border="0">
125
Definition at line <a class="el" href="a00140.html#l00059">59</a> of file <a class="el" href="a00140.html">bmdef.h</a>.
127
Referenced by <a class="el" href="a00137.html#l02612">bm::bvector< Alloc, MS >::combine_operation()</a>, <a class="el" href="a00137.html#l01481">bm::bvector< Alloc, MS >::combine_operation_with_block()</a>, <a class="el" href="a00137.html#l01909">bm::bvector< Alloc, MS >::compare()</a>, <a class="el" href="a00137.html#l01678">bm::bvector< Alloc, MS >::count_range()</a>, <a class="el" href="a00137.html#l01796">bm::bvector< Alloc, MS >::get_bit()</a>, <a class="el" href="a00137.html#l00422">bm::bvector< Alloc, MS >::enumerator::go_first()</a>, and <a class="el" href="a00137.html#l00487">bm::bvector< Alloc, MS >::enumerator::go_up()</a>. </td>
130
<a class="anchor" name="a13" doxytag="bmdef.h::BM_SET_MMX_GUARD"></a><p>
131
<table class="mdTable" cellpadding="2" cellspacing="0">
134
<table cellpadding="0" cellspacing="0" border="0">
136
<td class="md" nowrap valign="top">#define BM_SET_MMX_GUARD sse2_empty_guard bm_mmx_guard_; </td>
142
<table cellspacing="5" cellpadding="0" border="0">
152
Definition at line <a class="el" href="a00140.html#l00093">93</a> of file <a class="el" href="a00140.html">bmdef.h</a>.
154
Referenced by <a class="el" href="a00137.html#l02612">bm::bvector< Alloc, MS >::combine_operation()</a>, <a class="el" href="a00137.html#l01772">bm::bvector< Alloc, MS >::invert()</a>, and <a class="el" href="a00137.html#l01615">bm::bvector< Alloc, MS >::set_range()</a>. </td>
157
<a class="anchor" name="a12" doxytag="bmdef.h::BMFORCEINLINE"></a><p>
158
<table class="mdTable" cellpadding="2" cellspacing="0">
161
<table cellpadding="0" cellspacing="0" border="0">
163
<td class="md" nowrap valign="top">#define BMFORCEINLINE inline </td>
169
<table cellspacing="5" cellpadding="0" border="0">
179
Definition at line <a class="el" href="a00140.html#l00079">79</a> of file <a class="el" href="a00140.html">bmdef.h</a>.
181
Referenced by <a class="el" href="a00145.html#l00328">bm::decoder_little_endian::get_16()</a>, <a class="el" href="a00145.html#l00249">bm::decoder::get_16()</a>, <a class="el" href="a00145.html#l00335">bm::decoder_little_endian::get_32()</a>, <a class="el" href="a00145.html#l00260">bm::decoder::get_32()</a>, <a class="el" href="a00145.html#l00069">bm::decoder_base::get_8()</a>, <a class="el" href="a00145.html#l00156">bm::encoder::put_16()</a>, <a class="el" href="a00145.html#l00199">bm::encoder::put_32()</a>, <a class="el" href="a00145.html#l00146">bm::encoder::put_8()</a>, <a class="el" href="a00142.html#l00060">bm::sse2_empty_guard::sse2_empty_guard()</a>, and <a class="el" href="a00142.html#l00065">bm::sse2_empty_guard::~sse2_empty_guard()</a>. </td>
184
<a class="anchor" name="a8" doxytag="bmdef.h::BMGAP_PTR"></a><p>
185
<table class="mdTable" cellpadding="2" cellspacing="0">
188
<table cellpadding="0" cellspacing="0" border="0">
190
<td class="md" nowrap valign="top">#define BMGAP_PTR </td>
191
<td class="md" valign="top">( </td>
192
<td class="md" nowrap valign="top">ptr </td>
193
<td class="mdname1" valign="top" nowrap> </td>
194
<td class="md" valign="top"> ) </td>
195
<td class="md" nowrap> ((<a class="el" href="a00129.html#a36">bm::gap_word_t</a>*)BMPTR_CLEARBIT0(ptr))</td>
201
<table cellspacing="5" cellpadding="0" border="0">
211
Definition at line <a class="el" href="a00140.html#l00057">57</a> of file <a class="el" href="a00140.html">bmdef.h</a>.
213
Referenced by <a class="el" href="a00137.html#l01909">bm::bvector< Alloc, MS >::compare()</a>, <a class="el" href="a00137.html#l01678">bm::bvector< Alloc, MS >::count_range()</a>, <a class="el" href="a00137.html#l01796">bm::bvector< Alloc, MS >::get_bit()</a>, and <a class="el" href="a00137.html#l02351">bm::bvector< Alloc, MS >::stat()</a>. </td>
216
<a class="anchor" name="a6" doxytag="bmdef.h::BMPTR_CLEARBIT0"></a><p>
217
<table class="mdTable" cellpadding="2" cellspacing="0">
220
<table cellpadding="0" cellspacing="0" border="0">
222
<td class="md" nowrap valign="top">#define BMPTR_CLEARBIT0 </td>
223
<td class="md" valign="top">( </td>
224
<td class="md" nowrap valign="top">ptr </td>
225
<td class="mdname1" valign="top" nowrap> </td>
226
<td class="md" valign="top"> ) </td>
227
<td class="md" nowrap> ( ((<a class="el" href="a00129.html#a25">bm::id64_t</a>)ptr) & ~(<a class="el" href="a00129.html#a25">bm::id64_t</a>)1 )</td>
233
<table cellspacing="5" cellpadding="0" border="0">
243
Definition at line <a class="el" href="a00140.html#l00046">46</a> of file <a class="el" href="a00140.html">bmdef.h</a>. </td>
246
<a class="anchor" name="a5" doxytag="bmdef.h::BMPTR_SETBIT0"></a><p>
247
<table class="mdTable" cellpadding="2" cellspacing="0">
250
<table cellpadding="0" cellspacing="0" border="0">
252
<td class="md" nowrap valign="top">#define BMPTR_SETBIT0 </td>
253
<td class="md" valign="top">( </td>
254
<td class="md" nowrap valign="top">ptr </td>
255
<td class="mdname1" valign="top" nowrap> </td>
256
<td class="md" valign="top"> ) </td>
257
<td class="md" nowrap> ( ((<a class="el" href="a00129.html#a25">bm::id64_t</a>)ptr) | 1 )</td>
263
<table cellspacing="5" cellpadding="0" border="0">
273
Definition at line <a class="el" href="a00140.html#l00045">45</a> of file <a class="el" href="a00140.html">bmdef.h</a>. </td>
276
<a class="anchor" name="a7" doxytag="bmdef.h::BMPTR_TESTBIT0"></a><p>
277
<table class="mdTable" cellpadding="2" cellspacing="0">
280
<table cellpadding="0" cellspacing="0" border="0">
282
<td class="md" nowrap valign="top">#define BMPTR_TESTBIT0 </td>
283
<td class="md" valign="top">( </td>
284
<td class="md" nowrap valign="top">ptr </td>
285
<td class="mdname1" valign="top" nowrap> </td>
286
<td class="md" valign="top"> ) </td>
287
<td class="md" nowrap> ( ((<a class="el" href="a00129.html#a25">bm::id64_t</a>)ptr) & 1 )</td>
293
<table cellspacing="5" cellpadding="0" border="0">
303
Definition at line <a class="el" href="a00140.html#l00047">47</a> of file <a class="el" href="a00140.html">bmdef.h</a>. </td>
306
<a class="anchor" name="a11" doxytag="bmdef.h::BMRESTRICT"></a><p>
307
<table class="mdTable" cellpadding="2" cellspacing="0">
310
<table cellpadding="0" cellspacing="0" border="0">
312
<td class="md" nowrap valign="top">#define BMRESTRICT </td>
318
<table cellspacing="5" cellpadding="0" border="0">
328
Definition at line <a class="el" href="a00140.html#l00070">70</a> of file <a class="el" href="a00140.html">bmdef.h</a>.
330
Referenced by <a class="el" href="a00141.html#l02960">bm::bit_block_and()</a>, <a class="el" href="a00141.html#l03513">bm::bit_block_or()</a>, <a class="el" href="a00141.html#l03609">bm::bit_block_sub()</a>, <a class="el" href="a00141.html#l03705">bm::bit_block_xor()</a>, <a class="el" href="a00141.html#l02308">bm::bit_convert_to_arr()</a>, <a class="el" href="a00141.html#l02172">bm::bit_convert_to_gap()</a>, and <a class="el" href="a00141.html#l02261">bm::gap_convert_to_arr()</a>. </td>
333
<a class="anchor" name="a9" doxytag="bmdef.h::BMSET_PTRGAP"></a><p>
334
<table class="mdTable" cellpadding="2" cellspacing="0">
337
<table cellpadding="0" cellspacing="0" border="0">
339
<td class="md" nowrap valign="top">#define BMSET_PTRGAP </td>
340
<td class="md" valign="top">( </td>
341
<td class="md" nowrap valign="top">ptr </td>
342
<td class="mdname1" valign="top" nowrap> </td>
343
<td class="md" valign="top"> ) </td>
344
<td class="md" nowrap> ptr = (<a class="el" href="a00129.html#a27">bm::word_t</a>*)BMPTR_SETBIT0(ptr)</td>
350
<table cellspacing="5" cellpadding="0" border="0">
360
Definition at line <a class="el" href="a00140.html#l00058">58</a> of file <a class="el" href="a00140.html">bmdef.h</a>. </td>
363
<a class="anchor" name="a1" doxytag="bmdef.h::FULL_BLOCK_ADDR"></a><p>
364
<table class="mdTable" cellpadding="2" cellspacing="0">
367
<table cellpadding="0" cellspacing="0" border="0">
369
<td class="md" nowrap valign="top">#define FULL_BLOCK_ADDR all_set<true>::_block._p </td>
375
<table cellspacing="5" cellpadding="0" border="0">
385
Definition at line <a class="el" href="a00140.html#l00022">22</a> of file <a class="el" href="a00140.html">bmdef.h</a>.
387
Referenced by <a class="el" href="a00141.html#l03551">bm::bit_operation_or()</a>, and <a class="el" href="a00141.html#l01845">bm::gap_convert_to_bitset_smart()</a>. </td>
390
<a class="anchor" name="a4" doxytag="bmdef.h::IS_EMPTY_BLOCK"></a><p>
391
<table class="mdTable" cellpadding="2" cellspacing="0">
394
<table cellpadding="0" cellspacing="0" border="0">
396
<td class="md" nowrap valign="top">#define IS_EMPTY_BLOCK </td>
397
<td class="md" valign="top">( </td>
398
<td class="md" nowrap valign="top">addr </td>
399
<td class="mdname1" valign="top" nowrap> </td>
400
<td class="md" valign="top"> ) </td>
401
<td class="md" nowrap> (addr == 0)</td>
407
<table cellspacing="5" cellpadding="0" border="0">
417
Definition at line <a class="el" href="a00140.html#l00025">25</a> of file <a class="el" href="a00140.html">bmdef.h</a>.
419
Referenced by <a class="el" href="a00141.html#l03256">bm::bit_operation_and()</a>, <a class="el" href="a00141.html#l03344">bm::bit_operation_and_any()</a>, <a class="el" href="a00141.html#l03321">bm::bit_operation_and_count()</a>, <a class="el" href="a00141.html#l03482">bm::bit_operation_or_any()</a>, <a class="el" href="a00141.html#l03450">bm::bit_operation_or_count()</a>, <a class="el" href="a00141.html#l03420">bm::bit_operation_sub_any()</a>, <a class="el" href="a00141.html#l03369">bm::bit_operation_sub_count()</a>, <a class="el" href="a00141.html#l03808">bm::bit_operation_xor_any()</a>, and <a class="el" href="a00141.html#l03783">bm::bit_operation_xor_count()</a>. </td>
422
<a class="anchor" name="a3" doxytag="bmdef.h::IS_FULL_BLOCK"></a><p>
423
<table class="mdTable" cellpadding="2" cellspacing="0">
426
<table cellpadding="0" cellspacing="0" border="0">
428
<td class="md" nowrap valign="top">#define IS_FULL_BLOCK </td>
429
<td class="md" valign="top">( </td>
430
<td class="md" nowrap valign="top">addr </td>
431
<td class="mdname1" valign="top" nowrap> </td>
432
<td class="md" valign="top"> ) </td>
433
<td class="md" nowrap> (addr == FULL_BLOCK_ADDR)</td>
439
<table cellspacing="5" cellpadding="0" border="0">
449
Definition at line <a class="el" href="a00140.html#l00024">24</a> of file <a class="el" href="a00140.html">bmdef.h</a>.
451
Referenced by <a class="el" href="a00141.html#l03256">bm::bit_operation_and()</a>, <a class="el" href="a00141.html#l03551">bm::bit_operation_or()</a>, <a class="el" href="a00141.html#l03649">bm::bit_operation_sub()</a>, and <a class="el" href="a00137.html#l02351">bm::bvector< Alloc, MS >::stat()</a>. </td>
454
<a class="anchor" name="a2" doxytag="bmdef.h::IS_VALID_ADDR"></a><p>
455
<table class="mdTable" cellpadding="2" cellspacing="0">
458
<table cellpadding="0" cellspacing="0" border="0">
460
<td class="md" nowrap valign="top">#define IS_VALID_ADDR </td>
461
<td class="md" valign="top">( </td>
462
<td class="md" nowrap valign="top">addr </td>
463
<td class="mdname1" valign="top" nowrap> </td>
464
<td class="md" valign="top"> ) </td>
465
<td class="md" nowrap> (addr && (addr != FULL_BLOCK_ADDR))</td>
471
<table cellspacing="5" cellpadding="0" border="0">
481
Definition at line <a class="el" href="a00140.html#l00023">23</a> of file <a class="el" href="a00140.html">bmdef.h</a>.
483
Referenced by <a class="el" href="a00141.html#l03256">bm::bit_operation_and()</a>, <a class="el" href="a00141.html#l03551">bm::bit_operation_or()</a>, <a class="el" href="a00141.html#l03649">bm::bit_operation_sub()</a>, and <a class="el" href="a00141.html#l03745">bm::bit_operation_xor()</a>. </td>
486
<hr size="1"><address style="align: right;"><small>Generated on Sun Aug 5 14:12:28 2007 for BitMagic by
158
487
<a href="http://www.doxygen.org/index.html">
159
488
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.1 </small></address>