Documentation for 8b1eab204b

This commit is contained in:
realstealthninja
2024-11-04 12:43:05 +00:00
parent 4fb6e622e9
commit a7bccf7d01
6732 changed files with 153919 additions and 365711 deletions

View File

@@ -1,3 +1,4 @@
<!-- HTML header for doxygen 1.12.0-->
<!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" lang="en-US">
<head>
@@ -5,10 +6,15 @@
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: others/lfu_cache.cpp File Reference</title>
<title>TheAlgorithms/C++: others/lfu_cache.cpp File Reference</title>
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
</script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../navtreedata.js"></script>
@@ -18,14 +24,24 @@
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
<script type="text/javascript">
window.MathJax = {
options: {
ignoreHtmlClass: 'tex2jax_ignore',
processHtmlClass: 'tex2jax_process'
},
loader: {
load: ['[tex]/ams']
},
tex: {
macros: {},
packages: ['base','configmacros','ams']
}
};
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
@@ -33,10 +49,11 @@ MathJax.Hub.Config({
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
<div id="projectname">TheAlgorithms/C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
<div id="projectbrief">All the algorithms implemented in C++</div>
</td>
</tr>
</tbody>
@@ -123,7 +140,9 @@ Include dependency graph for lfu_cache.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d6/dca/lfu__cache_8cpp__incl.svg" width="306" height="111"><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">
</div>
<p><a href="../../d9/d65/lfu__cache_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">others::Cache::D_Node&lt; T &gt;</a></td></tr>
@@ -144,9 +163,8 @@ Namespaces</h2></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a5c0dfbf62803f020205076c3da18d058" id="r_a5c0dfbf62803f020205076c3da18d058"><td class="memTemplParams" colspan="2"><a id="a5c0dfbf62803f020205076c3da18d058" name="a5c0dfbf62803f020205076c3da18d058"></a>
template&lt;typename K , typename V &gt; </td></tr>
<tr class="memitem:a5c0dfbf62803f020205076c3da18d058"><td class="memTemplItemLeft" align="right" valign="top">using&#160;</td><td class="memTemplItemRight" valign="bottom"><b>others::Cache::CacheNode</b> = <a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">D_Node</a>&lt;<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a>&lt;K, V&gt;&gt;</td></tr>
<tr class="memitem:a5c0dfbf62803f020205076c3da18d058" id="r_a5c0dfbf62803f020205076c3da18d058"><td class="memTemplParams" colspan="2">template&lt;typename K , typename V &gt; </td></tr>
<tr class="memitem:a5c0dfbf62803f020205076c3da18d058"><td class="memTemplItemLeft" align="right" valign="top">using&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../db/dde/namespaceothers_1_1_cache.html#a5c0dfbf62803f020205076c3da18d058">others::Cache::CacheNode</a> = <a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">D_Node</a>&lt;std::pair&lt;K, V&gt;&gt;</td></tr>
<tr class="separator:a5c0dfbf62803f020205076c3da18d058"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
@@ -165,6 +183,8 @@ map).</p>
<p>Hashmap maps the key to the address of the node of the linked list and its current usage frequency. If the element is accessed the element is removed from the linked list of the current frequency and added to the linked list of incremented frequency.</p>
<p>When the cache is full, the last element in the minimum frequency linked list is popped.</p>
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/deDSeC00720" target="_blank">Karan Sharma</a> </dd></dl>
<p class="definition">Definition in file <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html">lfu_cache.cpp</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">&#9670;&#160;</a></span>main()</h2>
@@ -183,17 +203,14 @@ map).</p>
<p>main function </p>
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00301">301</a> of file <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html">lfu_cache.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 301</span> {</div>
<div class="line"><span class="lineno"> 302</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run the self test implementation</span></div>
<div class="line"><span class="lineno"> 303</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 304</span>}</div>
<div class="ttc" id="alfu__cache_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">self test implementation</div><div class="ttdef"><b>Definition</b> lfu_cache.cpp:250</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="../../d9/d65/lfu__cache_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="100%" height="511"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div></div>
</div>
<div class="ttc" id="alfu__cache_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">self test implementation</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d65/lfu__cache_8cpp_source.html#l00250">lfu_cache.cpp:250</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="aa8dca7b867074164d5f45b0f3851269d" name="aa8dca7b867074164d5f45b0f3851269d"></a>
@@ -221,6 +238,8 @@ Here is the call graph for this function:</div>
<p>self test implementation </p>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00250">250</a> of file <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html">lfu_cache.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 250</span> {</div>
<div class="line"><span class="lineno"> 251</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">others::Cache::LFUCache&lt;int, int&gt;</a> cache(5);</div>
<div class="line"><span class="lineno"> 252</span> </div>
@@ -265,16 +284,10 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 291</span> assert(cache.get(5) == -50);</div>
<div class="line"><span class="lineno"> 292</span> assert(cache.get(6) == 60);</div>
<div class="line"><span class="lineno"> 293</span> </div>
<div class="line"><span class="lineno"> 294</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;test - passed\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 294</span> std::cout &lt;&lt; <span class="stringliteral">&quot;test - passed\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 295</span>}</div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html"><div class="ttname"><a href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">others::Cache::LFUCache</a></div><div class="ttdoc">LFUCache.</div><div class="ttdef"><b>Definition</b> lfu_cache.cpp:64</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="../../d9/d65/lfu__cache_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="100%" height="511"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div></div>
</div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html"><div class="ttname"><a href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">others::Cache::LFUCache</a></div><div class="ttdoc">LFUCache.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d65/lfu__cache_8cpp_source.html#l00064">lfu_cache.cpp:64</a></div></div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->