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::Cache::LFUCache&lt; K, V &gt; Class Template Reference</title>
<title>TheAlgorithms/C++: others::Cache::LFUCache&lt; K, V &gt; Class Template 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>
@@ -150,7 +167,7 @@ Private Member Functions</h2></td></tr>
<tr class="memitem:adad4ab43141fb8ba43facd3a71e07047" id="r_adad4ab43141fb8ba43facd3a71e07047"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#adad4ab43141fb8ba43facd3a71e07047">push</a> (int freq, <a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode</a>&lt; K, V &gt; *<a class="el" href="../../d5/da1/structnode.html">node</a>)</td></tr>
<tr class="memdesc:adad4ab43141fb8ba43facd3a71e07047"><td class="mdescLeft">&#160;</td><td class="mdescRight">push the node at first position in the linked list of given frequency <br /></td></tr>
<tr class="separator:adad4ab43141fb8ba43facd3a71e07047"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16a25c102554c5653721a5112ef676c9" id="r_a16a25c102554c5653721a5112ef676c9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a16a25c102554c5653721a5112ef676c9">increase_frequency</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a>&lt; <a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode</a>&lt; K, V &gt; *, int &gt; &amp;p_node)</td></tr>
<tr class="memitem:a16a25c102554c5653721a5112ef676c9" id="r_a16a25c102554c5653721a5112ef676c9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a16a25c102554c5653721a5112ef676c9">increase_frequency</a> (std::pair&lt; <a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode</a>&lt; K, V &gt; *, int &gt; &amp;p_node)</td></tr>
<tr class="memdesc:a16a25c102554c5653721a5112ef676c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">increase the frequency of node and push it in the respective list. <br /></td></tr>
<tr class="separator:a16a25c102554c5653721a5112ef676c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3561ab204754295199f9566924f7e69" id="r_ab3561ab204754295199f9566924f7e69"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab3561ab204754295199f9566924f7e69">pop</a> ()</td></tr>
@@ -159,21 +176,17 @@ Private Member Functions</h2></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:ac7684879e2e5da3d8bc5b1699ee42d35" id="r_ac7684879e2e5da3d8bc5b1699ee42d35"><td class="memItemLeft" align="right" valign="top"><a id="ac7684879e2e5da3d8bc5b1699ee42d35" name="ac7684879e2e5da3d8bc5b1699ee42d35"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/unordered_map.html">std::unordered_map</a>&lt; K, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a>&lt; <a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode</a>&lt; K, V &gt; *, int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>node_map</b></td></tr>
<tr class="memdesc:ac7684879e2e5da3d8bc5b1699ee42d35"><td class="mdescLeft">&#160;</td><td class="mdescRight">maps the key to the node address and frequency <br /></td></tr>
<tr class="memitem:ac7684879e2e5da3d8bc5b1699ee42d35" id="r_ac7684879e2e5da3d8bc5b1699ee42d35"><td class="memItemLeft" align="right" valign="top">std::unordered_map&lt; K, std::pair&lt; <a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode</a>&lt; K, V &gt; *, int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a></td></tr>
<tr class="memdesc:ac7684879e2e5da3d8bc5b1699ee42d35"><td class="mdescLeft">&#160;</td><td class="mdescRight">maps the key to the node address and frequency <br /></td></tr>
<tr class="separator:ac7684879e2e5da3d8bc5b1699ee42d35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba5d59d0f6ab0c0d30a92551ca5a05f2" id="r_aba5d59d0f6ab0c0d30a92551ca5a05f2"><td class="memItemLeft" align="right" valign="top"><a id="aba5d59d0f6ab0c0d30a92551ca5a05f2" name="aba5d59d0f6ab0c0d30a92551ca5a05f2"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/unordered_map.html">std::unordered_map</a>&lt; int, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a>&lt; <a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode</a>&lt; K, V &gt; *, <a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode</a>&lt; K, V &gt; * &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>freq_map</b></td></tr>
<tr class="memdesc:aba5d59d0f6ab0c0d30a92551ca5a05f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">maps the frequency to doubly linked list <br /></td></tr>
<tr class="memitem:aba5d59d0f6ab0c0d30a92551ca5a05f2" id="r_aba5d59d0f6ab0c0d30a92551ca5a05f2"><td class="memItemLeft" align="right" valign="top">std::unordered_map&lt; int, std::pair&lt; <a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode</a>&lt; K, V &gt; *, <a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode</a>&lt; K, V &gt; * &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a></td></tr>
<tr class="memdesc:aba5d59d0f6ab0c0d30a92551ca5a05f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">maps the frequency to doubly linked list <br /></td></tr>
<tr class="separator:aba5d59d0f6ab0c0d30a92551ca5a05f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6de844d1589a809239cc07752f311285" id="r_a6de844d1589a809239cc07752f311285"><td class="memItemLeft" align="right" valign="top"><a id="a6de844d1589a809239cc07752f311285" name="a6de844d1589a809239cc07752f311285"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>minFreq</b></td></tr>
<tr class="memdesc:a6de844d1589a809239cc07752f311285"><td class="mdescLeft">&#160;</td><td class="mdescRight">minimum frequency in the cache <br /></td></tr>
<tr class="memitem:a6de844d1589a809239cc07752f311285" id="r_a6de844d1589a809239cc07752f311285"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a6de844d1589a809239cc07752f311285">minFreq</a></td></tr>
<tr class="memdesc:a6de844d1589a809239cc07752f311285"><td class="mdescLeft">&#160;</td><td class="mdescRight">minimum frequency in the cache <br /></td></tr>
<tr class="separator:a6de844d1589a809239cc07752f311285"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3acc10e6bb67d9d9c4187f625723e6c5" id="r_a3acc10e6bb67d9d9c4187f625723e6c5"><td class="memItemLeft" align="right" valign="top"><a id="a3acc10e6bb67d9d9c4187f625723e6c5" name="a3acc10e6bb67d9d9c4187f625723e6c5"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>_capacity</b></td></tr>
<tr class="memdesc:a3acc10e6bb67d9d9c4187f625723e6c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">maximum capacity of the cache <br /></td></tr>
<tr class="memitem:a3acc10e6bb67d9d9c4187f625723e6c5" id="r_a3acc10e6bb67d9d9c4187f625723e6c5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a3acc10e6bb67d9d9c4187f625723e6c5">_capacity</a></td></tr>
<tr class="memdesc:a3acc10e6bb67d9d9c4187f625723e6c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">maximum capacity of the cache <br /></td></tr>
<tr class="separator:a3acc10e6bb67d9d9c4187f625723e6c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
@@ -186,6 +199,8 @@ class others::Cache::LFUCache&lt; K, V &gt;</div><p><a class="el" href="../../df
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00064">64</a> of file <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html">lfu_cache.cpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="affd7776c246caa2d0f92fd8616f6e5dc" name="affd7776c246caa2d0f92fd8616f6e5dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#affd7776c246caa2d0f92fd8616f6e5dc">&#9670;&#160;</a></span>LFUCache()</h2>
@@ -219,9 +234,11 @@ template&lt;typename K , typename V &gt; </div>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00078">78</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"> 78</span>: <a class="code hl_variable" href="#a6de844d1589a809239cc07752f311285">minFreq</a>(0), <a class="code hl_variable" href="#a3acc10e6bb67d9d9c4187f625723e6c5">_capacity</a>(<a class="code hl_variable" href="#a3acc10e6bb67d9d9c4187f625723e6c5">_capacity</a>) {}</div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_a3acc10e6bb67d9d9c4187f625723e6c5"><div class="ttname"><a href="#a3acc10e6bb67d9d9c4187f625723e6c5">others::Cache::LFUCache::_capacity</a></div><div class="ttdeci">int _capacity</div><div class="ttdoc">maximum capacity of the cache</div><div class="ttdef"><b>Definition</b> lfu_cache.cpp:71</div></div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_a6de844d1589a809239cc07752f311285"><div class="ttname"><a href="#a6de844d1589a809239cc07752f311285">others::Cache::LFUCache::minFreq</a></div><div class="ttdeci">int minFreq</div><div class="ttdoc">minimum frequency in the cache</div><div class="ttdef"><b>Definition</b> lfu_cache.cpp:70</div></div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_a3acc10e6bb67d9d9c4187f625723e6c5"><div class="ttname"><a href="#a3acc10e6bb67d9d9c4187f625723e6c5">others::Cache::LFUCache::_capacity</a></div><div class="ttdeci">int _capacity</div><div class="ttdoc">maximum capacity of the cache</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d65/lfu__cache_8cpp_source.html#l00071">lfu_cache.cpp:71</a></div></div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_a6de844d1589a809239cc07752f311285"><div class="ttname"><a href="#a6de844d1589a809239cc07752f311285">others::Cache::LFUCache::minFreq</a></div><div class="ttdeci">int minFreq</div><div class="ttdoc">minimum frequency in the cache</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d65/lfu__cache_8cpp_source.html#l00070">lfu_cache.cpp:70</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -251,6 +268,8 @@ template&lt;typename K , typename V &gt; </div>
</div><div class="memdoc">
<p>destructs the cache, iterates on the map and deletes every node present in the cache. </p>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00235">235</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"> 235</span> {</div>
<div class="line"><span class="lineno"> 236</span> <span class="keyword">auto</span> it = <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.begin();</div>
<div class="line"><span class="lineno"> 237</span> <span class="keywordflow">while</span> (it != <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.end()) {</div>
@@ -258,7 +277,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="line"><span class="lineno"> 239</span> ++it;</div>
<div class="line"><span class="lineno"> 240</span> }</div>
<div class="line"><span class="lineno"> 241</span> }</div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_ac7684879e2e5da3d8bc5b1699ee42d35"><div class="ttname"><a href="#ac7684879e2e5da3d8bc5b1699ee42d35">others::Cache::LFUCache::node_map</a></div><div class="ttdeci">std::unordered_map&lt; K, std::pair&lt; CacheNode&lt; K, V &gt; *, int &gt; &gt; node_map</div><div class="ttdoc">maps the key to the node address and frequency</div><div class="ttdef"><b>Definition</b> lfu_cache.cpp:66</div></div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_ac7684879e2e5da3d8bc5b1699ee42d35"><div class="ttname"><a href="#ac7684879e2e5da3d8bc5b1699ee42d35">others::Cache::LFUCache::node_map</a></div><div class="ttdeci">std::unordered_map&lt; K, std::pair&lt; CacheNode&lt; K, V &gt; *, int &gt; &gt; node_map</div><div class="ttdoc">maps the key to the node address and frequency</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d65/lfu__cache_8cpp_source.html#l00066">lfu_cache.cpp:66</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -290,6 +309,8 @@ template&lt;typename K , typename V &gt; </div>
<p>Returns the total capacity of the cache. </p>
<dl class="section return"><dt>Returns</dt><dd>Total capacity of the cache </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00223">223</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"> 223</span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="#a3acc10e6bb67d9d9c4187f625723e6c5">_capacity</a>; }</div>
</div><!-- fragment -->
</div>
@@ -321,6 +342,8 @@ template&lt;typename K , typename V &gt; </div>
<p>returns true if the cache is empty, false otherwise. </p>
<dl class="section return"><dt>Returns</dt><dd>true if the cache is empty, false otherwise. </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00229">229</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"> 229</span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.empty(); }</div>
</div><!-- fragment -->
</div>
@@ -364,9 +387,11 @@ template&lt;typename K , typename V &gt; </div>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00202">202</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"> 202</span> {</div>
<div class="line"><span class="lineno"> 203</span> <span class="keywordflow">if</span> (!<a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.count(key)) {</div>
<div class="line"><span class="lineno"> 204</span> <span class="keywordflow">throw</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/error/runtime_error.html">std::runtime_error</a>(<span class="stringliteral">&quot;key is not present in the cache&quot;</span>);</div>
<div class="line"><span class="lineno"> 204</span> <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;key is not present in the cache&quot;</span>);</div>
<div class="line"><span class="lineno"> 205</span> }</div>
<div class="line"><span class="lineno"> 206</span> </div>
<div class="line"><span class="lineno"> 207</span> <span class="comment">// increase the frequency and return the value</span></div>
@@ -374,14 +399,8 @@ template&lt;typename K , typename V &gt; </div>
<div class="line"><span class="lineno"> 209</span> <a class="code hl_function" href="#a16a25c102554c5653721a5112ef676c9">increase_frequency</a>(<a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>[key]);</div>
<div class="line"><span class="lineno"> 210</span> <span class="keywordflow">return</span> value;</div>
<div class="line"><span class="lineno"> 211</span> }</div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_a16a25c102554c5653721a5112ef676c9"><div class="ttname"><a href="#a16a25c102554c5653721a5112ef676c9">others::Cache::LFUCache::increase_frequency</a></div><div class="ttdeci">void increase_frequency(std::pair&lt; CacheNode&lt; K, V &gt; *, int &gt; &amp;p_node)</div><div class="ttdoc">increase the frequency of node and push it in the respective list.</div><div class="ttdef"><b>Definition</b> lfu_cache.cpp:109</div></div>
<div class="ttc" id="aruntime_error_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/error/runtime_error.html">std::runtime_error</a></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/d8f/classothers_1_1_cache_1_1_l_f_u_cache_a58e37d3713f28d36abbb8cdf6c432781_cgraph.svg" width="656" height="52"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_a16a25c102554c5653721a5112ef676c9"><div class="ttname"><a href="#a16a25c102554c5653721a5112ef676c9">others::Cache::LFUCache::increase_frequency</a></div><div class="ttdeci">void increase_frequency(std::pair&lt; CacheNode&lt; K, V &gt; *, int &gt; &amp;p_node)</div><div class="ttdoc">increase the frequency of node and push it in the respective list.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d65/lfu__cache_8cpp_source.html#l00109">lfu_cache.cpp:109</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a16a25c102554c5653721a5112ef676c9" name="a16a25c102554c5653721a5112ef676c9"></a>
@@ -398,7 +417,7 @@ template&lt;typename K , typename V &gt; </div>
<tr>
<td class="memname">void <a class="el" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">others::Cache::LFUCache</a>&lt; K, V &gt;::increase_frequency </td>
<td>(</td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a>&lt; <a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode</a>&lt; K, V &gt; *, int &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>p_node</em></span></td><td>)</td>
<td class="paramtype">std::pair&lt; <a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode</a>&lt; K, V &gt; *, int &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>p_node</em></span></td><td>)</td>
<td></td>
</tr>
</table>
@@ -416,11 +435,13 @@ template&lt;typename K , typename V &gt; </div>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00109">109</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"> 109</span> {</div>
<div class="line"><span class="lineno"> 110</span> CacheNode&lt;K, V&gt; *<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = p_node.first;</div>
<div class="line"><span class="lineno"> 111</span> <span class="keywordtype">int</span> freq = p_node.second;</div>
<div class="line"><span class="lineno"> 112</span> </div>
<div class="line"><span class="lineno"> 113</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair&lt;CacheNode&lt;K, V&gt;</a> *, CacheNode&lt;K, V&gt; *&gt; &amp;p = <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[freq];</div>
<div class="line"><span class="lineno"> 113</span> std::pair&lt;CacheNode&lt;K, V&gt; *, CacheNode&lt;K, V&gt; *&gt; &amp;p = <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[freq];</div>
<div class="line"><span class="lineno"> 114</span> </div>
<div class="line"><span class="lineno"> 115</span> <span class="comment">// if the given node is the only node in the list,</span></div>
<div class="line"><span class="lineno"> 116</span> <span class="comment">// then erase the frequency from map</span></div>
@@ -432,38 +453,30 @@ template&lt;typename K , typename V &gt; </div>
<div class="line"><span class="lineno"> 122</span> }</div>
<div class="line"><span class="lineno"> 123</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 124</span> <span class="comment">// remove the given node from current freq linked list</span></div>
<div class="line"><span class="lineno"> 125</span> CacheNode&lt;K, V&gt; *<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a> = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;prev;</div>
<div class="line"><span class="lineno"> 126</span> CacheNode&lt;K, V&gt; *<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a> = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;next;</div>
<div class="line"><span class="lineno"> 125</span> CacheNode&lt;K, V&gt; *prev = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;prev;</div>
<div class="line"><span class="lineno"> 126</span> CacheNode&lt;K, V&gt; *next = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;next;</div>
<div class="line"><span class="lineno"> 127</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;prev = <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 128</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;next = <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 129</span> </div>
<div class="line"><span class="lineno"> 130</span> <span class="keywordflow">if</span> (prev) {</div>
<div class="line"><span class="lineno"> 131</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a>-&gt;next = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a>;</div>
<div class="line"><span class="lineno"> 131</span> prev-&gt;next = next;</div>
<div class="line"><span class="lineno"> 132</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 133</span> p.first = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a>;</div>
<div class="line"><span class="lineno"> 133</span> p.first = next;</div>
<div class="line"><span class="lineno"> 134</span> }</div>
<div class="line"><span class="lineno"> 135</span> </div>
<div class="line"><span class="lineno"> 136</span> <span class="keywordflow">if</span> (next) {</div>
<div class="line"><span class="lineno"> 137</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a>-&gt;prev = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a>;</div>
<div class="line"><span class="lineno"> 137</span> next-&gt;prev = prev;</div>
<div class="line"><span class="lineno"> 138</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 139</span> p.second = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a>;</div>
<div class="line"><span class="lineno"> 139</span> p.second = prev;</div>
<div class="line"><span class="lineno"> 140</span> }</div>
<div class="line"><span class="lineno"> 141</span> }</div>
<div class="line"><span class="lineno"> 142</span> <a class="code hl_function" href="#adad4ab43141fb8ba43facd3a71e07047">push</a>(freq + 1, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
<div class="line"><span class="lineno"> 143</span> ++p_node.second;</div>
<div class="line"><span class="lineno"> 144</span> }</div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_aba5d59d0f6ab0c0d30a92551ca5a05f2"><div class="ttname"><a href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">others::Cache::LFUCache::freq_map</a></div><div class="ttdeci">std::unordered_map&lt; int, std::pair&lt; CacheNode&lt; K, V &gt; *, CacheNode&lt; K, V &gt; * &gt; &gt; freq_map</div><div class="ttdoc">maps the frequency to doubly linked list</div><div class="ttdef"><b>Definition</b> lfu_cache.cpp:68</div></div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_adad4ab43141fb8ba43facd3a71e07047"><div class="ttname"><a href="#adad4ab43141fb8ba43facd3a71e07047">others::Cache::LFUCache::push</a></div><div class="ttdeci">void push(int freq, CacheNode&lt; K, V &gt; *node)</div><div class="ttdoc">push the node at first position in the linked list of given frequency</div><div class="ttdef"><b>Definition</b> lfu_cache.cpp:88</div></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 class="ttc" id="apair_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a></div></div>
<div class="ttc" id="aprev_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/iterator/prev.html">std::prev</a></div><div class="ttdeci">T prev(T... args)</div></div>
<div class="ttc" id="astructnode_html"><div class="ttname"><a href="../../d5/da1/structnode.html">node</a></div><div class="ttdef"><b>Definition</b> binary_search_tree.cpp:11</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/d8f/classothers_1_1_cache_1_1_l_f_u_cache_a16a25c102554c5653721a5112ef676c9_cgraph.svg" width="408" height="52"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_aba5d59d0f6ab0c0d30a92551ca5a05f2"><div class="ttname"><a href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">others::Cache::LFUCache::freq_map</a></div><div class="ttdeci">std::unordered_map&lt; int, std::pair&lt; CacheNode&lt; K, V &gt; *, CacheNode&lt; K, V &gt; * &gt; &gt; freq_map</div><div class="ttdoc">maps the frequency to doubly linked list</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d65/lfu__cache_8cpp_source.html#l00068">lfu_cache.cpp:68</a></div></div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_adad4ab43141fb8ba43facd3a71e07047"><div class="ttname"><a href="#adad4ab43141fb8ba43facd3a71e07047">others::Cache::LFUCache::push</a></div><div class="ttdeci">void push(int freq, CacheNode&lt; K, V &gt; *node)</div><div class="ttdoc">push the node at first position in the linked list of given frequency</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d65/lfu__cache_8cpp_source.html#l00088">lfu_cache.cpp:88</a></div></div>
<div class="ttc" id="astructnode_html"><div class="ttname"><a href="../../d5/da1/structnode.html">node</a></div><div class="ttdef"><b>Definition</b> <a href="../../d3/d26/binary__search__tree_8cpp_source.html#l00011">binary_search_tree.cpp:11</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="ab3561ab204754295199f9566924f7e69" name="ab3561ab204754295199f9566924f7e69"></a>
@@ -492,8 +505,10 @@ template&lt;typename K , typename V &gt; </div>
</div><div class="memdoc">
<p>pop the last node in the least frequently used linked list </p>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00149">149</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"> 149</span> {</div>
<div class="line"><span class="lineno"> 150</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair&lt;CacheNode&lt;K, V&gt;</a> *, CacheNode&lt;K, V&gt; *&gt; &amp;p = <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[<a class="code hl_variable" href="#a6de844d1589a809239cc07752f311285">minFreq</a>];</div>
<div class="line"><span class="lineno"> 150</span> std::pair&lt;CacheNode&lt;K, V&gt; *, CacheNode&lt;K, V&gt; *&gt; &amp;p = <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[<a class="code hl_variable" href="#a6de844d1589a809239cc07752f311285">minFreq</a>];</div>
<div class="line"><span class="lineno"> 151</span> </div>
<div class="line"><span class="lineno"> 152</span> <span class="comment">// if there is only one node</span></div>
<div class="line"><span class="lineno"> 153</span> <span class="comment">// remove the node and erase</span></div>
@@ -550,6 +565,8 @@ template&lt;typename K , typename V &gt; </div>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00088">88</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"> 88</span> {</div>
<div class="line"><span class="lineno"> 89</span> <span class="comment">// if freq is not present, then make a new list with node as the head as</span></div>
<div class="line"><span class="lineno"> 90</span> <span class="comment">// well as tail.</span></div>
@@ -558,7 +575,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="line"><span class="lineno"> 93</span> <span class="keywordflow">return</span>;</div>
<div class="line"><span class="lineno"> 94</span> }</div>
<div class="line"><span class="lineno"> 95</span> </div>
<div class="line"><span class="lineno"> 96</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair&lt;CacheNode&lt;K, V&gt;</a> *, CacheNode&lt;K, V&gt; *&gt; &amp;p = <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[freq];</div>
<div class="line"><span class="lineno"> 96</span> std::pair&lt;CacheNode&lt;K, V&gt; *, CacheNode&lt;K, V&gt; *&gt; &amp;p = <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[freq];</div>
<div class="line"><span class="lineno"> 97</span> </div>
<div class="line"><span class="lineno"> 98</span> <span class="comment">// insert the node at the beginning of the linked list and update the</span></div>
<div class="line"><span class="lineno"> 99</span> <span class="comment">// head.</span></div>
@@ -566,7 +583,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="line"><span class="lineno"> 101</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;next = p.first;</div>
<div class="line"><span class="lineno"> 102</span> p.first = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
<div class="line"><span class="lineno"> 103</span> }</div>
<div class="ttc" id="aavltree_8cpp_html_a74f0cf18a0e5b832d9994e2f2d022287"><div class="ttname"><a href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a></div><div class="ttdeci">struct node { int data; int height; struct node *left; struct node *right;} node</div><div class="ttdoc">for std::queue</div><div class="ttdef"><b>Definition</b> avltree.cpp:13</div></div>
<div class="ttc" id="aavltree_8cpp_html_a74f0cf18a0e5b832d9994e2f2d022287"><div class="ttname"><a href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a></div><div class="ttdeci">struct node { int data; int height; struct node *left; struct node *right;} node</div><div class="ttdoc">for std::queue</div><div class="ttdef"><b>Definition</b> <a href="../../d8/dee/avltree_8cpp_source.html#l00013">avltree.cpp:13</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -607,6 +624,8 @@ template&lt;typename K , typename V &gt; </div>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00174">174</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"> 174</span> {</div>
<div class="line"><span class="lineno"> 175</span> <span class="comment">// update the value if key already exists</span></div>
<div class="line"><span class="lineno"> 176</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.count(key)) {</div>
@@ -628,13 +647,8 @@ template&lt;typename K , typename V &gt; </div>
<div class="line"><span class="lineno"> 192</span> <a class="code hl_variable" href="#a6de844d1589a809239cc07752f311285">minFreq</a> = 1;</div>
<div class="line"><span class="lineno"> 193</span> <a class="code hl_function" href="#adad4ab43141fb8ba43facd3a71e07047">push</a>(1, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
<div class="line"><span class="lineno"> 194</span> }</div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_ab3561ab204754295199f9566924f7e69"><div class="ttname"><a href="#ab3561ab204754295199f9566924f7e69">others::Cache::LFUCache::pop</a></div><div class="ttdeci">void pop()</div><div class="ttdoc">pop the last node in the least frequently used linked list</div><div class="ttdef"><b>Definition</b> lfu_cache.cpp:149</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="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache_af6f8e5a66a45436b490dfe015ff8866e_cgraph.svg" width="100%" height="414"><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_ab3561ab204754295199f9566924f7e69"><div class="ttname"><a href="#ab3561ab204754295199f9566924f7e69">others::Cache::LFUCache::pop</a></div><div class="ttdeci">void pop()</div><div class="ttdoc">pop the last node in the least frequently used linked list</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d65/lfu__cache_8cpp_source.html#l00149">lfu_cache.cpp:149</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="adbfb2ef7358423fdf1f49d410f55f195" name="adbfb2ef7358423fdf1f49d410f55f195"></a>
@@ -664,12 +678,127 @@ template&lt;typename K , typename V &gt; </div>
<p>Returns the number of items present in the cache. </p>
<dl class="section return"><dt>Returns</dt><dd>number of items in the cache </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00217">217</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"> 217</span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.size(); }</div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a3acc10e6bb67d9d9c4187f625723e6c5" name="a3acc10e6bb67d9d9c4187f625723e6c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3acc10e6bb67d9d9c4187f625723e6c5">&#9670;&#160;</a></span>_capacity</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">others::Cache::LFUCache</a>&lt; K, V &gt;::_capacity</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>maximum capacity of the cache </p>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00071">71</a> of file <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html">lfu_cache.cpp</a>.</p>
</div>
</div>
<a id="aba5d59d0f6ab0c0d30a92551ca5a05f2" name="aba5d59d0f6ab0c0d30a92551ca5a05f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">&#9670;&#160;</a></span>freq_map</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::unordered_map&lt;int, std::pair&lt;<a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode</a>&lt;K, V&gt; *, <a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode</a>&lt;K, V&gt; *&gt; &gt; <a class="el" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">others::Cache::LFUCache</a>&lt; K, V &gt;::freq_map</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>maps the frequency to doubly linked list </p>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00068">68</a> of file <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html">lfu_cache.cpp</a>.</p>
</div>
</div>
<a id="a6de844d1589a809239cc07752f311285" name="a6de844d1589a809239cc07752f311285"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6de844d1589a809239cc07752f311285">&#9670;&#160;</a></span>minFreq</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">others::Cache::LFUCache</a>&lt; K, V &gt;::minFreq</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>minimum frequency in the cache </p>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00070">70</a> of file <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html">lfu_cache.cpp</a>.</p>
</div>
</div>
<a id="ac7684879e2e5da3d8bc5b1699ee42d35" name="ac7684879e2e5da3d8bc5b1699ee42d35"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac7684879e2e5da3d8bc5b1699ee42d35">&#9670;&#160;</a></span>node_map</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::unordered_map&lt;K, std::pair&lt;<a class="el" href="../../de/d21/classothers_1_1_cache_1_1_d___node.html">CacheNode</a>&lt;K, V&gt; *, int&gt; &gt; <a class="el" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">others::Cache::LFUCache</a>&lt; K, V &gt;::node_map</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>maps the key to the node address and frequency </p>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00066">66</a> of file <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html">lfu_cache.cpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>others/<a class="el" href="../../d9/d65/lfu__cache_8cpp.html">lfu_cache.cpp</a></li>
<li>others/<a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html">lfu_cache.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->

