File: sample22_8cpp-example.html

package info (click to toggle)
bmagic 6.3.0-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 49,956 kB
  • sloc: cpp: 84,298; ansic: 9,703; sh: 1,664; makefile: 742
file content (285 lines) | stat: -rwxr-xr-x 30,331 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BitMagic-C++: sample22.cpp</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BitMagic-C++
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">sample22.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<p>Example on ranges and intervals.BitMagic <a class="el" href="classbm_1_1bvector.html">bvector&lt;&gt;</a> implements high performance operation on RLE coded bit-vectors, transparently supporting all logical operations like intersections. Serialization uses compressive encoding (binary interpolative codes) to efficiently store collections of intervals.</p>
<p>This creates a use case to use compressed bit-vector as an engine for ranges and intervals.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classbm_1_1bvector.html#aafb2ecaa1a55856533e6b4afbf788eae" title="Sets all bits in the specified closed interval [left,right] Interval must be inside the bvector&#39;s siz...">bm::bvector::set_range</a> </dd>
<dd>
<a class="el" href="classbm_1_1bvector.html#a81d21e99befe6e54a0fb33c0778cf1f0" title="Sets all bits to zero in the specified closed interval [left,right] Interval must be inside the bvect...">bm::bvector::clear_range</a> </dd>
<dd>
<a class="el" href="classbm_1_1bvector.html#a7595276e924423bc734c4fd74113f1b5" title="Sets all bits to zero outside of the closed interval [left,right] Expected result: 00000....">bm::bvector::keep_range</a> </dd>
<dd>
<a class="el" href="classbm_1_1bvector.html#a7d36a1f08ff5c39c55b6bbdfe6251001" title="Returns true if all bits in the range are 1s (saturated interval) Function uses closed interval [left...">bm::bvector::is_all_one_range</a> </dd>
<dd>
<a class="el" href="classbm_1_1bvector.html#a530f12c9a00799ecbe9abd276a7ae619" title="Returns true if any bits in the range are 1s (non-empty interval) Function uses closed interval [left...">bm::bvector::any_range</a> </dd>
<dd>
<a class="el" href="group__bvintervals.html#gaae6ab80711097efc62afa54af888abd2" title="Returns true if range is all 1s flanked with 0s Function performs the test on a closed range [left,...">bm::is_interval</a> </dd>
<dd>
<a class="el" href="group__bvintervals.html#ga41642899622fcb337ef94b6861f40f92" title="Reverse find index of first 1 bit gap (01110) starting from position Reverse scan for the first 1 in ...">bm::find_interval_end</a> </dd>
<dd>
<a class="el" href="group__bvintervals.html#gaa184975ff6e9b314ab559f132e730880" title="Reverse find index of first 1 bit gap (01110) starting from position Reverse scan for the first 1 in ...">bm::find_interval_start</a> </dd>
<dd>
<a class="el" href="group__bvserial.html#ga8057580b944fa3ad68419f2673772999" title="Bitvector range deserialization from a memory BLOB.">bm::deserialize_range</a></dd>
<dd>
<a class="el" href="sample23_8cpp.html" title="Example: interval_enumerator&lt;&gt; - interator class for intervals.">sample23.cpp</a> </dd>
<dd>
<a class="el" href="group__bvintervals.html" title="Algorithms and iterators for bit ranges and intervals.">Algorithms for bit intervals</a></dd></dl>
<div class="fragment"><div class="line"><span class="comment">/*</span></div>
<div class="line"><span class="comment">Copyright(c) 2002-2017 Anatoliy Kuznetsov(anatoliy_kuznetsov at yahoo.com)</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><span class="comment">you may not use this file except in compliance with the License.</span></div>
<div class="line"><span class="comment">You may obtain a copy of the License at</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">    http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><span class="comment">distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><span class="comment">See the License for the specific language governing permissions and</span></div>
<div class="line"><span class="comment">limitations under the License.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">For more information please visit:  http://bitmagic.io</span></div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">/** \example sample22.cpp</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">  Example on ranges and intervals.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">  BitMagic bvector&lt;&gt; implements high performance operation on RLE</span></div>
<div class="line"><span class="comment">  coded bit-vectors, transparently supporting all logical operations</span></div>
<div class="line"><span class="comment">  like intersections. Serialization uses compressive encoding</span></div>
<div class="line"><span class="comment">  (binary interpolative codes) to efficiently store collections </span></div>
<div class="line"><span class="comment">  of intervals.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">  This creates a use case to use compressed bit-vector as an engine</span></div>
<div class="line"><span class="comment">  for ranges and intervals.</span></div>
<div class="line"><span class="comment"> </span></div>
<div class="line"><span class="comment">  \sa bm::bvector::set_range</span></div>
<div class="line"><span class="comment">  \sa bm::bvector::clear_range</span></div>
<div class="line"><span class="comment">  \sa bm::bvector::keep_range</span></div>
<div class="line"><span class="comment">  \sa bm::bvector::is_all_one_range</span></div>
<div class="line"><span class="comment">  \sa bm::bvector::any_range</span></div>
<div class="line"><span class="comment">  \sa bm::is_interval</span></div>
<div class="line"><span class="comment">  \sa bm::find_interval_end</span></div>
<div class="line"><span class="comment">  \sa bm::find_interval_start</span></div>
<div class="line"><span class="comment">  \sa bm::deserialize_range</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">  \sa sample23.cpp</span></div>
<div class="line"><span class="comment">  \sa bvintervals</span></div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">/*! \file sample22.cpp</span></div>
<div class="line"><span class="comment">    \brief Example: bvector&lt;&gt; - ranges and intervals functions</span></div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="bm_8h.html">bm.h</a>&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="bmserial_8h.html">bmserial.h</a>&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="bmintervals_8h.html">bmintervals.h</a>&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">using namespace </span>std;</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Utility template function used to print container</span></div>
<div class="line"><span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keywordtype">void</span> <a name="a0"></a><a class="code" href="sample22_8cpp.html#a15ab1ec24c164cc91abcefb45a316cec">PrintContainer</a>(T first, T last)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordflow">if</span> (first == last)</div>
<div class="line">        cout &lt;&lt; <span class="stringliteral">&quot;&lt;EMPTY SET&gt;&quot;</span>;</div>
<div class="line">    <span class="keywordflow">else</span></div>
<div class="line">        <span class="keywordflow">for</span>(;first != last; ++first)</div>
<div class="line">            cout &lt;&lt; *first &lt;&lt; <span class="stringliteral">&quot;, &quot;</span>;</div>
<div class="line">    cout &lt;&lt; endl;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> <a name="a1"></a><a class="code" href="sample22_8cpp.html#a840291bc02cba5474a4cb46a9b9566fe">main</a>(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordflow">try</span></div>
<div class="line">    {        </div>
<div class="line">        <a name="_a2"></a><a class="code" href="classbm_1_1bvector.html">bm::bvector&lt;&gt;</a> bv(<a name="a3"></a><a class="code" href="group__bvector.html#ggad0b87b3b7292383a864d27feaf1c9effa7fe09d1d7c62a813db922c396c0cbc9c">bm::BM_GAP</a>); <span class="comment">// use RLE compressed vector from the start</span></div>
<div class="line">        </div>
<div class="line">        bv.set_range(100, 110); <span class="comment">// sets a range of 1s [100, 110] .....11111....</span></div>
<div class="line"> </div>
<div class="line">        bv.optimize(); <span class="comment">// RLE memory compression</span></div>
<div class="line"> </div>
<div class="line">        cout &lt;&lt; <span class="stringliteral">&quot;Source set:&quot;</span>;</div>
<div class="line">        <a class="code" href="sample22_8cpp.html#a15ab1ec24c164cc91abcefb45a316cec">PrintContainer</a>(bv.first(), bv.end());</div>
<div class="line"> </div>
<div class="line">        cout &lt;&lt; <span class="stringliteral">&quot;bvector&lt;&gt;::is_all_one_range() demo&quot;</span> &lt;&lt; endl;</div>
<div class="line">        <span class="comment">// check is range has no 0s in it &quot;....1111....&quot;</span></div>
<div class="line">        <span class="keywordtype">bool</span> all_one = bv.is_all_one_range(100, 110); <span class="comment">// true</span></div>
<div class="line">        cout &lt;&lt; all_one &lt;&lt; endl;</div>
<div class="line">        all_one = bv.is_all_one_range(100, 111); <span class="comment">// false (last bit is 0)</span></div>
<div class="line">        cout &lt;&lt; all_one &lt;&lt; endl;</div>
<div class="line"> </div>
<div class="line">        cout &lt;&lt; <span class="stringliteral">&quot;bvector&lt;&gt;::is_interval() demo&quot;</span> &lt;&lt; endl;</div>
<div class="line">        <span class="comment">// verify if the range is all 1s AND flanked by 0s &quot;...011110...&quot;</span></div>
<div class="line">        <span class="keywordtype">bool</span> is_int = <a name="a4"></a><a class="code" href="group__bvintervals.html#gaae6ab80711097efc62afa54af888abd2">bm::is_interval</a>(bv, 100, 110); <span class="comment">// true</span></div>
<div class="line">        cout &lt;&lt; is_int &lt;&lt; endl;</div>
<div class="line">        is_int = <a class="code" href="group__bvintervals.html#gaae6ab80711097efc62afa54af888abd2">bm::is_interval</a>(bv, 99, 110); <span class="comment">// false (internal range is not all 1s)</span></div>
<div class="line">        cout &lt;&lt; is_int &lt;&lt; endl;</div>
<div class="line"> </div>
<div class="line">        cout &lt;&lt; <span class="stringliteral">&quot;bvector&lt;&gt;::any_range() demo&quot;</span> &lt;&lt; endl;</div>
<div class="line">        <span class="comment">// Check is specified inetrval contains at least one 1</span></div>
<div class="line">        <span class="keywordtype">bool</span> any_one = bv.any_range(0, 99); <span class="comment">// false</span></div>
<div class="line">        cout &lt;&lt; any_one &lt;&lt; endl;</div>
<div class="line">        any_one = bv.any_range(0, 100); <span class="comment">// true </span></div>
<div class="line">        cout &lt;&lt; any_one &lt;&lt; endl;</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// interval boundaries detection</span></div>
<div class="line">        <span class="comment">//</span></div>
<div class="line">        <span class="comment">//</span></div>
<div class="line">        cout &lt;&lt; <span class="stringliteral">&quot;bvector&lt;&gt;::find_interval demo&quot;</span> &lt;&lt; endl;</div>
<div class="line">        <a class="code" href="classbm_1_1bvector.html#a405dd9ed048c935c84a5086ec8ba3649">bm::bvector&lt;&gt;::size_type</a> pos;</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// interval end search from interval start</span></div>
<div class="line">        <span class="keywordtype">bool</span> found = <a name="a5"></a><a class="code" href="group__bvintervals.html#ga41642899622fcb337ef94b6861f40f92">bm::find_interval_end</a>(bv, 100, pos);</div>
<div class="line">        <span class="keywordflow">if</span> (found)</div>
<div class="line">            cout &lt;&lt; pos &lt;&lt; endl; <span class="comment">// 110</span></div>
<div class="line">        <span class="keywordflow">else</span></div>
<div class="line">            cout &lt;&lt; <span class="stringliteral">&quot;Not found.&quot;</span> &lt;&lt; endl;</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// interval end start from a non-interval location</span></div>
<div class="line">        <span class="comment">// - it will not find anything</span></div>
<div class="line">        found = <a class="code" href="group__bvintervals.html#ga41642899622fcb337ef94b6861f40f92">bm::find_interval_end</a>(bv, 99, pos);</div>
<div class="line">        <span class="keywordflow">if</span> (found)</div>
<div class="line">            cout &lt;&lt; pos &lt;&lt; endl; </div>
<div class="line">        <span class="keywordflow">else</span></div>
<div class="line">            cout &lt;&lt; <span class="stringliteral">&quot;Not found.&quot;</span> &lt;&lt; endl; <span class="comment">// This ! </span></div>
<div class="line"> </div>
<div class="line">        <span class="comment">// start search from a position within the interval</span></div>
<div class="line">        found = <a name="a6"></a><a class="code" href="group__bvintervals.html#gaa184975ff6e9b314ab559f132e730880">bm::find_interval_start</a>(bv, 105, pos);</div>
<div class="line">        <span class="keywordflow">if</span> (found)</div>
<div class="line">            cout &lt;&lt; pos &lt;&lt; endl; <span class="comment">// 100</span></div>
<div class="line">        <span class="keywordflow">else</span></div>
<div class="line">            cout &lt;&lt; <span class="stringliteral">&quot;Not found.&quot;</span> &lt;&lt; endl;</div>
<div class="line"> </div>
<div class="line">        <a class="code" href="classbm_1_1bvector.html">bm::bvector&lt;&gt;</a> bv3(bv);</div>
<div class="line">        </div>
<div class="line"> </div>
<div class="line">        <span class="comment">// range editing </span></div>
<div class="line">        <span class="comment">//</span></div>
<div class="line">        cout &lt;&lt; endl;</div>
<div class="line"> </div>
<div class="line">        <a class="code" href="classbm_1_1bvector.html">bm::bvector&lt;&gt;</a> bv2;</div>
<div class="line">        bv2.<a name="a7"></a><a class="code" href="classbm_1_1bvector.html#ab7978570375ae288a6893d7b4d673769">copy_range</a>(bv, 101, 105); <span class="comment">// make a copy of [101..105]</span></div>
<div class="line"> </div>
<div class="line">        bv.clear_range(99, 100); <span class="comment">// clear bits in [99..100]</span></div>
<div class="line">        <a class="code" href="sample22_8cpp.html#a15ab1ec24c164cc91abcefb45a316cec">PrintContainer</a>(bv.first(), bv.end());</div>
<div class="line"> </div>
<div class="line">        bv.keep_range(99, 105); <span class="comment">// clear everything outside [99..105]</span></div>
<div class="line">        <a class="code" href="sample22_8cpp.html#a15ab1ec24c164cc91abcefb45a316cec">PrintContainer</a>(bv.first(), bv.end()); <span class="comment">// print edited vector</span></div>
<div class="line"> </div>
<div class="line">        <a class="code" href="sample22_8cpp.html#a15ab1ec24c164cc91abcefb45a316cec">PrintContainer</a>(bv2.<a name="a8"></a><a class="code" href="classbm_1_1bvector.html#a86b939f3aed555dc073e8c26e9efea71">first</a>(), bv2.<a name="a9"></a><a class="code" href="classbm_1_1bvector.html#a937cd13482984f234a5d94cc638c22b5">end</a>()); <span class="comment">// print range copy vector</span></div>
<div class="line"> </div>
<div class="line">        <span class="keywordtype">bool</span> eq = bv.equal(bv2); <span class="comment">// make sure both vectors are the same</span></div>
<div class="line">        cout &lt;&lt; eq &lt;&lt; endl; <span class="comment">// true</span></div>
<div class="line"> </div>
<div class="line">        <span class="comment">// demo (de)serialization range</span></div>
<div class="line">        <span class="comment">// BM can serialize a bit-vector and selectively restore only </span></div>
<div class="line">        <span class="comment">// part of it (range). Adding block bookmarks makes target range</span></div>
<div class="line">        <span class="comment">// extraction faster. </span></div>
<div class="line">        <span class="comment">//</span></div>
<div class="line">        {</div>
<div class="line">            <span class="comment">// configure serializer to use bookmarks every 64 blocks</span></div>
<div class="line">            <span class="comment">// for faster extraction. Higher number gives you smaller BLOB</span></div>
<div class="line">            <span class="comment">// but slower speed. Tweak it as needed.</span></div>
<div class="line">            <span class="comment">// </span></div>
<div class="line">            <span class="comment">// (range deserialization would work even without bookmarks)</span></div>
<div class="line">            <span class="comment">//</span></div>
<div class="line">            <a name="_a10"></a><a class="code" href="classbm_1_1serializer.html">bm::serializer&lt;bm::bvector&lt;&gt;</a> &gt; ser;</div>
<div class="line">            ser.<a name="a11"></a><a class="code" href="classbm_1_1serializer.html#a89cebac62eb991ee3f4a5b805a255e81">set_bookmarks</a>(<span class="keyword">true</span>, 64); </div>
<div class="line">            </div>
<div class="line">            <a class="code" href="classbm_1_1serializer.html">bm::serializer&lt;bm::bvector&lt;&gt;</a> &gt;::buffer buf;</div>
<div class="line">            ser.<a name="a12"></a><a class="code" href="classbm_1_1serializer.html#af4fcd3cfdbf46e2e746a8790674ea5f9">serialize</a>(bv3, buf);</div>
<div class="line">            cout &lt;&lt; <span class="stringliteral">&quot;BLOB size=&quot;</span> &lt;&lt; buf.size() &lt;&lt; endl;</div>
<div class="line"> </div>
<div class="line">            <span class="comment">// equivalent of a copy_range right from a compressed BLOB</span></div>
<div class="line">            <a class="code" href="classbm_1_1bvector.html">bm::bvector&lt;&gt;</a> bv4;</div>
<div class="line">            <a name="a13"></a><a class="code" href="group__bvserial.html#ga8057580b944fa3ad68419f2673772999">bm::deserialize_range</a>(bv4, buf.data(), 101, 105);</div>
<div class="line"> </div>
<div class="line">            <a class="code" href="sample22_8cpp.html#a15ab1ec24c164cc91abcefb45a316cec">PrintContainer</a>(bv4.<a class="code" href="classbm_1_1bvector.html#a86b939f3aed555dc073e8c26e9efea71">first</a>(), bv4.<a class="code" href="classbm_1_1bvector.html#a937cd13482984f234a5d94cc638c22b5">end</a>()); <span class="comment">// print deserialized range vector</span></div>
<div class="line"> </div>
<div class="line">            eq = bv4.<a name="a14"></a><a class="code" href="classbm_1_1bvector.html#a23a267a48a594836e6a2f1d08a4166f3">equal</a>(bv2); <span class="comment">// make sure both vectors are the same</span></div>
<div class="line">            cout &lt;&lt; eq &lt;&lt; endl; <span class="comment">// true</span></div>
<div class="line">        }</div>
<div class="line"> </div>
<div class="line">    }</div>
<div class="line">    <span class="keywordflow">catch</span>(std::exception&amp; ex)</div>
<div class="line">    {</div>
<div class="line">        std::cerr &lt;&lt; ex.what() &lt;&lt; std::endl;</div>
<div class="line">        <span class="keywordflow">return</span> 1;</div>
<div class="line">    }</div>
<div class="line">        </div>
<div class="line">    <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
<div class="line"> </div>
</div><!-- fragment --> </div><!-- contents -->
<div class="ttc" id="agroup__bvintervals_html_gaa184975ff6e9b314ab559f132e730880"><div class="ttname"><a href="group__bvintervals.html#gaa184975ff6e9b314ab559f132e730880">bm::find_interval_start</a></div><div class="ttdeci">bool find_interval_start(const BV &amp;bv, typename BV::size_type from, typename BV::size_type &amp;pos) BMNOEXCEPT</div><div class="ttdoc">Reverse find index of first 1 bit gap (01110) starting from position Reverse scan for the first 1 in ...</div><div class="ttdef"><b>Definition:</b> <a href="bmintervals_8h_source.html#l00315">bmintervals.h:315</a></div></div>
<div class="ttc" id="aclassbm_1_1serializer_html_af4fcd3cfdbf46e2e746a8790674ea5f9"><div class="ttname"><a href="classbm_1_1serializer.html#af4fcd3cfdbf46e2e746a8790674ea5f9">bm::serializer::serialize</a></div><div class="ttdeci">size_type serialize(const BV &amp;bv, unsigned char *buf, size_t buf_size)</div><div class="ttdoc">Bitvector serialization into memory block.</div><div class="ttdef"><b>Definition:</b> <a href="bmserial_8h_source.html#l02264">bmserial.h:2264</a></div></div>
<div class="ttc" id="asample22_8cpp_html_a840291bc02cba5474a4cb46a9b9566fe"><div class="ttname"><a href="sample22_8cpp.html#a840291bc02cba5474a4cb46a9b9566fe">main</a></div><div class="ttdeci">int main(void)</div><div class="ttdef"><b>Definition:</b> <a href="sample22_8cpp_source.html#l00069">sample22.cpp:69</a></div></div>
<div class="ttc" id="aclassbm_1_1bvector_html"><div class="ttname"><a href="classbm_1_1bvector.html">bm::bvector&lt;&gt;</a></div></div>
<div class="ttc" id="aclassbm_1_1bvector_html_ab7978570375ae288a6893d7b4d673769"><div class="ttname"><a href="classbm_1_1bvector.html#ab7978570375ae288a6893d7b4d673769">bm::bvector::copy_range</a></div><div class="ttdeci">void copy_range(const bvector&lt; Alloc &gt; &amp;bvect, size_type left, size_type right)</div><div class="ttdoc">Copy all bits in the specified closed interval [left,right].</div><div class="ttdef"><b>Definition:</b> <a href="bm_8h_source.html#l06653">bm.h:6653</a></div></div>
<div class="ttc" id="aclassbm_1_1bvector_html_a23a267a48a594836e6a2f1d08a4166f3"><div class="ttname"><a href="classbm_1_1bvector.html#a23a267a48a594836e6a2f1d08a4166f3">bm::bvector::equal</a></div><div class="ttdeci">bool equal(const bvector&lt; Alloc &gt; &amp;bvect) const BMNOEXCEPT</div><div class="ttdoc">Equal comparison with an agr bit-vector.</div><div class="ttdef"><b>Definition:</b> <a href="bm_8h_source.html#l01883">bm.h:1883</a></div></div>
<div class="ttc" id="agroup__bvector_html_ggad0b87b3b7292383a864d27feaf1c9effa7fe09d1d7c62a813db922c396c0cbc9c"><div class="ttname"><a href="group__bvector.html#ggad0b87b3b7292383a864d27feaf1c9effa7fe09d1d7c62a813db922c396c0cbc9c">bm::BM_GAP</a></div><div class="ttdeci">@ BM_GAP</div><div class="ttdoc">GAP compression is ON.</div><div class="ttdef"><b>Definition:</b> <a href="bmconst_8h_source.html#l00144">bmconst.h:144</a></div></div>
<div class="ttc" id="abmintervals_8h_html"><div class="ttname"><a href="bmintervals_8h.html">bmintervals.h</a></div><div class="ttdoc">Algorithms for bit ranges and intervals.</div></div>
<div class="ttc" id="asample22_8cpp_html_a15ab1ec24c164cc91abcefb45a316cec"><div class="ttname"><a href="sample22_8cpp.html#a15ab1ec24c164cc91abcefb45a316cec">PrintContainer</a></div><div class="ttdeci">void PrintContainer(T first, T last)</div><div class="ttdef"><b>Definition:</b> <a href="sample22_8cpp_source.html#l00059">sample22.cpp:59</a></div></div>
<div class="ttc" id="aclassbm_1_1serializer_html"><div class="ttname"><a href="classbm_1_1serializer.html">bm::serializer</a></div><div class="ttdoc">Bit-vector serialization class.</div><div class="ttdef"><b>Definition:</b> <a href="bmserial_8h_source.html#l00075">bmserial.h:75</a></div></div>
<div class="ttc" id="abmserial_8h_html"><div class="ttname"><a href="bmserial_8h.html">bmserial.h</a></div><div class="ttdoc">Serialization / compression of bvector&lt;&gt;. Set theoretical operations on compressed BLOBs.</div></div>
<div class="ttc" id="aclassbm_1_1bvector_html_a937cd13482984f234a5d94cc638c22b5"><div class="ttname"><a href="classbm_1_1bvector.html#a937cd13482984f234a5d94cc638c22b5">bm::bvector::end</a></div><div class="ttdeci">enumerator end() const</div><div class="ttdoc">Returns enumerator pointing on the next bit after the last.</div><div class="ttdef"><b>Definition:</b> <a href="bm_8h_source.html#l01776">bm.h:1776</a></div></div>
<div class="ttc" id="agroup__bvserial_html_ga8057580b944fa3ad68419f2673772999"><div class="ttname"><a href="group__bvserial.html#ga8057580b944fa3ad68419f2673772999">bm::deserialize_range</a></div><div class="ttdeci">void deserialize_range(BV &amp;bv, const unsigned char *buf, typename BV::size_type from, typename BV::size_type to, const bm::bv_ref_vector&lt; BV &gt; *ref_vect=0)</div><div class="ttdoc">Bitvector range deserialization from a memory BLOB.</div><div class="ttdef"><b>Definition:</b> <a href="bmserial_8h_source.html#l02751">bmserial.h:2751</a></div></div>
<div class="ttc" id="aclassbm_1_1bvector_html_a86b939f3aed555dc073e8c26e9efea71"><div class="ttname"><a href="classbm_1_1bvector.html#a86b939f3aed555dc073e8c26e9efea71">bm::bvector::first</a></div><div class="ttdeci">enumerator first() const</div><div class="ttdoc">Returns enumerator pointing on the first non-zero bit.</div><div class="ttdef"><b>Definition:</b> <a href="bm_8h_source.html#l01770">bm.h:1770</a></div></div>
<div class="ttc" id="aclassbm_1_1bvector_html_a405dd9ed048c935c84a5086ec8ba3649"><div class="ttname"><a href="classbm_1_1bvector.html#a405dd9ed048c935c84a5086ec8ba3649">bm::bvector::size_type</a></div><div class="ttdeci">bm::id_t size_type</div><div class="ttdef"><b>Definition:</b> <a href="bm_8h_source.html#l00117">bm.h:117</a></div></div>
<div class="ttc" id="aclassbm_1_1serializer_html_a89cebac62eb991ee3f4a5b805a255e81"><div class="ttname"><a href="classbm_1_1serializer.html#a89cebac62eb991ee3f4a5b805a255e81">bm::serializer::set_bookmarks</a></div><div class="ttdeci">void set_bookmarks(bool enable, unsigned bm_interval=256) BMNOEXCEPT</div><div class="ttdoc">Add skip-markers to serialization BLOB for faster range decode at the expense of some BLOB size incre...</div><div class="ttdef"><b>Definition:</b> <a href="bmserial_8h_source.html#l01138">bmserial.h:1138</a></div></div>
<div class="ttc" id="abm_8h_html"><div class="ttname"><a href="bm_8h.html">bm.h</a></div><div class="ttdoc">Compressed bit-vector bvector&lt;&gt; container, set algebraic methods, traversal iterators.</div></div>
<div class="ttc" id="agroup__bvintervals_html_ga41642899622fcb337ef94b6861f40f92"><div class="ttname"><a href="group__bvintervals.html#ga41642899622fcb337ef94b6861f40f92">bm::find_interval_end</a></div><div class="ttdeci">bool find_interval_end(const BV &amp;bv, typename BV::size_type from, typename BV::size_type &amp;pos) BMNOEXCEPT</div><div class="ttdoc">Reverse find index of first 1 bit gap (01110) starting from position Reverse scan for the first 1 in ...</div><div class="ttdef"><b>Definition:</b> <a href="bmintervals_8h_source.html#l00438">bmintervals.h:438</a></div></div>
<div class="ttc" id="agroup__bvintervals_html_gaae6ab80711097efc62afa54af888abd2"><div class="ttname"><a href="group__bvintervals.html#gaae6ab80711097efc62afa54af888abd2">bm::is_interval</a></div><div class="ttdeci">bool is_interval(const BV &amp;bv, typename BV::size_type left, typename BV::size_type right) BMNOEXCEPT</div><div class="ttdoc">Returns true if range is all 1s flanked with 0s Function performs the test on a closed range [left,...</div><div class="ttdef"><b>Definition:</b> <a href="bmintervals_8h_source.html#l00248">bmintervals.h:248</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>