mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-22 04:42:10 +08:00
Documentation for db149bf3b7
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||
<meta name="generator" content="Doxygen 1.9.5"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: range_queries/prefix_sum_array.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -41,10 +41,10 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.4 -->
|
||||
<!-- Generated by Doxygen 1.9.5 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="../../menudata.js"></script>
|
||||
@@ -84,9 +84,16 @@ $(document).ready(function(){initNavTree('d1/d9e/prefix__sum__array_8cpp.html','
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
@@ -106,7 +113,7 @@ $(document).ready(function(){initNavTree('d1/d9e/prefix__sum__array_8cpp.html','
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for prefix_sum_array.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d2/d76/prefix__sum__array_8cpp__incl.svg" width="256" height="127"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d2/d76/prefix__sum__array_8cpp__incl.svg" width="256" height="124"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div><table class="memberdecls">
|
||||
@@ -154,7 +161,7 @@ Variables</h2></td></tr>
|
||||
</ul>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="ab36151479ad37d53ef9fcb60a274b1d9" name="ab36151479ad37d53ef9fcb60a274b1d9"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ab36151479ad37d53ef9fcb60a274b1d9">◆ </a></span>build()</h2>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ab36151479ad37d53ef9fcb60a274b1d9">◆ </a></span>build()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -187,14 +194,14 @@ Variables</h2></td></tr>
|
||||
</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="../../d1/d9e/prefix__sum__array_8cpp_ab36151479ad37d53ef9fcb60a274b1d9_cgraph.svg" width="318" height="76"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/d9e/prefix__sum__array_8cpp_ab36151479ad37d53ef9fcb60a274b1d9_cgraph.svg" width="356" height="92"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">◆ </a></span>main()</h2>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">◆ </a></span>main()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -219,14 +226,14 @@ Here is the call graph for this function:</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="../../d1/d9e/prefix__sum__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="256" height="62"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/d9e/prefix__sum__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="154" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a7c8fd967c36dbba5fdf9c71faed604cf" name="a7c8fd967c36dbba5fdf9c71faed604cf"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a7c8fd967c36dbba5fdf9c71faed604cf">◆ </a></span>query()</h2>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a7c8fd967c36dbba5fdf9c71faed604cf">◆ </a></span>query()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -266,7 +273,7 @@ Here is the call graph for this function:</div>
|
||||
</div>
|
||||
</div>
|
||||
<a id="aa8dca7b867074164d5f45b0f3851269d" name="aa8dca7b867074164d5f45b0f3851269d"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#aa8dca7b867074164d5f45b0f3851269d">◆ </a></span>test()</h2>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#aa8dca7b867074164d5f45b0f3851269d">◆ </a></span>test()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -297,23 +304,16 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><span class="lineno"> 65</span> <a class="code hl_function" href="../../d1/d9e/prefix__sum__array_8cpp.html#ab36151479ad37d53ef9fcb60a274b1d9">range_queries::prefix_sum_array::build</a>(values);</div>
|
||||
<div class="line"><span class="lineno"> 66</span> <span class="comment">// queries are of the type: sum of the range [a, b] = psa[b] - psa[a-1]</span></div>
|
||||
<div class="line"><span class="lineno"> 67</span> </div>
|
||||
<div class="line"><span class="lineno"> 68</span> assert(<a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">range_queries::prefix_sum_array::query</a>(1, 10) ==</div>
|
||||
<div class="line"><span class="lineno"> 68</span> assert(range_queries::prefix_sum_array::query(1, 10) ==</div>
|
||||
<div class="line"><span class="lineno"> 69</span> 173); <span class="comment">// sum of the entire array</span></div>
|
||||
<div class="line"><span class="lineno"> 70</span> assert(<a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">range_queries::prefix_sum_array::query</a>(4, 6) ==</div>
|
||||
<div class="line"><span class="lineno"> 70</span> assert(range_queries::prefix_sum_array::query(4, 6) ==</div>
|
||||
<div class="line"><span class="lineno"> 71</span> 27); <span class="comment">// the sum of the interval [4, 6]</span></div>
|
||||
<div class="line"><span class="lineno"> 72</span> assert(<a class="code hl_function" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">range_queries::prefix_sum_array::query</a>(5, 9) ==</div>
|
||||
<div class="line"><span class="lineno"> 72</span> assert(range_queries::prefix_sum_array::query(5, 9) ==</div>
|
||||
<div class="line"><span class="lineno"> 73</span> 51); <span class="comment">// the sum of the interval [5, 9]</span></div>
|
||||
<div class="line"><span class="lineno"> 74</span>}</div>
|
||||
<div class="ttc" id="aprefix__sum__array_8cpp_html_ab36151479ad37d53ef9fcb60a274b1d9"><div class="ttname"><a href="../../d1/d9e/prefix__sum__array_8cpp.html#ab36151479ad37d53ef9fcb60a274b1d9">range_queries::prefix_sum_array::build</a></div><div class="ttdeci">void build(std::vector< int64_t > original_array)</div><div class="ttdoc">function that builds the PSA</div><div class="ttdef"><b>Definition:</b> prefix_sum_array.cpp:41</div></div>
|
||||
<div class="ttc" id="asegtree_8cpp_html_a423a97ea0c7ea6e33b5844a6858d902d"><div class="ttname"><a href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">query</a></div><div class="ttdeci">int64_t query(std::vector< int64_t > *segtree, std::vector< int64_t > *lazy, uint64_t qlow, uint64_t qhigh, uint64_t low, uint64_t high, uint64_t pos)</div><div class="ttdoc">Returns the sum of all elements in a range.</div><div class="ttdef"><b>Definition:</b> segtree.cpp:62</div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector< int64_t ></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="../../d1/d9e/prefix__sum__array_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="158" height="62"><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="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
@@ -322,7 +322,7 @@ Here is the call graph for this function:</div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_074119ce3a874b57120c49a0cc4bb5ad.html">range_queries</a></li><li class="navelem"><a class="el" href="../../d1/d9e/prefix__sum__array_8cpp.html">prefix_sum_array.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user