View File

@@ -1,5 +0,0 @@
<map id="others::Cache::LFUCache::increase_frequency" name="others::Cache::LFUCache::increase_frequency">
<area shape="rect" id="Node000001" title="increase the frequency of node and push it in the respective list." alt="" coords="5,5,180,46"/>
<area shape="rect" id="Node000002" href="$df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adad4ab43141fb8ba43facd3a71e07047" title="push the node at first position in the linked list of given frequency" alt="" coords="228,5,402,46"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="180,23,212,23,212,28,180,28"/>
</map>

View File

@@ -1 +0,0 @@
136e5b2fde508fd9779a8e62e4f72912

View File

@@ -1,67 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: others::Cache::LFUCache::increase_frequency Pages: 1 -->
<svg width="306pt" height="39pt"
viewBox="0.00 0.00 305.50 38.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 34.5)">
<title>others::Cache::LFUCache::increase_frequency</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="increase the frequency of node and push it in the respective list.">
<polygon fill="#999999" stroke="#666666" points="130.75,-30.5 0,-30.5 0,0 130.75,0 130.75,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
<text text-anchor="middle" x="65.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">::increase_frequency</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adad4ab43141fb8ba43facd3a71e07047" target="_top" xlink:title="push the node at first position in the linked list of given frequency">
<polygon fill="white" stroke="#666666" points="297.5,-30.5 166.75,-30.5 166.75,0 297.5,0 297.5,-30.5"/>
<text text-anchor="start" x="174.75" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
<text text-anchor="middle" x="232.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">::push</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M131.02,-15.25C138.92,-15.25 147.05,-15.25 155.1,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="154.89,-18.75 164.89,-15.25 154.89,-11.75 154.89,-18.75"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: others::Cache::LFUCache::increase_frequency Pages: 1 -->
<svg width="306pt" height="39pt"
viewBox="0.00 0.00 305.50 38.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 34.5)">
<title>others::Cache::LFUCache::increase_frequency</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="increase the frequency of node and push it in the respective list.">
<polygon fill="#999999" stroke="#666666" points="130.75,-30.5 0,-30.5 0,0 130.75,0 130.75,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
<text text-anchor="middle" x="65.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">::increase_frequency</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adad4ab43141fb8ba43facd3a71e07047" target="_top" xlink:title="push the node at first position in the linked list of given frequency">
<polygon fill="white" stroke="#666666" points="297.5,-30.5 166.75,-30.5 166.75,0 297.5,0 297.5,-30.5"/>
<text text-anchor="start" x="174.75" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
<text text-anchor="middle" x="232.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">::push</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M131.02,-15.25C138.92,-15.25 147.05,-15.25 155.1,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="154.89,-18.75 164.89,-15.25 154.89,-11.75 154.89,-18.75"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -1,7 +0,0 @@
<map id="others::Cache::LFUCache::get" name="others::Cache::LFUCache::get">
<area shape="rect" id="Node000001" title="get the value of the key&#45;value pair if exists" alt="" coords="5,13,206,38"/>
<area shape="rect" id="Node000002" href="$df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a16a25c102554c5653721a5112ef676c9" title="increase the frequency of node and push it in the respective list." alt="" coords="254,5,428,46"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="206,23,238,23,238,28,206,28"/>
<area shape="rect" id="Node000003" href="$df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adad4ab43141fb8ba43facd3a71e07047" title="push the node at first position in the linked list of given frequency" alt="" coords="476,5,650,46"/>
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="428,23,460,23,460,28,428,28"/>
</map>

