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
|
<!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++: sample16.cpp File Reference</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&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_6f9635d4fbfa321d4c00f29df5cd540c.html">samples</a></li><li class="navelem"><a class="el" href="dir_567f9d57e67306eb26cce7d346169976.html">bvsample16</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> |
<a href="#var-members">Variables</a> </div>
<div class="headertitle">
<div class="title">sample16.cpp File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Example: how to use bm::aggregator<> for logical operations.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include <stdlib.h></code><br />
<code>#include <iostream></code><br />
<code>#include <vector></code><br />
<code>#include <memory></code><br />
<code>#include "<a class="el" href="bm_8h_source.html">bm.h</a>"</code><br />
<code>#include "<a class="el" href="bmaggregator_8h_source.html">bmaggregator.h</a>"</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for sample16.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="sample16_8cpp__incl.png" border="0" usemap="#sample16_8cpp" alt=""/></div>
<map name="sample16_8cpp" id="sample16_8cpp">
<area shape="rect" title="Example: how to use bm::aggregator<> for logical operations." alt="" coords="925,5,1027,32"/>
<area shape="rect" title=" " alt="" coords="24,251,88,278"/>
<area shape="rect" title=" " alt="" coords="983,80,1055,107"/>
<area shape="rect" title=" " alt="" coords="1079,80,1135,107"/>
<area shape="rect" title=" " alt="" coords="1159,80,1228,107"/>
<area shape="rect" href="bm_8h.html" title="Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators." alt="" coords="908,80,959,107"/>
<area shape="rect" href="bmaggregator_8h.html" title="Algorithms for fast aggregation of N bvectors." alt="" coords="179,162,291,189"/>
<area shape="rect" title=" " alt="" coords="1462,162,1525,189"/>
<area shape="rect" title=" " alt="" coords="315,162,413,189"/>
<area shape="rect" title=" " alt="" coords="437,162,515,189"/>
<area shape="rect" title=" " alt="" coords="540,162,604,189"/>
<area shape="rect" href="bmdef_8h.html" title="Definitions(internal)" alt="" coords="705,408,773,435"/>
<area shape="rect" href="bmconst_8h.html" title="Constants, tables and typedefs." alt="" coords="1421,408,1504,435"/>
<area shape="rect" href="bmsimd_8h.html" title="SIMD target version definitions." alt="" coords="1651,162,1730,189"/>
<area shape="rect" title=" " alt="" coords="629,162,699,189"/>
<area shape="rect" title=" " alt="" coords="723,162,791,189"/>
<area shape="rect" href="bmfunc_8h.html" title="Bit manipulation primitives (internal)" alt="" coords="701,251,776,278"/>
<area shape="rect" href="encoding_8h.html" title="Encoding utilities for serialization (internal)" alt="" coords="981,251,1067,278"/>
<area shape="rect" href="bmalloc_8h.html" title="Default SIMD friendly allocator." alt="" coords="75,162,154,189"/>
<area shape="rect" title=" " alt="" coords="815,162,905,189"/>
<area shape="rect" title=" " alt="" coords="929,155,1085,196"/>
<area shape="rect" title=" " alt="" coords="1109,162,1192,189"/>
<area shape="rect" title=" " alt="" coords="1216,162,1299,189"/>
<area shape="rect" title=" " alt="" coords="801,244,957,285"/>
<area shape="rect" title=" " alt="" coords="1323,162,1386,189"/>
<area shape="rect" title=" " alt="" coords="753,483,813,509"/>
<area shape="rect" title=" " alt="" coords="663,483,729,509"/>
<area shape="rect" title=" " alt="" coords="1432,483,1493,509"/>
<area shape="rect" href="bmsse4_8h.html" title="Compute functions for SSE4.2 SIMD instruction set (internal)" alt="" coords="1369,251,1447,278"/>
<area shape="rect" href="bmsse2_8h.html" title="Compute functions for SSE2 SIMD instruction set (internal)" alt="" coords="1091,251,1170,278"/>
<area shape="rect" title=" " alt="" coords="1085,333,1168,360"/>
<area shape="rect" title=" " alt="" coords="1003,408,1093,435"/>
<area shape="rect" title=" " alt="" coords="1640,333,1731,360"/>
<area shape="rect" title=" " alt="" coords="1363,333,1453,360"/>
<area shape="rect" title=" " alt="" coords="1478,333,1565,360"/>
<area shape="rect" href="bmsse__util_8h.html" title="Compute functions for SSE SIMD instruction set (internal)" alt="" coords="1192,333,1288,360"/>
<area shape="rect" href="bmutil_8h.html" title="Bit manipulation primitives (internal)" alt="" coords="891,333,959,360"/>
<area shape="rect" title=" " alt="" coords="783,333,863,360"/>
<area shape="rect" title=" " alt="" coords="112,251,157,278"/>
<area shape="rect" href="bmalgo__impl_8h.html" title="Algorithms for bvector<>" alt="" coords="571,251,677,278"/>
</map>
</div>
</div>
<p><a href="sample16_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a15ab1ec24c164cc91abcefb45a316cec"><td class="memTemplParams" colspan="2">template<class T > </td></tr>
<tr class="memitem:a15ab1ec24c164cc91abcefb45a316cec"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="sample16_8cpp.html#a15ab1ec24c164cc91abcefb45a316cec">PrintContainer</a> (T first, T last)</td></tr>
<tr class="separator:a15ab1ec24c164cc91abcefb45a316cec"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="sample16_8cpp.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a1628f8ef83d2de474e2ee5bb37d065f8"><td class="memItemLeft" align="right" valign="top">const unsigned </td><td class="memItemRight" valign="bottom"><a class="el" href="sample16_8cpp.html#a1628f8ef83d2de474e2ee5bb37d065f8">max_vectors</a> = 10</td></tr>
<tr class="separator:a1628f8ef83d2de474e2ee5bb37d065f8"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Example: how to use bm::aggregator<> for logical operations. </p>
<p>bm::aggregator<> uses cache blocking techniques and bandwidth optimizations to do logical operations (OR, AND, AND-SUB) faster, than if we do it by combining bit-vectors one by one, sequentially. </p>
<p class="definition">Definition in file <a class="el" href="sample16_8cpp_source.html">sample16.cpp</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a840291bc02cba5474a4cb46a9b9566fe">◆ </a></span>main()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int main </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="sample16_8cpp-example.html#a2">sample16.cpp</a>.</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="sample16_8cpp_source.html#l00060">60</a> of file <a class="el" href="sample16_8cpp_source.html">sample16.cpp</a>.</p>
<p class="reference">References <a class="el" href="bmaggregator_8h_source.html#l00576">bm::aggregator< BV >::add()</a>, <a class="el" href="bmaggregator_8h_source.html#l00617">bm::aggregator< BV >::combine_and()</a>, <a class="el" href="bmaggregator_8h_source.html#l00625">bm::aggregator< BV >::combine_and_sub()</a>, <a class="el" href="bmaggregator_8h_source.html#l00609">bm::aggregator< BV >::combine_or()</a>, <a class="el" href="bm_8h_source.html#l01776">bm::bvector< Alloc >::end()</a>, <a class="el" href="bm_8h_source.html#l01770">bm::bvector< Alloc >::first()</a>, <a class="el" href="bmaggregator_8h_source.html#l00071">bm::aggregator< BV >::max_aggregator_cap</a>, <a class="el" href="sample16_8cpp_source.html#l00058">max_vectors</a>, <a class="el" href="sample16_8cpp_source.html#l00047">PrintContainer()</a>, and <a class="el" href="bmaggregator_8h_source.html#l00542">bm::aggregator< BV >::reset()</a>.</p>
</div>
</div>
<a id="a15ab1ec24c164cc91abcefb45a316cec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a15ab1ec24c164cc91abcefb45a316cec">◆ </a></span>PrintContainer()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class T > </div>
<table class="memname">
<tr>
<td class="memname">void PrintContainer </td>
<td>(</td>
<td class="paramtype">T </td>
<td class="paramname"><em>first</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">T </td>
<td class="paramname"><em>last</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="sample16_8cpp-example.html#a0">sample16.cpp</a>.</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="sample16_8cpp_source.html#l00047">47</a> of file <a class="el" href="sample16_8cpp_source.html">sample16.cpp</a>.</p>
<p class="reference">Referenced by <a class="el" href="sample16_8cpp_source.html#l00060">main()</a>.</p>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a1628f8ef83d2de474e2ee5bb37d065f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1628f8ef83d2de474e2ee5bb37d065f8">◆ </a></span>max_vectors</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const unsigned max_vectors = 10</td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="sample16_8cpp-example.html#a1">sample16.cpp</a>.</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="sample16_8cpp_source.html#l00058">58</a> of file <a class="el" href="sample16_8cpp_source.html">sample16.cpp</a>.</p>
<p class="reference">Referenced by <a class="el" href="sample16_8cpp_source.html#l00060">main()</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
|