mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-07-16 11:32:44 +08:00
Documentation for 53a6c16730
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.2"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: data_structures::sparse_table::Sparse_table Struct Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -97,11 +97,17 @@ $(document).ready(function(){initNavTree('da/d37/structdata__structures_1_1spars
|
||||
<div class="headertitle"><div class="title">data_structures::sparse_table::Sparse_table Struct Reference</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="dynheader">
|
||||
Collaboration diagram for data_structures::sparse_table::Sparse_table:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/daa/structdata__structures_1_1sparse__table_1_1_sparse__table__coll__graph.svg" width="266" height="335"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
<center><span class="legend">[<a target="top" href="../../graph_legend.html">legend</a>]</span></center></div>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
|
||||
Public Member Functions</h2></td></tr>
|
||||
<tr class="memitem:a0c8cbe7239232863f104793c08273039"><td class="memItemLeft" align="right" valign="top">int64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html#a0c8cbe7239232863f104793c08273039">query</a> (int64_t l, int64_t r)</td></tr>
|
||||
<tr class="memdesc:a0c8cbe7239232863f104793c08273039"><td class="mdescLeft"> </td><td class="mdescRight">Queries the sparse table for the value of the interval <a href="../../i.e. from l to r inclusive" target="_blank">l, r</a>. <a href="../../da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html#a0c8cbe7239232863f104793c08273039">More...</a><br /></td></tr>
|
||||
<tr class="memdesc:a0c8cbe7239232863f104793c08273039"><td class="mdescLeft"> </td><td class="mdescRight">Queries the sparse table for the value of the interval [l, r] (i.e. from l to r inclusive). <a href="../../da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html#a0c8cbe7239232863f104793c08273039">More...</a><br /></td></tr>
|
||||
<tr class="separator:a0c8cbe7239232863f104793c08273039"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
|
||||
@@ -157,7 +163,7 @@ size_t </td><td class="memItemRight" valign="bottom"><b>n</b> = 0</td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Queries the sparse table for the value of the interval <a href="../../i.e. from l to r inclusive" target="_blank">l, r</a>. </p>
|
||||
<p>Queries the sparse table for the value of the interval [l, r] (i.e. from l to r inclusive). </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">l</td><td>the left index of the range (inclusive). </td></tr>
|
||||
@@ -170,17 +176,17 @@ size_t </td><td class="memItemRight" valign="bottom"><b>n</b> = 0</td></tr>
|
||||
<p >< represents minimum value over the range [g,l]</p>
|
||||
<p >< represents minimum value over the range [g, r - pow(2,g) + 1]</p>
|
||||
<p >< represents minimum value over the whole range [l,r]</p>
|
||||
<div class="fragment"><div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> {</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> int64_t <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">g</a> = <a class="code hl_variable" href="../../da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html#a6cf72f93b1551f0d943c585b4f173be3">LOG</a>[r - <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> + 1]; <span class="comment">///< smallest power of 2 covering [l,r]</span></div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> int64_t x = <a class="code hl_variable" href="../../da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html#ad36b9a20fed47b068e407008c04e9f81">ST</a>[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">g</a>][<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a>]; <span class="comment">///< represents minimum value over the range</span><span class="comment"></span></div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span><span class="comment"> ///< [g,l]</span></div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span><span class="comment"></span> int64_t y =</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <a class="code hl_variable" href="../../da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html#ad36b9a20fed47b068e407008c04e9f81">ST</a>[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">g</a>][r - (1 << <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">g</a>) + 1]; <span class="comment">///< represents minimum value over the</span><span class="comment"></span></div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span><span class="comment"> ///< range [g, r - pow(2,g) + 1]</span></div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordflow">return</span> (<a class="code hl_variable" href="../../da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html#ab78620742305a35ff2f8d61179f47d3e">A</a>[x] <= <a class="code hl_variable" href="../../da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html#ab78620742305a35ff2f8d61179f47d3e">A</a>[y] ? x : y); <span class="comment">///< represents minimum value over</span><span class="comment"></span></div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span><span class="comment"> ///< the whole range [l,r]</span></div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span><span class="comment"></span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 109</span> {</div>
|
||||
<div class="line"><span class="lineno"> 110</span> int64_t <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">g</a> = <a class="code hl_variable" href="../../da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html#a6cf72f93b1551f0d943c585b4f173be3">LOG</a>[r - <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> + 1]; <span class="comment">///< smallest power of 2 covering [l,r]</span></div>
|
||||
<div class="line"><span class="lineno"> 111</span> int64_t x = <a class="code hl_variable" href="../../da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html#ad36b9a20fed47b068e407008c04e9f81">ST</a>[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">g</a>][<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a>]; <span class="comment">///< represents minimum value over the range</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 112</span><span class="comment"> ///< [g,l]</span></div>
|
||||
<div class="line"><span class="lineno"> 113</span><span class="comment"></span> int64_t y =</div>
|
||||
<div class="line"><span class="lineno"> 114</span> <a class="code hl_variable" href="../../da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html#ad36b9a20fed47b068e407008c04e9f81">ST</a>[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">g</a>][r - (1 << <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">g</a>) + 1]; <span class="comment">///< represents minimum value over the</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 115</span><span class="comment"> ///< range [g, r - pow(2,g) + 1]</span></div>
|
||||
<div class="line"><span class="lineno"> 116</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 117</span> <span class="keywordflow">return</span> (<a class="code hl_variable" href="../../da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html#ab78620742305a35ff2f8d61179f47d3e">A</a>[x] <= <a class="code hl_variable" href="../../da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html#ab78620742305a35ff2f8d61179f47d3e">A</a>[y] ? x : y); <span class="comment">///< represents minimum value over</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 118</span><span class="comment"> ///< the whole range [l,r]</span></div>
|
||||
<div class="line"><span class="lineno"> 119</span><span class="comment"></span> }</div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a2f67508d5f392b0321772169342c98ad"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">numerical_methods::simpson_method::g</a></div><div class="ttdeci">double g(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition:</b> composite_simpson_rule.cpp:115</div></div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a6d8df83a6f26ce24a75d3b358b7f5b8a"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">numerical_methods::simpson_method::l</a></div><div class="ttdeci">double l(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition:</b> composite_simpson_rule.cpp:119</div></div>
|
||||
<div class="ttc" id="astructdata__structures_1_1sparse__table_1_1_sparse__table_html_a6cf72f93b1551f0d943c585b4f173be3"><div class="ttname"><a href="../../da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html#a6cf72f93b1551f0d943c585b4f173be3">data_structures::sparse_table::Sparse_table::LOG</a></div><div class="ttdeci">std::array< int64_t, N > LOG</div><div class="ttdoc">where floor(log2(i)) are precomputed.</div><div class="ttdef"><b>Definition:</b> sparse_table.cpp:59</div></div>
|
||||
@@ -216,7 +222,7 @@ size_t </td><td class="memItemRight" valign="bottom"><b>n</b> = 0</td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d5/d3c/namespacedata__structures.html">data_structures</a></li><li class="navelem"><b>sparse_table</b></li><li class="navelem"><a class="el" href="../../da/d37/structdata__structures_1_1sparse__table_1_1_sparse__table.html">Sparse_table</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user