View File

@@ -1 +0,0 @@
a478dd2129b44698d51017d165ed8e6b

View File

@@ -1,85 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: others::Cache::LFUCache::get Pages: 1 -->
<svg width="492pt" height="39pt"
viewBox="0.00 0.00 491.75 38.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 34.5)">
<title>others::Cache::LFUCache::get</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="get the value of the key&#45;value pair if exists">
<polygon fill="#999999" stroke="#666666" points="150.25,-24.88 0,-24.88 0,-5.63 150.25,-5.63 150.25,-24.88"/>
<text text-anchor="middle" x="75.12" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache::get</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a16a25c102554c5653721a5112ef676c9" target="_top" xlink:title="increase the frequency of node and push it in the respective list.">
<polygon fill="white" stroke="#666666" points="317,-30.5 186.25,-30.5 186.25,0 317,0 317,-30.5"/>
<text text-anchor="start" x="194.25" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
<text text-anchor="middle" x="251.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">::increase_frequency</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M150.63,-15.25C158.54,-15.25 166.59,-15.25 174.51,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="174.48,-18.75 184.48,-15.25 174.48,-11.75 174.48,-18.75"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adad4ab43141fb8ba43facd3a71e07047" target="_top" xlink:title="push the node at first position in the linked list of given frequency">
<polygon fill="white" stroke="#666666" points="483.75,-30.5 353,-30.5 353,0 483.75,0 483.75,-30.5"/>
<text text-anchor="start" x="361" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
<text text-anchor="middle" x="418.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">::push</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node3 -->
<g id="edge2_Node000002_Node000003" class="edge">
<title>Node2&#45;&gt;Node3</title>
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M317.27,-15.25C325.17,-15.25 333.3,-15.25 341.35,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="341.14,-18.75 351.14,-15.25 341.14,-11.75 341.14,-18.75"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: others::Cache::LFUCache::get Pages: 1 -->
<svg width="492pt" height="39pt"
viewBox="0.00 0.00 491.75 38.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 34.5)">
<title>others::Cache::LFUCache::get</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="get the value of the key&#45;value pair if exists">
<polygon fill="#999999" stroke="#666666" points="150.25,-24.88 0,-24.88 0,-5.63 150.25,-5.63 150.25,-24.88"/>
<text text-anchor="middle" x="75.12" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache::get</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a16a25c102554c5653721a5112ef676c9" target="_top" xlink:title="increase the frequency of node and push it in the respective list.">
<polygon fill="white" stroke="#666666" points="317,-30.5 186.25,-30.5 186.25,0 317,0 317,-30.5"/>
<text text-anchor="start" x="194.25" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
<text text-anchor="middle" x="251.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">::increase_frequency</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M150.63,-15.25C158.54,-15.25 166.59,-15.25 174.51,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="174.48,-18.75 184.48,-15.25 174.48,-11.75 174.48,-18.75"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adad4ab43141fb8ba43facd3a71e07047" target="_top" xlink:title="push the node at first position in the linked list of given frequency">
<polygon fill="white" stroke="#666666" points="483.75,-30.5 353,-30.5 353,0 483.75,0 483.75,-30.5"/>
<text text-anchor="start" x="361" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
<text text-anchor="middle" x="418.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">::push</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node3 -->
<g id="edge2_Node000002_Node000003" class="edge">
<title>Node2&#45;&gt;Node3</title>
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M317.27,-15.25C325.17,-15.25 333.3,-15.25 341.35,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="341.14,-18.75 351.14,-15.25 341.14,-11.75 341.14,-18.75"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -1,10 +0,0 @@
<map id="others::Cache::LFUCache::put" name="others::Cache::LFUCache::put">
<area shape="rect" id="Node000001" title="upsert a key&#45;value pair" alt="" coords="5,70,206,96"/>
<area shape="rect" id="Node000002" href="$df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a16a25c102554c5653721a5112ef676c9" title="increase the frequency of node and push it in the respective list." alt="" coords="268,5,442,46"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="164,67,253,46,254,52,165,72"/>
<area shape="rect" id="Node000003" href="$df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adad4ab43141fb8ba43facd3a71e07047" title="push the node at first position in the linked list of given frequency" alt="" coords="505,35,679,75"/>
<area shape="poly" id="edge4_Node000001_Node000003" title=" " alt="" coords="206,75,489,58,489,64,206,80"/>
<area shape="rect" id="Node000004" href="$df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#ab3561ab204754295199f9566924f7e69" title="pop the last node in the least frequently used linked list" alt="" coords="254,121,457,146"/>
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="173,94,274,115,273,120,172,99"/>
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="443,34,490,40,489,45,442,39"/>
</map>

