Documentation for db149bf3b7

This commit is contained in:
github-actions
2022-09-02 14:36:25 +00:00
parent ca6acdc719
commit 766f10286e
5464 changed files with 92674 additions and 78796 deletions

View File

@@ -1,9 +1,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<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.4"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: probability/windowed_median.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -41,10 +41,10 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<!-- Generated by Doxygen 1.9.5 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
@@ -84,9 +84,16 @@ $(document).ready(function(){initNavTree('d1/ded/windowed__median_8cpp.html','..
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
@@ -110,7 +117,7 @@ $(document).ready(function(){initNavTree('d1/ded/windowed__median_8cpp.html','..
</div><div class="textblock"><div class="dynheader">
Include dependency graph for windowed_median.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d0/d5b/windowed__median_8cpp__incl.svg" width="450" height="127"><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="../../d0/d5b/windowed__median_8cpp__incl.svg" width="450" height="124"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div><table class="memberdecls">
@@ -156,7 +163,7 @@ Algorithm</h3>
<p >Time complexity: O(logN). Space complexity: O(N). N - size of window </p><dl class="section author"><dt>Author</dt><dd><a href="https://github.com/YanivHollander" target="_blank">Yaniv Hollander</a> </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="ac0f2228420376f4db7e1274f2b41667c" name="ac0f2228420376f4db7e1274f2b41667c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac0f2228420376f4db7e1274f2b41667c">&#9670;&nbsp;</a></span>main()</h2>
<h2 class="memtitle"><span class="permalink"><a href="#ac0f2228420376f4db7e1274f2b41667c">&#9670;&#160;</a></span>main()</h2>
<div class="memitem">
<div class="memproto">
@@ -205,20 +212,20 @@ Algorithm</h3>
<p >Testing randomized test</p>
<div class="fragment"><div class="line"><span class="lineno"> 198</span> {<span class="comment"></span></div>
<div class="line"><span class="lineno"> 199</span><span class="comment"> /// A few fixed test cases</span></div>
<div class="line"><span class="lineno"> 200</span><span class="comment"></span> <a class="code hl_function" href="../../d1/ded/windowed__median_8cpp.html#a6dc652a36ea42ba262c4e4236e3e6601">test</a>({1, 2, 3, 4, 5, 6, 7, 8, 9},</div>
<div class="line"><span class="lineno"> 200</span><span class="comment"></span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>({1, 2, 3, 4, 5, 6, 7, 8, 9},</div>
<div class="line"><span class="lineno"> 201</span> 3); <span class="comment">/// Array of sorted values; odd window size</span></div>
<div class="line"><span class="lineno"> 202</span> <a class="code hl_function" href="../../d1/ded/windowed__median_8cpp.html#a6dc652a36ea42ba262c4e4236e3e6601">test</a>({9, 8, 7, 6, 5, 4, 3, 2, 1},</div>
<div class="line"><span class="lineno"> 202</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>({9, 8, 7, 6, 5, 4, 3, 2, 1},</div>
<div class="line"><span class="lineno"> 203</span> 3); <span class="comment">/// Array of sorted values - decreasing; odd window size</span></div>
<div class="line"><span class="lineno"> 204</span> <a class="code hl_function" href="../../d1/ded/windowed__median_8cpp.html#a6dc652a36ea42ba262c4e4236e3e6601">test</a>({9, 8, 7, 6, 5, 4, 5, 6}, 4); <span class="comment">/// Even window size</span></div>
<div class="line"><span class="lineno"> 205</span> <a class="code hl_function" href="../../d1/ded/windowed__median_8cpp.html#a6dc652a36ea42ba262c4e4236e3e6601">test</a>({3, 3, 3, 3, 3, 3, 3, 3, 3}, 3); <span class="comment">/// Array with repeating values</span></div>
<div class="line"><span class="lineno"> 206</span> <a class="code hl_function" href="../../d1/ded/windowed__median_8cpp.html#a6dc652a36ea42ba262c4e4236e3e6601">test</a>({3, 3, 3, 3, 7, 3, 3, 3, 3}, 3); <span class="comment">/// Array with same values except one</span></div>
<div class="line"><span class="lineno"> 207</span> <a class="code hl_function" href="../../d1/ded/windowed__median_8cpp.html#a6dc652a36ea42ba262c4e4236e3e6601">test</a>({4, 3, 3, -5, -5, 1, 3, 4, 5},</div>
<div class="line"><span class="lineno"> 204</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>({9, 8, 7, 6, 5, 4, 5, 6}, 4); <span class="comment">/// Even window size</span></div>
<div class="line"><span class="lineno"> 205</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>({3, 3, 3, 3, 3, 3, 3, 3, 3}, 3); <span class="comment">/// Array with repeating values</span></div>
<div class="line"><span class="lineno"> 206</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>({3, 3, 3, 3, 7, 3, 3, 3, 3}, 3); <span class="comment">/// Array with same values except one</span></div>
<div class="line"><span class="lineno"> 207</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>({4, 3, 3, -5, -5, 1, 3, 4, 5},</div>
<div class="line"><span class="lineno"> 208</span> 5); <span class="comment">/// Array that includes repeating values including negatives</span></div>
<div class="line"><span class="lineno"> 209</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 210</span><span class="comment"> /// Array with large values - sum of few pairs exceeds MAX_INT. Window size</span></div>
<div class="line"><span class="lineno"> 211</span><span class="comment"> /// is even - testing calculation of average median between two middle</span></div>
<div class="line"><span class="lineno"> 212</span><span class="comment"> /// values</span></div>
<div class="line"><span class="lineno"> 213</span><span class="comment"></span> <a class="code hl_function" href="../../d1/ded/windowed__median_8cpp.html#a6dc652a36ea42ba262c4e4236e3e6601">test</a>({470211272, 101027544, 1457850878, 1458777923, 2007237709, 823564440,</div>
<div class="line"><span class="lineno"> 213</span><span class="comment"></span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>({470211272, 101027544, 1457850878, 1458777923, 2007237709, 823564440,</div>
<div class="line"><span class="lineno"> 214</span> 1115438165, 1784484492, 74243042, 114807987},</div>
<div class="line"><span class="lineno"> 215</span> 6);</div>
<div class="line"><span class="lineno"> 216</span><span class="comment"></span> </div>
@@ -238,29 +245,29 @@ Algorithm</h3>
<div class="line"><span class="lineno"> 230</span> vals.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(</div>
<div class="line"><span class="lineno"> 231</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">rand</a>() - RAND_MAX); <span class="comment">/// Random array values (positive/negative)</span></div>
<div class="line"><span class="lineno"> 232</span> }</div>
<div class="line"><span class="lineno"> 233</span> <a class="code hl_function" href="../../d1/ded/windowed__median_8cpp.html#a6dc652a36ea42ba262c4e4236e3e6601">test</a>(vals, windowSize); <span class="comment">/// Testing randomized test</span></div>
<div class="line"><span class="lineno"> 233</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>(vals, windowSize); <span class="comment">/// Testing randomized test</span></div>
<div class="line"><span class="lineno"> 234</span> }</div>
<div class="line"><span class="lineno"> 235</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 236</span>}</div>
<div class="ttc" id="acaesar__cipher_8cpp_html_ae1a3968e7947464bee7714f6d43b7002"><div class="ttname"><a href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a></div><div class="ttdeci">void test()</div><div class="ttdef"><b>Definition:</b> caesar_cipher.cpp:100</div></div>
<div class="ttc" id="aclear_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/clear.html">std::vector::clear</a></div><div class="ttdeci">T clear(T... args)</div></div>
<div class="ttc" id="apush_back_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">std::vector::push_back</a></div><div class="ttdeci">T push_back(T... args)</div></div>
<div class="ttc" id="arand_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/random/rand.html">std::rand</a></div><div class="ttdeci">T rand(T... args)</div></div>
<div class="ttc" id="areserve_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/reserve.html">std::vector::reserve</a></div><div class="ttdeci">T reserve(T... args)</div></div>
<div class="ttc" id="asrand_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/random/srand.html">std::srand</a></div><div class="ttdeci">T srand(T... args)</div></div>
<div class="ttc" id="atime_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/chrono/c/time.html">std::time</a></div><div class="ttdeci">T time(T... args)</div></div>
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt; int &gt;</a></div></div>
<div class="ttc" id="awindowed__median_8cpp_html_a6dc652a36ea42ba262c4e4236e3e6601"><div class="ttname"><a href="../../d1/ded/windowed__median_8cpp.html#a6dc652a36ea42ba262c4e4236e3e6601">test</a></div><div class="ttdeci">static void test(const std::vector&lt; int &gt; &amp;vals, int windowSize)</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition:</b> windowed_median.cpp:182</div></div>
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d1/ded/windowed__median_8cpp_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg" width="100%" height="600"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/ded/windowed__median_8cpp_ac0f2228420376f4db7e1274f2b41667c_cgraph.svg" width="384" height="332"><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="a6dc652a36ea42ba262c4e4236e3e6601" name="a6dc652a36ea42ba262c4e4236e3e6601"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6dc652a36ea42ba262c4e4236e3e6601">&#9670;&nbsp;</a></span>test()</h2>
<h2 class="memtitle"><span class="permalink"><a href="#a6dc652a36ea42ba262c4e4236e3e6601">&#9670;&#160;</a></span>test()</h2>
<div class="memitem">
<div class="memproto">
@@ -327,7 +334,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="../../dir_82e494173a87936756866de2fa774307.html">probability</a></li><li class="navelem"><a class="el" href="../../d1/ded/windowed__median_8cpp.html">windowed_median.cpp</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.4 </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.5 </li>
</ul>
</div>
</body>