|
|
|
|
@@ -3,7 +3,7 @@
|
|
|
|
|
<head>
|
|
|
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
|
|
|
<meta name="generator" content="Doxygen 1.9.2"/>
|
|
|
|
|
<meta name="generator" content="Doxygen 1.9.3"/>
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
|
|
|
<title>Algorithms_in_C++: probability::windowed_median::WindowedMedian Class Reference</title>
|
|
|
|
|
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
|
|
|
|
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
|
|
|
|
<div id="titlearea">
|
|
|
|
|
<table cellspacing="0" cellpadding="0">
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr style="height: 56px;">
|
|
|
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
|
|
|
<tr id="projectrow">
|
|
|
|
|
<td id="projectalign">
|
|
|
|
|
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
|
|
|
|
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- end header part -->
|
|
|
|
|
<!-- Generated by Doxygen 1.9.2 -->
|
|
|
|
|
<!-- Generated by Doxygen 1.9.3 -->
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
|
|
|
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
|
|
|
|
@@ -104,7 +104,7 @@ $(document).ready(function(){initNavTree('df/d34/classprobability_1_1windowed__m
|
|
|
|
|
<div class="dynheader">
|
|
|
|
|
Collaboration diagram for probability::windowed_median::WindowedMedian:</div>
|
|
|
|
|
<div class="dyncontent">
|
|
|
|
|
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d2/d92/classprobability_1_1windowed__median_1_1_windowed_median__coll__graph.svg" width="194" height="142"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
|
|
|
|
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d2/d92/classprobability_1_1windowed__median_1_1_windowed_median__coll__graph.svg" width="270" height="156"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
|
|
|
|
</div>
|
|
|
|
|
<center><span class="legend">[<a target="top" href="../../graph_legend.html">legend</a>]</span></center></div>
|
|
|
|
|
<table class="memberdecls">
|
|
|
|
|
@@ -181,7 +181,7 @@ const size_type </td><td class="memItemRight" valign="bottom"><b>_windowSiz
|
|
|
|
|
</table>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<div class="fragment"><div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span>: <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aafda847b152684578dab891e5268d750">_windowSize</a>(windowSize){};</div>
|
|
|
|
|
<div class="fragment"><div class="line"><span class="lineno"> 123</span>: <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aafda847b152684578dab891e5268d750">_windowSize</a>(windowSize){};</div>
|
|
|
|
|
<div class="ttc" id="aclassprobability_1_1windowed__median_1_1_windowed_median_html_aafda847b152684578dab891e5268d750"><div class="ttname"><a href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aafda847b152684578dab891e5268d750">probability::windowed_median::WindowedMedian::_windowSize</a></div><div class="ttdeci">const size_type _windowSize</div><div class="ttdoc">sliding window size</div><div class="ttdef"><b>Definition:</b> windowed_median.cpp:57</div></div>
|
|
|
|
|
</div><!-- fragment -->
|
|
|
|
|
</div>
|
|
|
|
|
@@ -222,31 +222,40 @@ const size_type </td><td class="memItemRight" valign="bottom"><b>_windowSiz
|
|
|
|
|
<p >O(1) - traversing one step to the right child</p>
|
|
|
|
|
<p >However, if the erased value is on the right branch or the median itself, and the number of elements is odd, the new median will be the left child of the current one</p>
|
|
|
|
|
<p >Find the (first) position of the value we want to erase, and erase it</p>
|
|
|
|
|
<div class="fragment"><div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> {</div>
|
|
|
|
|
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="keyword">const</span> <span class="keyword">auto</span> sz = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.size();</div>
|
|
|
|
|
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="comment"></span> </div>
|
|
|
|
|
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span><span class="comment"> /// If the erased value is on the left branch or the median itself and</span></div>
|
|
|
|
|
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="comment"> /// the number of elements is even, the new median will be the right</span></div>
|
|
|
|
|
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="comment"> /// child of the current one</span></div>
|
|
|
|
|
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span><span class="comment"></span> <span class="keywordflow">if</span> (value <= *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 == 0) {</div>
|
|
|
|
|
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> ++<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">/// O(1) - traversing one step to the right child</span></div>
|
|
|
|
|
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> }</div>
|
|
|
|
|
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="comment"></span> </div>
|
|
|
|
|
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span><span class="comment"> /// However, if the erased value is on the right branch or the median</span></div>
|
|
|
|
|
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span><span class="comment"> /// itself, and the number of elements is odd, the new median will be</span></div>
|
|
|
|
|
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span><span class="comment"> /// the left child of the current one</span></div>
|
|
|
|
|
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (value >= *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 != 0) {</div>
|
|
|
|
|
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> --<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">// O(1) - traversing one step to the left child</span></div>
|
|
|
|
|
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> }</div>
|
|
|
|
|
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span><span class="comment"></span> </div>
|
|
|
|
|
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span><span class="comment"> /// Find the (first) position of the value we want to erase, and erase</span></div>
|
|
|
|
|
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span><span class="comment"> /// it</span></div>
|
|
|
|
|
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span><span class="comment"></span> <span class="keyword">const</span> <span class="keyword">auto</span> it = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.find(value); <span class="comment">// O(logN)</span></div>
|
|
|
|
|
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.erase(it); <span class="comment">// O(logN)</span></div>
|
|
|
|
|
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> }</div>
|
|
|
|
|
<div class="fragment"><div class="line"><span class="lineno"> 95</span> {</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 96</span> <span class="keyword">const</span> <span class="keyword">auto</span> sz = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/multiset/size.html">size</a>();</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 97</span><span class="comment"></span> </div>
|
|
|
|
|
<div class="line"><span class="lineno"> 98</span><span class="comment"> /// If the erased value is on the left branch or the median itself and</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 99</span><span class="comment"> /// the number of elements is even, the new median will be the right</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 100</span><span class="comment"> /// child of the current one</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 101</span><span class="comment"></span> <span class="keywordflow">if</span> (value <= *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 == 0) {</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 102</span> ++<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">/// O(1) - traversing one step to the right child</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 103</span> }</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 104</span><span class="comment"></span> </div>
|
|
|
|
|
<div class="line"><span class="lineno"> 105</span><span class="comment"> /// However, if the erased value is on the right branch or the median</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 106</span><span class="comment"> /// itself, and the number of elements is odd, the new median will be</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 107</span><span class="comment"> /// the left child of the current one</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 108</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (value >= *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 != 0) {</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 109</span> --<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">// O(1) - traversing one step to the left child</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 110</span> }</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 111</span><span class="comment"></span> </div>
|
|
|
|
|
<div class="line"><span class="lineno"> 112</span><span class="comment"> /// Find the (first) position of the value we want to erase, and erase</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 113</span><span class="comment"> /// it</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 114</span><span class="comment"></span> <span class="keyword">const</span> <span class="keyword">auto</span> it = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/multiset/find.html">find</a>(value); <span class="comment">// O(logN)</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 115</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/multiset/erase.html">erase</a>(it); <span class="comment">// O(logN)</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 116</span> }</div>
|
|
|
|
|
<div class="ttc" id="aclassprobability_1_1windowed__median_1_1_windowed_median_html_a55ae3543a76045dffcb5ec7904a32a20"><div class="ttname"><a href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">probability::windowed_median::WindowedMedian::_itMedian</a></div><div class="ttdeci">std::multiset< int >::const_iterator _itMedian</div><div class="ttdef"><b>Definition:</b> windowed_median.cpp:62</div></div>
|
|
|
|
|
<div class="ttc" id="aclassprobability_1_1windowed__median_1_1_windowed_median_html_aacd76f078632faee1a8788d031e6c2de"><div class="ttname"><a href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">probability::windowed_median::WindowedMedian::_sortedValues</a></div><div class="ttdeci">std::multiset< int > _sortedValues</div><div class="ttdef"><b>Definition:</b> windowed_median.cpp:59</div></div>
|
|
|
|
|
</div><!-- fragment -->
|
|
|
|
|
<div class="ttc" id="aerase_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/multiset/erase.html">std::multiset::erase</a></div><div class="ttdeci">T erase(T... args)</div></div>
|
|
|
|
|
<div class="ttc" id="afind_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/multiset/find.html">std::multiset::find</a></div><div class="ttdeci">T find(T... args)</div></div>
|
|
|
|
|
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/multiset/size.html">std::multiset::size</a></div><div class="ttdeci">T size(T... args)</div></div>
|
|
|
|
|
</div><!-- fragment --><div class="dynheader">
|
|
|
|
|
Here is the call graph for this function:</div>
|
|
|
|
|
<div class="dyncontent">
|
|
|
|
|
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median_af544e271ea19a6fd69a6b3ed6816453e_cgraph.svg" width="376" height="139"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<a id="a938cafbdf70dc01e86e9bb12d29ec65d" name="a938cafbdf70dc01e86e9bb12d29ec65d"></a>
|
|
|
|
|
@@ -275,14 +284,20 @@ const size_type </td><td class="memItemRight" valign="bottom"><b>_windowSiz
|
|
|
|
|
<p>Gets the median of the values in the sliding window. </p>
|
|
|
|
|
<dl class="section return"><dt>Returns</dt><dd>Median of sliding window. For even window size return the average between the two values in the middle </dd></dl>
|
|
|
|
|
<p >O(1)</p>
|
|
|
|
|
<div class="fragment"><div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> {</div>
|
|
|
|
|
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.size() % 2 != 0) {</div>
|
|
|
|
|
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="keywordflow">return</span> *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">// O(1)</span></div>
|
|
|
|
|
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> }</div>
|
|
|
|
|
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="keywordflow">return</span> 0.5f * *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> + 0.5f * *<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a>(<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>); <span class="comment">/// O(1)</span></div>
|
|
|
|
|
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> }</div>
|
|
|
|
|
<div class="fragment"><div class="line"><span class="lineno"> 148</span> {</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 149</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/multiset/size.html">size</a>() % 2 != 0) {</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 150</span> <span class="keywordflow">return</span> *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">// O(1)</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 151</span> }</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 152</span> <span class="keywordflow">return</span> 0.5f * *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> + 0.5f * *<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a>(<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>); <span class="comment">/// O(1)</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 153</span> }</div>
|
|
|
|
|
<div class="ttc" id="anext_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/iterator/next.html">std::next</a></div><div class="ttdeci">T next(T... args)</div></div>
|
|
|
|
|
</div><!-- fragment -->
|
|
|
|
|
</div><!-- fragment --><div class="dynheader">
|
|
|
|
|
Here is the call graph for this function:</div>
|
|
|
|
|
<div class="dyncontent">
|
|
|
|
|
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median_a938cafbdf70dc01e86e9bb12d29ec65d_cgraph.svg" width="368" height="67"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<a id="a61804988fcb1a6caf640f8291979aaa6" name="a61804988fcb1a6caf640f8291979aaa6"></a>
|
|
|
|
|
@@ -313,18 +328,18 @@ const size_type </td><td class="memItemRight" valign="bottom"><b>_windowSiz
|
|
|
|
|
<p >Sort window - O(NlogN)</p>
|
|
|
|
|
<p >Find value in the middle - O(N)</p>
|
|
|
|
|
<p >O(N)</p>
|
|
|
|
|
<div class="fragment"><div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> {</div>
|
|
|
|
|
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="keyword">auto</span> window = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>;</div>
|
|
|
|
|
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> window.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/sort.html">sort</a>(); <span class="comment">/// Sort window - O(NlogN)</span></div>
|
|
|
|
|
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="keyword">auto</span> median =</div>
|
|
|
|
|
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> *<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a>(window.begin(),</div>
|
|
|
|
|
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> window.size() / 2); <span class="comment">/// Find value in the middle - O(N)</span></div>
|
|
|
|
|
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <span class="keywordflow">if</span> (window.size() % 2 != 0) {</div>
|
|
|
|
|
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <span class="keywordflow">return</span> median;</div>
|
|
|
|
|
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> }</div>
|
|
|
|
|
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <span class="keywordflow">return</span> 0.5f * median +</div>
|
|
|
|
|
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> 0.5f * *<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a>(window.begin(), window.size() / 2 - 1); <span class="comment">/// O(N)</span></div>
|
|
|
|
|
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> }</div>
|
|
|
|
|
<div class="fragment"><div class="line"><span class="lineno"> 161</span> {</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 162</span> <span class="keyword">auto</span> window = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>;</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 163</span> window.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/sort.html">sort</a>(); <span class="comment">/// Sort window - O(NlogN)</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 164</span> <span class="keyword">auto</span> median =</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 165</span> *<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a>(window.begin(),</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 166</span> window.size() / 2); <span class="comment">/// Find value in the middle - O(N)</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 167</span> <span class="keywordflow">if</span> (window.size() % 2 != 0) {</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 168</span> <span class="keywordflow">return</span> median;</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 169</span> }</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 170</span> <span class="keywordflow">return</span> 0.5f * median +</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 171</span> 0.5f * *<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a>(window.begin(), window.size() / 2 - 1); <span class="comment">/// O(N)</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 172</span> }</div>
|
|
|
|
|
<div class="ttc" id="aclassprobability_1_1windowed__median_1_1_windowed_median_html_a825a7aaef844c9f743a27b268e8569b2"><div class="ttname"><a href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">probability::windowed_median::WindowedMedian::_window</a></div><div class="ttdeci">Window _window</div><div class="ttdoc">a sliding window of values along the stream</div><div class="ttdef"><b>Definition:</b> windowed_median.cpp:58</div></div>
|
|
|
|
|
<div class="ttc" id="asort_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/sort.html">std::list::sort</a></div><div class="ttdeci">T sort(T... args)</div></div>
|
|
|
|
|
</div><!-- fragment --><div class="dynheader">
|
|
|
|
|
@@ -371,29 +386,28 @@ Here is the call graph for this function:</div>
|
|
|
|
|
<p >If exceeding size of window, pop from its left side</p>
|
|
|
|
|
<p >Erase from the multi-value BST the window left side value</p>
|
|
|
|
|
<p >Pop the left side value from the window - O(1)</p>
|
|
|
|
|
<div class="fragment"><div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> {<span class="comment"></span></div>
|
|
|
|
|
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span><span class="comment"> /// Push new value to the back of the sliding window - O(1)</span></div>
|
|
|
|
|
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span><span class="comment"></span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/push_back.html">push_back</a>(value);</div>
|
|
|
|
|
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <a class="code hl_function" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a3a7f57679e9cd6c9f042dfd0612b2b24">insertToSorted</a>(value); <span class="comment">// Insert value to the multi-value BST - O(logN)</span></div>
|
|
|
|
|
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/size.html">size</a>() > <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aafda847b152684578dab891e5268d750">_windowSize</a>) { <span class="comment">/// If exceeding size of window,</span><span class="comment"></span></div>
|
|
|
|
|
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span><span class="comment"> /// pop from its left side</span></div>
|
|
|
|
|
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span><span class="comment"></span> <a class="code hl_function" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#af544e271ea19a6fd69a6b3ed6816453e">eraseFromSorted</a>(</div>
|
|
|
|
|
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/front.html">front</a>()); <span class="comment">/// Erase from the multi-value BST</span><span class="comment"></span></div>
|
|
|
|
|
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span><span class="comment"> /// the window left side value</span></div>
|
|
|
|
|
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span><span class="comment"></span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/pop_front.html">pop_front</a>(); <span class="comment">/// Pop the left side value from the window -</span><span class="comment"></span></div>
|
|
|
|
|
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span><span class="comment"> /// O(1)</span></div>
|
|
|
|
|
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span><span class="comment"></span> }</div>
|
|
|
|
|
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> }</div>
|
|
|
|
|
<div class="fragment"><div class="line"><span class="lineno"> 129</span> {<span class="comment"></span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 130</span><span class="comment"> /// Push new value to the back of the sliding window - O(1)</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 131</span><span class="comment"></span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/push_back.html">push_back</a>(value);</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 132</span> <a class="code hl_function" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a3a7f57679e9cd6c9f042dfd0612b2b24">insertToSorted</a>(value); <span class="comment">// Insert value to the multi-value BST - O(logN)</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 133</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/size.html">size</a>() > <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aafda847b152684578dab891e5268d750">_windowSize</a>) { <span class="comment">/// If exceeding size of window,</span><span class="comment"></span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 134</span><span class="comment"> /// pop from its left side</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 135</span><span class="comment"></span> <a class="code hl_function" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#af544e271ea19a6fd69a6b3ed6816453e">eraseFromSorted</a>(</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 136</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/front.html">front</a>()); <span class="comment">/// Erase from the multi-value BST</span><span class="comment"></span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 137</span><span class="comment"> /// the window left side value</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 138</span><span class="comment"></span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a825a7aaef844c9f743a27b268e8569b2">_window</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/pop_front.html">pop_front</a>(); <span class="comment">/// Pop the left side value from the window -</span><span class="comment"></span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 139</span><span class="comment"> /// O(1)</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 140</span><span class="comment"></span> }</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 141</span> }</div>
|
|
|
|
|
<div class="ttc" id="aclassprobability_1_1windowed__median_1_1_windowed_median_html_a3a7f57679e9cd6c9f042dfd0612b2b24"><div class="ttname"><a href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a3a7f57679e9cd6c9f042dfd0612b2b24">probability::windowed_median::WindowedMedian::insertToSorted</a></div><div class="ttdeci">void insertToSorted(int value)</div><div class="ttdoc">Inserts a value to a sorted multi-value BST.</div><div class="ttdef"><b>Definition:</b> windowed_median.cpp:69</div></div>
|
|
|
|
|
<div class="ttc" id="aclassprobability_1_1windowed__median_1_1_windowed_median_html_af544e271ea19a6fd69a6b3ed6816453e"><div class="ttname"><a href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#af544e271ea19a6fd69a6b3ed6816453e">probability::windowed_median::WindowedMedian::eraseFromSorted</a></div><div class="ttdeci">void eraseFromSorted(int value)</div><div class="ttdoc">Erases a value from a sorted multi-value BST.</div><div class="ttdef"><b>Definition:</b> windowed_median.cpp:95</div></div>
|
|
|
|
|
<div class="ttc" id="afront_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/front.html">std::list::front</a></div><div class="ttdeci">T front(T... args)</div></div>
|
|
|
|
|
<div class="ttc" id="apop_front_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/pop_front.html">std::list::pop_front</a></div><div class="ttdeci">T pop_front(T... args)</div></div>
|
|
|
|
|
<div class="ttc" id="apush_back_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/push_back.html">std::list::push_back</a></div><div class="ttdeci">T push_back(T... args)</div></div>
|
|
|
|
|
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/size.html">std::list::size</a></div><div class="ttdeci">T size(T... args)</div></div>
|
|
|
|
|
</div><!-- fragment --><div class="dynheader">
|
|
|
|
|
Here is the call graph for this function:</div>
|
|
|
|
|
<div class="dyncontent">
|
|
|
|
|
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median_a6b52b7851750f28d53508e63c52a69f7_cgraph.svg" width="424" height="350"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
|
|
|
|
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median_a6b52b7851750f28d53508e63c52a69f7_cgraph.svg" width="607" height="382"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@@ -435,28 +449,36 @@ Here is the call graph for this function:</div>
|
|
|
|
|
<p >If new value goes to left tree branch, and number of elements is even, the new median in the balanced tree is the left child of the median before the insertion</p>
|
|
|
|
|
<p >However, if the new value goes to the right branch, the previous median's right child is the new median in the balanced tree</p>
|
|
|
|
|
<p >O(1) - traversing one step to the right child</p>
|
|
|
|
|
<div class="fragment"><div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> {</div>
|
|
|
|
|
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.insert(value); <span class="comment">/// Insert value to BST - O(logN)</span></div>
|
|
|
|
|
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keyword">const</span> <span class="keyword">auto</span> sz = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.size();</div>
|
|
|
|
|
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordflow">if</span> (sz == 1) { <span class="comment">/// For the first value, set median iterator to BST root</span></div>
|
|
|
|
|
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.begin();</div>
|
|
|
|
|
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordflow">return</span>;</div>
|
|
|
|
|
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> }</div>
|
|
|
|
|
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="comment"></span> </div>
|
|
|
|
|
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span><span class="comment"> /// If new value goes to left tree branch, and number of elements is</span></div>
|
|
|
|
|
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span><span class="comment"> /// even, the new median in the balanced tree is the left child of the</span></div>
|
|
|
|
|
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span><span class="comment"> /// median before the insertion</span></div>
|
|
|
|
|
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="comment"></span> <span class="keywordflow">if</span> (value < *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 == 0) {</div>
|
|
|
|
|
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> --<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">// O(1) - traversing one step to the left child</span></div>
|
|
|
|
|
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> }</div>
|
|
|
|
|
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span><span class="comment"></span> </div>
|
|
|
|
|
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span><span class="comment"> /// However, if the new value goes to the right branch, the previous</span></div>
|
|
|
|
|
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="comment"> /// median's right child is the new median in the balanced tree</span></div>
|
|
|
|
|
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (value >= *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 != 0) {</div>
|
|
|
|
|
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> ++<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">/// O(1) - traversing one step to the right child</span></div>
|
|
|
|
|
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> }</div>
|
|
|
|
|
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> }</div>
|
|
|
|
|
</div><!-- fragment -->
|
|
|
|
|
<div class="fragment"><div class="line"><span class="lineno"> 69</span> {</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 70</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/multiset/insert.html">insert</a>(value); <span class="comment">/// Insert value to BST - O(logN)</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 71</span> <span class="keyword">const</span> <span class="keyword">auto</span> sz = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/multiset/size.html">size</a>();</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 72</span> <span class="keywordflow">if</span> (sz == 1) { <span class="comment">/// For the first value, set median iterator to BST root</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 73</span> <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> = <a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/multiset/begin.html">begin</a>();</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 74</span> <span class="keywordflow">return</span>;</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 75</span> }</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 76</span><span class="comment"></span> </div>
|
|
|
|
|
<div class="line"><span class="lineno"> 77</span><span class="comment"> /// If new value goes to left tree branch, and number of elements is</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 78</span><span class="comment"> /// even, the new median in the balanced tree is the left child of the</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 79</span><span class="comment"> /// median before the insertion</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 80</span><span class="comment"></span> <span class="keywordflow">if</span> (value < *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 == 0) {</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 81</span> --<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">// O(1) - traversing one step to the left child</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 82</span> }</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 83</span><span class="comment"></span> </div>
|
|
|
|
|
<div class="line"><span class="lineno"> 84</span><span class="comment"> /// However, if the new value goes to the right branch, the previous</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 85</span><span class="comment"> /// median's right child is the new median in the balanced tree</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 86</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (value >= *<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> && sz % 2 != 0) {</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 87</span> ++<a class="code hl_variable" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">/// O(1) - traversing one step to the right child</span></div>
|
|
|
|
|
<div class="line"><span class="lineno"> 88</span> }</div>
|
|
|
|
|
<div class="line"><span class="lineno"> 89</span> }</div>
|
|
|
|
|
<div class="ttc" id="abegin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/multiset/begin.html">std::multiset::begin</a></div><div class="ttdeci">T begin(T... args)</div></div>
|
|
|
|
|
<div class="ttc" id="ainsert_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/multiset/insert.html">std::multiset::insert</a></div><div class="ttdeci">T insert(T... args)</div></div>
|
|
|
|
|
</div><!-- fragment --><div class="dynheader">
|
|
|
|
|
Here is the call graph for this function:</div>
|
|
|
|
|
<div class="dyncontent">
|
|
|
|
|
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median_a3a7f57679e9cd6c9f042dfd0612b2b24_cgraph.svg" width="376" height="139"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<h2 class="groupheader">Member Data Documentation</h2>
|
|
|
|
|
@@ -515,7 +537,7 @@ Here is the call graph for this function:</div>
|
|
|
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
|
|
|
<ul>
|
|
|
|
|
<li class="navelem"><a class="el" href="../../d4/ded/namespaceprobability.html">probability</a></li><li class="navelem"><b>windowed_median</b></li><li class="navelem"><a class="el" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html">WindowedMedian</a></li>
|
|
|
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
|
|
|
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
|