View File

@@ -1 +0,0 @@
2f5e8422a3e70831f5f71798302110cc

View File

@@ -1,169 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: others::Cache::LFUCache::put Pages: 1 -->
<!--zoomable 114 -->
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" onload="init(evt)">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<defs>
<circle id="rim" cx="0" cy="0" r="7"/>
<circle id="rim2" cx="0" cy="0" r="3.5"/>
<g id="zoomPlus">
<use xlink:href="#rim" fill="#404040"><set attributeName="fill" to="#808080" begin="zoomplus.mouseover" end="zoomplus.mouseout"/></use>
<path d="M-4,0h8M0,-4v8" fill="none" stroke="white" stroke-width="1.5" pointer-events="none"/>
</g>
<g id="zoomMin">
<use xlink:href="#rim" fill="#404040"><set attributeName="fill" to="#808080" begin="zoomminus.mouseover" end="zoomminus.mouseout"/></use>
<path d="M-4,0h8" fill="none" stroke="white" stroke-width="1.5" pointer-events="none"/>
</g>
<g id="arrowUp" transform="translate(30 24)">
<use xlink:href="#rim"/>
<path pointer-events="none" fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
</g>
<g id="arrowRight" transform="rotate(90) translate(36 -43)">
<use xlink:href="#rim"/>
<path pointer-events="none" fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
</g>
<g id="arrowDown" transform="rotate(180) translate(-30 -48)">
<use xlink:href="#rim"/>
<path pointer-events="none" fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
</g>
<g id="arrowLeft" transform="rotate(270) translate(-36 17)">
<use xlink:href="#rim"/>
<path pointer-events="none" fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
</g>
<g id="resetDef">
<use xlink:href="#rim2" fill="#404040"><set attributeName="fill" to="#808080" begin="reset.mouseover" end="reset.mouseout"/></use>
</g>
</defs>
<script type="application/ecmascript">
var viewWidth = 514;
var viewHeight = 114;
var sectionId = 'dynsection-3';
</script>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="viewport">
<title>others::Cache::LFUCache::put</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="upsert a key&#45;value pair">
<polygon fill="#999999" stroke="#666666" points="150.25,-57.25 0,-57.25 0,-38 150.25,-38 150.25,-57.25"/>
<text text-anchor="middle" x="75.12" y="-43.75" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache::put</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a16a25c102554c5653721a5112ef676c9" target="_top" xlink:title="increase the frequency of node and push it in the respective list.">
<polygon fill="white" stroke="#666666" points="327.88,-105.88 197.12,-105.88 197.12,-75.38 327.88,-75.38 327.88,-105.88"/>
<text text-anchor="start" x="205.12" y="-92.38" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
<text text-anchor="middle" x="262.5" y="-81.12" font-family="Helvetica,sans-Serif" font-size="10.00">::increase_frequency</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M119.59,-57.71C139.36,-62.29 163.34,-67.86 185.92,-73.09"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="184.86,-76.44 195.39,-75.29 186.44,-69.62 184.86,-76.44"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adad4ab43141fb8ba43facd3a71e07047" target="_top" xlink:title="push the node at first position in the linked list of given frequency">
<polygon fill="white" stroke="#666666" points="505.5,-83.88 374.75,-83.88 374.75,-53.38 505.5,-53.38 505.5,-83.88"/>
<text text-anchor="start" x="382.75" y="-70.38" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
<text text-anchor="middle" x="440.12" y="-59.12" font-family="Helvetica,sans-Serif" font-size="10.00">::push</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge4_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge4_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M150.46,-51.93C212.46,-55.51 300.45,-60.6 362.95,-64.22"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="362.62,-67.7 372.8,-64.79 363.02,-60.72 362.62,-67.7"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a xlink:href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#ab3561ab204754295199f9566924f7e69" target="_top" xlink:title="pop the last node in the least frequently used linked list">
<polygon fill="white" stroke="#666666" points="338.75,-19.25 186.25,-19.25 186.25,0 338.75,0 338.75,-19.25"/>
<text text-anchor="middle" x="262.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache::pop</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node4 -->
<g id="edge3_Node000001_Node000004" class="edge">
<title>Node1&#45;&gt;Node4</title>
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M125.32,-37.54C148.66,-32.76 176.77,-26.99 201.37,-21.95"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="201.83,-25.43 210.92,-19.99 200.42,-18.57 201.83,-25.43"/>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node3 -->
<g id="edge2_Node000002_Node000003" class="edge">
<title>Node2&#45;&gt;Node3</title>
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M327.9,-82.56C339.4,-81.12 351.48,-79.6 363.26,-78.13"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="363.45,-81.63 372.94,-76.92 362.58,-74.69 363.45,-81.63"/>
</a>
</g>
</g>
</g>
</svg>
<g id="navigator" transform="translate(0 0)" fill="#404254">
<rect fill="#f2f5e9" fill-opacity="0.5" stroke="#606060" stroke-width=".5" x="0" y="0" width="60" height="60"/>
<use id="zoomplus" xlink:href="#zoomPlus" x="17" y="9" onmousedown="handleZoom(evt,'in')"/>
<use id="zoomminus" xlink:href="#zoomMin" x="42" y="9" onmousedown="handleZoom(evt,'out')"/>
<use id="reset" xlink:href="#resetDef" x="30" y="36" onmousedown="handleReset()"/>
<use id="arrowup" xlink:href="#arrowUp" x="0" y="0" onmousedown="handlePan(0,-1)"/>
<use id="arrowright" xlink:href="#arrowRight" x="0" y="0" onmousedown="handlePan(1,0)"/>
<use id="arrowdown" xlink:href="#arrowDown" x="0" y="0" onmousedown="handlePan(0,1)"/>
<use id="arrowleft" xlink:href="#arrowLeft" x="0" y="0" onmousedown="handlePan(-1,0)"/>
</g>
<svg viewBox="0 0 15 15" width="100%" height="30px" preserveAspectRatio="xMaxYMin meet">
<g id="arrow_out" transform="scale(0.3 0.3)">
<a xlink:href="classothers_1_1_cache_1_1_l_f_u_cache_af6f8e5a66a45436b490dfe015ff8866e_cgraph_org.svg" target="_base">
<rect id="button" ry="5" rx="5" y="6" x="6" height="38" width="38"
fill="#f2f5e9" fill-opacity="0.5" stroke="#606060" stroke-width="1.0"/>
<path id="arrow"
d="M 11.500037,31.436501 C 11.940474,20.09759 22.043105,11.32322 32.158766,21.979434 L 37.068811,17.246167 C 37.068811,17.246167 37.088388,32 37.088388,32 L 22.160133,31.978069 C 22.160133,31.978069 26.997745,27.140456 26.997745,27.140456 C 18.528582,18.264221 13.291696,25.230495 11.500037,31.436501 z"
style="fill:#404040;"/>
</a>
</g>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 8.2 KiB

