svf-tools 1.0.496 → 1.0.499
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SVF-doxygen/html/html/CFLAlias_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/CFLGraphBuilder_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/CoreBitVector_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/DPItem_8h_source.html +2 -2
- package/SVF-doxygen/html/html/LLVMLoopAnalysis_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/LLVMModule_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/Options_8cpp_source.html +6 -7
- package/SVF-doxygen/html/html/Options_8h_source.html +6 -7
- package/SVF-doxygen/html/html/PointsTo_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/SVFUtil_8h.html +3 -3
- package/SVF-doxygen/html/html/SVFUtil_8h_source.html +2 -2
- package/SVF-doxygen/html/html/cfl_8cpp.html +47 -2
- package/SVF-doxygen/html/html/cfl_8cpp_source.html +4 -2
- package/SVF-doxygen/html/html/classSVF_1_1CFLAlias.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1CFLGraphBuilder.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1ContextCond.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1CoreBitVector.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1CxtDPItem.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1LLVMLoopAnalysis.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1LLVMModuleSet.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1Options-members.html +105 -106
- package/SVF-doxygen/html/html/classSVF_1_1Options.html +30 -56
- package/SVF-doxygen/html/html/classSVF_1_1PointsTo.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1PointsTo_1_1PointsToIterator.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +1 -1
- package/SVF-doxygen/html/html/cuddInt_8c.html +98 -98
- package/SVF-doxygen/html/html/cuddInt_8c_source.html +2 -2
- package/SVF-doxygen/html/html/cuddInt_8h.html +4 -4
- package/SVF-doxygen/html/html/dda_8cpp.html +46 -2
- package/SVF-doxygen/html/html/dda_8cpp_source.html +3 -2
- package/SVF-doxygen/html/html/functions_c.html +19 -18
- package/SVF-doxygen/html/html/functions_func_s.html +1 -1
- package/SVF-doxygen/html/html/functions_g.html +6 -9
- package/SVF-doxygen/html/html/functions_i.html +7 -10
- package/SVF-doxygen/html/html/functions_l.html +6 -6
- package/SVF-doxygen/html/html/functions_o.html +3 -3
- package/SVF-doxygen/html/html/functions_p.html +14 -14
- package/SVF-doxygen/html/html/functions_r.html +4 -6
- package/SVF-doxygen/html/html/functions_s.html +11 -13
- package/SVF-doxygen/html/html/functions_t.html +7 -7
- package/SVF-doxygen/html/html/functions_v.html +3 -3
- package/SVF-doxygen/html/html/functions_vars_c.html +3 -0
- package/SVF-doxygen/html/html/functions_vars_g.html +0 -3
- package/SVF-doxygen/html/html/functions_vars_i.html +0 -3
- package/SVF-doxygen/html/html/globals_func_i.html +14 -4
- package/SVF-doxygen/html/html/globals_i.html +12 -4
- package/SVF-doxygen/html/html/globals_r.html +3 -3
- package/SVF-doxygen/html/html/globals_s.html +6 -6
- package/SVF-doxygen/html/html/mta_8cpp.html +46 -2
- package/SVF-doxygen/html/html/mta_8cpp_source.html +3 -2
- package/SVF-doxygen/html/html/namespaceSVF_1_1SVFUtil.html +7 -7
- package/SVF-doxygen/html/html/namespacemembers_func.html +1 -1
- package/SVF-doxygen/html/html/namespacemembers_m.html +1 -1
- package/SVF-doxygen/html/html/saber_8cpp.html +46 -2
- package/SVF-doxygen/html/html/saber_8cpp_source.html +3 -2
- package/SVF-doxygen/html/html/search/all_10.js +7 -7
- package/SVF-doxygen/html/html/search/all_12.js +4 -4
- package/SVF-doxygen/html/html/search/all_13.js +13 -13
- package/SVF-doxygen/html/html/search/all_14.js +6 -6
- package/SVF-doxygen/html/html/search/all_16.js +3 -3
- package/SVF-doxygen/html/html/search/all_3.js +1 -1
- package/SVF-doxygen/html/html/search/all_7.js +0 -1
- package/SVF-doxygen/html/html/search/all_9.js +2 -2
- package/SVF-doxygen/html/html/search/all_c.js +3 -3
- package/SVF-doxygen/html/html/search/all_d.js +2 -2
- package/SVF-doxygen/html/html/search/all_e.js +3 -3
- package/SVF-doxygen/html/html/search/all_f.js +3 -3
- package/SVF-doxygen/html/html/search/functions_11.js +1 -1
- package/SVF-doxygen/html/html/search/functions_8.js +1 -0
- package/SVF-doxygen/html/html/search/functions_c.js +1 -1
- package/SVF-doxygen/html/html/search/variables_14.js +3 -3
- package/SVF-doxygen/html/html/search/variables_3.js +1 -0
- package/SVF-doxygen/html/html/search/variables_7.js +0 -1
- package/SVF-doxygen/html/html/search/variables_9.js +0 -1
- package/SVF-doxygen/html/html/search/variables_d.js +1 -1
- package/SVF-doxygen/html/html/search/variables_e.js +2 -2
- package/SVF-doxygen/html/html/svf-ex_8cpp.html +54 -10
- package/SVF-doxygen/html/html/svf-ex_8cpp_source.html +7 -6
- package/SVF-doxygen/html/html/wpa_8cpp.html +46 -2
- package/SVF-doxygen/html/html/wpa_8cpp_source.html +3 -2
- package/build.sh +27 -26
- package/include/Util/Options.h +1 -2
- package/include/Util/SVFUtil.h +1 -1
- package/lib/CFL/CFLAlias.cpp +6 -6
- package/lib/Util/Options.cpp +6 -12
- package/package.json +1 -1
- package/tools/CFL/cfl.cpp +4 -1
- package/tools/DDA/dda.cpp +3 -0
- package/tools/Example/svf-ex.cpp +3 -0
- package/tools/MTA/mta.cpp +3 -0
- package/tools/SABER/saber.cpp +3 -0
- package/tools/WPA/wpa.cpp +3 -0
|
@@ -66,7 +66,7 @@ $(function() {
|
|
|
66
66
|
<div class="title">CoreBitVector.cpp</div> </div>
|
|
67
67
|
</div><!--header-->
|
|
68
68
|
<div class="contents">
|
|
69
|
-
<a href="CoreBitVector_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">//===- CoreBitVector.cpp -- Dynamically sized bit vector data structure ------------//</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> </div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">/*</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * CoreBitVector.h</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * Contiguous bit vector which resizes as required by common operations (implementation).</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * Created on: Jan 31, 2021</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> * Author: Mohamad Barbar</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> */</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> </div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#include <limits.h></span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="preprocessor">#include <llvm/Support/MathExtras.h></span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#include "<a class="code" href="CoreBitVector_8h.html">Util/CoreBitVector.h</a>"</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include "<a class="code" href="SVFBasicTypes_8h.html">Util/SVFBasicTypes.h</a>"</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#include "<a class="code" href="SVFUtil_8h.html">Util/SVFUtil.h</a>"</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> </div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="keyword">namespace </span><a class="code" href="namespaceSVF.html">SVF</a></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> {</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">CoreBitVector::WordSize</a> = <span class="keyword">sizeof</span>(Word) * CHAR_BIT;</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#adb5b13df8bc76f00ceb145711cfb77e1"> 24</a></span> <a class="code" href="classSVF_1_1CoreBitVector.html#adb5b13df8bc76f00ceb145711cfb77e1">CoreBitVector::CoreBitVector</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  : <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a>(0) { }</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#aa25de5d26935c74e156c5f6604b3d8a8"> 27</a></span> <a class="code" href="classSVF_1_1CoreBitVector.html#adb5b13df8bc76f00ceb145711cfb77e1">CoreBitVector::CoreBitVector</a>(<span class="keywordtype">size_t</span> <a class="code" href="cJSON_8cpp.html#ab6e2ea6dc7bd57d1483413449998230a">n</a>)</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  : <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>(0), <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>(n, 0) { }</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a57b3db689583b652ab1426c04a66c4ae"> 30</a></span> <a class="code" href="classSVF_1_1CoreBitVector.html#adb5b13df8bc76f00ceb145711cfb77e1">CoreBitVector::CoreBitVector</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &cbv)</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  : <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>(cbv.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>), <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>(cbv.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>) { }</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a93f42d767c99bdf788dc4df4881751c5"> 33</a></span> <a class="code" href="classSVF_1_1CoreBitVector.html#adb5b13df8bc76f00ceb145711cfb77e1">CoreBitVector::CoreBitVector</a>(<a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &&cbv)</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  : <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>(cbv.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>), <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>(<a class="code" href="namespacestd.html">std</a>::<a class="code" href="namespaceSVF_1_1SVFUtil.html#ac5ca4c51589285ed63b2902471e5594b">move</a>(cbv.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>)) { }</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a3594d997fba0aa6201855199a884d98d"> 36</a></span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &<a class="code" href="classSVF_1_1CoreBitVector.html#a3594d997fba0aa6201855199a884d98d">CoreBitVector::operator=</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> {</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  this-><a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> = rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  this-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a> = rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> }</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> </div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#ae14cc9ce0abbad20636c51e6ca781305"> 43</a></span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &<a class="code" href="classSVF_1_1CoreBitVector.html#a3594d997fba0aa6201855199a884d98d">CoreBitVector::operator=</a>(<a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &&rhs)</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> {</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  this-><a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> = rhs.offset;</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  this-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a> = <a class="code" href="namespaceSVF_1_1SVFUtil.html#ac5ca4c51589285ed63b2902471e5594b">std::move</a>(rhs.words);</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> }</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a98b9795b4fdc74d9d2efa9a3f2ecb62f"> 50</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a98b9795b4fdc74d9d2efa9a3f2ecb62f">CoreBitVector::empty</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="keyword"></span>{</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> &w : <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>) <span class="keywordflow">if</span> (w) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> }</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#abfed2e7daf2407e11cade625ac19a6ce"> 56</a></span> <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> <a class="code" href="classSVF_1_1CoreBitVector.html#abfed2e7daf2407e11cade625ac19a6ce">CoreBitVector::count</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="keyword"></span>{</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> <a class="code" href="cJSON_8cpp.html#ab6e2ea6dc7bd57d1483413449998230a">n</a> = 0;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> &w : <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>) n += llvm::countPopulation(w);</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keywordflow">return</span> <a class="code" href="cJSON_8cpp.html#ab6e2ea6dc7bd57d1483413449998230a">n</a>;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> }</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> </div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a1e523bab1013a9f3e9eaea56e53afa58"> 63</a></span> <span class="keywordtype">void</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a1e523bab1013a9f3e9eaea56e53afa58">CoreBitVector::clear</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> {</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> = 0;</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.clear();</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.shrink_to_fit();</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> }</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a7b20ffd3cd4a0ffc48a1348f657deaa0"> 70</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a7b20ffd3cd4a0ffc48a1348f657deaa0">CoreBitVector::test</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)<span class="keyword"> const</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="keyword"></span>{</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keywordflow">if</span> (bit < offset || bit >= <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> + <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> &containingWord = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[(bit - <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>];</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> mask = (<a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a>)0b1 << (bit % <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>);</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keywordflow">return</span> mask & containingWord;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> }</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> </div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a3299b296d20d2b76c6538ba51a684972"> 78</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a3299b296d20d2b76c6538ba51a684972">CoreBitVector::test_and_set</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> {</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <span class="comment">// TODO: can be faster.</span></div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector.html#a7b20ffd3cd4a0ffc48a1348f657deaa0">test</a>(bit)) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <span class="keyword">set</span>(bit);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> }</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> </div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a553e3e51bffe1aab04adc047e0fd3f24"> 86</a></span> <span class="keywordtype">void</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a553e3e51bffe1aab04adc047e0fd3f24">CoreBitVector::set</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> {</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a73e5b15854f4f56f50992ed0d0cc7349">extendTo</a>(bit);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> &containingWord = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[(bit - <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>];</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> mask = (<a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a>)0b1 << (bit % <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>);</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  containingWord |= mask;</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span> }</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> </div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a42fc777d574db4ef23b02308b944a85b"> 95</a></span> <span class="keywordtype">void</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a42fc777d574db4ef23b02308b944a85b">CoreBitVector::reset</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> {</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordflow">if</span> (bit < offset || bit >= <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> + <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> &containingWord = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[(bit - <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>];</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> mask = ~((<a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a>)0b1 << (bit % <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>));</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  containingWord &= mask;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> }</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> </div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#af08c16aed45dfa65472f0b5ae518add2"> 103</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#af08c16aed45dfa65472f0b5ae518add2">CoreBitVector::contains</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)<span class="keyword"> const</span></div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> <span class="keyword"></span>{</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> tmp(*<span class="keyword">this</span>);</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  tmp &= rhs;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keywordflow">return</span> tmp == rhs;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span> }</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span> </div><div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a15be4ce7e9a07d9b01da0c60d51b22de"> 110</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a15be4ce7e9a07d9b01da0c60d51b22de">CoreBitVector::intersects</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)<span class="keyword"> const</span></div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="keyword"></span>{</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="comment">// TODO: want some common iteration method.</span></div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector.html#a98b9795b4fdc74d9d2efa9a3f2ecb62f">empty</a>() && rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a98b9795b4fdc74d9d2efa9a3f2ecb62f">empty</a>()) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> </div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &earlierOffsetCBV = <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> <= rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> ? *this : rhs;</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &laterOffsetCBV = <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> <= rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> ? rhs : *<span class="keyword">this</span>;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> </div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordtype">size_t</span> earlierOffset = (<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> < rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> ? <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> : rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="keywordtype">size_t</span> laterOffset = (<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> > rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> ? <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> : rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  laterOffset -= earlierOffset;</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> </div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> *eWords = &earlierOffsetCBV.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[0];</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> eSize = earlierOffsetCBV.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size();</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> *lWords = &laterOffsetCBV.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[0];</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> lSize = laterOffsetCBV.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size();</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span> </div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="keywordtype">size_t</span> e = 0;</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="keywordflow">for</span> ( ; e != laterOffset && e != eSize; ++e) { }</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span> </div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keywordtype">size_t</span> l = 0;</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="keywordflow">for</span> ( ; e != eSize && l != lSize; ++e, ++l)</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  {</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="keywordflow">if</span> (eWords[e] & lWords[l]) <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  }</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span> </div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span> }</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span> </div><div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a0ddd7fc5e043d36f3c62c2fb93b22684"> 139</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a0ddd7fc5e043d36f3c62c2fb93b22684">CoreBitVector::operator==</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)<span class="keyword"> const</span></div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span> <span class="keyword"></span>{</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keywordflow">if</span> (<span class="keyword">this</span> == &rhs) <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span> </div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <span class="comment">// TODO: maybe a simple equal offset, equal size path?</span></div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span> </div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keywordtype">size_t</span> lhsSetIndex = <a class="code" href="classSVF_1_1CoreBitVector.html#a087f69adea5e9e83bd908a1ab0ee1383">nextSetIndex</a>(0);</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="keywordtype">size_t</span> rhsSetIndex = rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a087f69adea5e9e83bd908a1ab0ee1383">nextSetIndex</a>(0);</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="comment">// Iterate comparing only words with set bits, if there is ever a mismatch,</span></div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="comment">// then the bit-vectors aren't equal.</span></div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="keywordflow">while</span> (lhsSetIndex < <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() && rhsSetIndex < rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size())</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  {</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="comment">// If the first bit is not the same in the word or words are different,</span></div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="comment">// then we have a mismatch.</span></div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="keywordflow">if</span> (lhsSetIndex * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a> + <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> != rhsSetIndex * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a> + rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a></div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  || <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[lhsSetIndex] != rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[rhsSetIndex])</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  {</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  }</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span> </div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  lhsSetIndex = <a class="code" href="classSVF_1_1CoreBitVector.html#a087f69adea5e9e83bd908a1ab0ee1383">nextSetIndex</a>(lhsSetIndex + 1);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  rhsSetIndex = rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a087f69adea5e9e83bd908a1ab0ee1383">nextSetIndex</a>(rhsSetIndex + 1);</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  }</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span> </div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="comment">// Make sure both got to the end at the same time.</span></div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="keywordflow">return</span> lhsSetIndex >= <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() && rhsSetIndex >= rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size();</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span> }</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span> </div><div class="line"><a name="l00167"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#af142d3bb07e77c28bba6ece5b5b13f51"> 167</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#af142d3bb07e77c28bba6ece5b5b13f51">CoreBitVector::operator!=</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)<span class="keyword"> const</span></div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span> <span class="keyword"></span>{</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == rhs);</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span> }</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span> </div><div class="line"><a name="l00172"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#af8e63360242a49fb63c3ef3d7071503d"> 172</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#af8e63360242a49fb63c3ef3d7071503d">CoreBitVector::operator|=</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span> {</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() == 0)</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  {</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  *<span class="keyword">this</span> = rhs;</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keywordflow">return</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() != 0;</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  }</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span> </div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="keywordflow">if</span> (rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() == 0) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span> </div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <span class="keywordflow">if</span> (<span class="keyword">this</span> == &rhs) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span> </div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <span class="comment">// TODO: some redundancy in extendTo calls.</span></div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector.html#a8825e54f584be8aa0ff627335064244e">finalBit</a>() < rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a8825e54f584be8aa0ff627335064244e">finalBit</a>()) <a class="code" href="classSVF_1_1CoreBitVector.html#a5d3f1eb85bc388cb76c588b8d8b3c181">extendForward</a>(rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a8825e54f584be8aa0ff627335064244e">finalBit</a>());</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> > rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) <a class="code" href="classSVF_1_1CoreBitVector.html#ab6d789e3c68390a9026fd4f8c4cf344a">extendBackward</a>(rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>);</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span> </div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="comment">// Start counting this where rhs starts.</span></div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> thisIndex = <a class="code" href="classSVF_1_1CoreBitVector.html#ad73fca28bd4882eaa70817023a632d35">indexForBit</a>(rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>);</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  <span class="keywordtype">size_t</span> rhsIndex = 0;</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span> </div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="comment">// Only need to test against rhs's size since we extended this to hold rhs.</span></div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> *thisWords = &<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex];</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> *rhsWords = &rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[rhsIndex];</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> <a class="code" href="cJSON_8h.html#a9f237f17f4e79d5b89149e09152edabe">length</a> = rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size();</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> changed = 0;</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span> </div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="comment">// Can start counting from 0 because we took the addresses of both</span></div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <span class="comment">// word vectors at the correct index.</span></div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <span class="comment">// #pragma omp simd</span></div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0 ; i < <a class="code" href="cJSON_8h.html#a9f237f17f4e79d5b89149e09152edabe">length</a>; ++i)</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  {</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> oldWord = thisWords[i];</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <span class="comment">// Is there anything in rhs not in *this?</span></div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  thisWords[i] = thisWords[i] | rhsWords[i];</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  changed |= oldWord ^ thisWords[i];</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  }</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span> </div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="keywordflow">return</span> changed;</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span> }</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span> </div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#ae84257a1544b94c9abf5c8d0f6cfaec9">CoreBitVector::operator&=</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span> {</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <span class="comment">// The first bit this and rhs have in common is the greater of</span></div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="comment">// their offsets if the CBV with the smaller offset can hold</span></div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  <span class="comment">// the greater offset.</span></div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> greaterOffset = std::max(<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>, rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>);</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span> </div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="comment">// If there is no overlap, then clear this CBV.</span></div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <span class="keywordflow">if</span> (!<a class="code" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486">canHold</a>(greaterOffset) || !rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486">canHold</a>(greaterOffset))</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  {</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="keywordtype">bool</span> changed = <span class="keyword">false</span>;</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size(); ++i)</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  {</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keywordflow">if</span> (!changed) changed = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[i] != 0;</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[i] = 0;</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  }</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span> </div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  <span class="keywordflow">return</span> changed;</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  }</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span> </div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <span class="keywordtype">bool</span> changed = <span class="keyword">false</span>;</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  <span class="keywordtype">size_t</span> thisIndex = <a class="code" href="classSVF_1_1CoreBitVector.html#ad73fca28bd4882eaa70817023a632d35">indexForBit</a>(greaterOffset);</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  <span class="keywordtype">size_t</span> rhsIndex = rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#ad73fca28bd4882eaa70817023a632d35">indexForBit</a>(greaterOffset);</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span> </div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <span class="comment">// Clear everything before the overlapping part.</span></div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < thisIndex; ++i)</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  {</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <span class="keywordflow">if</span> (!changed) changed = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[i] != 0;</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[i] = 0;</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  }</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span> </div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> oldWord;</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  <span class="keywordflow">for</span> ( ; thisIndex < <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() && rhsIndex < rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size(); ++thisIndex, ++rhsIndex)</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  {</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  <span class="keywordflow">if</span> (!changed) oldWord = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex];</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex] &= rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[rhsIndex];</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="keywordflow">if</span> (!changed) changed = oldWord != <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex];</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  }</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span> </div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <span class="comment">// Clear the remaining bits with no rhs analogue.</span></div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  <span class="keywordflow">for</span> ( ; thisIndex < <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size(); ++thisIndex)</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  {</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <span class="keywordflow">if</span> (!changed && <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex] != 0) changed = <span class="keyword">true</span>;</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex] = 0;</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  }</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span> </div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  <span class="keywordflow">return</span> changed;</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span> }</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span> </div><div class="line"><a name="l00261"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a5b87ae9d4a713483522666c893d7eac9"> 261</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a5b87ae9d4a713483522666c893d7eac9">CoreBitVector::operator-=</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span> {</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="comment">// Similar to |= in that we only iterate over rhs within this, but we</span></div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  <span class="comment">// don't need to extend anything since nothing from rhs is being added.</span></div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> greaterOffset = std::max(<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>, rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>);</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  <span class="comment">// TODO: calling twice.</span></div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  <span class="comment">// No overlap if either cannot hold the greater offset.</span></div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  <span class="keywordflow">if</span> (!<a class="code" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486">canHold</a>(greaterOffset) || !rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486">canHold</a>(greaterOffset)) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span> </div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  <span class="keywordtype">bool</span> changed = <span class="keyword">false</span>;</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  <span class="keywordtype">size_t</span> thisIndex = <a class="code" href="classSVF_1_1CoreBitVector.html#ad73fca28bd4882eaa70817023a632d35">indexForBit</a>(greaterOffset);</div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  <span class="keywordtype">size_t</span> rhsIndex = rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#ad73fca28bd4882eaa70817023a632d35">indexForBit</a>(greaterOffset);</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> oldWord;</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  <span class="keywordflow">for</span> ( ; thisIndex < <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() && rhsIndex < rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size(); ++thisIndex, ++rhsIndex)</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  {</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  <span class="keywordflow">if</span> (!changed) oldWord = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex];</div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex] &= ~rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[rhsIndex];</div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  <span class="keywordflow">if</span> (!changed) changed = oldWord != <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex];</div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  }</div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span> </div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  <span class="keywordflow">return</span> changed;</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span> }</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span> </div><div class="line"><a name="l00284"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a8ba857b68282055e485c441892e39b9b"> 284</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a8ba857b68282055e485c441892e39b9b">CoreBitVector::intersectWithComplement</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)</div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span> {</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span> -= rhs;</div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span> }</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span> </div><div class="line"><a name="l00289"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a79121882bc302b9b9188fa0a51c63fb6"> 289</a></span> <span class="keywordtype">void</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a8ba857b68282055e485c441892e39b9b">CoreBitVector::intersectWithComplement</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &lhs, <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span> {</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  <span class="comment">// TODO: inefficient!</span></div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  *<span class="keyword">this</span> = lhs;</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a8ba857b68282055e485c441892e39b9b">intersectWithComplement</a>(rhs);</div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span> }</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span> </div><div class="line"><a name="l00296"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#af979ecb48d3d5296bce5bd0b4676e359"> 296</a></span> <span class="keywordtype">size_t</span> <a class="code" href="classSVF_1_1CoreBitVector.html#af979ecb48d3d5296bce5bd0b4676e359">CoreBitVector::hash</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span> <span class="keyword"></span>{</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  <span class="comment">// From https://stackoverflow.com/a/27216842</span></div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <span class="keywordtype">size_t</span> h = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size();</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> &w : <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>)</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  {</div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  h ^= w + 0x9e3779b9 + (h << 6) + (h >> 2);</div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  }</div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span> </div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  <span class="keywordflow">return</span> h + <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>;</div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span> }</div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span> </div><div class="line"><a name="l00308"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a93cdd9890522cc9fee2451567e0b1f0d"> 308</a></span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVector::const_iterator</a> <a class="code" href="classSVF_1_1CoreBitVector.html#a93cdd9890522cc9fee2451567e0b1f0d">CoreBitVector::end</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span> <span class="keyword"></span>{</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  <span class="keywordflow">return</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVectorIterator</a>(<span class="keyword">this</span>, <span class="keyword">true</span>);</div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span> }</div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span> </div><div class="line"><a name="l00313"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a835bf11a1f698942db8e6bdadbbfd1f3"> 313</a></span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVector::const_iterator</a> <a class="code" href="classSVF_1_1CoreBitVector.html#a835bf11a1f698942db8e6bdadbbfd1f3">CoreBitVector::begin</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span> <span class="keyword"></span>{</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  <span class="keywordflow">return</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVectorIterator</a>(<span class="keyword">this</span>);</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span> }</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span> </div><div class="line"><a name="l00318"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#ab6d789e3c68390a9026fd4f8c4cf344a"> 318</a></span> <span class="keywordtype">void</span> <a class="code" href="classSVF_1_1CoreBitVector.html#ab6d789e3c68390a9026fd4f8c4cf344a">CoreBitVector::extendBackward</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span> {</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  <span class="comment">// New offset is the starting bit of the word which contains bit.</span></div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> newOffset = (bit / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>) * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span> </div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  <span class="comment">// TODO: maybe assertions?</span></div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  <span class="comment">// Check if bit can already be included in this BV or if it's extendForward's problem.</span></div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  <span class="keywordflow">if</span> (newOffset >= <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span> </div><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.insert(<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.begin(), (<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> - newOffset) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>, 0);</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> = newOffset;</div><div class="line"><a name="l00329"></a><span class="lineno"> 329</span> }</div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span> </div><div class="line"><a name="l00331"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a5d3f1eb85bc388cb76c588b8d8b3c181"> 331</a></span> <span class="keywordtype">void</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a5d3f1eb85bc388cb76c588b8d8b3c181">CoreBitVector::extendForward</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)</div><div class="line"><a name="l00332"></a><span class="lineno"> 332</span> {</div><div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  <span class="comment">// TODO: maybe assertions?</span></div><div class="line"><a name="l00334"></a><span class="lineno"> 334</span>  <span class="comment">// Not our problem; extendBackward's problem, or there is nothing to do.</span></div><div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  <span class="keywordflow">if</span> (bit < <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> || <a class="code" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486">canHold</a>(bit)) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00336"></a><span class="lineno"> 336</span> </div><div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  <span class="comment">// Starting bit of word which would contain bit.</span></div><div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bitsWord = (bit / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>) * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span> </div><div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  <span class="comment">// Add 1 to represent the final word starting at bitsWord.</span></div><div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> wordsToAdd = 1 + (bitsWord - <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a> - <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.insert(<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end(), wordsToAdd, 0);</div><div class="line"><a name="l00343"></a><span class="lineno"> 343</span> }</div><div class="line"><a name="l00344"></a><span class="lineno"> 344</span> </div><div class="line"><a name="l00345"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a73e5b15854f4f56f50992ed0d0cc7349"> 345</a></span> <span class="keywordtype">void</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a73e5b15854f4f56f50992ed0d0cc7349">CoreBitVector::extendTo</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)</div><div class="line"><a name="l00346"></a><span class="lineno"> 346</span> {</div><div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> == 0 && <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() == 0)</div><div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  {</div><div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> = (bit / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>) * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.push_back(0);</div><div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  }</div><div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (bit < <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) <a class="code" href="classSVF_1_1CoreBitVector.html#ab6d789e3c68390a9026fd4f8c4cf344a">extendBackward</a>(bit);</div><div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (bit >= <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> + <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>) <a class="code" href="classSVF_1_1CoreBitVector.html#a5d3f1eb85bc388cb76c588b8d8b3c181">extendForward</a>(bit);</div><div class="line"><a name="l00354"></a><span class="lineno"> 354</span> }</div><div class="line"><a name="l00355"></a><span class="lineno"> 355</span> </div><div class="line"><a name="l00356"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#ad73fca28bd4882eaa70817023a632d35"> 356</a></span> <span class="keywordtype">size_t</span> <a class="code" href="classSVF_1_1CoreBitVector.html#ad73fca28bd4882eaa70817023a632d35">CoreBitVector::indexForBit</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)<span class="keyword"> const</span></div><div class="line"><a name="l00357"></a><span class="lineno"> 357</span> <span class="keyword"></span>{</div><div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<a class="code" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486">canHold</a>(bit));</div><div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  <span class="comment">// Recall, offset (and the bits in that word) are represented by words[0],</span></div><div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  <span class="comment">// so solve (offset + x) / WordSize == 0... x == -offset.</span></div><div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  <span class="keywordflow">return</span> (bit - <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00362"></a><span class="lineno"> 362</span> }</div><div class="line"><a name="l00363"></a><span class="lineno"> 363</span> </div><div class="line"><a name="l00364"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486"> 364</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486">CoreBitVector::canHold</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)<span class="keyword"> const</span></div><div class="line"><a name="l00365"></a><span class="lineno"> 365</span> <span class="keyword"></span>{</div><div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  <span class="keywordflow">return</span> bit >= <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> && bit < <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> + <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00367"></a><span class="lineno"> 367</span> }</div><div class="line"><a name="l00368"></a><span class="lineno"> 368</span> </div><div class="line"><a name="l00369"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a8825e54f584be8aa0ff627335064244e"> 369</a></span> <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> <a class="code" href="classSVF_1_1CoreBitVector.html#a8825e54f584be8aa0ff627335064244e">CoreBitVector::finalBit</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00370"></a><span class="lineno"> 370</span> <span class="keyword"></span>{</div><div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  <span class="keywordflow">return</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> + <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a> - 1;</div><div class="line"><a name="l00372"></a><span class="lineno"> 372</span> }</div><div class="line"><a name="l00373"></a><span class="lineno"> 373</span> </div><div class="line"><a name="l00374"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a087f69adea5e9e83bd908a1ab0ee1383"> 374</a></span> <span class="keywordtype">size_t</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a087f69adea5e9e83bd908a1ab0ee1383">CoreBitVector::nextSetIndex</a>(<span class="keyword">const</span> <span class="keywordtype">size_t</span> start)<span class="keyword"> const</span></div><div class="line"><a name="l00375"></a><span class="lineno"> 375</span> <span class="keyword"></span>{</div><div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  <span class="keywordtype">size_t</span> <a class="code" href="cJSON_8h.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a> = start;</div><div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  <span class="keywordflow">for</span> ( ; index < <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size(); ++<a class="code" href="cJSON_8h.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a>)</div><div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  {</div><div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[index]) <span class="keywordflow">break</span>;</div><div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  }</div><div class="line"><a name="l00381"></a><span class="lineno"> 381</span> </div><div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  <span class="keywordflow">return</span> <a class="code" href="cJSON_8h.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a>;</div><div class="line"><a name="l00383"></a><span class="lineno"> 383</span> }</div><div class="line"><a name="l00384"></a><span class="lineno"> 384</span> </div><div class="line"><a name="l00385"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#ae209179f396c8b5b788ff6d2c437e5d6"> 385</a></span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#abe0289ad45158397b6950afc920f34ef">CoreBitVector::CoreBitVectorIterator::CoreBitVectorIterator</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> *cbv, <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a93cdd9890522cc9fee2451567e0b1f0d">end</a>)</div><div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  : cbv(cbv), bit(0)</div><div class="line"><a name="l00387"></a><span class="lineno"> 387</span> {</div><div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> = end ? cbv-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end() : cbv-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.begin();</div><div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  <span class="comment">// If user didn't request an end iterator, or words is non-empty,</span></div><div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  <span class="comment">// from 0, go to the next bit. But if the 0 bit is set, we don't</span></div><div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  <span class="comment">// need to because that is the first element.</span></div><div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> != cbv-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end() && !(cbv-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[0] & (<a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a>)0b1)) ++(*<span class="keyword">this</span>);</div><div class="line"><a name="l00393"></a><span class="lineno"> 393</span> }</div><div class="line"><a name="l00394"></a><span class="lineno"> 394</span> </div><div class="line"><a name="l00395"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0afff5162af357634e7213e85b5371c7"> 395</a></span> <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVector::CoreBitVectorIterator</a> &<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0afff5162af357634e7213e85b5371c7">CoreBitVector::CoreBitVectorIterator::operator++</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00396"></a><span class="lineno"> 396</span> {</div><div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(!<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#ad3af46dcfb0e2846587eb5a71f38161f">atEnd</a>() && <span class="stringliteral">"CoreBitVectorIterator::++(pre): incrementing past end!"</span>);</div><div class="line"><a name="l00398"></a><span class="lineno"> 398</span> </div><div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  ++<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a>;</div><div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  <span class="comment">// Check if no more bits in wordIt. Find word with a bit set.</span></div><div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a> == <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a> || (*<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> >> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a>) == 0)</div><div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  {</div><div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a> = 0;</div><div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  ++<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a>;</div><div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  <span class="keywordflow">while</span> (<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> != <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a>-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end() && *<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> == 0) ++<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a>;</div><div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  }</div><div class="line"><a name="l00407"></a><span class="lineno"> 407</span> </div><div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  <span class="comment">// Find set bit if we're not at the end.</span></div><div class="line"><a name="l00409"></a><span class="lineno"> 409</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> != <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a>-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end())</div><div class="line"><a name="l00410"></a><span class="lineno"> 410</span>  {</div><div class="line"><a name="l00411"></a><span class="lineno"> 411</span>  <span class="keywordflow">while</span> (<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a> != <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a> && (*<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> & ((<a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a>)0b1 << <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a>)) == 0) ++<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a>;</div><div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  }</div><div class="line"><a name="l00413"></a><span class="lineno"> 413</span> </div><div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00415"></a><span class="lineno"> 415</span> }</div><div class="line"><a name="l00416"></a><span class="lineno"> 416</span> </div><div class="line"><a name="l00417"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a943e3e32d7bf7c585ee841f2663992e8"> 417</a></span> <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVector::CoreBitVectorIterator</a> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0afff5162af357634e7213e85b5371c7">CoreBitVector::CoreBitVectorIterator::operator++</a>(<span class="keywordtype">int</span>)</div><div class="line"><a name="l00418"></a><span class="lineno"> 418</span> {</div><div class="line"><a name="l00419"></a><span class="lineno"> 419</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(!<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#ad3af46dcfb0e2846587eb5a71f38161f">atEnd</a>() && <span class="stringliteral">"CoreBitVectorIterator::++(pre): incrementing past end!"</span>);</div><div class="line"><a name="l00420"></a><span class="lineno"> 420</span>  <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVectorIterator</a> old = *<span class="keyword">this</span>;</div><div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  ++*<span class="keyword">this</span>;</div><div class="line"><a name="l00422"></a><span class="lineno"> 422</span>  <span class="keywordflow">return</span> old;</div><div class="line"><a name="l00423"></a><span class="lineno"> 423</span> }</div><div class="line"><a name="l00424"></a><span class="lineno"> 424</span> </div><div class="line"><a name="l00425"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#aec0b2c6ebcf16734a69a54613a18b33e"> 425</a></span> <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#aec0b2c6ebcf16734a69a54613a18b33e">CoreBitVector::CoreBitVectorIterator::operator*</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00426"></a><span class="lineno"> 426</span> <span class="keyword"></span>{</div><div class="line"><a name="l00427"></a><span class="lineno"> 427</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(!<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#ad3af46dcfb0e2846587eb5a71f38161f">atEnd</a>() && <span class="stringliteral">"CoreBitVectorIterator::*: dereferencing end!"</span>);</div><div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  <span class="keywordtype">size_t</span> wordsIndex = <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> - <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a>-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.begin();</div><div class="line"><a name="l00429"></a><span class="lineno"> 429</span>  <span class="comment">// Add where the bit vector starts (offset), with the number of bits</span></div><div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  <span class="comment">// in the passed words (the index encodes how many we have completely</span></div><div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  <span class="comment">// passed since it is position - 1) and the bit we are up to for the</span></div><div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  <span class="comment">// current word (i.e., in the n+1th)</span></div><div class="line"><a name="l00433"></a><span class="lineno"> 433</span>  <span class="keywordflow">return</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a>-><a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> + wordsIndex * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a> + <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a>;</div><div class="line"><a name="l00434"></a><span class="lineno"> 434</span> }</div><div class="line"><a name="l00435"></a><span class="lineno"> 435</span> </div><div class="line"><a name="l00436"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a7278c27a0ab2096b29a537a8afe0be5e"> 436</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a7278c27a0ab2096b29a537a8afe0be5e">CoreBitVector::CoreBitVectorIterator::operator==</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVectorIterator</a> &rhs)<span class="keyword"> const</span></div><div class="line"><a name="l00437"></a><span class="lineno"> 437</span> <span class="keyword"></span>{</div><div class="line"><a name="l00438"></a><span class="lineno"> 438</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a> == rhs.<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a> && <span class="stringliteral">"CoreBitVectorIterator::==: comparing iterators from different CBVs"</span>);</div><div class="line"><a name="l00439"></a><span class="lineno"> 439</span>  <span class="comment">// When we're at the end we don't care about bit.</span></div><div class="line"><a name="l00440"></a><span class="lineno"> 440</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> == <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a>-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end()) <span class="keywordflow">return</span> rhs.<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> == <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a>-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end();</div><div class="line"><a name="l00441"></a><span class="lineno"> 441</span>  <span class="keywordflow">return</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> == rhs.<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> && <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a> == rhs.<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a>;</div><div class="line"><a name="l00442"></a><span class="lineno"> 442</span> }</div><div class="line"><a name="l00443"></a><span class="lineno"> 443</span> </div><div class="line"><a name="l00444"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#aebdb5ddb9b50704f83dc924b7bfac74c"> 444</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#aebdb5ddb9b50704f83dc924b7bfac74c">CoreBitVector::CoreBitVectorIterator::operator!=</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVectorIterator</a> &rhs)<span class="keyword"> const</span></div><div class="line"><a name="l00445"></a><span class="lineno"> 445</span> <span class="keyword"></span>{</div><div class="line"><a name="l00446"></a><span class="lineno"> 446</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a> == rhs.<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a> && <span class="stringliteral">"CoreBitVectorIterator::!=: comparing iterators from different CBVs"</span>);</div><div class="line"><a name="l00447"></a><span class="lineno"> 447</span>  <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == rhs);</div><div class="line"><a name="l00448"></a><span class="lineno"> 448</span> }</div><div class="line"><a name="l00449"></a><span class="lineno"> 449</span> </div><div class="line"><a name="l00450"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#ad3af46dcfb0e2846587eb5a71f38161f"> 450</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#ad3af46dcfb0e2846587eb5a71f38161f">CoreBitVector::CoreBitVectorIterator::atEnd</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00451"></a><span class="lineno"> 451</span> <span class="keyword"></span>{</div><div class="line"><a name="l00452"></a><span class="lineno"> 452</span>  <span class="keywordflow">return</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> == <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a>-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end();</div><div class="line"><a name="l00453"></a><span class="lineno"> 453</span> }</div><div class="line"><a name="l00454"></a><span class="lineno"> 454</span> </div><div class="line"><a name="l00455"></a><span class="lineno"> 455</span> }; <span class="comment">// namespace SVF</span></div><div class="ttc" id="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator_html_a853b685cf022839c183df46f1cafe638"><div class="ttname"><a href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">SVF::CoreBitVector::CoreBitVectorIterator::bit</a></div><div class="ttdeci">u32_t bit</div><div class="ttdef"><b>Definition:</b> <a href="CoreBitVector_8h_source.html#l00193">CoreBitVector.h:193</a></div></div>
|
|
69
|
+
<a href="CoreBitVector_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">//===- CoreBitVector.cpp -- Dynamically sized bit vector data structure ------------//</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> </div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">/*</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * CoreBitVector.h</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * Contiguous bit vector which resizes as required by common operations (implementation).</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * Created on: Jan 31, 2021</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> * Author: Mohamad Barbar</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> */</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> </div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#include <limits.h></span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="preprocessor">#include <llvm/Support/MathExtras.h></span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#include "<a class="code" href="CoreBitVector_8h.html">Util/CoreBitVector.h</a>"</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include "<a class="code" href="SVFBasicTypes_8h.html">Util/SVFBasicTypes.h</a>"</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#include "<a class="code" href="SVFUtil_8h.html">Util/SVFUtil.h</a>"</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> </div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="keyword">namespace </span><a class="code" href="namespaceSVF.html">SVF</a></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> {</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">CoreBitVector::WordSize</a> = <span class="keyword">sizeof</span>(Word) * CHAR_BIT;</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#adb5b13df8bc76f00ceb145711cfb77e1"> 24</a></span> <a class="code" href="classSVF_1_1CoreBitVector.html#adb5b13df8bc76f00ceb145711cfb77e1">CoreBitVector::CoreBitVector</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  : <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a>(0) { }</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#aa25de5d26935c74e156c5f6604b3d8a8"> 27</a></span> <a class="code" href="classSVF_1_1CoreBitVector.html#adb5b13df8bc76f00ceb145711cfb77e1">CoreBitVector::CoreBitVector</a>(<span class="keywordtype">size_t</span> <a class="code" href="cJSON_8cpp.html#ab6e2ea6dc7bd57d1483413449998230a">n</a>)</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  : <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>(0), <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>(n, 0) { }</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a57b3db689583b652ab1426c04a66c4ae"> 30</a></span> <a class="code" href="classSVF_1_1CoreBitVector.html#adb5b13df8bc76f00ceb145711cfb77e1">CoreBitVector::CoreBitVector</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &cbv)</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  : <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>(cbv.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>), <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>(cbv.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>) { }</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a93f42d767c99bdf788dc4df4881751c5"> 33</a></span> <a class="code" href="classSVF_1_1CoreBitVector.html#adb5b13df8bc76f00ceb145711cfb77e1">CoreBitVector::CoreBitVector</a>(<a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &&cbv)</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  : <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>(cbv.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>), <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>(<a class="code" href="namespacestd.html">std</a>::<a class="code" href="namespaceSVF_1_1SVFUtil.html#a72502f7f536418621485e90ab98c2016">move</a>(cbv.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>)) { }</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a3594d997fba0aa6201855199a884d98d"> 36</a></span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &<a class="code" href="classSVF_1_1CoreBitVector.html#a3594d997fba0aa6201855199a884d98d">CoreBitVector::operator=</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> {</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  this-><a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> = rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  this-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a> = rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> }</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> </div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#ae14cc9ce0abbad20636c51e6ca781305"> 43</a></span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &<a class="code" href="classSVF_1_1CoreBitVector.html#a3594d997fba0aa6201855199a884d98d">CoreBitVector::operator=</a>(<a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &&rhs)</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> {</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  this-><a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> = rhs.offset;</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  this-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a> = <a class="code" href="namespaceSVF_1_1SVFUtil.html#a72502f7f536418621485e90ab98c2016">std::move</a>(rhs.words);</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> }</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a98b9795b4fdc74d9d2efa9a3f2ecb62f"> 50</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a98b9795b4fdc74d9d2efa9a3f2ecb62f">CoreBitVector::empty</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="keyword"></span>{</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> &w : <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>) <span class="keywordflow">if</span> (w) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> }</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#abfed2e7daf2407e11cade625ac19a6ce"> 56</a></span> <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> <a class="code" href="classSVF_1_1CoreBitVector.html#abfed2e7daf2407e11cade625ac19a6ce">CoreBitVector::count</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="keyword"></span>{</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> <a class="code" href="cJSON_8cpp.html#ab6e2ea6dc7bd57d1483413449998230a">n</a> = 0;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> &w : <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>) n += llvm::countPopulation(w);</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keywordflow">return</span> <a class="code" href="cJSON_8cpp.html#ab6e2ea6dc7bd57d1483413449998230a">n</a>;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> }</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> </div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a1e523bab1013a9f3e9eaea56e53afa58"> 63</a></span> <span class="keywordtype">void</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a1e523bab1013a9f3e9eaea56e53afa58">CoreBitVector::clear</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> {</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> = 0;</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.clear();</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.shrink_to_fit();</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> }</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a7b20ffd3cd4a0ffc48a1348f657deaa0"> 70</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a7b20ffd3cd4a0ffc48a1348f657deaa0">CoreBitVector::test</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)<span class="keyword"> const</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="keyword"></span>{</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keywordflow">if</span> (bit < offset || bit >= <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> + <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> &containingWord = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[(bit - <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>];</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> mask = (<a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a>)0b1 << (bit % <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>);</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keywordflow">return</span> mask & containingWord;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> }</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> </div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a3299b296d20d2b76c6538ba51a684972"> 78</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a3299b296d20d2b76c6538ba51a684972">CoreBitVector::test_and_set</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> {</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <span class="comment">// TODO: can be faster.</span></div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector.html#a7b20ffd3cd4a0ffc48a1348f657deaa0">test</a>(bit)) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <span class="keyword">set</span>(bit);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> }</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> </div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a553e3e51bffe1aab04adc047e0fd3f24"> 86</a></span> <span class="keywordtype">void</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a553e3e51bffe1aab04adc047e0fd3f24">CoreBitVector::set</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> {</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a73e5b15854f4f56f50992ed0d0cc7349">extendTo</a>(bit);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> &containingWord = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[(bit - <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>];</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> mask = (<a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a>)0b1 << (bit % <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>);</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  containingWord |= mask;</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span> }</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> </div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a42fc777d574db4ef23b02308b944a85b"> 95</a></span> <span class="keywordtype">void</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a42fc777d574db4ef23b02308b944a85b">CoreBitVector::reset</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> {</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordflow">if</span> (bit < offset || bit >= <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> + <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> &containingWord = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[(bit - <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>];</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> mask = ~((<a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a>)0b1 << (bit % <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>));</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  containingWord &= mask;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> }</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> </div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#af08c16aed45dfa65472f0b5ae518add2"> 103</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#af08c16aed45dfa65472f0b5ae518add2">CoreBitVector::contains</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)<span class="keyword"> const</span></div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> <span class="keyword"></span>{</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> tmp(*<span class="keyword">this</span>);</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  tmp &= rhs;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keywordflow">return</span> tmp == rhs;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span> }</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span> </div><div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a15be4ce7e9a07d9b01da0c60d51b22de"> 110</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a15be4ce7e9a07d9b01da0c60d51b22de">CoreBitVector::intersects</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)<span class="keyword"> const</span></div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="keyword"></span>{</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="comment">// TODO: want some common iteration method.</span></div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector.html#a98b9795b4fdc74d9d2efa9a3f2ecb62f">empty</a>() && rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a98b9795b4fdc74d9d2efa9a3f2ecb62f">empty</a>()) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> </div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &earlierOffsetCBV = <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> <= rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> ? *this : rhs;</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &laterOffsetCBV = <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> <= rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> ? rhs : *<span class="keyword">this</span>;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> </div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordtype">size_t</span> earlierOffset = (<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> < rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> ? <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> : rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="keywordtype">size_t</span> laterOffset = (<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> > rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> ? <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> : rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  laterOffset -= earlierOffset;</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> </div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> *eWords = &earlierOffsetCBV.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[0];</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> eSize = earlierOffsetCBV.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size();</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> *lWords = &laterOffsetCBV.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[0];</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> lSize = laterOffsetCBV.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size();</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span> </div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="keywordtype">size_t</span> e = 0;</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="keywordflow">for</span> ( ; e != laterOffset && e != eSize; ++e) { }</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span> </div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keywordtype">size_t</span> l = 0;</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="keywordflow">for</span> ( ; e != eSize && l != lSize; ++e, ++l)</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  {</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="keywordflow">if</span> (eWords[e] & lWords[l]) <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  }</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span> </div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span> }</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span> </div><div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a0ddd7fc5e043d36f3c62c2fb93b22684"> 139</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a0ddd7fc5e043d36f3c62c2fb93b22684">CoreBitVector::operator==</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)<span class="keyword"> const</span></div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span> <span class="keyword"></span>{</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keywordflow">if</span> (<span class="keyword">this</span> == &rhs) <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span> </div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <span class="comment">// TODO: maybe a simple equal offset, equal size path?</span></div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span> </div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keywordtype">size_t</span> lhsSetIndex = <a class="code" href="classSVF_1_1CoreBitVector.html#a087f69adea5e9e83bd908a1ab0ee1383">nextSetIndex</a>(0);</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="keywordtype">size_t</span> rhsSetIndex = rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a087f69adea5e9e83bd908a1ab0ee1383">nextSetIndex</a>(0);</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="comment">// Iterate comparing only words with set bits, if there is ever a mismatch,</span></div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="comment">// then the bit-vectors aren't equal.</span></div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="keywordflow">while</span> (lhsSetIndex < <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() && rhsSetIndex < rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size())</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  {</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="comment">// If the first bit is not the same in the word or words are different,</span></div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="comment">// then we have a mismatch.</span></div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="keywordflow">if</span> (lhsSetIndex * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a> + <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> != rhsSetIndex * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a> + rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a></div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  || <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[lhsSetIndex] != rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[rhsSetIndex])</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  {</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  }</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span> </div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  lhsSetIndex = <a class="code" href="classSVF_1_1CoreBitVector.html#a087f69adea5e9e83bd908a1ab0ee1383">nextSetIndex</a>(lhsSetIndex + 1);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  rhsSetIndex = rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a087f69adea5e9e83bd908a1ab0ee1383">nextSetIndex</a>(rhsSetIndex + 1);</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  }</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span> </div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="comment">// Make sure both got to the end at the same time.</span></div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="keywordflow">return</span> lhsSetIndex >= <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() && rhsSetIndex >= rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size();</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span> }</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span> </div><div class="line"><a name="l00167"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#af142d3bb07e77c28bba6ece5b5b13f51"> 167</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#af142d3bb07e77c28bba6ece5b5b13f51">CoreBitVector::operator!=</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)<span class="keyword"> const</span></div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span> <span class="keyword"></span>{</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == rhs);</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span> }</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span> </div><div class="line"><a name="l00172"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#af8e63360242a49fb63c3ef3d7071503d"> 172</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#af8e63360242a49fb63c3ef3d7071503d">CoreBitVector::operator|=</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span> {</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() == 0)</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  {</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  *<span class="keyword">this</span> = rhs;</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keywordflow">return</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() != 0;</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  }</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span> </div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="keywordflow">if</span> (rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() == 0) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span> </div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <span class="keywordflow">if</span> (<span class="keyword">this</span> == &rhs) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span> </div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <span class="comment">// TODO: some redundancy in extendTo calls.</span></div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector.html#a8825e54f584be8aa0ff627335064244e">finalBit</a>() < rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a8825e54f584be8aa0ff627335064244e">finalBit</a>()) <a class="code" href="classSVF_1_1CoreBitVector.html#a5d3f1eb85bc388cb76c588b8d8b3c181">extendForward</a>(rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a8825e54f584be8aa0ff627335064244e">finalBit</a>());</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> > rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) <a class="code" href="classSVF_1_1CoreBitVector.html#ab6d789e3c68390a9026fd4f8c4cf344a">extendBackward</a>(rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>);</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span> </div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="comment">// Start counting this where rhs starts.</span></div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> thisIndex = <a class="code" href="classSVF_1_1CoreBitVector.html#ad73fca28bd4882eaa70817023a632d35">indexForBit</a>(rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>);</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  <span class="keywordtype">size_t</span> rhsIndex = 0;</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span> </div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="comment">// Only need to test against rhs's size since we extended this to hold rhs.</span></div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> *thisWords = &<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex];</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> *rhsWords = &rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[rhsIndex];</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> <a class="code" href="cJSON_8h.html#a9f237f17f4e79d5b89149e09152edabe">length</a> = rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size();</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> changed = 0;</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span> </div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="comment">// Can start counting from 0 because we took the addresses of both</span></div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <span class="comment">// word vectors at the correct index.</span></div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <span class="comment">// #pragma omp simd</span></div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0 ; i < <a class="code" href="cJSON_8h.html#a9f237f17f4e79d5b89149e09152edabe">length</a>; ++i)</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  {</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> oldWord = thisWords[i];</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <span class="comment">// Is there anything in rhs not in *this?</span></div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  thisWords[i] = thisWords[i] | rhsWords[i];</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  changed |= oldWord ^ thisWords[i];</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  }</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span> </div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="keywordflow">return</span> changed;</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span> }</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span> </div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#ae84257a1544b94c9abf5c8d0f6cfaec9">CoreBitVector::operator&=</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span> {</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <span class="comment">// The first bit this and rhs have in common is the greater of</span></div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="comment">// their offsets if the CBV with the smaller offset can hold</span></div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  <span class="comment">// the greater offset.</span></div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> greaterOffset = std::max(<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>, rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>);</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span> </div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="comment">// If there is no overlap, then clear this CBV.</span></div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <span class="keywordflow">if</span> (!<a class="code" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486">canHold</a>(greaterOffset) || !rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486">canHold</a>(greaterOffset))</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  {</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="keywordtype">bool</span> changed = <span class="keyword">false</span>;</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size(); ++i)</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  {</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keywordflow">if</span> (!changed) changed = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[i] != 0;</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[i] = 0;</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  }</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span> </div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  <span class="keywordflow">return</span> changed;</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  }</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span> </div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <span class="keywordtype">bool</span> changed = <span class="keyword">false</span>;</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  <span class="keywordtype">size_t</span> thisIndex = <a class="code" href="classSVF_1_1CoreBitVector.html#ad73fca28bd4882eaa70817023a632d35">indexForBit</a>(greaterOffset);</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  <span class="keywordtype">size_t</span> rhsIndex = rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#ad73fca28bd4882eaa70817023a632d35">indexForBit</a>(greaterOffset);</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span> </div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <span class="comment">// Clear everything before the overlapping part.</span></div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < thisIndex; ++i)</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  {</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <span class="keywordflow">if</span> (!changed) changed = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[i] != 0;</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[i] = 0;</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  }</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span> </div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> oldWord;</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  <span class="keywordflow">for</span> ( ; thisIndex < <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() && rhsIndex < rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size(); ++thisIndex, ++rhsIndex)</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  {</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  <span class="keywordflow">if</span> (!changed) oldWord = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex];</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex] &= rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[rhsIndex];</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="keywordflow">if</span> (!changed) changed = oldWord != <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex];</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  }</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span> </div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <span class="comment">// Clear the remaining bits with no rhs analogue.</span></div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  <span class="keywordflow">for</span> ( ; thisIndex < <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size(); ++thisIndex)</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  {</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <span class="keywordflow">if</span> (!changed && <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex] != 0) changed = <span class="keyword">true</span>;</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex] = 0;</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  }</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span> </div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  <span class="keywordflow">return</span> changed;</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span> }</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span> </div><div class="line"><a name="l00261"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a5b87ae9d4a713483522666c893d7eac9"> 261</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a5b87ae9d4a713483522666c893d7eac9">CoreBitVector::operator-=</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span> {</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="comment">// Similar to |= in that we only iterate over rhs within this, but we</span></div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  <span class="comment">// don't need to extend anything since nothing from rhs is being added.</span></div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> greaterOffset = std::max(<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>, rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>);</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  <span class="comment">// TODO: calling twice.</span></div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  <span class="comment">// No overlap if either cannot hold the greater offset.</span></div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  <span class="keywordflow">if</span> (!<a class="code" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486">canHold</a>(greaterOffset) || !rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486">canHold</a>(greaterOffset)) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span> </div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  <span class="keywordtype">bool</span> changed = <span class="keyword">false</span>;</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  <span class="keywordtype">size_t</span> thisIndex = <a class="code" href="classSVF_1_1CoreBitVector.html#ad73fca28bd4882eaa70817023a632d35">indexForBit</a>(greaterOffset);</div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  <span class="keywordtype">size_t</span> rhsIndex = rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#ad73fca28bd4882eaa70817023a632d35">indexForBit</a>(greaterOffset);</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> oldWord;</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  <span class="keywordflow">for</span> ( ; thisIndex < <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() && rhsIndex < rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size(); ++thisIndex, ++rhsIndex)</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  {</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  <span class="keywordflow">if</span> (!changed) oldWord = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex];</div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex] &= ~rhs.<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[rhsIndex];</div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  <span class="keywordflow">if</span> (!changed) changed = oldWord != <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[thisIndex];</div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  }</div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span> </div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  <span class="keywordflow">return</span> changed;</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span> }</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span> </div><div class="line"><a name="l00284"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a8ba857b68282055e485c441892e39b9b"> 284</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a8ba857b68282055e485c441892e39b9b">CoreBitVector::intersectWithComplement</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)</div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span> {</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span> -= rhs;</div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span> }</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span> </div><div class="line"><a name="l00289"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a79121882bc302b9b9188fa0a51c63fb6"> 289</a></span> <span class="keywordtype">void</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a8ba857b68282055e485c441892e39b9b">CoreBitVector::intersectWithComplement</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &lhs, <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> &rhs)</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span> {</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  <span class="comment">// TODO: inefficient!</span></div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  *<span class="keyword">this</span> = lhs;</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a8ba857b68282055e485c441892e39b9b">intersectWithComplement</a>(rhs);</div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span> }</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span> </div><div class="line"><a name="l00296"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#af979ecb48d3d5296bce5bd0b4676e359"> 296</a></span> <span class="keywordtype">size_t</span> <a class="code" href="classSVF_1_1CoreBitVector.html#af979ecb48d3d5296bce5bd0b4676e359">CoreBitVector::hash</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span> <span class="keyword"></span>{</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  <span class="comment">// From https://stackoverflow.com/a/27216842</span></div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <span class="keywordtype">size_t</span> h = <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size();</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a> &w : <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>)</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  {</div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  h ^= w + 0x9e3779b9 + (h << 6) + (h >> 2);</div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  }</div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span> </div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  <span class="keywordflow">return</span> h + <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>;</div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span> }</div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span> </div><div class="line"><a name="l00308"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a93cdd9890522cc9fee2451567e0b1f0d"> 308</a></span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVector::const_iterator</a> <a class="code" href="classSVF_1_1CoreBitVector.html#a93cdd9890522cc9fee2451567e0b1f0d">CoreBitVector::end</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span> <span class="keyword"></span>{</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  <span class="keywordflow">return</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVectorIterator</a>(<span class="keyword">this</span>, <span class="keyword">true</span>);</div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span> }</div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span> </div><div class="line"><a name="l00313"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a835bf11a1f698942db8e6bdadbbfd1f3"> 313</a></span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVector::const_iterator</a> <a class="code" href="classSVF_1_1CoreBitVector.html#a835bf11a1f698942db8e6bdadbbfd1f3">CoreBitVector::begin</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span> <span class="keyword"></span>{</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  <span class="keywordflow">return</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVectorIterator</a>(<span class="keyword">this</span>);</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span> }</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span> </div><div class="line"><a name="l00318"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#ab6d789e3c68390a9026fd4f8c4cf344a"> 318</a></span> <span class="keywordtype">void</span> <a class="code" href="classSVF_1_1CoreBitVector.html#ab6d789e3c68390a9026fd4f8c4cf344a">CoreBitVector::extendBackward</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span> {</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  <span class="comment">// New offset is the starting bit of the word which contains bit.</span></div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> newOffset = (bit / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>) * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span> </div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  <span class="comment">// TODO: maybe assertions?</span></div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  <span class="comment">// Check if bit can already be included in this BV or if it's extendForward's problem.</span></div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  <span class="keywordflow">if</span> (newOffset >= <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span> </div><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.insert(<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.begin(), (<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> - newOffset) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>, 0);</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> = newOffset;</div><div class="line"><a name="l00329"></a><span class="lineno"> 329</span> }</div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span> </div><div class="line"><a name="l00331"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a5d3f1eb85bc388cb76c588b8d8b3c181"> 331</a></span> <span class="keywordtype">void</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a5d3f1eb85bc388cb76c588b8d8b3c181">CoreBitVector::extendForward</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)</div><div class="line"><a name="l00332"></a><span class="lineno"> 332</span> {</div><div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  <span class="comment">// TODO: maybe assertions?</span></div><div class="line"><a name="l00334"></a><span class="lineno"> 334</span>  <span class="comment">// Not our problem; extendBackward's problem, or there is nothing to do.</span></div><div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  <span class="keywordflow">if</span> (bit < <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> || <a class="code" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486">canHold</a>(bit)) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00336"></a><span class="lineno"> 336</span> </div><div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  <span class="comment">// Starting bit of word which would contain bit.</span></div><div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bitsWord = (bit / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>) * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span> </div><div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  <span class="comment">// Add 1 to represent the final word starting at bitsWord.</span></div><div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> wordsToAdd = 1 + (bitsWord - <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a> - <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.insert(<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end(), wordsToAdd, 0);</div><div class="line"><a name="l00343"></a><span class="lineno"> 343</span> }</div><div class="line"><a name="l00344"></a><span class="lineno"> 344</span> </div><div class="line"><a name="l00345"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a73e5b15854f4f56f50992ed0d0cc7349"> 345</a></span> <span class="keywordtype">void</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a73e5b15854f4f56f50992ed0d0cc7349">CoreBitVector::extendTo</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)</div><div class="line"><a name="l00346"></a><span class="lineno"> 346</span> {</div><div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> == 0 && <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() == 0)</div><div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  {</div><div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> = (bit / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>) * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.push_back(0);</div><div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  }</div><div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (bit < <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) <a class="code" href="classSVF_1_1CoreBitVector.html#ab6d789e3c68390a9026fd4f8c4cf344a">extendBackward</a>(bit);</div><div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (bit >= <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> + <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>) <a class="code" href="classSVF_1_1CoreBitVector.html#a5d3f1eb85bc388cb76c588b8d8b3c181">extendForward</a>(bit);</div><div class="line"><a name="l00354"></a><span class="lineno"> 354</span> }</div><div class="line"><a name="l00355"></a><span class="lineno"> 355</span> </div><div class="line"><a name="l00356"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#ad73fca28bd4882eaa70817023a632d35"> 356</a></span> <span class="keywordtype">size_t</span> <a class="code" href="classSVF_1_1CoreBitVector.html#ad73fca28bd4882eaa70817023a632d35">CoreBitVector::indexForBit</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)<span class="keyword"> const</span></div><div class="line"><a name="l00357"></a><span class="lineno"> 357</span> <span class="keyword"></span>{</div><div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<a class="code" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486">canHold</a>(bit));</div><div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  <span class="comment">// Recall, offset (and the bits in that word) are represented by words[0],</span></div><div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  <span class="comment">// so solve (offset + x) / WordSize == 0... x == -offset.</span></div><div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  <span class="keywordflow">return</span> (bit - <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a>) / <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00362"></a><span class="lineno"> 362</span> }</div><div class="line"><a name="l00363"></a><span class="lineno"> 363</span> </div><div class="line"><a name="l00364"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486"> 364</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a3c85fd2084e52df869cb8fcf2dab6486">CoreBitVector::canHold</a>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> bit)<span class="keyword"> const</span></div><div class="line"><a name="l00365"></a><span class="lineno"> 365</span> <span class="keyword"></span>{</div><div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  <span class="keywordflow">return</span> bit >= <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> && bit < <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> + <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a>;</div><div class="line"><a name="l00367"></a><span class="lineno"> 367</span> }</div><div class="line"><a name="l00368"></a><span class="lineno"> 368</span> </div><div class="line"><a name="l00369"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a8825e54f584be8aa0ff627335064244e"> 369</a></span> <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> <a class="code" href="classSVF_1_1CoreBitVector.html#a8825e54f584be8aa0ff627335064244e">CoreBitVector::finalBit</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00370"></a><span class="lineno"> 370</span> <span class="keyword"></span>{</div><div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  <span class="keywordflow">return</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> + <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size() * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a> - 1;</div><div class="line"><a name="l00372"></a><span class="lineno"> 372</span> }</div><div class="line"><a name="l00373"></a><span class="lineno"> 373</span> </div><div class="line"><a name="l00374"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector.html#a087f69adea5e9e83bd908a1ab0ee1383"> 374</a></span> <span class="keywordtype">size_t</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a087f69adea5e9e83bd908a1ab0ee1383">CoreBitVector::nextSetIndex</a>(<span class="keyword">const</span> <span class="keywordtype">size_t</span> start)<span class="keyword"> const</span></div><div class="line"><a name="l00375"></a><span class="lineno"> 375</span> <span class="keyword"></span>{</div><div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  <span class="keywordtype">size_t</span> <a class="code" href="cJSON_8h.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a> = start;</div><div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  <span class="keywordflow">for</span> ( ; index < <a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.size(); ++<a class="code" href="cJSON_8h.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a>)</div><div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  {</div><div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[index]) <span class="keywordflow">break</span>;</div><div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  }</div><div class="line"><a name="l00381"></a><span class="lineno"> 381</span> </div><div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  <span class="keywordflow">return</span> <a class="code" href="cJSON_8h.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a>;</div><div class="line"><a name="l00383"></a><span class="lineno"> 383</span> }</div><div class="line"><a name="l00384"></a><span class="lineno"> 384</span> </div><div class="line"><a name="l00385"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#ae209179f396c8b5b788ff6d2c437e5d6"> 385</a></span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#abe0289ad45158397b6950afc920f34ef">CoreBitVector::CoreBitVectorIterator::CoreBitVectorIterator</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector.html">CoreBitVector</a> *cbv, <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector.html#a93cdd9890522cc9fee2451567e0b1f0d">end</a>)</div><div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  : cbv(cbv), bit(0)</div><div class="line"><a name="l00387"></a><span class="lineno"> 387</span> {</div><div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> = end ? cbv-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end() : cbv-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.begin();</div><div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  <span class="comment">// If user didn't request an end iterator, or words is non-empty,</span></div><div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  <span class="comment">// from 0, go to the next bit. But if the 0 bit is set, we don't</span></div><div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  <span class="comment">// need to because that is the first element.</span></div><div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> != cbv-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end() && !(cbv-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>[0] & (<a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a>)0b1)) ++(*<span class="keyword">this</span>);</div><div class="line"><a name="l00393"></a><span class="lineno"> 393</span> }</div><div class="line"><a name="l00394"></a><span class="lineno"> 394</span> </div><div class="line"><a name="l00395"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0afff5162af357634e7213e85b5371c7"> 395</a></span> <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVector::CoreBitVectorIterator</a> &<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0afff5162af357634e7213e85b5371c7">CoreBitVector::CoreBitVectorIterator::operator++</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00396"></a><span class="lineno"> 396</span> {</div><div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(!<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#ad3af46dcfb0e2846587eb5a71f38161f">atEnd</a>() && <span class="stringliteral">"CoreBitVectorIterator::++(pre): incrementing past end!"</span>);</div><div class="line"><a name="l00398"></a><span class="lineno"> 398</span> </div><div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  ++<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a>;</div><div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  <span class="comment">// Check if no more bits in wordIt. Find word with a bit set.</span></div><div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a> == <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a> || (*<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> >> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a>) == 0)</div><div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  {</div><div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a> = 0;</div><div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  ++<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a>;</div><div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  <span class="keywordflow">while</span> (<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> != <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a>-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end() && *<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> == 0) ++<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a>;</div><div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  }</div><div class="line"><a name="l00407"></a><span class="lineno"> 407</span> </div><div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  <span class="comment">// Find set bit if we're not at the end.</span></div><div class="line"><a name="l00409"></a><span class="lineno"> 409</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> != <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a>-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end())</div><div class="line"><a name="l00410"></a><span class="lineno"> 410</span>  {</div><div class="line"><a name="l00411"></a><span class="lineno"> 411</span>  <span class="keywordflow">while</span> (<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a> != <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a> && (*<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> & ((<a class="code" href="classSVF_1_1CoreBitVector.html#aaee26ffc13d05cd57f0fd7e4c2ea875c">Word</a>)0b1 << <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a>)) == 0) ++<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a>;</div><div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  }</div><div class="line"><a name="l00413"></a><span class="lineno"> 413</span> </div><div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00415"></a><span class="lineno"> 415</span> }</div><div class="line"><a name="l00416"></a><span class="lineno"> 416</span> </div><div class="line"><a name="l00417"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a943e3e32d7bf7c585ee841f2663992e8"> 417</a></span> <span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVector::CoreBitVectorIterator</a> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0afff5162af357634e7213e85b5371c7">CoreBitVector::CoreBitVectorIterator::operator++</a>(<span class="keywordtype">int</span>)</div><div class="line"><a name="l00418"></a><span class="lineno"> 418</span> {</div><div class="line"><a name="l00419"></a><span class="lineno"> 419</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(!<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#ad3af46dcfb0e2846587eb5a71f38161f">atEnd</a>() && <span class="stringliteral">"CoreBitVectorIterator::++(pre): incrementing past end!"</span>);</div><div class="line"><a name="l00420"></a><span class="lineno"> 420</span>  <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVectorIterator</a> old = *<span class="keyword">this</span>;</div><div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  ++*<span class="keyword">this</span>;</div><div class="line"><a name="l00422"></a><span class="lineno"> 422</span>  <span class="keywordflow">return</span> old;</div><div class="line"><a name="l00423"></a><span class="lineno"> 423</span> }</div><div class="line"><a name="l00424"></a><span class="lineno"> 424</span> </div><div class="line"><a name="l00425"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#aec0b2c6ebcf16734a69a54613a18b33e"> 425</a></span> <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#aec0b2c6ebcf16734a69a54613a18b33e">CoreBitVector::CoreBitVectorIterator::operator*</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00426"></a><span class="lineno"> 426</span> <span class="keyword"></span>{</div><div class="line"><a name="l00427"></a><span class="lineno"> 427</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(!<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#ad3af46dcfb0e2846587eb5a71f38161f">atEnd</a>() && <span class="stringliteral">"CoreBitVectorIterator::*: dereferencing end!"</span>);</div><div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  <span class="keywordtype">size_t</span> wordsIndex = <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> - <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a>-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.begin();</div><div class="line"><a name="l00429"></a><span class="lineno"> 429</span>  <span class="comment">// Add where the bit vector starts (offset), with the number of bits</span></div><div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  <span class="comment">// in the passed words (the index encodes how many we have completely</span></div><div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  <span class="comment">// passed since it is position - 1) and the bit we are up to for the</span></div><div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  <span class="comment">// current word (i.e., in the n+1th)</span></div><div class="line"><a name="l00433"></a><span class="lineno"> 433</span>  <span class="keywordflow">return</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a>-><a class="code" href="classSVF_1_1CoreBitVector.html#a79dfa9f4c2efb6a0a2de18c6359c41bd">offset</a> + wordsIndex * <a class="code" href="classSVF_1_1CoreBitVector.html#a63f5e4a36359ae62401e5f8dfecb86a3">WordSize</a> + <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a>;</div><div class="line"><a name="l00434"></a><span class="lineno"> 434</span> }</div><div class="line"><a name="l00435"></a><span class="lineno"> 435</span> </div><div class="line"><a name="l00436"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a7278c27a0ab2096b29a537a8afe0be5e"> 436</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a7278c27a0ab2096b29a537a8afe0be5e">CoreBitVector::CoreBitVectorIterator::operator==</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVectorIterator</a> &rhs)<span class="keyword"> const</span></div><div class="line"><a name="l00437"></a><span class="lineno"> 437</span> <span class="keyword"></span>{</div><div class="line"><a name="l00438"></a><span class="lineno"> 438</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a> == rhs.<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a> && <span class="stringliteral">"CoreBitVectorIterator::==: comparing iterators from different CBVs"</span>);</div><div class="line"><a name="l00439"></a><span class="lineno"> 439</span>  <span class="comment">// When we're at the end we don't care about bit.</span></div><div class="line"><a name="l00440"></a><span class="lineno"> 440</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> == <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a>-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end()) <span class="keywordflow">return</span> rhs.<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> == <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a>-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end();</div><div class="line"><a name="l00441"></a><span class="lineno"> 441</span>  <span class="keywordflow">return</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> == rhs.<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> && <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a> == rhs.<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">bit</a>;</div><div class="line"><a name="l00442"></a><span class="lineno"> 442</span> }</div><div class="line"><a name="l00443"></a><span class="lineno"> 443</span> </div><div class="line"><a name="l00444"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#aebdb5ddb9b50704f83dc924b7bfac74c"> 444</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#aebdb5ddb9b50704f83dc924b7bfac74c">CoreBitVector::CoreBitVectorIterator::operator!=</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html">CoreBitVectorIterator</a> &rhs)<span class="keyword"> const</span></div><div class="line"><a name="l00445"></a><span class="lineno"> 445</span> <span class="keyword"></span>{</div><div class="line"><a name="l00446"></a><span class="lineno"> 446</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a> == rhs.<a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a> && <span class="stringliteral">"CoreBitVectorIterator::!=: comparing iterators from different CBVs"</span>);</div><div class="line"><a name="l00447"></a><span class="lineno"> 447</span>  <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == rhs);</div><div class="line"><a name="l00448"></a><span class="lineno"> 448</span> }</div><div class="line"><a name="l00449"></a><span class="lineno"> 449</span> </div><div class="line"><a name="l00450"></a><span class="lineno"><a class="line" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#ad3af46dcfb0e2846587eb5a71f38161f"> 450</a></span> <span class="keywordtype">bool</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#ad3af46dcfb0e2846587eb5a71f38161f">CoreBitVector::CoreBitVectorIterator::atEnd</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><a name="l00451"></a><span class="lineno"> 451</span> <span class="keyword"></span>{</div><div class="line"><a name="l00452"></a><span class="lineno"> 452</span>  <span class="keywordflow">return</span> <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a1afa1cb9e8377d3dab767aa4bfc713dc">wordIt</a> == <a class="code" href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">cbv</a>-><a class="code" href="classSVF_1_1CoreBitVector.html#a807283a917e845ef19c4962b1744e98b">words</a>.end();</div><div class="line"><a name="l00453"></a><span class="lineno"> 453</span> }</div><div class="line"><a name="l00454"></a><span class="lineno"> 454</span> </div><div class="line"><a name="l00455"></a><span class="lineno"> 455</span> }; <span class="comment">// namespace SVF</span></div><div class="ttc" id="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator_html_a853b685cf022839c183df46f1cafe638"><div class="ttname"><a href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a853b685cf022839c183df46f1cafe638">SVF::CoreBitVector::CoreBitVectorIterator::bit</a></div><div class="ttdeci">u32_t bit</div><div class="ttdef"><b>Definition:</b> <a href="CoreBitVector_8h_source.html#l00193">CoreBitVector.h:193</a></div></div>
|
|
70
70
|
<div class="ttc" id="classSVF_1_1CoreBitVector_html_a5b87ae9d4a713483522666c893d7eac9"><div class="ttname"><a href="classSVF_1_1CoreBitVector.html#a5b87ae9d4a713483522666c893d7eac9">SVF::CoreBitVector::operator-=</a></div><div class="ttdeci">bool operator-=(const CoreBitVector &rhs)</div><div class="ttdef"><b>Definition:</b> <a href="CoreBitVector_8cpp_source.html#l00261">CoreBitVector.cpp:261</a></div></div>
|
|
71
71
|
<div class="ttc" id="cJSON_8h_html_a750b5d744c39a06bfb13e6eb010e35d0"><div class="ttname"><a href="cJSON_8h.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a></div><div class="ttdeci">int index</div><div class="ttdef"><b>Definition:</b> <a href="cJSON_8h_source.html#l00170">cJSON.h:170</a></div></div>
|
|
72
72
|
<div class="ttc" id="classSVF_1_1CoreBitVector_html_a42fc777d574db4ef23b02308b944a85b"><div class="ttname"><a href="classSVF_1_1CoreBitVector.html#a42fc777d574db4ef23b02308b944a85b">SVF::CoreBitVector::reset</a></div><div class="ttdeci">void reset(u32_t bit)</div><div class="ttdoc">Resets bit in the CBV. </div><div class="ttdef"><b>Definition:</b> <a href="CoreBitVector_8cpp_source.html#l00095">CoreBitVector.cpp:95</a></div></div>
|
|
@@ -89,6 +89,7 @@ $(function() {
|
|
|
89
89
|
<div class="ttc" id="SVFBasicTypes_8h_html"><div class="ttname"><a href="SVFBasicTypes_8h.html">SVFBasicTypes.h</a></div></div>
|
|
90
90
|
<div class="ttc" id="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator_html_a0cba79551b56ed83dc45ab63619dc590"><div class="ttname"><a href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#a0cba79551b56ed83dc45ab63619dc590">SVF::CoreBitVector::CoreBitVectorIterator::cbv</a></div><div class="ttdeci">const CoreBitVector * cbv</div><div class="ttdoc">CoreBitVector we are iterating over. </div><div class="ttdef"><b>Definition:</b> <a href="CoreBitVector_8h_source.html#l00188">CoreBitVector.h:188</a></div></div>
|
|
91
91
|
<div class="ttc" id="cJSON_8cpp_html_ab6e2ea6dc7bd57d1483413449998230a"><div class="ttname"><a href="cJSON_8cpp.html#ab6e2ea6dc7bd57d1483413449998230a">n</a></div><div class="ttdeci">cJSON * n</div><div class="ttdef"><b>Definition:</b> <a href="cJSON_8cpp_source.html#l02558">cJSON.cpp:2558</a></div></div>
|
|
92
|
+
<div class="ttc" id="namespaceSVF_1_1SVFUtil_html_a72502f7f536418621485e90ab98c2016"><div class="ttname"><a href="namespaceSVF_1_1SVFUtil.html#a72502f7f536418621485e90ab98c2016">SVF::SVFUtil::move</a></div><div class="ttdeci">constexpr std::remove_reference< T >::type && move(T &&t) noexcept</div><div class="ttdef"><b>Definition:</b> <a href="SVFUtil_8h_source.html#l00729">SVFUtil.h:729</a></div></div>
|
|
92
93
|
<div class="ttc" id="classSVF_1_1CoreBitVector_html"><div class="ttname"><a href="classSVF_1_1CoreBitVector.html">SVF::CoreBitVector</a></div><div class="ttdef"><b>Definition:</b> <a href="CoreBitVector_8h_source.html#l00030">CoreBitVector.h:30</a></div></div>
|
|
93
94
|
<div class="ttc" id="classSVF_1_1CoreBitVector_html_a8825e54f584be8aa0ff627335064244e"><div class="ttname"><a href="classSVF_1_1CoreBitVector.html#a8825e54f584be8aa0ff627335064244e">SVF::CoreBitVector::finalBit</a></div><div class="ttdeci">u32_t finalBit(void) const</div><div class="ttdoc">Returns the last bit that this CBV can hold. </div><div class="ttdef"><b>Definition:</b> <a href="CoreBitVector_8cpp_source.html#l00369">CoreBitVector.cpp:369</a></div></div>
|
|
94
95
|
<div class="ttc" id="classSVF_1_1CoreBitVector_html_a7b20ffd3cd4a0ffc48a1348f657deaa0"><div class="ttname"><a href="classSVF_1_1CoreBitVector.html#a7b20ffd3cd4a0ffc48a1348f657deaa0">SVF::CoreBitVector::test</a></div><div class="ttdeci">bool test(u32_t bit) const</div><div class="ttdoc">Returns true if bit is set in this CBV. </div><div class="ttdef"><b>Definition:</b> <a href="CoreBitVector_8cpp_source.html#l00070">CoreBitVector.cpp:70</a></div></div>
|
|
@@ -109,7 +110,6 @@ $(function() {
|
|
|
109
110
|
<div class="ttc" id="classSVF_1_1CoreBitVector_html_ae84257a1544b94c9abf5c8d0f6cfaec9"><div class="ttname"><a href="classSVF_1_1CoreBitVector.html#ae84257a1544b94c9abf5c8d0f6cfaec9">SVF::CoreBitVector::operator &=</a></div><div class="ttdeci">bool operator &=(const CoreBitVector &rhs)</div></div>
|
|
110
111
|
<div class="ttc" id="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator_html_abe0289ad45158397b6950afc920f34ef"><div class="ttname"><a href="classSVF_1_1CoreBitVector_1_1CoreBitVectorIterator.html#abe0289ad45158397b6950afc920f34ef">SVF::CoreBitVector::CoreBitVectorIterator::CoreBitVectorIterator</a></div><div class="ttdeci">CoreBitVectorIterator(void)=delete</div></div>
|
|
111
112
|
<div class="ttc" id="classSVF_1_1CoreBitVector_html_af8e63360242a49fb63c3ef3d7071503d"><div class="ttname"><a href="classSVF_1_1CoreBitVector.html#af8e63360242a49fb63c3ef3d7071503d">SVF::CoreBitVector::operator|=</a></div><div class="ttdeci">bool operator|=(const CoreBitVector &rhs)</div><div class="ttdef"><b>Definition:</b> <a href="CoreBitVector_8cpp_source.html#l00172">CoreBitVector.cpp:172</a></div></div>
|
|
112
|
-
<div class="ttc" id="namespaceSVF_1_1SVFUtil_html_ac5ca4c51589285ed63b2902471e5594b"><div class="ttname"><a href="namespaceSVF_1_1SVFUtil.html#ac5ca4c51589285ed63b2902471e5594b">SVF::SVFUtil::move</a></div><div class="ttdeci">constexpr std::remove_reference< T >::type && move(T &t) noexcept</div><div class="ttdef"><b>Definition:</b> <a href="SVFUtil_8h_source.html#l00729">SVFUtil.h:729</a></div></div>
|
|
113
113
|
<div class="ttc" id="classSVF_1_1CoreBitVector_html_abfed2e7daf2407e11cade625ac19a6ce"><div class="ttname"><a href="classSVF_1_1CoreBitVector.html#abfed2e7daf2407e11cade625ac19a6ce">SVF::CoreBitVector::count</a></div><div class="ttdeci">u32_t count(void) const</div><div class="ttdoc">Returns number of bits set. </div><div class="ttdef"><b>Definition:</b> <a href="CoreBitVector_8cpp_source.html#l00056">CoreBitVector.cpp:56</a></div></div>
|
|
114
114
|
<div class="ttc" id="classSVF_1_1CoreBitVector_html_a8ba857b68282055e485c441892e39b9b"><div class="ttname"><a href="classSVF_1_1CoreBitVector.html#a8ba857b68282055e485c441892e39b9b">SVF::CoreBitVector::intersectWithComplement</a></div><div class="ttdeci">bool intersectWithComplement(const CoreBitVector &rhs)</div><div class="ttdef"><b>Definition:</b> <a href="CoreBitVector_8cpp_source.html#l00284">CoreBitVector.cpp:284</a></div></div>
|
|
115
115
|
<div class="ttc" id="classSVF_1_1CoreBitVector_html_af979ecb48d3d5296bce5bd0b4676e359"><div class="ttname"><a href="classSVF_1_1CoreBitVector.html#af979ecb48d3d5296bce5bd0b4676e359">SVF::CoreBitVector::hash</a></div><div class="ttdeci">size_t hash(void) const</div><div class="ttdoc">Hash for this CBV. </div><div class="ttdef"><b>Definition:</b> <a href="CoreBitVector_8cpp_source.html#l00296">CoreBitVector.cpp:296</a></div></div>
|