View File

@@ -1,86 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: others::Cache::LFUCache::put Pages: 1 -->
<svg width="514pt" height="114pt"
viewBox="0.00 0.00 513.50 113.88" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 109.88)">
<title>others::Cache::LFUCache::put</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="upsert a key&#45;value pair">
<polygon fill="#999999" stroke="#666666" points="150.25,-57.25 0,-57.25 0,-38 150.25,-38 150.25,-57.25"/>
<text text-anchor="middle" x="75.12" y="-43.75" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache::put</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#a16a25c102554c5653721a5112ef676c9" target="_top" xlink:title="increase the frequency of node and push it in the respective list.">
<polygon fill="white" stroke="#666666" points="327.88,-105.88 197.12,-105.88 197.12,-75.38 327.88,-75.38 327.88,-105.88"/>
<text text-anchor="start" x="205.12" y="-92.38" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
<text text-anchor="middle" x="262.5" y="-81.12" font-family="Helvetica,sans-Serif" font-size="10.00">::increase_frequency</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M119.59,-57.71C139.36,-62.29 163.34,-67.86 185.92,-73.09"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="184.86,-76.44 195.39,-75.29 186.44,-69.62 184.86,-76.44"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#adad4ab43141fb8ba43facd3a71e07047" target="_top" xlink:title="push the node at first position in the linked list of given frequency">
<polygon fill="white" stroke="#666666" points="505.5,-83.88 374.75,-83.88 374.75,-53.38 505.5,-53.38 505.5,-83.88"/>
<text text-anchor="start" x="382.75" y="-70.38" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
<text text-anchor="middle" x="440.12" y="-59.12" font-family="Helvetica,sans-Serif" font-size="10.00">::push</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge4_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge4_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M150.46,-51.93C212.46,-55.51 300.45,-60.6 362.95,-64.22"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="362.62,-67.7 372.8,-64.79 363.02,-60.72 362.62,-67.7"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a xlink:href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html#ab3561ab204754295199f9566924f7e69" target="_top" xlink:title="pop the last node in the least frequently used linked list">
<polygon fill="white" stroke="#666666" points="338.75,-19.25 186.25,-19.25 186.25,0 338.75,0 338.75,-19.25"/>
<text text-anchor="middle" x="262.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache::pop</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node4 -->
<g id="edge3_Node000001_Node000004" class="edge">
<title>Node1&#45;&gt;Node4</title>
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M125.32,-37.54C148.66,-32.76 176.77,-26.99 201.37,-21.95"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="201.83,-25.43 210.92,-19.99 200.42,-18.57 201.83,-25.43"/>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node3 -->
<g id="edge2_Node000002_Node000003" class="edge">
<title>Node2&#45;&gt;Node3</title>
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M327.9,-82.56C339.4,-81.12 351.48,-79.6 363.26,-78.13"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="363.45,-81.63 372.94,-76.92 362.58,-74.69 363.45,-81.63"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.3 KiB