Documentation for c26eea874d
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/iterative_factorial.cpp Pages: 1 -->
|
||||
<svg width="268pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/iterative_factorial.cpp Pages: 1 -->
|
||||
<svg width="268pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/babylonian_method.cpp Pages: 1 -->
|
||||
<svg width="189pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/babylonian_method.cpp Pages: 1 -->
|
||||
<svg width="189pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: hashing/sha256.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -170,7 +170,7 @@ Functions</h2></td></tr>
|
||||
<tr class="memitem:a28c1c6724dc6bcf91a39818699bbec27" id="r_a28c1c6724dc6bcf91a39818699bbec27"><td class="memItemLeft" align="right" valign="top">std::size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#a28c1c6724dc6bcf91a39818699bbec27">hashing::sha256::compute_padded_size</a> (const std::size_t input_size)</td></tr>
|
||||
<tr class="memdesc:a28c1c6724dc6bcf91a39818699bbec27"><td class="mdescLeft"> </td><td class="mdescRight">Computes size of the padded input. <br /></td></tr>
|
||||
<tr class="separator:a28c1c6724dc6bcf91a39818699bbec27"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:afea411191ec5281f43e91ea327984627" id="r_afea411191ec5281f43e91ea327984627"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:afea411191ec5281f43e91ea327984627" id="r_afea411191ec5281f43e91ea327984627"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:afea411191ec5281f43e91ea327984627"><td class="memTemplItemLeft" align="right" valign="top">uint8_t </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#afea411191ec5281f43e91ea327984627">hashing::sha256::extract_byte</a> (const T in_value, const std::size_t byte_num)</td></tr>
|
||||
<tr class="memdesc:afea411191ec5281f43e91ea327984627"><td class="mdescLeft"> </td><td class="mdescRight">Returns the byte at position byte_num in in_value. <br /></td></tr>
|
||||
<tr class="separator:afea411191ec5281f43e91ea327984627"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -277,23 +277,23 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 199</span> <span class="comment">// Copy chunk into first 16 words of the message schedule array</span></div>
|
||||
<div class="line"><span class="lineno"> 200</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> block_num = 0; block_num < 16; ++block_num) {</div>
|
||||
<div class="line"><span class="lineno"> 201</span> blocks[block_num] =</div>
|
||||
<div class="line"><span class="lineno"> 202</span> (<span class="keyword">static_cast<</span>uint8_t<span class="keyword">></span>(<a class="code hl_function" href="#a9e98c180d32b04aab6f767cb0c13e1da">get_char</a>(input, byte_num + block_num * 4))</div>
|
||||
<div class="line"><span class="lineno"> 202</span> (<span class="keyword">static_cast<</span>uint8_t<span class="keyword">></span>(get_char(input, byte_num + block_num * 4))</div>
|
||||
<div class="line"><span class="lineno"> 203</span> << 24) |</div>
|
||||
<div class="line"><span class="lineno"> 204</span> (<span class="keyword">static_cast<</span>uint8_t<span class="keyword">></span>(<a class="code hl_function" href="#a9e98c180d32b04aab6f767cb0c13e1da">get_char</a>(input, byte_num + block_num * 4 + 1))</div>
|
||||
<div class="line"><span class="lineno"> 204</span> (<span class="keyword">static_cast<</span>uint8_t<span class="keyword">></span>(get_char(input, byte_num + block_num * 4 + 1))</div>
|
||||
<div class="line"><span class="lineno"> 205</span> << 16) |</div>
|
||||
<div class="line"><span class="lineno"> 206</span> (<span class="keyword">static_cast<</span>uint8_t<span class="keyword">></span>(<a class="code hl_function" href="#a9e98c180d32b04aab6f767cb0c13e1da">get_char</a>(input, byte_num + block_num * 4 + 2))</div>
|
||||
<div class="line"><span class="lineno"> 206</span> (<span class="keyword">static_cast<</span>uint8_t<span class="keyword">></span>(get_char(input, byte_num + block_num * 4 + 2))</div>
|
||||
<div class="line"><span class="lineno"> 207</span> << 8) |</div>
|
||||
<div class="line"><span class="lineno"> 208</span> <span class="keyword">static_cast<</span>uint8_t<span class="keyword">></span>(<a class="code hl_function" href="#a9e98c180d32b04aab6f767cb0c13e1da">get_char</a>(input, byte_num + block_num * 4 + 3));</div>
|
||||
<div class="line"><span class="lineno"> 208</span> <span class="keyword">static_cast<</span>uint8_t<span class="keyword">></span>(get_char(input, byte_num + block_num * 4 + 3));</div>
|
||||
<div class="line"><span class="lineno"> 209</span> }</div>
|
||||
<div class="line"><span class="lineno"> 210</span> </div>
|
||||
<div class="line"><span class="lineno"> 211</span> <span class="comment">// Extend the first 16 words into remaining 48 words of the message schedule</span></div>
|
||||
<div class="line"><span class="lineno"> 212</span> <span class="comment">// array</span></div>
|
||||
<div class="line"><span class="lineno"> 213</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> block_num = 16; block_num < 64; ++block_num) {</div>
|
||||
<div class="line"><span class="lineno"> 214</span> <span class="keyword">const</span> <span class="keyword">auto</span> s0 = <a class="code hl_function" href="#adbcd504103c342a4da718f8fce6ff06c">right_rotate</a>(blocks[block_num - 15], 7) ^</div>
|
||||
<div class="line"><span class="lineno"> 215</span> <a class="code hl_function" href="#adbcd504103c342a4da718f8fce6ff06c">right_rotate</a>(blocks[block_num - 15], 18) ^</div>
|
||||
<div class="line"><span class="lineno"> 214</span> <span class="keyword">const</span> <span class="keyword">auto</span> s0 = right_rotate(blocks[block_num - 15], 7) ^</div>
|
||||
<div class="line"><span class="lineno"> 215</span> right_rotate(blocks[block_num - 15], 18) ^</div>
|
||||
<div class="line"><span class="lineno"> 216</span> (blocks[block_num - 15] >> 3);</div>
|
||||
<div class="line"><span class="lineno"> 217</span> <span class="keyword">const</span> <span class="keyword">auto</span> s1 = <a class="code hl_function" href="#adbcd504103c342a4da718f8fce6ff06c">right_rotate</a>(blocks[block_num - 2], 17) ^</div>
|
||||
<div class="line"><span class="lineno"> 218</span> <a class="code hl_function" href="#adbcd504103c342a4da718f8fce6ff06c">right_rotate</a>(blocks[block_num - 2], 19) ^</div>
|
||||
<div class="line"><span class="lineno"> 217</span> <span class="keyword">const</span> <span class="keyword">auto</span> s1 = right_rotate(blocks[block_num - 2], 17) ^</div>
|
||||
<div class="line"><span class="lineno"> 218</span> right_rotate(blocks[block_num - 2], 19) ^</div>
|
||||
<div class="line"><span class="lineno"> 219</span> (blocks[block_num - 2] >> 10);</div>
|
||||
<div class="line"><span class="lineno"> 220</span> blocks[block_num] =</div>
|
||||
<div class="line"><span class="lineno"> 221</span> blocks[block_num - 16] + s0 + blocks[block_num - 7] + s1;</div>
|
||||
@@ -301,8 +301,6 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 223</span> </div>
|
||||
<div class="line"><span class="lineno"> 224</span> <span class="keywordflow">return</span> blocks;</div>
|
||||
<div class="line"><span class="lineno"> 225</span>}</div>
|
||||
<div class="ttc" id="asha256_8cpp_html_a9e98c180d32b04aab6f767cb0c13e1da"><div class="ttname"><a href="#a9e98c180d32b04aab6f767cb0c13e1da">hashing::sha256::get_char</a></div><div class="ttdeci">char get_char(const std::string &input, std::size_t pos)</div><div class="ttdoc">Returns the character at pos after the input is padded.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d08/sha256_8cpp_source.html#l00170">sha256.cpp:170</a></div></div>
|
||||
<div class="ttc" id="asha256_8cpp_html_adbcd504103c342a4da718f8fce6ff06c"><div class="ttname"><a href="#adbcd504103c342a4da718f8fce6ff06c">hashing::sha256::right_rotate</a></div><div class="ttdeci">uint32_t right_rotate(uint32_t n, size_t rotate)</div><div class="ttdoc">Rotates the bits of a 32-bit unsigned integer.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d08/sha256_8cpp_source.html#l00058">sha256.cpp:58</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -312,7 +310,7 @@ Functions</h2></td></tr>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">uint8_t hashing::sha256::extract_byte </td>
|
||||
@@ -385,7 +383,7 @@ template<typename T > </div>
|
||||
<div class="line"><span class="lineno"> 175</span> <span class="keywordflow">if</span> (pos == input_size) {</div>
|
||||
<div class="line"><span class="lineno"> 176</span> <span class="keywordflow">return</span> <span class="stringliteral">'\x80'</span>;</div>
|
||||
<div class="line"><span class="lineno"> 177</span> }</div>
|
||||
<div class="line"><span class="lineno"> 178</span> <span class="keyword">const</span> <span class="keyword">auto</span> padded_input_size = <a class="code hl_function" href="#a28c1c6724dc6bcf91a39818699bbec27">compute_padded_size</a>(input_size);</div>
|
||||
<div class="line"><span class="lineno"> 178</span> <span class="keyword">const</span> <span class="keyword">auto</span> padded_input_size = compute_padded_size(input_size);</div>
|
||||
<div class="line"><span class="lineno"> 179</span> <span class="keywordflow">if</span> (pos < padded_input_size - 8) {</div>
|
||||
<div class="line"><span class="lineno"> 180</span> <span class="keywordflow">return</span> <span class="stringliteral">'\x00'</span>;</div>
|
||||
<div class="line"><span class="lineno"> 181</span> }</div>
|
||||
@@ -393,9 +391,9 @@ template<typename T > </div>
|
||||
<div class="line"><span class="lineno"> 183</span> <span class="keywordflow">throw</span> std::out_of_range(<span class="stringliteral">"pos is out of range"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 184</span> }</div>
|
||||
<div class="line"><span class="lineno"> 185</span> <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><span class="keywordtype">char</span><span class="keyword">></span>(</div>
|
||||
<div class="line"><span class="lineno"> 186</span> extract_byte<size_t>(input_size * 8, padded_input_size - pos - 1));</div>
|
||||
<div class="line"><span class="lineno"> 186</span> <a class="code hl_function" href="#afea411191ec5281f43e91ea327984627">extract_byte<size_t></a>(input_size * 8, padded_input_size - pos - 1));</div>
|
||||
<div class="line"><span class="lineno"> 187</span>}</div>
|
||||
<div class="ttc" id="asha256_8cpp_html_a28c1c6724dc6bcf91a39818699bbec27"><div class="ttname"><a href="#a28c1c6724dc6bcf91a39818699bbec27">hashing::sha256::compute_padded_size</a></div><div class="ttdeci">std::size_t compute_padded_size(const std::size_t input_size)</div><div class="ttdoc">Computes size of the padded input.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d08/sha256_8cpp_source.html#l00143">sha256.cpp:143</a></div></div>
|
||||
<div class="ttc" id="asha256_8cpp_html_afea411191ec5281f43e91ea327984627"><div class="ttname"><a href="#afea411191ec5281f43e91ea327984627">hashing::sha256::extract_byte</a></div><div class="ttdeci">uint8_t extract_byte(const T in_value, const std::size_t byte_num)</div><div class="ttdoc">Returns the byte at position byte_num in in_value.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d08/sha256_8cpp_source.html#l00157">sha256.cpp:157</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -419,10 +417,10 @@ template<typename T > </div>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d08/sha256_8cpp_source.html#l00326">326</a> of file <a class="el" href="../../d4/d08/sha256_8cpp_source.html">sha256.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 326</span> {</div>
|
||||
<div class="line"><span class="lineno"> 327</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>(); <span class="comment">// Run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 327</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// Run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 328</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 329</span>}</div>
|
||||
<div class="ttc" id="acaesar__cipher_8cpp_html_ae1a3968e7947464bee7714f6d43b7002"><div class="ttname"><a href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a></div><div class="ttdeci">void test()</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d2c/caesar__cipher_8cpp_source.html#l00100">caesar_cipher.cpp:100</a></div></div>
|
||||
<div class="ttc" id="agenerate__parentheses_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d1e/generate__parentheses_8cpp_source.html#l00082">generate_parentheses.cpp:82</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -488,7 +486,7 @@ template<typename T > </div>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d08/sha256_8cpp_source.html#l00232">232</a> of file <a class="el" href="../../d4/d08/sha256_8cpp_source.html">sha256.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 232</span> {</div>
|
||||
<div class="line"><span class="lineno"> 233</span> Hash <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>;</div>
|
||||
<div class="line"><span class="lineno"> 233</span> <a class="code hl_class" href="../../d6/d84/classhashing_1_1sha256_1_1_hash.html">Hash</a> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>;</div>
|
||||
<div class="line"><span class="lineno"> 234</span> <span class="comment">// Process message in successive 512-bit (64-byte) chunks</span></div>
|
||||
<div class="line"><span class="lineno"> 235</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> byte_num = 0; byte_num < <a class="code hl_function" href="#a28c1c6724dc6bcf91a39818699bbec27">compute_padded_size</a>(input.length());</div>
|
||||
<div class="line"><span class="lineno"> 236</span> byte_num += 64) {</div>
|
||||
@@ -496,7 +494,9 @@ template<typename T > </div>
|
||||
<div class="line"><span class="lineno"> 238</span> }</div>
|
||||
<div class="line"><span class="lineno"> 239</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>.to_string();</div>
|
||||
<div class="line"><span class="lineno"> 240</span>}</div>
|
||||
<div class="ttc" id="aclasshashing_1_1sha256_1_1_hash_html"><div class="ttname"><a href="../../d6/d84/classhashing_1_1sha256_1_1_hash.html">hashing::sha256::Hash</a></div><div class="ttdoc">Contains hash array and functions to update it and convert it to a hexadecimal string.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d08/sha256_8cpp_source.html#l00040">sha256.cpp:40</a></div></div>
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a566eaf0ffafd50bc61e644561fd27001"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a></div><div class="ttdeci">int h(int key)</div><div class="ttdef"><b>Definition</b> <a href="../../d1/df3/hash__search_8cpp_source.html#l00045">hash_search.cpp:45</a></div></div>
|
||||
<div class="ttc" id="asha256_8cpp_html_a28c1c6724dc6bcf91a39818699bbec27"><div class="ttname"><a href="#a28c1c6724dc6bcf91a39818699bbec27">hashing::sha256::compute_padded_size</a></div><div class="ttdeci">std::size_t compute_padded_size(const std::size_t input_size)</div><div class="ttdoc">Computes size of the padded input.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d08/sha256_8cpp_source.html#l00143">sha256.cpp:143</a></div></div>
|
||||
<div class="ttc" id="asha256_8cpp_html_a525531b3939ed44fbf01674e21931b3a"><div class="ttname"><a href="#a525531b3939ed44fbf01674e21931b3a">hashing::sha256::create_message_schedule_array</a></div><div class="ttdeci">std::array< uint32_t, 64 > create_message_schedule_array(const std::string &input, const size_t byte_num)</div><div class="ttdoc">Creates the message schedule array.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d08/sha256_8cpp_source.html#l00195">sha256.cpp:195</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -519,7 +519,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -556,7 +556,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -566,9 +566,9 @@ template<typename T > </div>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d08/sha256_8cpp_source.html#l00248">248</a> of file <a class="el" href="../../d4/d08/sha256_8cpp_source.html">sha256.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 248</span> {</div>
|
||||
<div class="line"><span class="lineno"> 249</span> assert(hashing::sha256::compute_padded_size(55) == 64);</div>
|
||||
<div class="line"><span class="lineno"> 250</span> assert(hashing::sha256::compute_padded_size(56) == 128);</div>
|
||||
<div class="line"><span class="lineno"> 251</span> assert(hashing::sha256::compute_padded_size(130) == 192);</div>
|
||||
<div class="line"><span class="lineno"> 249</span> assert(<a class="code hl_function" href="#a28c1c6724dc6bcf91a39818699bbec27">hashing::sha256::compute_padded_size</a>(55) == 64);</div>
|
||||
<div class="line"><span class="lineno"> 250</span> assert(<a class="code hl_function" href="#a28c1c6724dc6bcf91a39818699bbec27">hashing::sha256::compute_padded_size</a>(56) == 128);</div>
|
||||
<div class="line"><span class="lineno"> 251</span> assert(<a class="code hl_function" href="#a28c1c6724dc6bcf91a39818699bbec27">hashing::sha256::compute_padded_size</a>(130) == 192);</div>
|
||||
<div class="line"><span class="lineno"> 252</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -591,18 +591,18 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d08/sha256_8cpp_source.html#l00254">254</a> of file <a class="el" href="../../d4/d08/sha256_8cpp_source.html">sha256.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 254</span> {</div>
|
||||
<div class="line"><span class="lineno"> 255</span> assert(hashing::sha256::extract_byte<uint32_t>(512, 0) == 0);</div>
|
||||
<div class="line"><span class="lineno"> 256</span> assert(hashing::sha256::extract_byte<uint32_t>(512, 1) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 255</span> assert(<a class="code hl_function" href="#afea411191ec5281f43e91ea327984627">hashing::sha256::extract_byte<uint32_t></a>(512, 0) == 0);</div>
|
||||
<div class="line"><span class="lineno"> 256</span> assert(<a class="code hl_function" href="#afea411191ec5281f43e91ea327984627">hashing::sha256::extract_byte<uint32_t></a>(512, 1) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 257</span> <span class="keywordtype">bool</span> exception = <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 258</span> <span class="keywordflow">try</span> {</div>
|
||||
<div class="line"><span class="lineno"> 259</span> hashing::sha256::extract_byte<uint32_t>(512, 5);</div>
|
||||
<div class="line"><span class="lineno"> 259</span> <a class="code hl_function" href="#afea411191ec5281f43e91ea327984627">hashing::sha256::extract_byte<uint32_t></a>(512, 5);</div>
|
||||
<div class="line"><span class="lineno"> 260</span> } <span class="keywordflow">catch</span> (<span class="keyword">const</span> std::out_of_range &) {</div>
|
||||
<div class="line"><span class="lineno"> 261</span> exception = <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 262</span> }</div>
|
||||
@@ -629,17 +629,17 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d08/sha256_8cpp_source.html#l00266">266</a> of file <a class="el" href="../../d4/d08/sha256_8cpp_source.html">sha256.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 266</span> {</div>
|
||||
<div class="line"><span class="lineno"> 267</span> assert(hashing::sha256::get_char(<span class="stringliteral">"test"</span>, 3) == <span class="charliteral">'t'</span>);</div>
|
||||
<div class="line"><span class="lineno"> 268</span> assert(hashing::sha256::get_char(<span class="stringliteral">"test"</span>, 4) == <span class="stringliteral">'\x80'</span>);</div>
|
||||
<div class="line"><span class="lineno"> 269</span> assert(hashing::sha256::get_char(<span class="stringliteral">"test"</span>, 5) == <span class="stringliteral">'\x00'</span>);</div>
|
||||
<div class="line"><span class="lineno"> 270</span> assert(hashing::sha256::get_char(<span class="stringliteral">"test"</span>, 63) == 32);</div>
|
||||
<div class="line"><span class="lineno"> 267</span> assert(<a class="code hl_function" href="#a9e98c180d32b04aab6f767cb0c13e1da">hashing::sha256::get_char</a>(<span class="stringliteral">"test"</span>, 3) == <span class="charliteral">'t'</span>);</div>
|
||||
<div class="line"><span class="lineno"> 268</span> assert(<a class="code hl_function" href="#a9e98c180d32b04aab6f767cb0c13e1da">hashing::sha256::get_char</a>(<span class="stringliteral">"test"</span>, 4) == <span class="stringliteral">'\x80'</span>);</div>
|
||||
<div class="line"><span class="lineno"> 269</span> assert(<a class="code hl_function" href="#a9e98c180d32b04aab6f767cb0c13e1da">hashing::sha256::get_char</a>(<span class="stringliteral">"test"</span>, 5) == <span class="stringliteral">'\x00'</span>);</div>
|
||||
<div class="line"><span class="lineno"> 270</span> assert(<a class="code hl_function" href="#a9e98c180d32b04aab6f767cb0c13e1da">hashing::sha256::get_char</a>(<span class="stringliteral">"test"</span>, 63) == 32);</div>
|
||||
<div class="line"><span class="lineno"> 271</span> <span class="keywordtype">bool</span> exception = <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 272</span> <span class="keywordflow">try</span> {</div>
|
||||
<div class="line"><span class="lineno"> 273</span> <a class="code hl_function" href="#a9e98c180d32b04aab6f767cb0c13e1da">hashing::sha256::get_char</a>(<span class="stringliteral">"test"</span>, 64);</div>
|
||||
@@ -648,6 +648,7 @@ template<typename T > </div>
|
||||
<div class="line"><span class="lineno"> 276</span> }</div>
|
||||
<div class="line"><span class="lineno"> 277</span> assert(exception);</div>
|
||||
<div class="line"><span class="lineno"> 278</span>}</div>
|
||||
<div class="ttc" id="asha256_8cpp_html_a9e98c180d32b04aab6f767cb0c13e1da"><div class="ttname"><a href="#a9e98c180d32b04aab6f767cb0c13e1da">hashing::sha256::get_char</a></div><div class="ttdeci">char get_char(const std::string &input, std::size_t pos)</div><div class="ttdoc">Returns the character at pos after the input is padded.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d08/sha256_8cpp_source.html#l00170">sha256.cpp:170</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -669,17 +670,18 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d08/sha256_8cpp_source.html#l00280">280</a> of file <a class="el" href="../../d4/d08/sha256_8cpp_source.html">sha256.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 280</span> {</div>
|
||||
<div class="line"><span class="lineno"> 281</span> assert(hashing::sha256::right_rotate(128, 3) == 16);</div>
|
||||
<div class="line"><span class="lineno"> 282</span> assert(hashing::sha256::right_rotate(1, 30) == 4);</div>
|
||||
<div class="line"><span class="lineno"> 283</span> assert(hashing::sha256::right_rotate(6, 30) == 24);</div>
|
||||
<div class="line"><span class="lineno"> 281</span> assert(<a class="code hl_function" href="#adbcd504103c342a4da718f8fce6ff06c">hashing::sha256::right_rotate</a>(128, 3) == 16);</div>
|
||||
<div class="line"><span class="lineno"> 282</span> assert(<a class="code hl_function" href="#adbcd504103c342a4da718f8fce6ff06c">hashing::sha256::right_rotate</a>(1, 30) == 4);</div>
|
||||
<div class="line"><span class="lineno"> 283</span> assert(<a class="code hl_function" href="#adbcd504103c342a4da718f8fce6ff06c">hashing::sha256::right_rotate</a>(6, 30) == 24);</div>
|
||||
<div class="line"><span class="lineno"> 284</span>}</div>
|
||||
<div class="ttc" id="asha256_8cpp_html_adbcd504103c342a4da718f8fce6ff06c"><div class="ttname"><a href="#adbcd504103c342a4da718f8fce6ff06c">hashing::sha256::right_rotate</a></div><div class="ttdeci">uint32_t right_rotate(uint32_t n, size_t rotate)</div><div class="ttdoc">Rotates the bits of a 32-bit unsigned integer.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d08/sha256_8cpp_source.html#l00058">sha256.cpp:58</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -701,7 +703,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -711,7 +713,7 @@ template<typename T > </div>
|
||||
<div class="line"><span class="lineno"> 287</span> <span class="keyword">struct </span><a class="code hl_struct" href="../../da/d86/struct_test_case.html">TestCase</a> {</div>
|
||||
<div class="line"><span class="lineno"> 288</span> <span class="keyword">const</span> std::string input;</div>
|
||||
<div class="line"><span class="lineno"> 289</span> <span class="keyword">const</span> std::string expected_hash;</div>
|
||||
<div class="line"><span class="lineno"> 290</span> <a class="code hl_struct" href="../../da/d86/struct_test_case.html">TestCase</a>(std::string input, std::string expected_hash)</div>
|
||||
<div class="line"><span class="lineno"> 290</span> TestCase(std::string input, std::string expected_hash)</div>
|
||||
<div class="line"><span class="lineno"> 291</span> : input(std::move(input)),</div>
|
||||
<div class="line"><span class="lineno"> 292</span> expected_hash(std::move(expected_hash)) {}</div>
|
||||
<div class="line"><span class="lineno"> 293</span> };</div>
|
||||
@@ -729,9 +731,10 @@ template<typename T > </div>
|
||||
<div class="line"><span class="lineno"> 305</span> <span class="stringliteral">"7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9"</span></div>
|
||||
<div class="line"><span class="lineno"> 306</span> <span class="stringliteral">"069"</span>)};</div>
|
||||
<div class="line"><span class="lineno"> 307</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &tc : test_cases) {</div>
|
||||
<div class="line"><span class="lineno"> 308</span> assert(hashing::sha256::sha256(tc.input) == tc.expected_hash);</div>
|
||||
<div class="line"><span class="lineno"> 308</span> assert(<a class="code hl_function" href="#a55475649a2bb7aae15de0716a217f43a">hashing::sha256::sha256</a>(tc.input) == tc.expected_hash);</div>
|
||||
<div class="line"><span class="lineno"> 309</span> }</div>
|
||||
<div class="line"><span class="lineno"> 310</span>}</div>
|
||||
<div class="ttc" id="asha256_8cpp_html_a55475649a2bb7aae15de0716a217f43a"><div class="ttname"><a href="#a55475649a2bb7aae15de0716a217f43a">hashing::sha256::sha256</a></div><div class="ttdeci">std::string sha256(const std::string &input)</div><div class="ttdoc">Computes the final hash value.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d08/sha256_8cpp_source.html#l00232">sha256.cpp:232</a></div></div>
|
||||
<div class="ttc" id="astruct_test_case_html"><div class="ttname"><a href="../../da/d86/struct_test_case.html">TestCase</a></div><div class="ttdoc">represents single example inputs and expected output of the function longest_common_string_length</div><div class="ttdef"><b>Definition</b> <a href="../../da/d0d/longest__common__string_8cpp_source.html#l00054">longest_common_string.cpp:54</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -742,7 +745,7 @@ template<typename T > </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_ece9b94c107bbaa1dd68197a8c9983b9.html">hashing</a></li><li class="navelem"><a class="el" href="../../d4/d08/sha256_8cpp.html">sha256.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
var sha256_8cpp =
|
||||
[
|
||||
[ "hashing::sha256::Hash", "d6/d84/classhashing_1_1sha256_1_1_hash.html", "d6/d84/classhashing_1_1sha256_1_1_hash" ],
|
||||
[ "compute_padded_size", "d4/d08/sha256_8cpp.html#a28c1c6724dc6bcf91a39818699bbec27", null ],
|
||||
[ "create_message_schedule_array", "d4/d08/sha256_8cpp.html#a525531b3939ed44fbf01674e21931b3a", null ],
|
||||
[ "extract_byte", "d4/d08/sha256_8cpp.html#afea411191ec5281f43e91ea327984627", null ],
|
||||
[ "get_char", "d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da", null ],
|
||||
[ "hashing::sha256::compute_padded_size", "d4/d08/sha256_8cpp.html#a28c1c6724dc6bcf91a39818699bbec27", null ],
|
||||
[ "hashing::sha256::create_message_schedule_array", "d4/d08/sha256_8cpp.html#a525531b3939ed44fbf01674e21931b3a", null ],
|
||||
[ "hashing::sha256::extract_byte", "d4/d08/sha256_8cpp.html#afea411191ec5281f43e91ea327984627", null ],
|
||||
[ "hashing::sha256::get_char", "d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da", null ],
|
||||
[ "main", "d4/d08/sha256_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "right_rotate", "d4/d08/sha256_8cpp.html#adbcd504103c342a4da718f8fce6ff06c", null ],
|
||||
[ "sha256", "d4/d08/sha256_8cpp.html#a55475649a2bb7aae15de0716a217f43a", null ],
|
||||
[ "hashing::sha256::right_rotate", "d4/d08/sha256_8cpp.html#adbcd504103c342a4da718f8fce6ff06c", null ],
|
||||
[ "hashing::sha256::sha256", "d4/d08/sha256_8cpp.html#a55475649a2bb7aae15de0716a217f43a", null ],
|
||||
[ "test_compute_padded_size", "d4/d08/sha256_8cpp.html#af9b52eba85d23e309035354141259f27", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: hashing/sha256.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,8 @@ $(function(){initNavTree('d4/d08/sha256_8cpp_source.html','../../'); initResizab
|
||||
<div class="headertitle"><div class="title">sha256.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d08/sha256_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d08/sha256_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <array></span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <cstdint></span> </div>
|
||||
@@ -133,9 +134,9 @@ $(function(){initNavTree('d4/d08/sha256_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include <sstream></span> </div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include <utility></span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d6/d0c/namespacehashing.html">hashing</a> {</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="keyword">namespace </span><a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a55475649a2bb7aae15de0716a217f43a">sha256</a> {</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="keyword">namespace </span>sha256 {</div>
|
||||
<div class="foldopen" id="foldopen00040" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="../../d6/d84/classhashing_1_1sha256_1_1_hash.html"> 40</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d6/d84/classhashing_1_1sha256_1_1_hash.html">Hash</a> {</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="comment">// Initialize array of hash values with first 32 bits of the fractional</span></div>
|
||||
@@ -149,13 +150,13 @@ $(function(){initNavTree('d4/d08/sha256_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> std::string <a class="code hl_function" href="../../d6/d84/classhashing_1_1sha256_1_1_hash.html#a4581f503a263d8e928e5716d54477e08">to_string</a>() <span class="keyword">const</span>;</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> </div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span></div>
|
||||
<div class="foldopen" id="foldopen00058" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="../../d4/d08/sha256_8cpp.html#adbcd504103c342a4da718f8fce6ff06c"> 58</a></span>uint32_t <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#adbcd504103c342a4da718f8fce6ff06c">right_rotate</a>(uint32_t n, <span class="keywordtype">size_t</span> rotate) {</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordflow">return</span> (n >> rotate) | (n << (32 - rotate));</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span></div>
|
||||
<div class="foldopen" id="foldopen00067" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="../../d6/d84/classhashing_1_1sha256_1_1_hash.html#a0896c27ac39c780e0ee62417fdd0b9d3"> 67</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d84/classhashing_1_1sha256_1_1_hash.html#a0896c27ac39c780e0ee62417fdd0b9d3">Hash::update</a>(<span class="keyword">const</span> std::array<uint32_t, 64> &blocks) {</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="comment">// Initialize array of round constants with first 32 bits of the fractional</span></div>
|
||||
@@ -216,7 +217,7 @@ $(function(){initNavTree('d4/d08/sha256_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> hash[7] += <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>;</div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> </div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span></div>
|
||||
<div class="foldopen" id="foldopen00130" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="../../d6/d84/classhashing_1_1sha256_1_1_hash.html#a4581f503a263d8e928e5716d54477e08"> 130</a></span>std::string <a class="code hl_function" href="../../d6/d84/classhashing_1_1sha256_1_1_hash.html#a4581f503a263d8e928e5716d54477e08">Hash::to_string</a>()<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> std::stringstream ss;</div>
|
||||
@@ -226,7 +227,7 @@ $(function(){initNavTree('d4/d08/sha256_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keywordflow">return</span> ss.str();</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> </div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span></div>
|
||||
<div class="foldopen" id="foldopen00143" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"><a class="line" href="../../d4/d08/sha256_8cpp.html#a28c1c6724dc6bcf91a39818699bbec27"> 143</a></span>std::size_t <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a28c1c6724dc6bcf91a39818699bbec27">compute_padded_size</a>(<span class="keyword">const</span> std::size_t input_size) {</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordflow">if</span> (input_size % 64 < 56) {</div>
|
||||
@@ -235,7 +236,7 @@ $(function(){initNavTree('d4/d08/sha256_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordflow">return</span> input_size + 128 - (input_size % 64);</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> </div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span></div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00157" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"><a class="line" href="../../d4/d08/sha256_8cpp.html#afea411191ec5281f43e91ea327984627"> 157</a></span>uint8_t <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#afea411191ec5281f43e91ea327984627">extract_byte</a>(<span class="keyword">const</span> T in_value, <span class="keyword">const</span> std::size_t byte_num) {</div>
|
||||
@@ -245,7 +246,7 @@ $(function(){initNavTree('d4/d08/sha256_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <span class="keywordflow">return</span> (in_value >> (byte_num * 8)) & 0xFF;</div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> </div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span></div>
|
||||
<div class="foldopen" id="foldopen00170" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"><a class="line" href="../../d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da"> 170</a></span><span class="keywordtype">char</span> <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da">get_char</a>(<span class="keyword">const</span> std::string &input, std::size_t pos) {</div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="keyword">const</span> <span class="keyword">auto</span> input_size = input.length();</div>
|
||||
@@ -263,10 +264,10 @@ $(function(){initNavTree('d4/d08/sha256_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <span class="keywordflow">throw</span> std::out_of_range(<span class="stringliteral">"pos is out of range"</span>);</div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> }</div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><span class="keywordtype">char</span><span class="keyword">></span>(</div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> extract_byte<size_t>(input_size * 8, padded_input_size - pos - 1));</div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#afea411191ec5281f43e91ea327984627">extract_byte<size_t></a>(input_size * 8, padded_input_size - pos - 1));</div>
|
||||
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> </div>
|
||||
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span></div>
|
||||
<div class="foldopen" id="foldopen00195" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"><a class="line" href="../../d4/d08/sha256_8cpp.html#a525531b3939ed44fbf01674e21931b3a"> 195</a></span>std::array<uint32_t, 64> <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a525531b3939ed44fbf01674e21931b3a">create_message_schedule_array</a>(<span class="keyword">const</span> std::string &input,</div>
|
||||
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> byte_num) {</div>
|
||||
@@ -300,7 +301,7 @@ $(function(){initNavTree('d4/d08/sha256_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> <span class="keywordflow">return</span> blocks;</div>
|
||||
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> </div>
|
||||
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span></div>
|
||||
<div class="foldopen" id="foldopen00232" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"><a class="line" href="../../d4/d08/sha256_8cpp.html#a55475649a2bb7aae15de0716a217f43a"> 232</a></span>std::string <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a55475649a2bb7aae15de0716a217f43a">sha256</a>(<span class="keyword">const</span> std::string &input) {</div>
|
||||
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> <a class="code hl_class" href="../../d6/d84/classhashing_1_1sha256_1_1_hash.html">Hash</a> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>;</div>
|
||||
@@ -309,26 +310,26 @@ $(function(){initNavTree('d4/d08/sha256_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> byte_num += 64) {</div>
|
||||
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>.update(<a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a525531b3939ed44fbf01674e21931b3a">create_message_schedule_array</a>(input, byte_num));</div>
|
||||
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> }</div>
|
||||
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>.<a class="code hl_function" href="../../d6/d84/classhashing_1_1sha256_1_1_hash.html#a4581f503a263d8e928e5716d54477e08">to_string</a>();</div>
|
||||
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>.to_string();</div>
|
||||
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span>} <span class="comment">// namespace sha256</span></div>
|
||||
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span>} <span class="comment">// namespace hashing</span></div>
|
||||
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> </div>
|
||||
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span></div>
|
||||
<div class="foldopen" id="foldopen00248" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"><a class="line" href="../../d4/d08/sha256_8cpp.html#af9b52eba85d23e309035354141259f27"> 248</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#af9b52eba85d23e309035354141259f27">test_compute_padded_size</a>() {</div>
|
||||
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> assert(hashing::sha256::compute_padded_size(55) == 64);</div>
|
||||
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> assert(hashing::sha256::compute_padded_size(56) == 128);</div>
|
||||
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> assert(hashing::sha256::compute_padded_size(130) == 192);</div>
|
||||
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> assert(<a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a28c1c6724dc6bcf91a39818699bbec27">hashing::sha256::compute_padded_size</a>(55) == 64);</div>
|
||||
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> assert(<a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a28c1c6724dc6bcf91a39818699bbec27">hashing::sha256::compute_padded_size</a>(56) == 128);</div>
|
||||
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> assert(<a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a28c1c6724dc6bcf91a39818699bbec27">hashing::sha256::compute_padded_size</a>(130) == 192);</div>
|
||||
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> </div>
|
||||
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span><span class="keyword">static</span> <span class="keywordtype">void</span> test_extract_byte() {</div>
|
||||
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> assert(hashing::sha256::extract_byte<uint32_t>(512, 0) == 0);</div>
|
||||
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> assert(hashing::sha256::extract_byte<uint32_t>(512, 1) == 2);</div>
|
||||
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> assert(<a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#afea411191ec5281f43e91ea327984627">hashing::sha256::extract_byte<uint32_t></a>(512, 0) == 0);</div>
|
||||
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> assert(<a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#afea411191ec5281f43e91ea327984627">hashing::sha256::extract_byte<uint32_t></a>(512, 1) == 2);</div>
|
||||
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> <span class="keywordtype">bool</span> exception = <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> <span class="keywordflow">try</span> {</div>
|
||||
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> hashing::sha256::extract_byte<uint32_t>(512, 5);</div>
|
||||
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#afea411191ec5281f43e91ea327984627">hashing::sha256::extract_byte<uint32_t></a>(512, 5);</div>
|
||||
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> } <span class="keywordflow">catch</span> (<span class="keyword">const</span> std::out_of_range &) {</div>
|
||||
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> exception = <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> }</div>
|
||||
@@ -336,10 +337,10 @@ $(function(){initNavTree('d4/d08/sha256_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span>}</div>
|
||||
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span> </div>
|
||||
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span><span class="keyword">static</span> <span class="keywordtype">void</span> test_get_char() {</div>
|
||||
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> assert(hashing::sha256::get_char(<span class="stringliteral">"test"</span>, 3) == <span class="charliteral">'t'</span>);</div>
|
||||
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> assert(hashing::sha256::get_char(<span class="stringliteral">"test"</span>, 4) == <span class="stringliteral">'\x80'</span>);</div>
|
||||
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> assert(hashing::sha256::get_char(<span class="stringliteral">"test"</span>, 5) == <span class="stringliteral">'\x00'</span>);</div>
|
||||
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> assert(hashing::sha256::get_char(<span class="stringliteral">"test"</span>, 63) == 32);</div>
|
||||
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> assert(<a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da">hashing::sha256::get_char</a>(<span class="stringliteral">"test"</span>, 3) == <span class="charliteral">'t'</span>);</div>
|
||||
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> assert(<a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da">hashing::sha256::get_char</a>(<span class="stringliteral">"test"</span>, 4) == <span class="stringliteral">'\x80'</span>);</div>
|
||||
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> assert(<a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da">hashing::sha256::get_char</a>(<span class="stringliteral">"test"</span>, 5) == <span class="stringliteral">'\x00'</span>);</div>
|
||||
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> assert(<a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da">hashing::sha256::get_char</a>(<span class="stringliteral">"test"</span>, 63) == 32);</div>
|
||||
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> <span class="keywordtype">bool</span> exception = <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> <span class="keywordflow">try</span> {</div>
|
||||
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da">hashing::sha256::get_char</a>(<span class="stringliteral">"test"</span>, 64);</div>
|
||||
@@ -350,16 +351,16 @@ $(function(){initNavTree('d4/d08/sha256_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span>}</div>
|
||||
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> </div>
|
||||
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span><span class="keyword">static</span> <span class="keywordtype">void</span> test_right_rotate() {</div>
|
||||
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> assert(hashing::sha256::right_rotate(128, 3) == 16);</div>
|
||||
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> assert(hashing::sha256::right_rotate(1, 30) == 4);</div>
|
||||
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> assert(hashing::sha256::right_rotate(6, 30) == 24);</div>
|
||||
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> assert(<a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#adbcd504103c342a4da718f8fce6ff06c">hashing::sha256::right_rotate</a>(128, 3) == 16);</div>
|
||||
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> assert(<a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#adbcd504103c342a4da718f8fce6ff06c">hashing::sha256::right_rotate</a>(1, 30) == 4);</div>
|
||||
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> assert(<a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#adbcd504103c342a4da718f8fce6ff06c">hashing::sha256::right_rotate</a>(6, 30) == 24);</div>
|
||||
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span>}</div>
|
||||
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> </div>
|
||||
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span><span class="keyword">static</span> <span class="keywordtype">void</span> test_sha256() {</div>
|
||||
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span> <span class="keyword">struct </span><a class="code hl_struct" href="../../da/d86/struct_test_case.html">TestCase</a> {</div>
|
||||
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> <span class="keyword">const</span> std::string input;</div>
|
||||
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> <span class="keyword">const</span> std::string expected_hash;</div>
|
||||
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> <a class="code hl_struct" href="../../da/d86/struct_test_case.html">TestCase</a>(std::string input, std::string expected_hash)</div>
|
||||
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> TestCase(std::string input, std::string expected_hash)</div>
|
||||
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> : input(std::move(input)),</div>
|
||||
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> expected_hash(std::move(expected_hash)) {}</div>
|
||||
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> };</div>
|
||||
@@ -377,11 +378,11 @@ $(function(){initNavTree('d4/d08/sha256_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> <span class="stringliteral">"7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9"</span></div>
|
||||
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> <span class="stringliteral">"069"</span>)};</div>
|
||||
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &tc : test_cases) {</div>
|
||||
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> assert(hashing::sha256::sha256(tc.input) == tc.expected_hash);</div>
|
||||
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> assert(<a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a55475649a2bb7aae15de0716a217f43a">hashing::sha256::sha256</a>(tc.input) == tc.expected_hash);</div>
|
||||
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span> }</div>
|
||||
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span>}</div>
|
||||
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span> </div>
|
||||
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>() {</div>
|
||||
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span> <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#af9b52eba85d23e309035354141259f27">test_compute_padded_size</a>();</div>
|
||||
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> test_extract_byte();</div>
|
||||
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> test_get_char();</div>
|
||||
@@ -390,17 +391,17 @@ $(function(){initNavTree('d4/d08/sha256_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"> 318</span> </div>
|
||||
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span> std::cout << <span class="stringliteral">"All tests have successfully passed!\n"</span>;</div>
|
||||
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span>}</div>
|
||||
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> </div>
|
||||
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span></div>
|
||||
<div class="foldopen" id="foldopen00326" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"><a class="line" href="../../d4/d08/sha256_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 326</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>(); <span class="comment">// Run self-test implementations</span></div>
|
||||
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// Run self-test implementations</span></div>
|
||||
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno"> 328</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span>}</div>
|
||||
</div>
|
||||
<div class="ttc" id="acaesar__cipher_8cpp_html_ae1a3968e7947464bee7714f6d43b7002"><div class="ttname"><a href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a></div><div class="ttdeci">void test()</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d2c/caesar__cipher_8cpp_source.html#l00100">caesar_cipher.cpp:100</a></div></div>
|
||||
<div class="ttc" id="aclasshashing_1_1sha256_1_1_hash_html"><div class="ttname"><a href="../../d6/d84/classhashing_1_1sha256_1_1_hash.html">hashing::sha256::Hash</a></div><div class="ttdoc">Contains hash array and functions to update it and convert it to a hexadecimal string.</div><div class="ttdef"><b>Definition</b> <a href="#l00040">sha256.cpp:40</a></div></div>
|
||||
<div class="ttc" id="aclasshashing_1_1sha256_1_1_hash_html_a0896c27ac39c780e0ee62417fdd0b9d3"><div class="ttname"><a href="../../d6/d84/classhashing_1_1sha256_1_1_hash.html#a0896c27ac39c780e0ee62417fdd0b9d3">hashing::sha256::Hash::update</a></div><div class="ttdeci">void update(const std::array< uint32_t, 64 > &blocks)</div><div class="ttdoc">Updates the hash array.</div><div class="ttdef"><b>Definition</b> <a href="#l00067">sha256.cpp:67</a></div></div>
|
||||
<div class="ttc" id="aclasshashing_1_1sha256_1_1_hash_html_a4581f503a263d8e928e5716d54477e08"><div class="ttname"><a href="../../d6/d84/classhashing_1_1sha256_1_1_hash.html#a4581f503a263d8e928e5716d54477e08">hashing::sha256::Hash::to_string</a></div><div class="ttdeci">std::string to_string() const</div><div class="ttdoc">Convert the hash to a hexadecimal string.</div><div class="ttdef"><b>Definition</b> <a href="#l00130">sha256.cpp:130</a></div></div>
|
||||
<div class="ttc" id="agenerate__parentheses_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d1e/generate__parentheses_8cpp_source.html#l00082">generate_parentheses.cpp:82</a></div></div>
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a566eaf0ffafd50bc61e644561fd27001"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a></div><div class="ttdeci">int h(int key)</div><div class="ttdef"><b>Definition</b> <a href="../../d1/df3/hash__search_8cpp_source.html#l00045">hash_search.cpp:45</a></div></div>
|
||||
<div class="ttc" id="anamespacehashing_html"><div class="ttname"><a href="../../d6/d0c/namespacehashing.html">hashing</a></div><div class="ttdoc">Used for assert.</div></div>
|
||||
<div class="ttc" id="asha256_8cpp_html_a28c1c6724dc6bcf91a39818699bbec27"><div class="ttname"><a href="../../d4/d08/sha256_8cpp.html#a28c1c6724dc6bcf91a39818699bbec27">hashing::sha256::compute_padded_size</a></div><div class="ttdeci">std::size_t compute_padded_size(const std::size_t input_size)</div><div class="ttdoc">Computes size of the padded input.</div><div class="ttdef"><b>Definition</b> <a href="#l00143">sha256.cpp:143</a></div></div>
|
||||
@@ -418,7 +419,7 @@ $(function(){initNavTree('d4/d08/sha256_8cpp_source.html','../../'); initResizab
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_ece9b94c107bbaa1dd68197a8c9983b9.html">hashing</a></li><li class="navelem"><a class="el" href="../../d4/d08/sha256_8cpp.html">sha256.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: data_structures/binary_search_tree.cpp Pages: 1 -->
|
||||
<svg width="121pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: data_structures/binary_search_tree.cpp Pages: 1 -->
|
||||
<svg width="121pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: data_structures::linked_list::Node Class Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -189,7 +189,7 @@ Public Attributes</h2></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>linked_list</b></li><li class="navelem"><a class="el" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: gram_schmidt Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d4/d0f/namespacegram__schmidt.html','../../'); initRes
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d4/d0f/namespacegram__schmidt.html">gram_schmidt</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Minimum Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -136,7 +136,7 @@ $(function(){initNavTree('d4/d12/namespace_minimum.html','../../'); initResizabl
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d4/d12/namespace_minimum.html">Minimum</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: bidirectional_dijkstra Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d4/d13/namespacebidirectional__dijkstra.html','../../'
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d4/d13/namespacebidirectional__dijkstra.html">bidirectional_dijkstra</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: numerical_methods/composite_simpson_rule.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -229,7 +229,7 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 72</span> </div>
|
||||
<div class="line"><span class="lineno"> 73</span> <span class="comment">// Create the data table</span></div>
|
||||
<div class="line"><span class="lineno"> 74</span> <span class="keywordtype">double</span> temp = NAN;</div>
|
||||
<div class="line"><span class="lineno"> 75</span> <span class="keywordflow">for</span> (std::int32_t i = 0; i <= <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 75</span> <span class="keywordflow">for</span> (std::int32_t i = 0; i <= N; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 76</span> temp = func(xi);</div>
|
||||
<div class="line"><span class="lineno"> 77</span> data_table.insert(</div>
|
||||
<div class="line"><span class="lineno"> 78</span> std::pair<std::int32_t, double>(i, temp)); <span class="comment">// add i and f(xi)</span></div>
|
||||
@@ -239,7 +239,7 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 82</span> <span class="comment">// Evaluate the integral.</span></div>
|
||||
<div class="line"><span class="lineno"> 83</span> <span class="comment">// Remember: f(x0) + 4*f(x1) + 2*f(x2) + ... + 2*f(xN-2) + 4*f(xN-1) + f(xN)</span></div>
|
||||
<div class="line"><span class="lineno"> 84</span> <span class="keywordtype">double</span> evaluate_integral = 0;</div>
|
||||
<div class="line"><span class="lineno"> 85</span> <span class="keywordflow">for</span> (std::int32_t i = 0; i <= <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 85</span> <span class="keywordflow">for</span> (std::int32_t i = 0; i <= N; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 86</span> <span class="keywordflow">if</span> (i == 0 || i == N) {</div>
|
||||
<div class="line"><span class="lineno"> 87</span> evaluate_integral += data_table.at(i);</div>
|
||||
<div class="line"><span class="lineno"> 88</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (i % 2 == 1) {</div>
|
||||
@@ -261,7 +261,6 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 104</span> <span class="keywordflow">return</span> evaluate_integral;</div>
|
||||
<div class="line"><span class="lineno"> 105</span>}</div>
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a566eaf0ffafd50bc61e644561fd27001"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a></div><div class="ttdeci">int h(int key)</div><div class="ttdef"><b>Definition</b> <a href="../../d1/df3/hash__search_8cpp_source.html#l00045">hash_search.cpp:45</a></div></div>
|
||||
<div class="ttc" id="asparse__table_8cpp_html_a10f3ffb3f6f7e1b83d556b9c8de89a5d"><div class="ttname"><a href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">data_structures::sparse_table::N</a></div><div class="ttdeci">constexpr uint32_t N</div><div class="ttdoc">A struct to represent sparse table for min() as their invariant function, for the given array A....</div><div class="ttdef"><b>Definition</b> <a href="../../d8/dab/sparse__table_8cpp_source.html#l00048">sparse_table.cpp:48</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -394,7 +393,7 @@ Functions</h2></td></tr>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00170">170</a> of file <a class="el" href="../../d4/d18/composite__simpson__rule_8cpp_source.html">composite_simpson_rule.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 170</span> {</div>
|
||||
<div class="line"><span class="lineno"> 171</span> std::int32_t <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 16; </div>
|
||||
<div class="line"><span class="lineno"> 171</span> std::int32_t N = 16; </div>
|
||||
<div class="line"><span class="lineno"> 173</span> <span class="keywordtype">double</span> a = 1, b = 3; </div>
|
||||
<div class="line"><span class="lineno"> 175</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> = NAN; </div>
|
||||
<div class="line"><span class="lineno"> 176</span> </div>
|
||||
@@ -405,7 +404,7 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 181</span> <span class="comment">// Get user input (by the command line parameters or the console after</span></div>
|
||||
<div class="line"><span class="lineno"> 182</span> <span class="comment">// displaying messages)</span></div>
|
||||
<div class="line"><span class="lineno"> 183</span> <span class="keywordflow">if</span> (argc == 4) {</div>
|
||||
<div class="line"><span class="lineno"> 184</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = std::atoi(argv[1]);</div>
|
||||
<div class="line"><span class="lineno"> 184</span> N = std::atoi(argv[1]);</div>
|
||||
<div class="line"><span class="lineno"> 185</span> a = std::atof(argv[2]);</div>
|
||||
<div class="line"><span class="lineno"> 186</span> b = std::atof(argv[3]);</div>
|
||||
<div class="line"><span class="lineno"> 187</span> <span class="comment">// Check if a<b else abort</span></div>
|
||||
@@ -414,10 +413,10 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 190</span> <span class="keywordflow">if</span> (N < 16 || a != 1 || b != 3) {</div>
|
||||
<div class="line"><span class="lineno"> 191</span> used_argv_parameters = <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 192</span> }</div>
|
||||
<div class="line"><span class="lineno"> 193</span> std::cout << <span class="stringliteral">"You selected N="</span> << <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> << <span class="stringliteral">", a="</span> << a << <span class="stringliteral">", b="</span> << b</div>
|
||||
<div class="line"><span class="lineno"> 193</span> std::cout << <span class="stringliteral">"You selected N="</span> << N << <span class="stringliteral">", a="</span> << a << <span class="stringliteral">", b="</span> << b</div>
|
||||
<div class="line"><span class="lineno"> 194</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 195</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 196</span> std::cout << <span class="stringliteral">"Default N="</span> << <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> << <span class="stringliteral">", a="</span> << a << <span class="stringliteral">", b="</span> << b</div>
|
||||
<div class="line"><span class="lineno"> 196</span> std::cout << <span class="stringliteral">"Default N="</span> << N << <span class="stringliteral">", a="</span> << a << <span class="stringliteral">", b="</span> << b</div>
|
||||
<div class="line"><span class="lineno"> 197</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 198</span> }</div>
|
||||
<div class="line"><span class="lineno"> 199</span> </div>
|
||||
@@ -469,7 +468,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -490,33 +489,37 @@ Functions</h2></td></tr>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 133</span> {</div>
|
||||
<div class="line"><span class="lineno"> 134</span> <span class="comment">// Call the functions and find the integral of each function</span></div>
|
||||
<div class="line"><span class="lineno"> 135</span> <span class="keywordtype">double</span> result_f = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><span class="lineno"> 136</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::f);</div>
|
||||
<div class="line"><span class="lineno"> 136</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="#a4251b4df4748a0b9c43a48f61bdd2397">numerical_methods::simpson_method::f</a>);</div>
|
||||
<div class="line"><span class="lineno"> 137</span> assert((used_argv_parameters || (result_f >= 4.09 && result_f <= 4.10)) &&</div>
|
||||
<div class="line"><span class="lineno"> 138</span> <span class="stringliteral">"The result of f(x) is wrong"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 139</span> std::cout << <span class="stringliteral">"The result of integral f(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><span class="lineno"> 140</span> << <span class="stringliteral">"] is equal to: "</span> << result_f << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 141</span> </div>
|
||||
<div class="line"><span class="lineno"> 142</span> <span class="keywordtype">double</span> result_g = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><span class="lineno"> 143</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::g);</div>
|
||||
<div class="line"><span class="lineno"> 143</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="#a2f67508d5f392b0321772169342c98ad">numerical_methods::simpson_method::g</a>);</div>
|
||||
<div class="line"><span class="lineno"> 144</span> assert((used_argv_parameters || (result_g >= 0.27 && result_g <= 0.28)) &&</div>
|
||||
<div class="line"><span class="lineno"> 145</span> <span class="stringliteral">"The result of g(x) is wrong"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 146</span> std::cout << <span class="stringliteral">"The result of integral g(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><span class="lineno"> 147</span> << <span class="stringliteral">"] is equal to: "</span> << result_g << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 148</span> </div>
|
||||
<div class="line"><span class="lineno"> 149</span> <span class="keywordtype">double</span> result_k = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><span class="lineno"> 150</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::k);</div>
|
||||
<div class="line"><span class="lineno"> 150</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a>);</div>
|
||||
<div class="line"><span class="lineno"> 151</span> assert((used_argv_parameters || (result_k >= 9.06 && result_k <= 9.07)) &&</div>
|
||||
<div class="line"><span class="lineno"> 152</span> <span class="stringliteral">"The result of k(x) is wrong"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 153</span> std::cout << <span class="stringliteral">"The result of integral k(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><span class="lineno"> 154</span> << <span class="stringliteral">"] is equal to: "</span> << result_k << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 155</span> </div>
|
||||
<div class="line"><span class="lineno"> 156</span> <span class="keywordtype">double</span> result_l = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><span class="lineno"> 157</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::l);</div>
|
||||
<div class="line"><span class="lineno"> 157</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="#a6d8df83a6f26ce24a75d3b358b7f5b8a">numerical_methods::simpson_method::l</a>);</div>
|
||||
<div class="line"><span class="lineno"> 158</span> assert((used_argv_parameters || (result_l >= 7.16 && result_l <= 7.17)) &&</div>
|
||||
<div class="line"><span class="lineno"> 159</span> <span class="stringliteral">"The result of l(x) is wrong"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 160</span> std::cout << <span class="stringliteral">"The result of integral l(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><span class="lineno"> 161</span> << <span class="stringliteral">"] is equal to: "</span> << result_l << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 162</span>}</div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a1b74d828b33760094906797042b89442"><div class="ttname"><a href="#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00117">composite_simpson_rule.cpp:117</a></div></div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a2f67508d5f392b0321772169342c98ad"><div class="ttname"><a href="#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> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00115">composite_simpson_rule.cpp:115</a></div></div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a4251b4df4748a0b9c43a48f61bdd2397"><div class="ttname"><a href="#a4251b4df4748a0b9c43a48f61bdd2397">numerical_methods::simpson_method::f</a></div><div class="ttdeci">double f(double x)</div><div class="ttdoc">A function f(x) that will be used to test the method.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00113">composite_simpson_rule.cpp:113</a></div></div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a6d8df83a6f26ce24a75d3b358b7f5b8a"><div class="ttname"><a href="#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> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00119">composite_simpson_rule.cpp:119</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -526,7 +529,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../d4/d18/composite__simpson__rule_8cpp.html">composite_simpson_rule.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
var composite__simpson__rule_8cpp =
|
||||
[
|
||||
[ "f", "d4/d18/composite__simpson__rule_8cpp.html#a4251b4df4748a0b9c43a48f61bdd2397", null ],
|
||||
[ "g", "d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad", null ],
|
||||
[ "k", "d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442", null ],
|
||||
[ "l", "d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a", null ],
|
||||
[ "numerical_methods::simpson_method::f", "d4/d18/composite__simpson__rule_8cpp.html#a4251b4df4748a0b9c43a48f61bdd2397", null ],
|
||||
[ "numerical_methods::simpson_method::g", "d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad", null ],
|
||||
[ "numerical_methods::simpson_method::k", "d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442", null ],
|
||||
[ "numerical_methods::simpson_method::l", "d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a", null ],
|
||||
[ "main", "d4/d18/composite__simpson__rule_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ],
|
||||
[ "test", "d4/d18/composite__simpson__rule_8cpp.html#a2ae48a41e43dc6ab11b962742349646e", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: numerical_methods/composite_simpson_rule.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,8 @@ $(function(){initNavTree('d4/d18/composite__simpson__rule_8cpp_source.html','../
|
||||
<div class="headertitle"><div class="title">composite_simpson_rule.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d18/composite__simpson__rule_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d18/composite__simpson__rule_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="preprocessor">#include <cmath></span> </div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="preprocessor">#include <cmath></span></div>
|
||||
@@ -133,7 +134,7 @@ $(function(){initNavTree('d4/d18/composite__simpson__rule_8cpp_source.html','../
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="preprocessor">#include <functional></span> </div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="preprocessor">#include <map></span> </div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> </div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span></div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d1/de0/namespacenumerical__methods.html">numerical_methods</a> {</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d3/d6d/namespacesimpson__method.html">simpson_method</a> {</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span><span class="keywordtype">double</span> evaluate_by_simpson(std::int32_t N, <span class="keywordtype">double</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, <span class="keywordtype">double</span> a,</div>
|
||||
@@ -144,7 +145,7 @@ $(function(){initNavTree('d4/d18/composite__simpson__rule_8cpp_source.html','../
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="comment">// Create the data table</span></div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordtype">double</span> temp = NAN;</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordflow">for</span> (std::int32_t i = 0; i <= <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordflow">for</span> (std::int32_t i = 0; i <= N; i++) {</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> temp = func(xi);</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> data_table.insert(</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> std::pair<std::int32_t, double>(i, temp)); <span class="comment">// add i and f(xi)</span></div>
|
||||
@@ -154,7 +155,7 @@ $(function(){initNavTree('d4/d18/composite__simpson__rule_8cpp_source.html','../
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="comment">// Evaluate the integral.</span></div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="comment">// Remember: f(x0) + 4*f(x1) + 2*f(x2) + ... + 2*f(xN-2) + 4*f(xN-1) + f(xN)</span></div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordtype">double</span> evaluate_integral = 0;</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">for</span> (std::int32_t i = 0; i <= <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">for</span> (std::int32_t i = 0; i <= N; i++) {</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordflow">if</span> (i == 0 || i == N) {</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> evaluate_integral += data_table.at(i);</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (i % 2 == 1) {</div>
|
||||
@@ -175,48 +176,48 @@ $(function(){initNavTree('d4/d18/composite__simpson__rule_8cpp_source.html','../
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="comment">// Else return</span></div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordflow">return</span> evaluate_integral;</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span>}</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> </div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span></div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"><a class="line" href="../../d4/d18/composite__simpson__rule_8cpp.html#a4251b4df4748a0b9c43a48f61bdd2397"> 113</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a4251b4df4748a0b9c43a48f61bdd2397">f</a>(<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> std::sqrt(x) + std::log(x); }</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad"> 115</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">g</a>(<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> std::exp(-x) * (4 - std::pow(x, 2)); }</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"><a class="line" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442"> 117</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>(<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> std::sqrt(2 * std::pow(x, 3) + 3); }</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"><a class="line" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a"> 119</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a>(<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> x + std::log(2 * x + 1); }</div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span>} <span class="comment">// namespace simpson_method</span></div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span>} <span class="comment">// namespace numerical_methods</span></div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> </div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span></div>
|
||||
<div class="foldopen" id="foldopen00132" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"><a class="line" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2ae48a41e43dc6ab11b962742349646e"> 132</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(std::int32_t N, <span class="keywordtype">double</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, <span class="keywordtype">double</span> a, <span class="keywordtype">double</span> b,</div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="keywordtype">bool</span> used_argv_parameters) {</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="comment">// Call the functions and find the integral of each function</span></div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keywordtype">double</span> result_f = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::f);</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a4251b4df4748a0b9c43a48f61bdd2397">numerical_methods::simpson_method::f</a>);</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> assert((used_argv_parameters || (result_f >= 4.09 && result_f <= 4.10)) &&</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="stringliteral">"The result of f(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> std::cout << <span class="stringliteral">"The result of integral f(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> << <span class="stringliteral">"] is equal to: "</span> << result_f << std::endl;</div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> </div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keywordtype">double</span> result_g = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::g);</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">numerical_methods::simpson_method::g</a>);</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> assert((used_argv_parameters || (result_g >= 0.27 && result_g <= 0.28)) &&</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="stringliteral">"The result of g(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> std::cout << <span class="stringliteral">"The result of integral g(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> << <span class="stringliteral">"] is equal to: "</span> << result_g << std::endl;</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordtype">double</span> result_k = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::k);</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a>);</div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> assert((used_argv_parameters || (result_k >= 9.06 && result_k <= 9.07)) &&</div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="stringliteral">"The result of k(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> std::cout << <span class="stringliteral">"The result of integral k(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> << <span class="stringliteral">"] is equal to: "</span> << result_k << std::endl;</div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> </div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keywordtype">double</span> result_l = numerical_methods::simpson_method::evaluate_by_simpson(</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::simpson_method::l);</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">numerical_methods::simpson_method::l</a>);</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> assert((used_argv_parameters || (result_l >= 7.16 && result_l <= 7.17)) &&</div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="stringliteral">"The result of l(x) is wrong"</span>);</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> std::cout << <span class="stringliteral">"The result of integral l(x) on interval ["</span> << a << <span class="stringliteral">", "</span> << b</div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> << <span class="stringliteral">"] is equal to: "</span> << result_l << std::endl;</div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> </div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span></div>
|
||||
<div class="foldopen" id="foldopen00170" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"><a class="line" href="../../d4/d18/composite__simpson__rule_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627"> 170</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv) {</div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> std::int32_t N = 16; </div>
|
||||
@@ -262,15 +263,14 @@ $(function(){initNavTree('d4/d18/composite__simpson__rule_8cpp_source.html','../
|
||||
<div class="ttc" id="agenerate__parentheses_8cpp_html_gae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d1e/generate__parentheses_8cpp_source.html#l00110">generate_parentheses.cpp:110</a></div></div>
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a566eaf0ffafd50bc61e644561fd27001"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a></div><div class="ttdeci">int h(int key)</div><div class="ttdef"><b>Definition</b> <a href="../../d1/df3/hash__search_8cpp_source.html#l00045">hash_search.cpp:45</a></div></div>
|
||||
<div class="ttc" id="anamespacenumerical__methods_html"><div class="ttname"><a href="../../d1/de0/namespacenumerical__methods.html">numerical_methods</a></div><div class="ttdoc">for assert</div></div>
|
||||
<div class="ttc" id="anamespacesimpson__method_html"><div class="ttname"><a href="../../d3/d6d/namespacesimpson__method.html">simpson_method</a></div><div class="ttdoc">Contains the Simpson's method implementation.</div></div>
|
||||
<div class="ttc" id="asparse__table_8cpp_html_a10f3ffb3f6f7e1b83d556b9c8de89a5d"><div class="ttname"><a href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">data_structures::sparse_table::N</a></div><div class="ttdeci">constexpr uint32_t N</div><div class="ttdoc">A struct to represent sparse table for min() as their invariant function, for the given array A....</div><div class="ttdef"><b>Definition</b> <a href="../../d8/dab/sparse__table_8cpp_source.html#l00048">sparse_table.cpp:48</a></div></div>
|
||||
<div class="ttc" id="anamespacesimpson__method_html"><div class="ttname"><a href="../../d3/d6d/namespacesimpson__method.html">simpson_method</a></div><div class="ttdoc">Contains the Simpson's method implementation.</div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../d4/d18/composite__simpson__rule_8cpp.html">composite_simpson_rule.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: hamming_distance Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d4/d1c/namespacehamming__distance.html','../../'); ini
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d4/d1c/namespacehamming__distance.html">hamming_distance</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -145,7 +145,7 @@ $(function(){initNavTree('d8/d72/class_r_btree.html','../../'); initResizable(tr
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -146,7 +146,7 @@ $(function(){initNavTree('d2/d05/class_min_heap.html','../../'); initResizable(t
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/merge_insertion_sort.cpp Pages: 1 -->
|
||||
<svg width="385pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/merge_insertion_sort.cpp Pages: 1 -->
|
||||
<svg width="385pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/least_common_multiple.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -302,7 +302,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d4/d21/least__common__multiple_8cpp.html">least_common_multiple.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/least_common_multiple.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,10 +124,11 @@ $(function(){initNavTree('d4/d21/least__common__multiple_8cpp_source.html','../.
|
||||
<div class="headertitle"><div class="title">least_common_multiple.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d21/least__common__multiple_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d21/least__common__multiple_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include <cassert></span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span></div>
|
||||
<div class="foldopen" id="foldopen00016" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="../../d4/d21/least__common__multiple_8cpp.html#a8ba1fc66e4134ab25b2602b323150563"> 16</a></span><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d21/least__common__multiple_8cpp.html#a8ba1fc66e4134ab25b2602b323150563">gcd</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> x, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> y) {</div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keywordflow">if</span> (x == 0) {</div>
|
||||
@@ -151,13 +152,13 @@ $(function(){initNavTree('d4/d21/least__common__multiple_8cpp_source.html','../.
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d4/d21/least__common__multiple_8cpp.html#a8ba1fc66e4134ab25b2602b323150563">gcd</a>(x, y - temp * x);</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span></div>
|
||||
<div class="foldopen" id="foldopen00043" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="../../d4/d21/least__common__multiple_8cpp.html#aa8d0e241db517813725e721a152e3a25"> 43</a></span><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d21/least__common__multiple_8cpp.html#aa8d0e241db517813725e721a152e3a25">lcm</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> x, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> y) {</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">return</span> x / <a class="code hl_function" href="../../d4/d21/least__common__multiple_8cpp.html#a8ba1fc66e4134ab25b2602b323150563">gcd</a>(x, y) * y;</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> </div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span></div>
|
||||
<div class="foldopen" id="foldopen00050" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="../../d4/d21/least__common__multiple_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9"> 50</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d21/least__common__multiple_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>() {</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="comment">// First test on lcm(5,10) == 10</span></div>
|
||||
@@ -184,7 +185,7 @@ $(function(){initNavTree('d4/d21/least__common__multiple_8cpp_source.html','../.
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> </div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span></div>
|
||||
<div class="foldopen" id="foldopen00078" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="../../d4/d21/least__common__multiple_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 78</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d21/least__common__multiple_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <a class="code hl_function" href="../../d4/d21/least__common__multiple_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>();</div>
|
||||
@@ -201,7 +202,7 @@ $(function(){initNavTree('d4/d21/least__common__multiple_8cpp_source.html','../.
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d4/d21/least__common__multiple_8cpp.html">least_common_multiple.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/ncr_modulo_p.cpp Pages: 1 -->
|
||||
<svg width="189pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/ncr_modulo_p.cpp Pages: 1 -->
|
||||
<svg width="189pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/durand_kerner_roots.cpp Pages: 1 -->
|
||||
<!--zoomable 94 -->
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/durand_kerner_roots.cpp Pages: 1 -->
|
||||
<svg width="653pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/pigeonhole_sort.cpp Pages: 1 -->
|
||||
<svg width="258pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/pigeonhole_sort.cpp Pages: 1 -->
|
||||
<svg width="258pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: Trie::TrieNode Pages: 1 -->
|
||||
<svg width="115pt" height="105pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: Trie::TrieNode Pages: 1 -->
|
||||
<svg width="115pt" height="105pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: cpu_scheduling_algorithms/fcfs_scheduling.cpp Pages: 1 -->
|
||||
<!--zoomable 94 -->
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: cpu_scheduling_algorithms/fcfs_scheduling.cpp Pages: 1 -->
|
||||
<svg width="670pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/fibonacci_fast.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -202,8 +202,8 @@ Variables</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 42</span> </div>
|
||||
<div class="line"><span class="lineno"> 43</span> <span class="keywordflow">if</span> (n <= 2) {</div>
|
||||
<div class="line"><span class="lineno"> 44</span> <span class="keywordflow">return</span> f2;</div>
|
||||
<div class="line"><span class="lineno"> 45</span> } <span class="keywordflow">if</span> (n >= <a class="code hl_variable" href="#abebd72fcda852381644b55f9316719a0">MAX</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 46</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">"Cannot compute for n>="</span> + std::to_string(<a class="code hl_variable" href="#abebd72fcda852381644b55f9316719a0">MAX</a>) +</div>
|
||||
<div class="line"><span class="lineno"> 45</span> } <span class="keywordflow">if</span> (n >= MAX) {</div>
|
||||
<div class="line"><span class="lineno"> 46</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">"Cannot compute for n>="</span> + std::to_string(MAX) +</div>
|
||||
<div class="line"><span class="lineno"> 47</span> <span class="stringliteral">" due to limit of 64-bit integers"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 48</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 49</span> }</div>
|
||||
@@ -215,7 +215,6 @@ Variables</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 55</span> </div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="keywordflow">return</span> f2;</div>
|
||||
<div class="line"><span class="lineno"> 57</span>}</div>
|
||||
<div class="ttc" id="afibonacci__fast_8cpp_html_abebd72fcda852381644b55f9316719a0"><div class="ttname"><a href="#abebd72fcda852381644b55f9316719a0">MAX</a></div><div class="ttdeci">constexpr uint64_t MAX</div><div class="ttdoc">for std::invalid_argument</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/fibonacci__fast_8cpp_source.html#l00031">fibonacci_fast.cpp:31</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -264,7 +263,7 @@ Variables</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -370,10 +369,10 @@ Variables</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 157</span> </div>
|
||||
<div class="line"><span class="lineno"> 158</span> <span class="comment">// Test for invalid Fibonacci numbers</span></div>
|
||||
<div class="line"><span class="lineno"> 159</span> <span class="keywordflow">try</span> {</div>
|
||||
<div class="line"><span class="lineno"> 160</span> <a class="code hl_function" href="#a5712edca101204eca8accdb1e096707f">fib</a>(<a class="code hl_variable" href="#abebd72fcda852381644b55f9316719a0">MAX</a> + 1);</div>
|
||||
<div class="line"><span class="lineno"> 160</span> <a class="code hl_function" href="#a5712edca101204eca8accdb1e096707f">fib</a>(MAX + 1);</div>
|
||||
<div class="line"><span class="lineno"> 161</span> assert(<span class="keyword">false</span> && <span class="stringliteral">"Expected an invalid_argument exception to be thrown"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 162</span> } <span class="keywordflow">catch</span> (<span class="keyword">const</span> std::invalid_argument& e) {</div>
|
||||
<div class="line"><span class="lineno"> 163</span> <span class="keyword">const</span> std::string expected_message = <span class="stringliteral">"Cannot compute for n>="</span> + std::to_string(<a class="code hl_variable" href="#abebd72fcda852381644b55f9316719a0">MAX</a>) +</div>
|
||||
<div class="line"><span class="lineno"> 163</span> <span class="keyword">const</span> std::string expected_message = <span class="stringliteral">"Cannot compute for n>="</span> + std::to_string(MAX) +</div>
|
||||
<div class="line"><span class="lineno"> 164</span> <span class="stringliteral">" due to limit of 64-bit integers"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 165</span> assert(e.what() == expected_message);</div>
|
||||
<div class="line"><span class="lineno"> 166</span> }</div>
|
||||
@@ -400,7 +399,7 @@ Variables</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel constexpr">constexpr</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -420,7 +419,7 @@ Variables</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d4/d32/fibonacci__fast_8cpp.html">fibonacci_fast.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/fibonacci_fast.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,16 +124,16 @@ $(function(){initNavTree('d4/d32/fibonacci__fast_8cpp_source.html','../../'); in
|
||||
<div class="headertitle"><div class="title">fibonacci_fast.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d32/fibonacci__fast_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d32/fibonacci__fast_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <cinttypes></span> </div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <cstdio></span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include <string></span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include <stdexcept></span> </div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="../../d4/d32/fibonacci__fast_8cpp.html#abebd72fcda852381644b55f9316719a0"> 31</a></span><span class="keyword">constexpr</span> uint64_t <a class="code hl_variable" href="../../d4/d32/fibonacci__fast_8cpp.html#abebd72fcda852381644b55f9316719a0">MAX</a> = 93;</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span></div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="../../d4/d32/fibonacci__fast_8cpp.html#abebd72fcda852381644b55f9316719a0"> 31</a></span><span class="keyword">constexpr</span> uint64_t MAX = 93;</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span></div>
|
||||
<div class="foldopen" id="foldopen00038" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="../../d4/d32/fibonacci__fast_8cpp.html#a5712edca101204eca8accdb1e096707f"> 38</a></span>uint64_t <a class="code hl_function" href="../../d4/d32/fibonacci__fast_8cpp.html#a5712edca101204eca8accdb1e096707f">fib</a>(uint64_t n) {</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="comment">// Using static keyword will retain the values of</span></div>
|
||||
@@ -142,8 +142,8 @@ $(function(){initNavTree('d4/d32/fibonacci__fast_8cpp_source.html','../../'); in
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keywordflow">if</span> (n <= 2) {</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">return</span> f2;</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> } <span class="keywordflow">if</span> (n >= <a class="code hl_variable" href="../../d4/d32/fibonacci__fast_8cpp.html#abebd72fcda852381644b55f9316719a0">MAX</a>) {</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">"Cannot compute for n>="</span> + std::to_string(<a class="code hl_variable" href="../../d4/d32/fibonacci__fast_8cpp.html#abebd72fcda852381644b55f9316719a0">MAX</a>) +</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> } <span class="keywordflow">if</span> (n >= MAX) {</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">"Cannot compute for n>="</span> + std::to_string(MAX) +</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="stringliteral">" due to limit of 64-bit integers"</span>);</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> }</div>
|
||||
@@ -156,7 +156,7 @@ $(function(){initNavTree('d4/d32/fibonacci__fast_8cpp_source.html','../../'); in
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordflow">return</span> f2;</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> </div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span></div>
|
||||
<div class="foldopen" id="foldopen00063" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="../../d4/d32/fibonacci__fast_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 63</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d32/fibonacci__fast_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="comment">// Test for valid Fibonacci numbers</span></div>
|
||||
@@ -255,10 +255,10 @@ $(function(){initNavTree('d4/d32/fibonacci__fast_8cpp_source.html','../../'); in
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> </div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="comment">// Test for invalid Fibonacci numbers</span></div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keywordflow">try</span> {</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <a class="code hl_function" href="../../d4/d32/fibonacci__fast_8cpp.html#a5712edca101204eca8accdb1e096707f">fib</a>(<a class="code hl_variable" href="../../d4/d32/fibonacci__fast_8cpp.html#abebd72fcda852381644b55f9316719a0">MAX</a> + 1);</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <a class="code hl_function" href="../../d4/d32/fibonacci__fast_8cpp.html#a5712edca101204eca8accdb1e096707f">fib</a>(MAX + 1);</div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> assert(<span class="keyword">false</span> && <span class="stringliteral">"Expected an invalid_argument exception to be thrown"</span>);</div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> } <span class="keywordflow">catch</span> (<span class="keyword">const</span> std::invalid_argument& e) {</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="keyword">const</span> std::string expected_message = <span class="stringliteral">"Cannot compute for n>="</span> + std::to_string(<a class="code hl_variable" href="../../d4/d32/fibonacci__fast_8cpp.html#abebd72fcda852381644b55f9316719a0">MAX</a>) +</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="keyword">const</span> std::string expected_message = <span class="stringliteral">"Cannot compute for n>="</span> + std::to_string(MAX) +</div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="stringliteral">" due to limit of 64-bit integers"</span>;</div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> assert(e.what() == expected_message);</div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> }</div>
|
||||
@@ -266,7 +266,7 @@ $(function(){initNavTree('d4/d32/fibonacci__fast_8cpp_source.html','../../'); in
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> std::cout << <span class="stringliteral">"All Fibonacci tests have successfully passed!\n"</span>;</div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> </div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span></div>
|
||||
<div class="foldopen" id="foldopen00175" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"><a class="line" href="../../d4/d32/fibonacci__fast_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 175</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d32/fibonacci__fast_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <a class="code hl_function" href="../../d4/d32/fibonacci__fast_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -275,7 +275,6 @@ $(function(){initNavTree('d4/d32/fibonacci__fast_8cpp_source.html','../../'); in
|
||||
</div>
|
||||
<div class="ttc" id="afibonacci__fast_8cpp_html_a5712edca101204eca8accdb1e096707f"><div class="ttname"><a href="../../d4/d32/fibonacci__fast_8cpp.html#a5712edca101204eca8accdb1e096707f">fib</a></div><div class="ttdeci">uint64_t fib(uint64_t n)</div><div class="ttdoc">Function to compute the nth Fibonacci number.</div><div class="ttdef"><b>Definition</b> <a href="#l00038">fibonacci_fast.cpp:38</a></div></div>
|
||||
<div class="ttc" id="afibonacci__fast_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d4/d32/fibonacci__fast_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Function to test the Fibonacci computation.</div><div class="ttdef"><b>Definition</b> <a href="#l00063">fibonacci_fast.cpp:63</a></div></div>
|
||||
<div class="ttc" id="afibonacci__fast_8cpp_html_abebd72fcda852381644b55f9316719a0"><div class="ttname"><a href="../../d4/d32/fibonacci__fast_8cpp.html#abebd72fcda852381644b55f9316719a0">MAX</a></div><div class="ttdeci">constexpr uint64_t MAX</div><div class="ttdoc">for std::invalid_argument</div><div class="ttdef"><b>Definition</b> <a href="#l00031">fibonacci_fast.cpp:31</a></div></div>
|
||||
<div class="ttc" id="afibonacci__fast_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d4/d32/fibonacci__fast_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main Function.</div><div class="ttdef"><b>Definition</b> <a href="#l00175">fibonacci_fast.cpp:175</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
@@ -283,7 +282,7 @@ $(function(){initNavTree('d4/d32/fibonacci__fast_8cpp_source.html','../../'); in
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d4/d32/fibonacci__fast_8cpp.html">fibonacci_fast.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: operations_on_datastructures/inorder_successor_of_bst.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -248,11 +248,12 @@ Method 2: Search from the root node</h4>
|
||||
<div class="line"><span class="lineno"> 211</span> <span class="keywordflow">if</span> (rootNode == <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><span class="lineno"> 212</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 213</span> }</div>
|
||||
<div class="line"><span class="lineno"> 214</span> <a class="code hl_function" href="#a7b20eb99272665c1777949e26ab59589">deallocate</a>(rootNode->left);</div>
|
||||
<div class="line"><span class="lineno"> 215</span> <a class="code hl_function" href="#a7b20eb99272665c1777949e26ab59589">deallocate</a>(rootNode->right);</div>
|
||||
<div class="line"><span class="lineno"> 214</span> deallocate(rootNode-><a class="code hl_variable" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#a9ccef4c746b7226488b014f5bac4789a">left</a>);</div>
|
||||
<div class="line"><span class="lineno"> 215</span> deallocate(rootNode-><a class="code hl_variable" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#a9b4ae6f5179a1c8ecfd563811a59e6c0">right</a>);</div>
|
||||
<div class="line"><span class="lineno"> 216</span> <span class="keyword">delete</span> (rootNode);</div>
|
||||
<div class="line"><span class="lineno"> 217</span>}</div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a7b20eb99272665c1777949e26ab59589"><div class="ttname"><a href="#a7b20eb99272665c1777949e26ab59589">operations_on_datastructures::inorder_traversal_of_bst::deallocate</a></div><div class="ttdeci">void deallocate(Node *rootNode)</div><div class="ttdoc">This function clears the memory allocated to entire tree recursively. Its just for clean up the memor...</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00210">inorder_successor_of_bst.cpp:210</a></div></div>
|
||||
<div class="ttc" id="aclassoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node_html_a9b4ae6f5179a1c8ecfd563811a59e6c0"><div class="ttname"><a href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#a9b4ae6f5179a1c8ecfd563811a59e6c0">operations_on_datastructures::inorder_traversal_of_bst::Node::right</a></div><div class="ttdeci">Node * right</div><div class="ttdoc">Pointer to right child.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00060">inorder_successor_of_bst.cpp:60</a></div></div>
|
||||
<div class="ttc" id="aclassoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node_html_a9ccef4c746b7226488b014f5bac4789a"><div class="ttname"><a href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#a9ccef4c746b7226488b014f5bac4789a">operations_on_datastructures::inorder_traversal_of_bst::Node::left</a></div><div class="ttdeci">Node * left</div><div class="ttdoc">Pointer to Left child.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00059">inorder_successor_of_bst.cpp:59</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -324,14 +325,14 @@ Method 2: Search from the root node</h4>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00176">176</a> of file <a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html">inorder_successor_of_bst.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 176</span> {</div>
|
||||
<div class="line"><span class="lineno"> 177</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *current = <a class="code hl_function" href="#a824cbf1814854824cf05f062eea07b95">getNode</a>(root, <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><span class="lineno"> 177</span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *current = <a class="code hl_function" href="#a824cbf1814854824cf05f062eea07b95">getNode</a>(root, <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><span class="lineno"> 178</span> <span class="keywordflow">if</span> (current == <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><span class="lineno"> 179</span> <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><span class="lineno"> 180</span> }</div>
|
||||
<div class="line"><span class="lineno"> 181</span> </div>
|
||||
<div class="line"><span class="lineno"> 182</span> <span class="comment">// Case - 1</span></div>
|
||||
<div class="line"><span class="lineno"> 183</span> <span class="keywordflow">if</span> (current->right != <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><span class="lineno"> 184</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a72483e3f6933e004a8d86371e8a990db">findMinNode</a>(current->right);</div>
|
||||
<div class="line"><span class="lineno"> 183</span> <span class="keywordflow">if</span> (current-><a class="code hl_variable" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#a9b4ae6f5179a1c8ecfd563811a59e6c0">right</a> != <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><span class="lineno"> 184</span> <span class="keywordflow">return</span> findMinNode(current-><a class="code hl_variable" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#a9b4ae6f5179a1c8ecfd563811a59e6c0">right</a>);</div>
|
||||
<div class="line"><span class="lineno"> 185</span> }</div>
|
||||
<div class="line"><span class="lineno"> 186</span> <span class="comment">// case - 2</span></div>
|
||||
<div class="line"><span class="lineno"> 187</span> <span class="keywordflow">else</span> {</div>
|
||||
@@ -340,7 +341,7 @@ Method 2: Search from the root node</h4>
|
||||
<div class="line"><span class="lineno"> 190</span> </div>
|
||||
<div class="line"><span class="lineno"> 191</span> <span class="keywordflow">while</span> (ancestor != current && ancestor != <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><span class="lineno"> 192</span> <span class="comment">// This means my current node is in left of the root node</span></div>
|
||||
<div class="line"><span class="lineno"> 193</span> <span class="keywordflow">if</span> (current->data < ancestor->data) {</div>
|
||||
<div class="line"><span class="lineno"> 193</span> <span class="keywordflow">if</span> (current-><a class="code hl_variable" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#ae161f3e5ef33ade73429cab9291612e2">data</a> < ancestor->data) {</div>
|
||||
<div class="line"><span class="lineno"> 194</span> successor = ancestor;</div>
|
||||
<div class="line"><span class="lineno"> 195</span> ancestor = ancestor->left; <span class="comment">// keep going left</span></div>
|
||||
<div class="line"><span class="lineno"> 196</span> } <span class="keywordflow">else</span> {</div>
|
||||
@@ -350,8 +351,9 @@ Method 2: Search from the root node</h4>
|
||||
<div class="line"><span class="lineno"> 200</span> <span class="keywordflow">return</span> successor; <span class="comment">// Nodes with maximum vales will not have a successor</span></div>
|
||||
<div class="line"><span class="lineno"> 201</span> }</div>
|
||||
<div class="line"><span class="lineno"> 202</span>}</div>
|
||||
<div class="ttc" id="aclassoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node_html"><div class="ttname"><a href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a></div><div class="ttdoc">A Node structure representing a single node in BST.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00056">inorder_successor_of_bst.cpp:56</a></div></div>
|
||||
<div class="ttc" id="aclassoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node_html_ae161f3e5ef33ade73429cab9291612e2"><div class="ttname"><a href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#ae161f3e5ef33ade73429cab9291612e2">operations_on_datastructures::inorder_traversal_of_bst::Node::data</a></div><div class="ttdeci">int64_t data</div><div class="ttdoc">The key/value of the node.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00058">inorder_successor_of_bst.cpp:58</a></div></div>
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a6e1a77282bc65ad359d753d25df23243"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a></div><div class="ttdeci">int data[MAX]</div><div class="ttdoc">test data</div><div class="ttdef"><b>Definition</b> <a href="../../d1/df3/hash__search_8cpp_source.html#l00024">hash_search.cpp:24</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a72483e3f6933e004a8d86371e8a990db"><div class="ttname"><a href="#a72483e3f6933e004a8d86371e8a990db">operations_on_datastructures::inorder_traversal_of_bst::findMinNode</a></div><div class="ttdeci">Node * findMinNode(Node *root)</div><div class="ttdoc">Finds and return the minimum node in BST.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00121">inorder_successor_of_bst.cpp:121</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a824cbf1814854824cf05f062eea07b95"><div class="ttname"><a href="#a824cbf1814854824cf05f062eea07b95">operations_on_datastructures::inorder_traversal_of_bst::getNode</a></div><div class="ttdeci">Node * getNode(Node *root, int64_t data)</div><div class="ttdoc">Searches the given data in BST and returns the pointer to the node containing that data.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00100">inorder_successor_of_bst.cpp:100</a></div></div>
|
||||
<div class="ttc" id="astruct_node_html"><div class="ttname"><a href="../../db/d8b/struct_node.html">Node</a></div><div class="ttdef"><b>Definition</b> <a href="../../d3/dce/linkedlist__implentation__usingarray_8cpp_source.html#l00014">linkedlist_implentation_usingarray.cpp:14</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
@@ -396,7 +398,7 @@ Method 2: Search from the root node</h4>
|
||||
<div class="line"><span class="lineno"> 103</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (root->data == <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 104</span> <span class="keywordflow">return</span> root; </div>
|
||||
<div class="line"><span class="lineno"> 105</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a> > root->data) {</div>
|
||||
<div class="line"><span class="lineno"> 108</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a824cbf1814854824cf05f062eea07b95">getNode</a>(root->right, <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><span class="lineno"> 108</span> <span class="keywordflow">return</span> getNode(root->right, <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><span class="lineno"> 109</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 112</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a824cbf1814854824cf05f062eea07b95">getNode</a>(root->left, <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><span class="lineno"> 113</span> }</div>
|
||||
@@ -444,7 +446,7 @@ Method 2: Search from the root node</h4>
|
||||
<div class="line"><span class="lineno"> 89</span> }</div>
|
||||
<div class="line"><span class="lineno"> 90</span> <span class="keywordflow">return</span> root;</div>
|
||||
<div class="line"><span class="lineno"> 91</span>}</div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a7f6f73a33beec448c27cc1d70b220702"><div class="ttname"><a href="#a7f6f73a33beec448c27cc1d70b220702">operations_on_datastructures::inorder_traversal_of_bst::makeNode</a></div><div class="ttdeci">Node * makeNode(int64_t data)</div><div class="ttdoc">Allocates a new node in heap for given data and returns it's pointer.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00068">inorder_successor_of_bst.cpp:68</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a7f6f73a33beec448c27cc1d70b220702"><div class="ttname"><a href="#a7f6f73a33beec448c27cc1d70b220702">operations_on_datastructures::inorder_traversal_of_bst::makeNode</a></div><div class="ttdeci">Node * makeNode(int64_t data)</div><div class="ttdoc">Allocates a new node in heap for given data and returns it's pointer.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00068">inorder_successor_of_bst.cpp:68</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -515,10 +517,9 @@ Method 2: Search from the root node</h4>
|
||||
<div class="line"><span class="lineno"> 427</span> </div>
|
||||
<div class="line"><span class="lineno"> 428</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 429</span>}</div>
|
||||
<div class="ttc" id="aclassoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node_html"><div class="ttname"><a href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a></div><div class="ttdoc">A Node structure representing a single node in BST.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00056">inorder_successor_of_bst.cpp:56</a></div></div>
|
||||
<div class="ttc" id="aclassoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node_html_ae161f3e5ef33ade73429cab9291612e2"><div class="ttname"><a href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#ae161f3e5ef33ade73429cab9291612e2">operations_on_datastructures::inorder_traversal_of_bst::Node::data</a></div><div class="ttdeci">int64_t data</div><div class="ttdoc">The key/value of the node.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00058">inorder_successor_of_bst.cpp:58</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a05fe8a029e155c43e4efa598d4d089d9"><div class="ttname"><a href="#a05fe8a029e155c43e4efa598d4d089d9">operations_on_datastructures::inorder_traversal_of_bst::makeBST</a></div><div class="ttdeci">Node * makeBST(Node *root, const std::vector< int64_t > &data)</div><div class="ttdoc">This function is used in test cases to quickly create BST containing large data instead of hard codin...</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00155">inorder_successor_of_bst.cpp:155</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a5d7266b934ca50c4f53e4f1e725d89a4"><div class="ttname"><a href="#a5d7266b934ca50c4f53e4f1e725d89a4">operations_on_datastructures::inorder_traversal_of_bst::printInorder</a></div><div class="ttdeci">void printInorder(Node *root)</div><div class="ttdoc">Prints the BST in inorder traversal using recursion.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00136">inorder_successor_of_bst.cpp:136</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a7b20eb99272665c1777949e26ab59589"><div class="ttname"><a href="#a7b20eb99272665c1777949e26ab59589">operations_on_datastructures::inorder_traversal_of_bst::deallocate</a></div><div class="ttdeci">void deallocate(Node *rootNode)</div><div class="ttdoc">This function clears the memory allocated to entire tree recursively. Its just for clean up the memor...</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00210">inorder_successor_of_bst.cpp:210</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00387">inorder_successor_of_bst.cpp:387</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -555,10 +556,11 @@ Method 2: Search from the root node</h4>
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00155">155</a> of file <a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html">inorder_successor_of_bst.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 155</span> {</div>
|
||||
<div class="line"><span class="lineno"> 156</span> <span class="keywordflow">for</span> (int64_t values : <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 157</span> root = Insert(root, values);</div>
|
||||
<div class="line"><span class="lineno"> 157</span> root = <a class="code hl_function" href="#a3ae0bea4123fd2ce155108e88f2ef78c">Insert</a>(root, values);</div>
|
||||
<div class="line"><span class="lineno"> 158</span> }</div>
|
||||
<div class="line"><span class="lineno"> 159</span> <span class="keywordflow">return</span> root;</div>
|
||||
<div class="line"><span class="lineno"> 160</span>}</div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a3ae0bea4123fd2ce155108e88f2ef78c"><div class="ttname"><a href="#a3ae0bea4123fd2ce155108e88f2ef78c">operations_on_datastructures::inorder_traversal_of_bst::Insert</a></div><div class="ttdeci">Node * Insert(Node *root, int64_t data)</div><div class="ttdoc">Inserts the given data in BST while maintaining the properties of BST.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00082">inorder_successor_of_bst.cpp:82</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -591,13 +593,12 @@ Method 2: Search from the root node</h4>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00068">68</a> of file <a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html">inorder_successor_of_bst.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 68</span> {</div>
|
||||
<div class="line"><span class="lineno"> 69</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = <span class="keyword">new</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a>();</div>
|
||||
<div class="line"><span class="lineno"> 69</span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = <span class="keyword">new</span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a>();</div>
|
||||
<div class="line"><span class="lineno"> 70</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->data = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>; </div>
|
||||
<div class="line"><span class="lineno"> 71</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->left = <span class="keyword">nullptr</span>; </div>
|
||||
<div class="line"><span class="lineno"> 72</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->right = <span class="keyword">nullptr</span>; </div>
|
||||
<div class="line"><span class="lineno"> 73</span> <span class="keywordflow">return</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
|
||||
<div class="line"><span class="lineno"> 73</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
|
||||
<div class="line"><span class="lineno"> 74</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> <a href="../../d8/dee/avltree_8cpp_source.html#l00013">avltree.cpp:13</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>
|
||||
@@ -634,9 +635,9 @@ Method 2: Search from the root node</h4>
|
||||
<div class="line"><span class="lineno"> 138</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 139</span> }</div>
|
||||
<div class="line"><span class="lineno"> 140</span> </div>
|
||||
<div class="line"><span class="lineno"> 141</span> <a class="code hl_function" href="#a5d7266b934ca50c4f53e4f1e725d89a4">printInorder</a>(root->left); </div>
|
||||
<div class="line"><span class="lineno"> 141</span> printInorder(root->left); </div>
|
||||
<div class="line"><span class="lineno"> 142</span> std::cout << root->data << <span class="stringliteral">" "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 143</span> <a class="code hl_function" href="#a5d7266b934ca50c4f53e4f1e725d89a4">printInorder</a>(root->right); </div>
|
||||
<div class="line"><span class="lineno"> 143</span> printInorder(root->right); </div>
|
||||
<div class="line"><span class="lineno"> 144</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -659,7 +660,7 @@ Method 2: Search from the root node</h4>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -683,7 +684,7 @@ Method 2: Search from the root node</h4>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_35422be6552f1b3672c1b6c4aba2da64.html">operations_on_datastructures</a></li><li class="navelem"><a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp.html">inorder_successor_of_bst.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
16
d4/d32/inorder__successor__of__bst_8cpp.js
vendored
@@ -2,14 +2,14 @@ var inorder__successor__of__bst_8cpp =
|
||||
[
|
||||
[ "operations_on_datastructures::inorder_traversal_of_bst::Node", "d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html", "d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node" ],
|
||||
[ "TestCases", "d5/d58/class_test_cases.html", "d5/d58/class_test_cases" ],
|
||||
[ "deallocate", "d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589", null ],
|
||||
[ "findMinNode", "d4/d32/inorder__successor__of__bst_8cpp.html#a72483e3f6933e004a8d86371e8a990db", null ],
|
||||
[ "getInorderSuccessor", "d4/d32/inorder__successor__of__bst_8cpp.html#a3923fb22b46e085376703cae0b44d690", null ],
|
||||
[ "getNode", "d4/d32/inorder__successor__of__bst_8cpp.html#a824cbf1814854824cf05f062eea07b95", null ],
|
||||
[ "Insert", "d4/d32/inorder__successor__of__bst_8cpp.html#a3ae0bea4123fd2ce155108e88f2ef78c", null ],
|
||||
[ "operations_on_datastructures::inorder_traversal_of_bst::deallocate", "d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589", null ],
|
||||
[ "operations_on_datastructures::inorder_traversal_of_bst::findMinNode", "d4/d32/inorder__successor__of__bst_8cpp.html#a72483e3f6933e004a8d86371e8a990db", null ],
|
||||
[ "operations_on_datastructures::inorder_traversal_of_bst::getInorderSuccessor", "d4/d32/inorder__successor__of__bst_8cpp.html#a3923fb22b46e085376703cae0b44d690", null ],
|
||||
[ "operations_on_datastructures::inorder_traversal_of_bst::getNode", "d4/d32/inorder__successor__of__bst_8cpp.html#a824cbf1814854824cf05f062eea07b95", null ],
|
||||
[ "operations_on_datastructures::inorder_traversal_of_bst::Insert", "d4/d32/inorder__successor__of__bst_8cpp.html#a3ae0bea4123fd2ce155108e88f2ef78c", null ],
|
||||
[ "main", "d4/d32/inorder__successor__of__bst_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97", null ],
|
||||
[ "makeBST", "d4/d32/inorder__successor__of__bst_8cpp.html#a05fe8a029e155c43e4efa598d4d089d9", null ],
|
||||
[ "makeNode", "d4/d32/inorder__successor__of__bst_8cpp.html#a7f6f73a33beec448c27cc1d70b220702", null ],
|
||||
[ "printInorder", "d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4", null ],
|
||||
[ "operations_on_datastructures::inorder_traversal_of_bst::makeBST", "d4/d32/inorder__successor__of__bst_8cpp.html#a05fe8a029e155c43e4efa598d4d089d9", null ],
|
||||
[ "operations_on_datastructures::inorder_traversal_of_bst::makeNode", "d4/d32/inorder__successor__of__bst_8cpp.html#a7f6f73a33beec448c27cc1d70b220702", null ],
|
||||
[ "operations_on_datastructures::inorder_traversal_of_bst::printInorder", "d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4", null ],
|
||||
[ "test", "d4/d32/inorder__successor__of__bst_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: operations_on_datastructures/inorder_successor_of_bst.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,15 +124,16 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="headertitle"><div class="title">inorder_successor_of_bst.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d32/inorder__successor__of__bst_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d32/inorder__successor__of__bst_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span></div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../da/d6d/namespaceoperations__on__datastructures.html">operations_on_datastructures</a> {</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span></div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="keyword">namespace </span>inorder_traversal_of_bst {</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span></div>
|
||||
<div class="foldopen" id="foldopen00056" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html"> 56</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> {</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keyword">public</span>:</div>
|
||||
@@ -141,30 +142,30 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#a9b4ae6f5179a1c8ecfd563811a59e6c0"> 60</a></span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *<a class="code hl_variable" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#a9b4ae6f5179a1c8ecfd563811a59e6c0">right</a>; </div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> </div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span></div>
|
||||
<div class="foldopen" id="foldopen00068" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7f6f73a33beec448c27cc1d70b220702"> 68</a></span><a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *<a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7f6f73a33beec448c27cc1d70b220702">makeNode</a>(int64_t <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = <span class="keyword">new</span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a>();</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->data = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>; </div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->left = <span class="keyword">nullptr</span>; </div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->right = <span class="keyword">nullptr</span>; </div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordflow">return</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> </div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span></div>
|
||||
<div class="foldopen" id="foldopen00082" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a3ae0bea4123fd2ce155108e88f2ef78c"> 82</a></span><a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *Insert(<a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *root, int64_t <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a3ae0bea4123fd2ce155108e88f2ef78c"> 82</a></span><a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *<a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a3ae0bea4123fd2ce155108e88f2ef78c">Insert</a>(<a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *root, int64_t <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordflow">if</span> (root == <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> root = <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7f6f73a33beec448c27cc1d70b220702">makeNode</a>(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data <= root-></a><a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> root->left = Insert(root->left, <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> root->left = <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a3ae0bea4123fd2ce155108e88f2ef78c">Insert</a>(root->left, <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> root->right = Insert(root->right, <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> root->right = <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a3ae0bea4123fd2ce155108e88f2ef78c">Insert</a>(root->right, <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> }</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">return</span> root;</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> </div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span></div>
|
||||
<div class="foldopen" id="foldopen00100" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a824cbf1814854824cf05f062eea07b95"> 100</a></span><a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *<a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a824cbf1814854824cf05f062eea07b95">getNode</a>(<a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *root, int64_t <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordflow">if</span> (root == <span class="keyword">nullptr</span>) {</div>
|
||||
@@ -178,7 +179,7 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> }</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> </div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span></div>
|
||||
<div class="foldopen" id="foldopen00121" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"><a class="line" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a72483e3f6933e004a8d86371e8a990db"> 121</a></span><a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *<a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a72483e3f6933e004a8d86371e8a990db">findMinNode</a>(<a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *root) {</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">if</span> (root == <span class="keyword">nullptr</span>) {</div>
|
||||
@@ -190,7 +191,7 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keywordflow">return</span> root;</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> </div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span></div>
|
||||
<div class="foldopen" id="foldopen00136" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"><a class="line" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4"> 136</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4">printInorder</a>(<a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *root) {</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keywordflow">if</span> (root == <span class="keyword">nullptr</span>) {</div>
|
||||
@@ -202,16 +203,16 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4">printInorder</a>(root->right); </div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> </div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span></div>
|
||||
<div class="foldopen" id="foldopen00155" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"><a class="line" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a05fe8a029e155c43e4efa598d4d089d9"> 155</a></span><a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *<a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a05fe8a029e155c43e4efa598d4d089d9">makeBST</a>(<a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *root, <span class="keyword">const</span> std::vector<int64_t> &<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keywordflow">for</span> (int64_t values : <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> root = Insert(root, values);</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> root = <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a3ae0bea4123fd2ce155108e88f2ef78c">Insert</a>(root, values);</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> }</div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keywordflow">return</span> root;</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> </div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span></div>
|
||||
<div class="foldopen" id="foldopen00176" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"><a class="line" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a3923fb22b46e085376703cae0b44d690"> 176</a></span><a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *<a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a3923fb22b46e085376703cae0b44d690">getInorderSuccessor</a>(<a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *root, int64_t <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *current = <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a824cbf1814854824cf05f062eea07b95">getNode</a>(root, <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
@@ -241,7 +242,7 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> }</div>
|
||||
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> </div>
|
||||
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span></div>
|
||||
<div class="foldopen" id="foldopen00210" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"><a class="line" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589"> 210</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589">deallocate</a>(<a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> *rootNode) {</div>
|
||||
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> <span class="keywordflow">if</span> (rootNode == <span class="keyword">nullptr</span>) {</div>
|
||||
@@ -255,7 +256,7 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> </div>
|
||||
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span>} <span class="comment">// namespace inorder_traversal_of_bst</span></div>
|
||||
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span>} <span class="comment">// namespace operations_on_datastructures</span></div>
|
||||
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> </div>
|
||||
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span></div>
|
||||
<div class="foldopen" id="foldopen00225" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"><a class="line" href="../../d5/d58/class_test_cases.html"> 225</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d5/d58/class_test_cases.html">TestCases</a> {</div>
|
||||
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> <span class="keyword">private</span>:</div>
|
||||
@@ -280,7 +281,7 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> std::cout << std::endl;</div>
|
||||
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> </div>
|
||||
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span></div>
|
||||
<div class="foldopen" id="foldopen00259" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"><a class="line" href="../../d5/d58/class_test_cases.html#ac2636e8b5b9e053374c45bfcf0603008"> 259</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#ac2636e8b5b9e053374c45bfcf0603008">testCase_1</a>() {</div>
|
||||
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> <span class="keyword">const</span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a></div>
|
||||
@@ -297,12 +298,12 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> std::vector<int64_t> node_data{</div>
|
||||
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> 20, 3, 5, 6, 2, 23, 45, 78, 21}; </div>
|
||||
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> </div>
|
||||
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> root = operations_on_datastructures::inorder_traversal_of_bst::makeBST(</div>
|
||||
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> root = <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a05fe8a029e155c43e4efa598d4d089d9">operations_on_datastructures::inorder_traversal_of_bst::makeBST</a>(</div>
|
||||
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> root,</div>
|
||||
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> node_data); </div>
|
||||
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> </div>
|
||||
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> std::cout << <span class="stringliteral">"Inorder sequence is : "</span>;</div>
|
||||
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> operations_on_datastructures::inorder_traversal_of_bst::printInorder(</div>
|
||||
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4">operations_on_datastructures::inorder_traversal_of_bst::printInorder</a>(</div>
|
||||
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> root); </div>
|
||||
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> std::cout << std::endl;</div>
|
||||
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> </div>
|
||||
@@ -315,14 +316,14 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> assert(inorderSuccessor == expectedOutput);</div>
|
||||
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">"Assertion check passed!"</span>);</div>
|
||||
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> </div>
|
||||
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> operations_on_datastructures::inorder_traversal_of_bst::deallocate(</div>
|
||||
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589">operations_on_datastructures::inorder_traversal_of_bst::deallocate</a>(</div>
|
||||
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> root); </div>
|
||||
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> </div>
|
||||
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">"[PASS] : TEST CASE 1 PASS!"</span>);</div>
|
||||
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"</span>);</div>
|
||||
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span> </div>
|
||||
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span></div>
|
||||
<div class="foldopen" id="foldopen00304" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"><a class="line" href="../../d5/d58/class_test_cases.html#abae0148985f159b582a385cf399254e3"> 304</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#abae0148985f159b582a385cf399254e3">testCase_2</a>() {</div>
|
||||
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> <span class="keyword">const</span> <span class="keywordtype">int</span> expectedOutput = 21; </div>
|
||||
@@ -335,12 +336,12 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> std::vector<int64_t> node_data{</div>
|
||||
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span> 20, 3, 5, 6, 2, 23, 45, 78, 21}; </div>
|
||||
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> </div>
|
||||
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> root = operations_on_datastructures::inorder_traversal_of_bst::makeBST(</div>
|
||||
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> root = <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a05fe8a029e155c43e4efa598d4d089d9">operations_on_datastructures::inorder_traversal_of_bst::makeBST</a>(</div>
|
||||
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> root,</div>
|
||||
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span> node_data); </div>
|
||||
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"> 318</span> </div>
|
||||
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span> std::cout << <span class="stringliteral">"Inorder sequence is : "</span>;</div>
|
||||
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span> operations_on_datastructures::inorder_traversal_of_bst::printInorder(</div>
|
||||
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span> <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4">operations_on_datastructures::inorder_traversal_of_bst::printInorder</a>(</div>
|
||||
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> root); </div>
|
||||
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> std::cout << std::endl;</div>
|
||||
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span> </div>
|
||||
@@ -353,14 +354,14 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"> 330</span> assert(inorderSuccessor-><a class="code hl_variable" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#ae161f3e5ef33ade73429cab9291612e2">data</a> == expectedOutput);</div>
|
||||
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno"> 331</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">"Assertion check passed!"</span>);</div>
|
||||
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno"> 332</span> </div>
|
||||
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno"> 333</span> operations_on_datastructures::inorder_traversal_of_bst::deallocate(</div>
|
||||
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno"> 333</span> <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589">operations_on_datastructures::inorder_traversal_of_bst::deallocate</a>(</div>
|
||||
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"> 334</span> root); </div>
|
||||
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</span> </div>
|
||||
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"> 336</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">"[PASS] : TEST CASE 2 PASS!"</span>);</div>
|
||||
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"</span>);</div>
|
||||
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno"> 338</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span> </div>
|
||||
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span></div>
|
||||
<div class="foldopen" id="foldopen00345" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno"><a class="line" href="../../d5/d58/class_test_cases.html#ad9f95c09931625b41e3be1f88d1e28c5"> 345</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#ad9f95c09931625b41e3be1f88d1e28c5">testCase_3</a>() {</div>
|
||||
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"> 346</span> <span class="keyword">const</span> <span class="keywordtype">int</span> expectedOutput = 110; </div>
|
||||
@@ -374,12 +375,12 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno"> 354</span> 89, 67, 32, 56, 90, 123, 120,</div>
|
||||
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno"> 355</span> 110, 115, 6, 78, 7, 10}; </div>
|
||||
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno"> 356</span> </div>
|
||||
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno"> 357</span> root = operations_on_datastructures::inorder_traversal_of_bst::makeBST(</div>
|
||||
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno"> 357</span> root = <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a05fe8a029e155c43e4efa598d4d089d9">operations_on_datastructures::inorder_traversal_of_bst::makeBST</a>(</div>
|
||||
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"> 358</span> root,</div>
|
||||
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno"> 359</span> node_data); </div>
|
||||
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno"> 360</span> </div>
|
||||
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno"> 361</span> std::cout << <span class="stringliteral">"Inorder sequence is : "</span>;</div>
|
||||
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno"> 362</span> operations_on_datastructures::inorder_traversal_of_bst::printInorder(</div>
|
||||
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno"> 362</span> <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4">operations_on_datastructures::inorder_traversal_of_bst::printInorder</a>(</div>
|
||||
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno"> 363</span> root); </div>
|
||||
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno"> 364</span> std::cout << std::endl;</div>
|
||||
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno"> 365</span> </div>
|
||||
@@ -392,7 +393,7 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno"> 372</span> assert(inorderSuccessor-><a class="code hl_variable" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#ae161f3e5ef33ade73429cab9291612e2">data</a> == expectedOutput);</div>
|
||||
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno"> 373</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">"Assertion check passed!"</span>);</div>
|
||||
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno"> 374</span> </div>
|
||||
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno"> 375</span> operations_on_datastructures::inorder_traversal_of_bst::deallocate(</div>
|
||||
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno"> 375</span> <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589">operations_on_datastructures::inorder_traversal_of_bst::deallocate</a>(</div>
|
||||
<div class="line"><a id="l00376" name="l00376"></a><span class="lineno"> 376</span> root); </div>
|
||||
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno"> 377</span> </div>
|
||||
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno"> 378</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">"[PASS] : TEST CASE 3 PASS!"</span>);</div>
|
||||
@@ -401,14 +402,14 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
</div>
|
||||
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno"> 381</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno"> 382</span> </div>
|
||||
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno"> 382</span></div>
|
||||
<div class="foldopen" id="foldopen00387" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00387" name="l00387"></a><span class="lineno"><a class="line" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 387</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00388" name="l00388"></a><span class="lineno"> 388</span> <a class="code hl_class" href="../../d5/d58/class_test_cases.html">TestCases</a> tc;</div>
|
||||
<div class="line"><a id="l00389" name="l00389"></a><span class="lineno"> 389</span> tc.<a class="code hl_function" href="../../d5/d58/class_test_cases.html#aeabea90c02f9159e4a784bbf736e1e23">runTests</a>();</div>
|
||||
<div class="line"><a id="l00390" name="l00390"></a><span class="lineno"> 390</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno"> 391</span> </div>
|
||||
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno"> 391</span></div>
|
||||
<div class="foldopen" id="foldopen00398" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno"><a class="line" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97"> 398</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[]) {</div>
|
||||
<div class="line"><a id="l00399" name="l00399"></a><span class="lineno"> 399</span> <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -419,7 +420,7 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00404" name="l00404"></a><span class="lineno"> 404</span> 89, 1, 2}; </div>
|
||||
<div class="line"><a id="l00405" name="l00405"></a><span class="lineno"> 405</span> </div>
|
||||
<div class="line"><a id="l00406" name="l00406"></a><span class="lineno"> 406</span> int64_t targetElement = 4; </div>
|
||||
<div class="line"><a id="l00407" name="l00407"></a><span class="lineno"> 407</span> root = operations_on_datastructures::inorder_traversal_of_bst::makeBST(</div>
|
||||
<div class="line"><a id="l00407" name="l00407"></a><span class="lineno"> 407</span> root = <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a05fe8a029e155c43e4efa598d4d089d9">operations_on_datastructures::inorder_traversal_of_bst::makeBST</a>(</div>
|
||||
<div class="line"><a id="l00408" name="l00408"></a><span class="lineno"> 408</span> root, node_data); </div>
|
||||
<div class="line"><a id="l00409" name="l00409"></a><span class="lineno"> 409</span> </div>
|
||||
<div class="line"><a id="l00410" name="l00410"></a><span class="lineno"> 410</span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a></div>
|
||||
@@ -427,7 +428,7 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno"> 412</span> inorder_traversal_of_bst::getInorderSuccessor(root, targetElement);</div>
|
||||
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno"> 413</span> </div>
|
||||
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno"> 414</span> std::cout << <span class="stringliteral">"In-order sequence is : "</span>;</div>
|
||||
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno"> 415</span> operations_on_datastructures::inorder_traversal_of_bst::printInorder(root);</div>
|
||||
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno"> 415</span> <a class="code hl_function" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4">operations_on_datastructures::inorder_traversal_of_bst::printInorder</a>(root);</div>
|
||||
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno"> 416</span> std::cout << std::endl;</div>
|
||||
<div class="line"><a id="l00417" name="l00417"></a><span class="lineno"> 417</span> </div>
|
||||
<div class="line"><a id="l00418" name="l00418"></a><span class="lineno"> 418</span> <span class="keywordflow">if</span> (inorderSuccessor == <span class="keyword">nullptr</span>) {</div>
|
||||
@@ -443,7 +444,6 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="line"><a id="l00428" name="l00428"></a><span class="lineno"> 428</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00429" name="l00429"></a><span class="lineno"> 429</span>}</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 class="ttc" id="aclass_test_cases_html"><div class="ttname"><a href="../../d5/d58/class_test_cases.html">TestCases</a></div><div class="ttdoc">class encapsulating the necessary test cases</div><div class="ttdef"><b>Definition</b> <a href="#l00225">inorder_successor_of_bst.cpp:225</a></div></div>
|
||||
<div class="ttc" id="aclass_test_cases_html_aa3aa3d5bf666f327ee8e2d11d397b06e"><div class="ttname"><a href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e">TestCases::log</a></div><div class="ttdeci">void log(T msg)</div><div class="ttdoc">A function to print given message on console.</div><div class="ttdef"><b>Definition</b> <a href="#l00233">inorder_successor_of_bst.cpp:233</a></div></div>
|
||||
<div class="ttc" id="aclass_test_cases_html_abae0148985f159b582a385cf399254e3"><div class="ttname"><a href="../../d5/d58/class_test_cases.html#abae0148985f159b582a385cf399254e3">TestCases::testCase_2</a></div><div class="ttdeci">void testCase_2()</div><div class="ttdoc">A test case which contains main list of 100 elements and sublist of 20.</div><div class="ttdef"><b>Definition</b> <a href="#l00304">inorder_successor_of_bst.cpp:304</a></div></div>
|
||||
@@ -458,10 +458,11 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a6e1a77282bc65ad359d753d25df23243"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a></div><div class="ttdeci">int data[MAX]</div><div class="ttdoc">test data</div><div class="ttdef"><b>Definition</b> <a href="../../d1/df3/hash__search_8cpp_source.html#l00024">hash_search.cpp:24</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a05fe8a029e155c43e4efa598d4d089d9"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a05fe8a029e155c43e4efa598d4d089d9">operations_on_datastructures::inorder_traversal_of_bst::makeBST</a></div><div class="ttdeci">Node * makeBST(Node *root, const std::vector< int64_t > &data)</div><div class="ttdoc">This function is used in test cases to quickly create BST containing large data instead of hard codin...</div><div class="ttdef"><b>Definition</b> <a href="#l00155">inorder_successor_of_bst.cpp:155</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a3923fb22b46e085376703cae0b44d690"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a3923fb22b46e085376703cae0b44d690">operations_on_datastructures::inorder_traversal_of_bst::getInorderSuccessor</a></div><div class="ttdeci">Node * getInorderSuccessor(Node *root, int64_t data)</div><div class="ttdoc">Inorder successor of a node is the next node in inorder traversal of the Binary Tree....</div><div class="ttdef"><b>Definition</b> <a href="#l00176">inorder_successor_of_bst.cpp:176</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a3ae0bea4123fd2ce155108e88f2ef78c"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a3ae0bea4123fd2ce155108e88f2ef78c">operations_on_datastructures::inorder_traversal_of_bst::Insert</a></div><div class="ttdeci">Node * Insert(Node *root, int64_t data)</div><div class="ttdoc">Inserts the given data in BST while maintaining the properties of BST.</div><div class="ttdef"><b>Definition</b> <a href="#l00082">inorder_successor_of_bst.cpp:82</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a5d7266b934ca50c4f53e4f1e725d89a4"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4">operations_on_datastructures::inorder_traversal_of_bst::printInorder</a></div><div class="ttdeci">void printInorder(Node *root)</div><div class="ttdoc">Prints the BST in inorder traversal using recursion.</div><div class="ttdef"><b>Definition</b> <a href="#l00136">inorder_successor_of_bst.cpp:136</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a72483e3f6933e004a8d86371e8a990db"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a72483e3f6933e004a8d86371e8a990db">operations_on_datastructures::inorder_traversal_of_bst::findMinNode</a></div><div class="ttdeci">Node * findMinNode(Node *root)</div><div class="ttdoc">Finds and return the minimum node in BST.</div><div class="ttdef"><b>Definition</b> <a href="#l00121">inorder_successor_of_bst.cpp:121</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a7b20eb99272665c1777949e26ab59589"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589">operations_on_datastructures::inorder_traversal_of_bst::deallocate</a></div><div class="ttdeci">void deallocate(Node *rootNode)</div><div class="ttdoc">This function clears the memory allocated to entire tree recursively. Its just for clean up the memor...</div><div class="ttdef"><b>Definition</b> <a href="#l00210">inorder_successor_of_bst.cpp:210</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a7f6f73a33beec448c27cc1d70b220702"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7f6f73a33beec448c27cc1d70b220702">operations_on_datastructures::inorder_traversal_of_bst::makeNode</a></div><div class="ttdeci">Node * makeNode(int64_t data)</div><div class="ttdoc">Allocates a new node in heap for given data and returns it's pointer.</div><div class="ttdef"><b>Definition</b> <a href="#l00068">inorder_successor_of_bst.cpp:68</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a7f6f73a33beec448c27cc1d70b220702"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7f6f73a33beec448c27cc1d70b220702">operations_on_datastructures::inorder_traversal_of_bst::makeNode</a></div><div class="ttdeci">Node * makeNode(int64_t data)</div><div class="ttdoc">Allocates a new node in heap for given data and returns it's pointer.</div><div class="ttdef"><b>Definition</b> <a href="#l00068">inorder_successor_of_bst.cpp:68</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a824cbf1814854824cf05f062eea07b95"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a824cbf1814854824cf05f062eea07b95">operations_on_datastructures::inorder_traversal_of_bst::getNode</a></div><div class="ttdeci">Node * getNode(Node *root, int64_t data)</div><div class="ttdoc">Searches the given data in BST and returns the pointer to the node containing that data.</div><div class="ttdef"><b>Definition</b> <a href="#l00100">inorder_successor_of_bst.cpp:100</a></div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="#l00387">inorder_successor_of_bst.cpp:387</a></div></div>
|
||||
<div class="ttc" id="anamespaceoperations__on__datastructures_html"><div class="ttname"><a href="../../da/d6d/namespaceoperations__on__datastructures.html">operations_on_datastructures</a></div><div class="ttdoc">for std::vector</div></div>
|
||||
@@ -472,7 +473,7 @@ $(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp_source.html','
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_35422be6552f1b3672c1b6c4aba2da64.html">operations_on_datastructures</a></li><li class="navelem"><a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp.html">inorder_successor_of_bst.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: count_bits_flip Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d4/d38/namespacecount__bits__flip.html','../../'); ini
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d4/d38/namespacecount__bits__flip.html">count_bits_flip</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/power_of_two.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -223,7 +223,7 @@ Algorithm</h3>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -281,7 +281,7 @@ Algorithm</h3>
|
||||
<div class="line"><span class="lineno"> 81</span> </div>
|
||||
<div class="line"><span class="lineno"> 82</span> std::cout << <span class="stringliteral">"Enter a number "</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 83</span> std::cin >> n; </div>
|
||||
<div class="line"><span class="lineno"> 84</span> </div>
|
||||
<div class="line"><span class="lineno"> 84</span></div>
|
||||
<div class="line"><span class="lineno"> 86</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = <a class="code hl_function" href="../../dd/d47/namespacemath.html#a8a48be4d7f14e34c5c92925bc1cbf3bb">math::power_of_two</a>(n);</div>
|
||||
<div class="line"><span class="lineno"> 87</span> <span class="keywordflow">if</span> (result == 1) {</div>
|
||||
<div class="line"><span class="lineno"> 88</span> std::cout << <span class="stringliteral">"Yes, the number "</span> << n << <span class="stringliteral">" is a power of 2\n"</span>;</div>
|
||||
@@ -300,7 +300,7 @@ Algorithm</h3>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d4/d38/power__of__two_8cpp.html">power_of_two.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
2
d4/d38/power__of__two_8cpp.js
vendored
@@ -1,7 +1,7 @@
|
||||
var power__of__two_8cpp =
|
||||
[
|
||||
[ "main", "d4/d38/power__of__two_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "power_of_two", "d4/d38/power__of__two_8cpp.html#a8a48be4d7f14e34c5c92925bc1cbf3bb", null ],
|
||||
[ "math::power_of_two", "dd/d47/namespacemath.html#a8a48be4d7f14e34c5c92925bc1cbf3bb", null ],
|
||||
[ "test", "d4/d38/power__of__two_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ],
|
||||
[ "user_input_test", "d4/d38/power__of__two_8cpp.html#adfd6be45be425ae28c62ce3bfb4b40dc", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/power_of_two.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,11 +124,12 @@ $(function(){initNavTree('d4/d38/power__of__two_8cpp_source.html','../../'); ini
|
||||
<div class="headertitle"><div class="title">power_of_two.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d38/power__of__two_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d38/power__of__two_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../dd/d47/namespacemath.html">math</a> {</div>
|
||||
<div class="foldopen" id="foldopen00042" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="../../dd/d47/namespacemath.html#a8a48be4d7f14e34c5c92925bc1cbf3bb"> 42</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../dd/d47/namespacemath.html#a8a48be4d7f14e34c5c92925bc1cbf3bb">power_of_two</a>(<span class="keywordtype">int</span> n) {</div>
|
||||
@@ -142,7 +143,7 @@ $(function(){initNavTree('d4/d38/power__of__two_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span>} <span class="comment">// namespace math</span></div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span></div>
|
||||
<div class="foldopen" id="foldopen00059" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="../../d4/d38/power__of__two_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 59</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d38/power__of__two_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> std::cout << <span class="stringliteral">"First case testing... \n"</span>; <span class="comment">// for n = 32 return 1</span></div>
|
||||
@@ -160,14 +161,14 @@ $(function(){initNavTree('d4/d38/power__of__two_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> std::cout << <span class="stringliteral">"\nAll test cases have successfully passed!\n"</span>;</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> </div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span></div>
|
||||
<div class="foldopen" id="foldopen00079" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="../../d4/d38/power__of__two_8cpp.html#adfd6be45be425ae28c62ce3bfb4b40dc"> 79</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d38/power__of__two_8cpp.html#adfd6be45be425ae28c62ce3bfb4b40dc">user_input_test</a>() {</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordtype">int</span> n = 0; <span class="comment">// input from user</span></div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> std::cout << <span class="stringliteral">"Enter a number "</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> std::cin >> n; </div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> </div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span></div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordtype">int</span> result = <a class="code hl_function" href="../../dd/d47/namespacemath.html#a8a48be4d7f14e34c5c92925bc1cbf3bb">math::power_of_two</a>(n);</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">if</span> (result == 1) {</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> std::cout << <span class="stringliteral">"Yes, the number "</span> << n << <span class="stringliteral">" is a power of 2\n"</span>;</div>
|
||||
@@ -177,7 +178,7 @@ $(function(){initNavTree('d4/d38/power__of__two_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> }</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> </div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span></div>
|
||||
<div class="foldopen" id="foldopen00099" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"><a class="line" href="../../d4/d38/power__of__two_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 99</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d38/power__of__two_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <a class="code hl_function" href="../../d4/d38/power__of__two_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -199,7 +200,7 @@ $(function(){initNavTree('d4/d38/power__of__two_8cpp_source.html','../../'); ini
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d4/d38/power__of__two_8cpp.html">power_of_two.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Open Addressing</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -145,7 +145,7 @@ Namespaces</h2></td></tr>
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: machine_learning/k_nearest_neighbors.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -163,7 +163,7 @@ Namespaces</h2></td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:ad6ae16e50bb153ebaa7251d0aaa97b69" id="r_ad6ae16e50bb153ebaa7251d0aaa97b69"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:ad6ae16e50bb153ebaa7251d0aaa97b69" id="r_ad6ae16e50bb153ebaa7251d0aaa97b69"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:ad6ae16e50bb153ebaa7251d0aaa97b69"><td class="memTemplItemLeft" align="right" valign="top">double </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ad6ae16e50bb153ebaa7251d0aaa97b69">machine_learning::k_nearest_neighbors::euclidean_distance</a> (const std::vector< T > &a, const std::vector< T > &b)</td></tr>
|
||||
<tr class="memdesc:ad6ae16e50bb153ebaa7251d0aaa97b69"><td class="mdescLeft"> </td><td class="mdescRight">Compute the Euclidean distance between two vectors. <br /></td></tr>
|
||||
<tr class="separator:ad6ae16e50bb153ebaa7251d0aaa97b69"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -187,7 +187,7 @@ Functions</h2></td></tr>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">double machine_learning::k_nearest_neighbors::euclidean_distance </td>
|
||||
@@ -285,7 +285,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -350,7 +350,7 @@ template<typename T > </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_3343723ae086de42ee4ca9774da3a13f.html">machine_learning</a></li><li class="navelem"><a class="el" href="../../d4/d3e/k__nearest__neighbors_8cpp.html">k_nearest_neighbors.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
2
d4/d3e/k__nearest__neighbors_8cpp.js
vendored
@@ -1,7 +1,7 @@
|
||||
var k__nearest__neighbors_8cpp =
|
||||
[
|
||||
[ "machine_learning::k_nearest_neighbors::Knn", "da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html", "da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn" ],
|
||||
[ "euclidean_distance", "d4/d3e/k__nearest__neighbors_8cpp.html#ad6ae16e50bb153ebaa7251d0aaa97b69", null ],
|
||||
[ "machine_learning::k_nearest_neighbors::euclidean_distance", "d4/d3e/k__nearest__neighbors_8cpp.html#ad6ae16e50bb153ebaa7251d0aaa97b69", null ],
|
||||
[ "main", "d4/d3e/k__nearest__neighbors_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97", null ],
|
||||
[ "test", "d4/d3e/k__nearest__neighbors_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: machine_learning/k_nearest_neighbors.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,8 @@ $(function(){initNavTree('d4/d3e/k__nearest__neighbors_8cpp_source.html','../../
|
||||
<div class="headertitle"><div class="title">k_nearest_neighbors.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d3e/k__nearest__neighbors_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d3e/k__nearest__neighbors_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include <algorithm></span> </div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <cmath></span> </div>
|
||||
@@ -132,11 +133,11 @@ $(function(){initNavTree('d4/d3e/k__nearest__neighbors_8cpp_source.html','../../
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <numeric></span> </div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <unordered_map></span> </div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d8/d77/namespacemachine__learning.html">machine_learning</a> {</div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span></div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d7/d4c/namespacek__nearest__neighbors.html">k_nearest_neighbors</a> {</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span></div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00043" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="../../d4/d3e/k__nearest__neighbors_8cpp.html#ad6ae16e50bb153ebaa7251d0aaa97b69"> 43</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d4/d3e/k__nearest__neighbors_8cpp.html#ad6ae16e50bb153ebaa7251d0aaa97b69">euclidean_distance</a>(<span class="keyword">const</span> std::vector<T>& a, <span class="keyword">const</span> std::vector<T>& b) {</div>
|
||||
@@ -147,9 +148,9 @@ $(function(){initNavTree('d4/d3e/k__nearest__neighbors_8cpp_source.html','../../
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">return</span> std::sqrt(std::accumulate(aux.begin(), aux.end(), 0.0));</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span></div>
|
||||
<div class="foldopen" id="foldopen00055" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html"> 55</a></span><span class="keyword">class </span><a class="code hl_class" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html">Knn</a> {</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html"> 55</a></span><span class="keyword">class </span><a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a188d29ffcefdb5900a8cd41eccd89200">Knn</a> {</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keyword">private</span>:</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a16ddc13621eec6ac5f83658b3401a581"> 57</a></span> std::vector<std::vector<double>> <a class="code hl_variable" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a16ddc13621eec6ac5f83658b3401a581">X_</a>{}; </div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a209383503fb6c03afac405a80bace964"> 58</a></span> std::vector<int> <a class="code hl_variable" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a209383503fb6c03afac405a80bace964">Y_</a>{}; </div>
|
||||
@@ -159,17 +160,17 @@ $(function(){initNavTree('d4/d3e/k__nearest__neighbors_8cpp_source.html','../../
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a188d29ffcefdb5900a8cd41eccd89200"> 67</a></span> <span class="keyword">explicit</span> <a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a188d29ffcefdb5900a8cd41eccd89200">Knn</a>(std::vector<std::vector<double>>& X, std::vector<int>& Y)</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> : <a class="code hl_variable" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a16ddc13621eec6ac5f83658b3401a581">X_</a>(X), <a class="code hl_variable" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a209383503fb6c03afac405a80bace964">Y_</a>(Y){};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a9f5885c40112481ae5b588fe81d7910b"> 75</a></span> <a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a9f5885c40112481ae5b588fe81d7910b">Knn</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html">Knn</a>& model) = <span class="keywordflow">default</span>;</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> </div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a080f5b1742832a03c1cbba596a48bd1a"> 80</a></span> <a class="code hl_class" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html">Knn</a>& <a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a080f5b1742832a03c1cbba596a48bd1a">operator=</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html">Knn</a>& model) = <span class="keywordflow">default</span>;</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a4b17dcf17c847f0295b60029512c120e"> 85</a></span> <a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a4b17dcf17c847f0295b60029512c120e">Knn</a>(<a class="code hl_class" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html">Knn</a>&&) = <span class="keywordflow">default</span>;</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> </div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"><a class="line" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#ac06986d5afddc767ddba4da738f75563"> 90</a></span> <a class="code hl_class" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html">Knn</a>& <a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#ac06986d5afddc767ddba4da738f75563">operator=</a>(<a class="code hl_class" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html">Knn</a>&&) = <span class="keywordflow">default</span>;</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> </div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span></div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a9f5885c40112481ae5b588fe81d7910b"> 75</a></span> <a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a9f5885c40112481ae5b588fe81d7910b">Knn</a>(<span class="keyword">const</span> <a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a188d29ffcefdb5900a8cd41eccd89200">Knn</a>& model) = <span class="keywordflow">default</span>;</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span></div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a080f5b1742832a03c1cbba596a48bd1a"> 80</a></span> <a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a188d29ffcefdb5900a8cd41eccd89200">Knn</a>& <a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a080f5b1742832a03c1cbba596a48bd1a">operator=</a>(<span class="keyword">const</span> <a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a188d29ffcefdb5900a8cd41eccd89200">Knn</a>& model) = <span class="keywordflow">default</span>;</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span></div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a4b17dcf17c847f0295b60029512c120e"> 85</a></span> <a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a4b17dcf17c847f0295b60029512c120e">Knn</a>(<a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a188d29ffcefdb5900a8cd41eccd89200">Knn</a>&&) = <span class="keywordflow">default</span>;</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span></div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"><a class="line" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#ac06986d5afddc767ddba4da738f75563"> 90</a></span> <a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a188d29ffcefdb5900a8cd41eccd89200">Knn</a>& <a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#ac06986d5afddc767ddba4da738f75563">operator=</a>(<a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a188d29ffcefdb5900a8cd41eccd89200">Knn</a>&&) = <span class="keywordflow">default</span>;</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span></div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"><a class="line" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#afe732a33112b457b738f403622d226e5"> 95</a></span> <a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#afe732a33112b457b738f403622d226e5">~Knn</a>() = <span class="keywordflow">default</span>;</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span></div>
|
||||
<div class="foldopen" id="foldopen00103" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"><a class="line" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a62e152db014cd4de675fa906e5ef2861"> 103</a></span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../da/d94/classmachine__learning_1_1k__nearest__neighbors_1_1_knn.html#a62e152db014cd4de675fa906e5ef2861">predict</a>(std::vector<double>& sample, <span class="keywordtype">int</span> k) {</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> std::vector<int> neighbors;</div>
|
||||
@@ -205,7 +206,7 @@ $(function(){initNavTree('d4/d3e/k__nearest__neighbors_8cpp_source.html','../../
|
||||
</div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span>} <span class="comment">// namespace k_nearest_neighbors</span></div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span>} <span class="comment">// namespace machine_learning</span></div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> </div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span></div>
|
||||
<div class="foldopen" id="foldopen00140" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"><a class="line" href="../../d4/d3e/k__nearest__neighbors_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 140</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d3e/k__nearest__neighbors_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> std::cout << <span class="stringliteral">"------- Test 1 -------"</span> << std::endl;</div>
|
||||
@@ -254,7 +255,7 @@ $(function(){initNavTree('d4/d3e/k__nearest__neighbors_8cpp_source.html','../../
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> std::cout << <span class="stringliteral">"... Passed"</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> </div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span></div>
|
||||
<div class="foldopen" id="foldopen00193" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"><a class="line" href="../../d4/d3e/k__nearest__neighbors_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97"> 193</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>* argv[]) {</div>
|
||||
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <a class="code hl_function" href="../../d4/d3e/k__nearest__neighbors_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -282,7 +283,7 @@ $(function(){initNavTree('d4/d3e/k__nearest__neighbors_8cpp_source.html','../../
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_3343723ae086de42ee4ca9774da3a13f.html">machine_learning</a></li><li class="navelem"><a class="el" href="../../d4/d3e/k__nearest__neighbors_8cpp.html">k_nearest_neighbors.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: backtracking/n_queens.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -269,9 +269,10 @@ template<size_t n> </div>
|
||||
<div class="line"><span class="lineno"> 123</span> std::array<int, n>({0, 0, 0, 0}), std::array<int, n>({0, 0, 0, 0}),</div>
|
||||
<div class="line"><span class="lineno"> 124</span> std::array<int, n>({0, 0, 0, 0}), std::array<int, n>({0, 0, 0, 0})};</div>
|
||||
<div class="line"><span class="lineno"> 125</span> </div>
|
||||
<div class="line"><span class="lineno"> 126</span> backtracking::n_queens::solveNQ<n>(board, 0);</div>
|
||||
<div class="line"><span class="lineno"> 126</span> <a class="code hl_function" href="#a0dbd7af47d87f0b956609fe9e3288ecb">backtracking::n_queens::solveNQ<n></a>(board, 0);</div>
|
||||
<div class="line"><span class="lineno"> 127</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 128</span>}</div>
|
||||
<div class="ttc" id="an__queens_8cpp_html_a0dbd7af47d87f0b956609fe9e3288ecb"><div class="ttname"><a href="#a0dbd7af47d87f0b956609fe9e3288ecb">backtracking::n_queens::solveNQ</a></div><div class="ttdeci">void solveNQ(std::array< std::array< int, n >, n > board, const int &col)</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d3e/n__queens_8cpp_source.html#l00091">n_queens.cpp:91</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -354,7 +355,7 @@ template<size_t n> </div>
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d3e/n__queens_8cpp_source.html#l00091">91</a> of file <a class="el" href="../../d4/d3e/n__queens_8cpp_source.html">n_queens.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 91</span> {</div>
|
||||
<div class="line"><span class="lineno"> 92</span> <span class="keywordflow">if</span> (col >= n) {</div>
|
||||
<div class="line"><span class="lineno"> 93</span> printSolution<n>(board);</div>
|
||||
<div class="line"><span class="lineno"> 93</span> <a class="code hl_function" href="#a40ae0c7fd04eb20e7f3bff13fc6a5808">printSolution<n></a>(board);</div>
|
||||
<div class="line"><span class="lineno"> 94</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 95</span> }</div>
|
||||
<div class="line"><span class="lineno"> 96</span> </div>
|
||||
@@ -374,6 +375,7 @@ template<size_t n> </div>
|
||||
<div class="line"><span class="lineno"> 110</span> }</div>
|
||||
<div class="line"><span class="lineno"> 111</span> }</div>
|
||||
<div class="line"><span class="lineno"> 112</span>}</div>
|
||||
<div class="ttc" id="an__queens_8cpp_html_a40ae0c7fd04eb20e7f3bff13fc6a5808"><div class="ttname"><a href="#a40ae0c7fd04eb20e7f3bff13fc6a5808">backtracking::n_queens::printSolution</a></div><div class="ttdeci">void printSolution(const std::array< std::array< int, n >, n > &board)</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d3e/n__queens_8cpp_source.html#l00038">n_queens.cpp:38</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -383,7 +385,7 @@ template<size_t n> </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_c11585dfcef32a26e29098facab6c144.html">backtracking</a></li><li class="navelem"><a class="el" href="../../d4/d3e/n__queens_8cpp.html">n_queens.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
6
d4/d3e/n__queens_8cpp.js
vendored
@@ -1,7 +1,7 @@
|
||||
var n__queens_8cpp =
|
||||
[
|
||||
[ "isSafe", "d4/d3e/n__queens_8cpp.html#a5730b6683f6adcf5c5ef75cf53dc7160", null ],
|
||||
[ "backtracking::n_queens::isSafe", "d4/d3e/n__queens_8cpp.html#a5730b6683f6adcf5c5ef75cf53dc7160", null ],
|
||||
[ "main", "d4/d3e/n__queens_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "printSolution", "d4/d3e/n__queens_8cpp.html#a40ae0c7fd04eb20e7f3bff13fc6a5808", null ],
|
||||
[ "solveNQ", "d4/d3e/n__queens_8cpp.html#a0dbd7af47d87f0b956609fe9e3288ecb", null ]
|
||||
[ "backtracking::n_queens::printSolution", "d4/d3e/n__queens_8cpp.html#a40ae0c7fd04eb20e7f3bff13fc6a5808", null ],
|
||||
[ "backtracking::n_queens::solveNQ", "d4/d3e/n__queens_8cpp.html#a0dbd7af47d87f0b956609fe9e3288ecb", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: backtracking/n_queens.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,15 +124,15 @@ $(function(){initNavTree('d4/d3e/n__queens_8cpp_source.html','../../'); initResi
|
||||
<div class="headertitle"><div class="title">n_queens.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d3e/n__queens_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d3e/n__queens_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <array></span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../db/dc0/namespacebacktracking.html">backtracking</a> {</div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d3/da1/namespacen__queens.html">n_queens</a> {</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="keyword">template</span> <<span class="keywordtype">size_t</span> n></div>
|
||||
<div class="foldopen" id="foldopen00038" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="../../d4/d3e/n__queens_8cpp.html#a40ae0c7fd04eb20e7f3bff13fc6a5808"> 38</a></span><span class="keywordtype">void</span> printSolution(<span class="keyword">const</span> std::array<std::array<int, n>, n> &board) {</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="../../d4/d3e/n__queens_8cpp.html#a40ae0c7fd04eb20e7f3bff13fc6a5808"> 38</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d3e/n__queens_8cpp.html#a40ae0c7fd04eb20e7f3bff13fc6a5808">printSolution</a>(<span class="keyword">const</span> std::array<std::array<int, n>, n> &board) {</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> std::cout << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < n; i++) {</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j < n; j++) {</div>
|
||||
@@ -142,10 +142,10 @@ $(function(){initNavTree('d4/d3e/n__queens_8cpp_source.html','../../'); initResi
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> }</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> </div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span></div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span><span class="keyword">template</span> <<span class="keywordtype">size_t</span> n></div>
|
||||
<div class="foldopen" id="foldopen00058" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="../../d4/d3e/n__queens_8cpp.html#a5730b6683f6adcf5c5ef75cf53dc7160"> 58</a></span><span class="keywordtype">bool</span> isSafe(<span class="keyword">const</span> std::array<std::array<int, n>, n> &board, <span class="keyword">const</span> <span class="keywordtype">int</span> &row,</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="../../d4/d3e/n__queens_8cpp.html#a5730b6683f6adcf5c5ef75cf53dc7160"> 58</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d4/d3e/n__queens_8cpp.html#a5730b6683f6adcf5c5ef75cf53dc7160">isSafe</a>(<span class="keyword">const</span> std::array<std::array<int, n>, n> &board, <span class="keyword">const</span> <span class="keywordtype">int</span> &row,</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keyword">const</span> <span class="keywordtype">int</span> &col) {</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keywordtype">int</span> i = 0, j = 0;</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
|
||||
@@ -171,12 +171,12 @@ $(function(){initNavTree('d4/d3e/n__queens_8cpp_source.html','../../'); initResi
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> </div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span></div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span><span class="keyword">template</span> <<span class="keywordtype">size_t</span> n></div>
|
||||
<div class="foldopen" id="foldopen00091" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="../../d4/d3e/n__queens_8cpp.html#a0dbd7af47d87f0b956609fe9e3288ecb"> 91</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d3e/n__queens_8cpp.html#a0dbd7af47d87f0b956609fe9e3288ecb">solveNQ</a>(std::array<std::array<int, n>, n> board, <span class="keyword">const</span> <span class="keywordtype">int</span> &col) {</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keywordflow">if</span> (col >= n) {</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> printSolution<n>(board);</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <a class="code hl_function" href="../../d4/d3e/n__queens_8cpp.html#a40ae0c7fd04eb20e7f3bff13fc6a5808">printSolution<n></a>(board);</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> }</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
|
||||
@@ -185,12 +185,12 @@ $(function(){initNavTree('d4/d3e/n__queens_8cpp_source.html','../../'); initResi
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < n; i++) {</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="comment">// Check if queen can be placed</span></div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="comment">// on board[i][col]</span></div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordflow">if</span> (isSafe<n>(board, i, col)) {</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../d4/d3e/n__queens_8cpp.html#a5730b6683f6adcf5c5ef75cf53dc7160">isSafe<n></a>(board, i, col)) {</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="comment">// Place this queen in matrix</span></div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> board[i][col] = 1;</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> </div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="comment">// Recursive to place rest of the queens</span></div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> solveNQ<n>(board, col + 1);</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <a class="code hl_function" href="../../d4/d3e/n__queens_8cpp.html#a0dbd7af47d87f0b956609fe9e3288ecb">solveNQ<n></a>(board, col + 1);</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> </div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> board[i][col] = 0; <span class="comment">// backtrack</span></div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> }</div>
|
||||
@@ -199,7 +199,7 @@ $(function(){initNavTree('d4/d3e/n__queens_8cpp_source.html','../../'); initResi
|
||||
</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span>} <span class="comment">// namespace n_queens</span></div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span>} <span class="comment">// namespace backtracking</span></div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> </div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span></div>
|
||||
<div class="foldopen" id="foldopen00120" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"><a class="line" href="../../d4/d3e/n__queens_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 120</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d3e/n__queens_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keyword">const</span> <span class="keywordtype">int</span> n = 4;</div>
|
||||
@@ -207,11 +207,13 @@ $(function(){initNavTree('d4/d3e/n__queens_8cpp_source.html','../../'); initResi
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> std::array<int, n>({0, 0, 0, 0}), std::array<int, n>({0, 0, 0, 0}),</div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> std::array<int, n>({0, 0, 0, 0}), std::array<int, n>({0, 0, 0, 0})};</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> </div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> backtracking::n_queens::solveNQ<n>(board, 0);</div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <a class="code hl_function" href="../../d4/d3e/n__queens_8cpp.html#a0dbd7af47d87f0b956609fe9e3288ecb">backtracking::n_queens::solveNQ<n></a>(board, 0);</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span>}</div>
|
||||
</div>
|
||||
<div class="ttc" id="an__queens_8cpp_html_a0dbd7af47d87f0b956609fe9e3288ecb"><div class="ttname"><a href="../../d4/d3e/n__queens_8cpp.html#a0dbd7af47d87f0b956609fe9e3288ecb">backtracking::n_queens::solveNQ</a></div><div class="ttdeci">void solveNQ(std::array< std::array< int, n >, n > board, const int &col)</div><div class="ttdef"><b>Definition</b> <a href="#l00091">n_queens.cpp:91</a></div></div>
|
||||
<div class="ttc" id="an__queens_8cpp_html_a40ae0c7fd04eb20e7f3bff13fc6a5808"><div class="ttname"><a href="../../d4/d3e/n__queens_8cpp.html#a40ae0c7fd04eb20e7f3bff13fc6a5808">backtracking::n_queens::printSolution</a></div><div class="ttdeci">void printSolution(const std::array< std::array< int, n >, n > &board)</div><div class="ttdef"><b>Definition</b> <a href="#l00038">n_queens.cpp:38</a></div></div>
|
||||
<div class="ttc" id="an__queens_8cpp_html_a5730b6683f6adcf5c5ef75cf53dc7160"><div class="ttname"><a href="../../d4/d3e/n__queens_8cpp.html#a5730b6683f6adcf5c5ef75cf53dc7160">backtracking::n_queens::isSafe</a></div><div class="ttdeci">bool isSafe(const std::array< std::array< int, n >, n > &board, const int &row, const int &col)</div><div class="ttdef"><b>Definition</b> <a href="#l00058">n_queens.cpp:58</a></div></div>
|
||||
<div class="ttc" id="an__queens_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d4/d3e/n__queens_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> <a href="#l00120">n_queens.cpp:120</a></div></div>
|
||||
<div class="ttc" id="anamespacebacktracking_html"><div class="ttname"><a href="../../db/dc0/namespacebacktracking.html">backtracking</a></div><div class="ttdoc">for vector container</div></div>
|
||||
<div class="ttc" id="anamespacen__queens_html"><div class="ttname"><a href="../../d3/da1/namespacen__queens.html">n_queens</a></div><div class="ttdoc">Functions for Eight Queens puzzle.</div></div>
|
||||
@@ -221,7 +223,7 @@ $(function(){initNavTree('d4/d3e/n__queens_8cpp_source.html','../../'); initResi
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_c11585dfcef32a26e29098facab6c144.html">backtracking</a></li><li class="navelem"><a class="el" href="../../d4/d3e/n__queens_8cpp.html">n_queens.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/gcd_recursive_euclidean.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -237,7 +237,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d4/d45/gcd__recursive__euclidean_8cpp.html">gcd_recursive_euclidean.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/gcd_recursive_euclidean.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,9 +124,9 @@ $(function(){initNavTree('d4/d45/gcd__recursive__euclidean_8cpp_source.html','..
|
||||
<div class="headertitle"><div class="title">gcd_recursive_euclidean.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d45/gcd__recursive__euclidean_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d45/gcd__recursive__euclidean_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span></div>
|
||||
<div class="foldopen" id="foldopen00014" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"><a class="line" href="../../d4/d45/gcd__recursive__euclidean_8cpp.html#ae48807fa2b7000afae599e67f327545e"> 14</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d45/gcd__recursive__euclidean_8cpp.html#ae48807fa2b7000afae599e67f327545e">gcd</a>(<span class="keywordtype">int</span> num1, <span class="keywordtype">int</span> num2) {</div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keywordflow">if</span> (num1 <= 0 | num2 <= 0) {</div>
|
||||
@@ -153,7 +153,7 @@ $(function(){initNavTree('d4/d45/gcd__recursive__euclidean_8cpp_source.html','..
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d4/d45/gcd__recursive__euclidean_8cpp.html#ae48807fa2b7000afae599e67f327545e">gcd</a>(num1, num2 - num1);</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span></div>
|
||||
<div class="foldopen" id="foldopen00042" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="../../d4/d45/gcd__recursive__euclidean_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 42</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d45/gcd__recursive__euclidean_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> std::cout << <span class="stringliteral">"gcd of 120,7 is "</span> << (<a class="code hl_function" href="../../d4/d45/gcd__recursive__euclidean_8cpp.html#ae48807fa2b7000afae599e67f327545e">gcd</a>(120, 7)) << std::endl;</div>
|
||||
@@ -175,7 +175,7 @@ $(function(){initNavTree('d4/d45/gcd__recursive__euclidean_8cpp_source.html','..
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d4/d45/gcd__recursive__euclidean_8cpp.html">gcd_recursive_euclidean.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: bit_manipulation/hamming_distance.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -332,7 +332,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -342,22 +342,22 @@ Functions</h2></td></tr>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d48/hamming__distance_8cpp_source.html#l00076">76</a> of file <a class="el" href="../../d4/d48/hamming__distance_8cpp_source.html">hamming_distance.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 76</span> {</div>
|
||||
<div class="line"><span class="lineno"> 77</span> assert(bit_manipulation::hamming_distance::hamming_distance(11, 2) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 78</span> assert(bit_manipulation::hamming_distance::hamming_distance(2, 0) == 1);</div>
|
||||
<div class="line"><span class="lineno"> 79</span> assert(bit_manipulation::hamming_distance::hamming_distance(11, 0) == 3);</div>
|
||||
<div class="line"><span class="lineno"> 77</span> assert(<a class="code hl_function" href="#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(11, 2) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 78</span> assert(<a class="code hl_function" href="#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(2, 0) == 1);</div>
|
||||
<div class="line"><span class="lineno"> 79</span> assert(<a class="code hl_function" href="#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(11, 0) == 3);</div>
|
||||
<div class="line"><span class="lineno"> 80</span> </div>
|
||||
<div class="line"><span class="lineno"> 81</span> assert(bit_manipulation::hamming_distance::hamming_distance(<span class="stringliteral">"1101"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 81</span> assert(<a class="code hl_function" href="#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(<span class="stringliteral">"1101"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 82</span> <span class="stringliteral">"1111"</span>) == 1);</div>
|
||||
<div class="line"><span class="lineno"> 83</span> assert(bit_manipulation::hamming_distance::hamming_distance(<span class="stringliteral">"1111"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 83</span> assert(<a class="code hl_function" href="#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(<span class="stringliteral">"1111"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 84</span> <span class="stringliteral">"1111"</span>) == 0);</div>
|
||||
<div class="line"><span class="lineno"> 85</span> assert(bit_manipulation::hamming_distance::hamming_distance(<span class="stringliteral">"0000"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 85</span> assert(<a class="code hl_function" href="#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(<span class="stringliteral">"0000"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 86</span> <span class="stringliteral">"1111"</span>) == 4);</div>
|
||||
<div class="line"><span class="lineno"> 87</span> </div>
|
||||
<div class="line"><span class="lineno"> 88</span> assert(bit_manipulation::hamming_distance::hamming_distance(<span class="stringliteral">"alpha"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 88</span> assert(<a class="code hl_function" href="#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(<span class="stringliteral">"alpha"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 89</span> <span class="stringliteral">"alphb"</span>) == 1);</div>
|
||||
<div class="line"><span class="lineno"> 90</span> assert(bit_manipulation::hamming_distance::hamming_distance(<span class="stringliteral">"abcd"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 90</span> assert(<a class="code hl_function" href="#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(<span class="stringliteral">"abcd"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 91</span> <span class="stringliteral">"abcd"</span>) == 0);</div>
|
||||
<div class="line"><span class="lineno"> 92</span> assert(bit_manipulation::hamming_distance::hamming_distance(<span class="stringliteral">"dcba"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 92</span> assert(<a class="code hl_function" href="#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(<span class="stringliteral">"dcba"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 93</span> <span class="stringliteral">"abcd"</span>) == 4);</div>
|
||||
<div class="line"><span class="lineno"> 94</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
@@ -369,7 +369,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_f3c4fbc4e901afa0a54d0623c5574aa7.html">bit_manipulation</a></li><li class="navelem"><a class="el" href="../../d4/d48/hamming__distance_8cpp.html">hamming_distance.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
var hamming__distance_8cpp =
|
||||
[
|
||||
[ "bitCount", "d4/d48/hamming__distance_8cpp.html#a65d845df3fecff7087a2126c7b72030b", null ],
|
||||
[ "hamming_distance", "d4/d48/hamming__distance_8cpp.html#a40ba9fe8b5df5c268f0c7d677ff2fe80", null ],
|
||||
[ "hamming_distance", "d4/d48/hamming__distance_8cpp.html#abfe6fbb2f3460a2623c96f283178a07a", null ],
|
||||
[ "bit_manipulation::hamming_distance::bitCount", "d4/d48/hamming__distance_8cpp.html#a65d845df3fecff7087a2126c7b72030b", null ],
|
||||
[ "bit_manipulation::hamming_distance::hamming_distance", "d4/d48/hamming__distance_8cpp.html#a40ba9fe8b5df5c268f0c7d677ff2fe80", null ],
|
||||
[ "bit_manipulation::hamming_distance::hamming_distance", "d4/d48/hamming__distance_8cpp.html#abfe6fbb2f3460a2623c96f283178a07a", null ],
|
||||
[ "main", "d4/d48/hamming__distance_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test", "d4/d48/hamming__distance_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: bit_manipulation/hamming_distance.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,11 +124,12 @@ $(function(){initNavTree('d4/d48/hamming__distance_8cpp_source.html','../../');
|
||||
<div class="headertitle"><div class="title">hamming_distance.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d48/hamming__distance_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d48/hamming__distance_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d7/d81/namespacebit__manipulation.html">bit_manipulation</a> {</div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d4/d1c/namespacehamming__distance.html">hamming_distance</a> {</div>
|
||||
<div class="foldopen" id="foldopen00035" data-start="{" data-end="}">
|
||||
@@ -143,9 +144,9 @@ $(function(){initNavTree('d4/d48/hamming__distance_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keywordflow">return</span> count;</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span></div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="../../d4/d48/hamming__distance_8cpp.html#abfe6fbb2f3460a2623c96f283178a07a"> 52</a></span>uint64_t <a class="code hl_namespace" href="../../d4/d1c/namespacehamming__distance.html">hamming_distance</a>(uint64_t a, uint64_t b) { <span class="keywordflow">return</span> <a class="code hl_function" href="../../d4/d48/hamming__distance_8cpp.html#a65d845df3fecff7087a2126c7b72030b">bitCount</a>(a ^ b); }</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span></div>
|
||||
<div class="foldopen" id="foldopen00060" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="../../d4/d48/hamming__distance_8cpp.html#a40ba9fe8b5df5c268f0c7d677ff2fe80"> 60</a></span>uint64_t <a class="code hl_namespace" href="../../d4/d1c/namespacehamming__distance.html">hamming_distance</a>(<span class="keyword">const</span> std::string& a, <span class="keyword">const</span> std::string& b) {</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> assert(a.size() == b.size());</div>
|
||||
@@ -159,29 +160,29 @@ $(function(){initNavTree('d4/d48/hamming__distance_8cpp_source.html','../../');
|
||||
</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span>} <span class="comment">// namespace hamming_distance</span></div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span>} <span class="comment">// namespace bit_manipulation</span></div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> </div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span></div>
|
||||
<div class="foldopen" id="foldopen00076" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="../../d4/d48/hamming__distance_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 76</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d48/hamming__distance_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> assert(bit_manipulation::hamming_distance::hamming_distance(11, 2) == 2);</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> assert(bit_manipulation::hamming_distance::hamming_distance(2, 0) == 1);</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> assert(bit_manipulation::hamming_distance::hamming_distance(11, 0) == 3);</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> assert(<a class="code hl_function" href="../../d4/d48/hamming__distance_8cpp.html#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(11, 2) == 2);</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> assert(<a class="code hl_function" href="../../d4/d48/hamming__distance_8cpp.html#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(2, 0) == 1);</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> assert(<a class="code hl_function" href="../../d4/d48/hamming__distance_8cpp.html#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(11, 0) == 3);</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> </div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> assert(bit_manipulation::hamming_distance::hamming_distance(<span class="stringliteral">"1101"</span>,</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> assert(<a class="code hl_function" href="../../d4/d48/hamming__distance_8cpp.html#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(<span class="stringliteral">"1101"</span>,</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="stringliteral">"1111"</span>) == 1);</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> assert(bit_manipulation::hamming_distance::hamming_distance(<span class="stringliteral">"1111"</span>,</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> assert(<a class="code hl_function" href="../../d4/d48/hamming__distance_8cpp.html#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(<span class="stringliteral">"1111"</span>,</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="stringliteral">"1111"</span>) == 0);</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> assert(bit_manipulation::hamming_distance::hamming_distance(<span class="stringliteral">"0000"</span>,</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> assert(<a class="code hl_function" href="../../d4/d48/hamming__distance_8cpp.html#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(<span class="stringliteral">"0000"</span>,</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="stringliteral">"1111"</span>) == 4);</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> </div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> assert(bit_manipulation::hamming_distance::hamming_distance(<span class="stringliteral">"alpha"</span>,</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> assert(<a class="code hl_function" href="../../d4/d48/hamming__distance_8cpp.html#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(<span class="stringliteral">"alpha"</span>,</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="stringliteral">"alphb"</span>) == 1);</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> assert(bit_manipulation::hamming_distance::hamming_distance(<span class="stringliteral">"abcd"</span>,</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> assert(<a class="code hl_function" href="../../d4/d48/hamming__distance_8cpp.html#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(<span class="stringliteral">"abcd"</span>,</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="stringliteral">"abcd"</span>) == 0);</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> assert(bit_manipulation::hamming_distance::hamming_distance(<span class="stringliteral">"dcba"</span>,</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> assert(<a class="code hl_function" href="../../d4/d48/hamming__distance_8cpp.html#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(<span class="stringliteral">"dcba"</span>,</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="stringliteral">"abcd"</span>) == 4);</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> </div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span></div>
|
||||
<div class="foldopen" id="foldopen00100" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="../../d4/d48/hamming__distance_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 100</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d48/hamming__distance_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <a class="code hl_function" href="../../d4/d48/hamming__distance_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// execute the tests</span></div>
|
||||
@@ -189,12 +190,13 @@ $(function(){initNavTree('d4/d48/hamming__distance_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> uint64_t b = 2; <span class="comment">// 0010 in binary</span></div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> </div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> std::cout << <span class="stringliteral">"Hamming distance between "</span> << a << <span class="stringliteral">" and "</span> << b << <span class="stringliteral">" is "</span></div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> << bit_manipulation::hamming_distance::hamming_distance(a, b)</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> << <a class="code hl_function" href="../../d4/d48/hamming__distance_8cpp.html#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a>(a, b)</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span>}</div>
|
||||
</div>
|
||||
<div class="ttc" id="ahamming__distance_8cpp_html_a65d845df3fecff7087a2126c7b72030b"><div class="ttname"><a href="../../d4/d48/hamming__distance_8cpp.html#a65d845df3fecff7087a2126c7b72030b">bit_manipulation::hamming_distance::bitCount</a></div><div class="ttdeci">uint64_t bitCount(uint64_t value)</div><div class="ttdef"><b>Definition</b> <a href="#l00035">hamming_distance.cpp:35</a></div></div>
|
||||
<div class="ttc" id="ahamming__distance_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d4/d48/hamming__distance_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Function to the test hamming distance.</div><div class="ttdef"><b>Definition</b> <a href="#l00076">hamming_distance.cpp:76</a></div></div>
|
||||
<div class="ttc" id="ahamming__distance_8cpp_html_abfe6fbb2f3460a2623c96f283178a07a"><div class="ttname"><a href="../../d4/d48/hamming__distance_8cpp.html#abfe6fbb2f3460a2623c96f283178a07a">bit_manipulation::hamming_distance::hamming_distance</a></div><div class="ttdeci">uint64_t hamming_distance(uint64_t a, uint64_t b)</div><div class="ttdef"><b>Definition</b> <a href="#l00052">hamming_distance.cpp:52</a></div></div>
|
||||
<div class="ttc" id="ahamming__distance_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d4/d48/hamming__distance_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> <a href="#l00100">hamming_distance.cpp:100</a></div></div>
|
||||
<div class="ttc" id="anamespacebit__manipulation_html"><div class="ttname"><a href="../../d7/d81/namespacebit__manipulation.html">bit_manipulation</a></div><div class="ttdoc">for assert</div></div>
|
||||
<div class="ttc" id="anamespacehamming__distance_html"><div class="ttname"><a href="../../d4/d1c/namespacehamming__distance.html">hamming_distance</a></div><div class="ttdoc">Functions for Hamming distance implementation.</div></div>
|
||||
@@ -204,7 +206,7 @@ $(function(){initNavTree('d4/d48/hamming__distance_8cpp_source.html','../../');
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_f3c4fbc4e901afa0a54d0623c5574aa7.html">bit_manipulation</a></li><li class="navelem"><a class="el" href="../../d4/d48/hamming__distance_8cpp.html">hamming_distance.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sorting/stooge_sort.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -351,7 +351,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d4/d4f/stooge__sort_8cpp.html">stooge_sort.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sorting/stooge_sort.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,12 +124,13 @@ $(function(){initNavTree('d4/d4f/stooge__sort_8cpp_source.html','../../'); initR
|
||||
<div class="headertitle"><div class="title">stooge_sort.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d4f/stooge__sort_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d4f/stooge__sort_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <algorithm></span> </div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span></div>
|
||||
<div class="foldopen" id="foldopen00028" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="../../d4/d4f/stooge__sort_8cpp.html#ac23852832437dc68327efe9b1da2d91b"> 28</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d4f/stooge__sort_8cpp.html#ac23852832437dc68327efe9b1da2d91b">stoogeSort</a>(std::vector<int>* L, <span class="keywordtype">size_t</span> i, <span class="keywordtype">size_t</span> j) {</div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordflow">if</span> (i >= j) {</div>
|
||||
@@ -146,7 +147,7 @@ $(function(){initNavTree('d4/d4f/stooge__sort_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> }</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span></div>
|
||||
<div class="foldopen" id="foldopen00047" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../d4/d4f/stooge__sort_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0"> 47</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d4f/stooge__sort_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a>() {</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> std::vector<int> L = { 8, 9, 10, 4, 3, 5, 1 };</div>
|
||||
@@ -154,7 +155,7 @@ $(function(){initNavTree('d4/d4f/stooge__sort_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> assert(std::is_sorted(std::begin(L), std::end(L)));</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span></div>
|
||||
<div class="foldopen" id="foldopen00057" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="../../d4/d4f/stooge__sort_8cpp.html#a0283886819c7c140a023582b7269e2d0"> 57</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d4f/stooge__sort_8cpp.html#a0283886819c7c140a023582b7269e2d0">test2</a>() {</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> std::vector<int> L = { -1 };</div>
|
||||
@@ -162,7 +163,7 @@ $(function(){initNavTree('d4/d4f/stooge__sort_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> assert(std::is_sorted(std::begin(L), std::end(L)));</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> </div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span></div>
|
||||
<div class="foldopen" id="foldopen00067" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="../../d4/d4f/stooge__sort_8cpp.html#a6d0455dd5c30adda100e95f0423c786e"> 67</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d4f/stooge__sort_8cpp.html#a6d0455dd5c30adda100e95f0423c786e">test3</a>() {</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> std::vector<int> L = { 1, 2, 5, 4, 1, 5 };</div>
|
||||
@@ -170,7 +171,7 @@ $(function(){initNavTree('d4/d4f/stooge__sort_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> assert(std::is_sorted(std::begin(L), std::end(L)));</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span></div>
|
||||
<div class="foldopen" id="foldopen00079" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="../../d4/d4f/stooge__sort_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 79</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d4f/stooge__sort_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <a class="code hl_function" href="../../d4/d4f/stooge__sort_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a>();</div>
|
||||
@@ -192,7 +193,7 @@ $(function(){initNavTree('d4/d4f/stooge__sort_8cpp_source.html','../../'); initR
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d4/d4f/stooge__sort_8cpp.html">stooge_sort.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
<map id="others::Cache::LFUCache< K, V >" name="others::Cache::LFUCache< K, V >">
|
||||
<area shape="rect" id="Node000001" title="LFUCache." alt="" coords="949,77,1123,118"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="668,17,829,87"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="845,64,949,81,948,86,844,70"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="5,22,44,47"/>
|
||||
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="59,21,67,20,97,20,326,18,427,19,556,25,668,37,667,43,555,31,427,24,326,23,97,25,68,25,60,27"/>
|
||||
<area shape="rect" id="Node000005" href="$de/d21/classothers_1_1_cache_1_1_d___node.html" title=" " alt="" coords="121,48,280,88"/>
|
||||
<area shape="poly" id="edge5_Node000005_Node000003" title=" " alt="" coords="59,38,121,50,120,55,58,43"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="402,40,555,96"/>
|
||||
<area shape="poly" id="edge3_Node000002_Node000004" title=" " alt="" coords="571,60,667,54,668,59,571,65"/>
|
||||
<area shape="poly" id="edge4_Node000004_Node000005" title=" " alt="" coords="296,65,402,65,402,71,296,71"/>
|
||||
<area shape="rect" id="Node000007" title=" " alt="" coords="402,119,555,190"/>
|
||||
<area shape="poly" id="edge8_Node000007_Node000005" title=" " alt="" coords="276,91,305,101,402,130,401,135,303,106,274,96"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="660,112,837,197"/>
|
||||
<area shape="poly" id="edge6_Node000001_Node000006" title=" " alt="" coords="851,131,948,112,949,117,853,137"/>
|
||||
<area shape="poly" id="edge7_Node000006_Node000007" title=" " alt="" coords="571,152,660,152,660,157,571,157"/>
|
||||
<area shape="rect" id="Node000001" title="LFUCache." alt="" coords="850,112,1025,153"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="562,39,724,125"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="740,96,850,115,849,120,739,101"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="346,5,384,31"/>
|
||||
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="400,23,563,61,562,66,399,29"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="288,55,442,126"/>
|
||||
<area shape="poly" id="edge3_Node000002_Node000004" title=" " alt="" coords="457,85,562,82,562,87,457,90"/>
|
||||
<area shape="rect" id="Node000005" href="$de/d21/classothers_1_1_cache_1_1_d___node.html" title=" " alt="" coords="5,124,165,165"/>
|
||||
<area shape="poly" id="edge4_Node000004_Node000005" title=" " alt="" coords="179,124,287,102,288,108,180,129"/>
|
||||
<area shape="rect" id="Node000007" title=" " alt="" coords="287,149,443,250"/>
|
||||
<area shape="poly" id="edge7_Node000007_Node000005" title=" " alt="" coords="181,161,287,182,286,187,180,166"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="548,149,738,250"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="753,172,850,150,851,155,754,177"/>
|
||||
<area shape="poly" id="edge6_Node000006_Node000007" title=" " alt="" coords="458,197,548,197,548,202,458,202"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
54a5d646e4613c69cba1946caf09977f
|
||||
c977b7f879f4fa331e404361d6e89a75
|
||||
@@ -1,10 +1,10 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: others::Cache::LFUCache< K, V > Pages: 1 -->
|
||||
<!--zoomable 152 -->
|
||||
<!--zoomable 191 -->
|
||||
|
||||
<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)">
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
</g>
|
||||
</defs>
|
||||
<script type="application/ecmascript">
|
||||
var viewWidth = 846;
|
||||
var viewHeight = 152;
|
||||
var viewWidth = 773;
|
||||
var viewHeight = 191;
|
||||
var sectionId = 'dynsection-0';
|
||||
</script>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
@@ -59,9 +59,9 @@ var sectionId = 'dynsection-0';
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="LFUCache.">
|
||||
<polygon fill="#999999" stroke="#666666" points="838.3,-90.38 707.55,-90.38 707.55,-59.88 838.3,-59.88 838.3,-90.38"/>
|
||||
<text text-anchor="start" x="715.55" y="-76.88" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
|
||||
<text text-anchor="middle" x="772.92" y="-65.62" font-family="Helvetica,sans-Serif" font-size="10.00">< K, V ></text>
|
||||
<polygon fill="#999999" stroke="#666666" points="764.5,-103 633.75,-103 633.75,-72.5 764.5,-72.5 764.5,-103"/>
|
||||
<text text-anchor="start" x="641.75" y="-89.5" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
|
||||
<text text-anchor="middle" x="699.12" y="-78.25" font-family="Helvetica,sans-Serif" font-size="10.00">< K, V ></text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -69,11 +69,12 @@ var sectionId = 'dynsection-0';
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="617.92,-135.62 496.92,-135.62 496.92,-82.62 617.92,-82.62 617.92,-135.62"/>
|
||||
<text text-anchor="start" x="504.92" y="-122.12" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_map</text>
|
||||
<text text-anchor="start" x="504.92" y="-110.88" font-family="Helvetica,sans-Serif" font-size="10.00">< K, std::pair< others</text>
|
||||
<text text-anchor="start" x="504.92" y="-99.62" font-family="Helvetica,sans-Serif" font-size="10.00">::Cache::D_Node< K, V</text>
|
||||
<text text-anchor="middle" x="557.42" y="-88.38" font-family="Helvetica,sans-Serif" font-size="10.00"> > *, int > ></text>
|
||||
<polygon fill="white" stroke="#666666" points="538.88,-157.88 417.88,-157.88 417.88,-93.62 538.88,-93.62 538.88,-157.88"/>
|
||||
<text text-anchor="start" x="425.88" y="-144.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_map</text>
|
||||
<text text-anchor="start" x="425.88" y="-133.12" font-family="Helvetica,sans-Serif" font-size="10.00">< K, std::pair< others</text>
|
||||
<text text-anchor="start" x="425.88" y="-121.88" font-family="Helvetica,sans-Serif" font-size="10.00">::Cache::D_Node< std::</text>
|
||||
<text text-anchor="start" x="425.88" y="-110.62" font-family="Helvetica,sans-Serif" font-size="10.00">pair< K, V > >< K, V ></text>
|
||||
<text text-anchor="middle" x="478.38" y="-99.38" font-family="Helvetica,sans-Serif" font-size="10.00"> *, int > ></text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -81,18 +82,18 @@ var sectionId = 'dynsection-0';
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node2->Node1</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M629.5,-97.81C654.63,-93.8 682.75,-89.33 707.32,-85.41"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="629,-94.34 619.68,-99.37 630.1,-101.25 629,-94.34"/>
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M550.37,-113.42C577.09,-108.78 607.32,-103.52 633.44,-98.99"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="549.89,-109.95 540.64,-115.11 551.09,-116.84 549.89,-109.95"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="665.55" y="-96.92" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> node_map</text>
|
||||
<text text-anchor="middle" x="591.75" y="-111.9" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> node_map</text>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="28.8,-131.75 0,-131.75 0,-112.5 28.8,-112.5 28.8,-131.75"/>
|
||||
<text text-anchor="middle" x="14.4" y="-118.25" font-family="Helvetica,sans-Serif" font-size="10.00">K</text>
|
||||
<polygon fill="white" stroke="#bfbfbf" points="284.02,-183.38 255.22,-183.38 255.22,-164.12 284.02,-164.12 284.02,-183.38"/>
|
||||
<text text-anchor="middle" x="269.62" y="-169.88" font-family="Helvetica,sans-Serif" font-size="10.00">K</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -100,40 +101,21 @@ var sectionId = 'dynsection-0';
|
||||
<g id="edge2_Node000002_Node000003" class="edge">
|
||||
<title>Node3->Node2</title>
|
||||
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M40.4,-129.96C42.55,-130.43 44.7,-130.83 46.8,-131.12 56.37,-132.47 58.88,-131.18 68.55,-131.12 221.45,-130.24 260,-137.52 412.55,-127.12 440.3,-125.23 470.9,-121.62 496.72,-118.13"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="41.31,-126.58 30.75,-127.4 39.52,-133.35 41.31,-126.58"/>
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M295.64,-167.94C325.7,-160.96 377.16,-149.02 417.67,-139.61"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="294.94,-164.51 285.99,-170.18 296.52,-171.33 294.94,-164.51"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="251.8" y="-134.53" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> keys</text>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:href="../../de/d21/classothers_1_1_cache_1_1_d___node.html" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="206.05,-112.38 86.55,-112.38 86.55,-81.88 206.05,-81.88 206.05,-112.38"/>
|
||||
<text text-anchor="start" x="94.55" y="-98.88" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::D_Node</text>
|
||||
<text text-anchor="middle" x="146.3" y="-87.62" font-family="Helvetica,sans-Serif" font-size="10.00">< K, V ></text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node5 -->
|
||||
<g id="edge5_Node000005_Node000003" class="edge">
|
||||
<title>Node3->Node5</title>
|
||||
<g id="a_edge5_Node000005_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M39.77,-117.44C52.98,-114.89 69.92,-111.63 86.34,-108.47"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="39.46,-113.93 30.3,-119.26 40.78,-120.8 39.46,-113.93"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="57.67" y="-117.17" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> data</text>
|
||||
<text text-anchor="middle" x="367.62" y="-157.21" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> keys</text>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="412.55,-118 297.55,-118 297.55,-76.25 412.55,-76.25 412.55,-118"/>
|
||||
<text text-anchor="start" x="305.55" y="-104.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::pair< others::</text>
|
||||
<text text-anchor="start" x="305.55" y="-93.25" font-family="Helvetica,sans-Serif" font-size="10.00">Cache::D_Node< K, V</text>
|
||||
<text text-anchor="middle" x="355.05" y="-82" font-family="Helvetica,sans-Serif" font-size="10.00"> > *, int ></text>
|
||||
<polygon fill="white" stroke="#666666" points="327.12,-146.25 212.12,-146.25 212.12,-93.25 327.12,-93.25 327.12,-146.25"/>
|
||||
<text text-anchor="start" x="220.12" y="-132.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::pair< others::</text>
|
||||
<text text-anchor="start" x="220.12" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">Cache::D_Node< std::</text>
|
||||
<text text-anchor="start" x="220.12" y="-110.25" font-family="Helvetica,sans-Serif" font-size="10.00">pair< K, V > >< K, V</text>
|
||||
<text text-anchor="middle" x="269.62" y="-99" font-family="Helvetica,sans-Serif" font-size="10.00"> > *, int ></text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -141,77 +123,90 @@ var sectionId = 'dynsection-0';
|
||||
<g id="edge3_Node000002_Node000004" class="edge">
|
||||
<title>Node4->Node2</title>
|
||||
<g id="a_edge3_Node000002_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M424.23,-101.21C447.72,-102.61 473.83,-104.18 496.6,-105.54"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="424.64,-97.73 414.44,-100.62 424.22,-104.71 424.64,-97.73"/>
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M338.82,-121.73C364.23,-122.47 392.87,-123.3 417.48,-124.01"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="339,-118.23 328.91,-121.44 338.8,-125.23 339,-118.23"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="367.62" y="-124.86" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> elements</text>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:href="../../de/d21/classothers_1_1_cache_1_1_d___node.html" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="119.5,-94 0,-94 0,-63.5 119.5,-63.5 119.5,-94"/>
|
||||
<text text-anchor="start" x="8" y="-80.5" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::D_Node</text>
|
||||
<text text-anchor="middle" x="59.75" y="-69.25" font-family="Helvetica,sans-Serif" font-size="10.00">< std::pair< K, V > ></text>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="451.92" y="-105.59" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> elements</text>
|
||||
</g>
|
||||
<!-- Node5->Node4 -->
|
||||
<g id="edge4_Node000004_Node000005" class="edge">
|
||||
<title>Node5->Node4</title>
|
||||
<g id="a_edge4_Node000004_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M217.83,-97.12C243.74,-97.12 272.73,-97.12 297.29,-97.12"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="218.06,-93.63 208.06,-97.13 218.06,-100.63 218.06,-93.63"/>
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M130.86,-92.58C157.26,-97.79 186.94,-103.64 211.97,-108.58"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="131.74,-89.18 121.25,-90.68 130.38,-96.05 131.74,-89.18"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="251.8" y="-98.88" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> first_type</text>
|
||||
<text text-anchor="middle" x="165.25" y="-105.88" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> first_type</text>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="412.55,-58.62 297.55,-58.62 297.55,-5.62 412.55,-5.62 412.55,-58.62"/>
|
||||
<text text-anchor="start" x="305.55" y="-45.12" font-family="Helvetica,sans-Serif" font-size="10.00">std::pair< others::</text>
|
||||
<text text-anchor="start" x="305.55" y="-33.88" font-family="Helvetica,sans-Serif" font-size="10.00">Cache::D_Node< K, V</text>
|
||||
<text text-anchor="start" x="305.55" y="-22.62" font-family="Helvetica,sans-Serif" font-size="10.00"> > *, others::Cache::</text>
|
||||
<text text-anchor="middle" x="355.05" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">D_Node< K, V > * ></text>
|
||||
<polygon fill="white" stroke="#666666" points="328.25,-75.5 211,-75.5 211,0 328.25,0 328.25,-75.5"/>
|
||||
<text text-anchor="start" x="219" y="-62" font-family="Helvetica,sans-Serif" font-size="10.00">std::pair< others::</text>
|
||||
<text text-anchor="start" x="219" y="-50.75" font-family="Helvetica,sans-Serif" font-size="10.00">Cache::D_Node< std::</text>
|
||||
<text text-anchor="start" x="219" y="-39.5" font-family="Helvetica,sans-Serif" font-size="10.00">pair< K, V > >< K, V</text>
|
||||
<text text-anchor="start" x="219" y="-28.25" font-family="Helvetica,sans-Serif" font-size="10.00"> > *, others::Cache::D</text>
|
||||
<text text-anchor="start" x="219" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">_Node< std::pair< K, V</text>
|
||||
<text text-anchor="middle" x="269.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00"> > >< K, V > * ></text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node7 -->
|
||||
<g id="edge8_Node000007_Node000005" class="edge">
|
||||
<g id="edge7_Node000007_Node000005" class="edge">
|
||||
<title>Node5->Node7</title>
|
||||
<g id="a_edge8_Node000007_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M202.09,-77.88C209.46,-75.38 216.92,-72.91 224.05,-70.62 247.92,-62.97 274.43,-55.02 297.25,-48.35"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="201.19,-74.48 192.86,-81.02 203.45,-81.11 201.19,-74.48"/>
|
||||
<g id="a_edge7_Node000007_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M131.02,-64.89C156.88,-59.79 185.87,-54.07 210.54,-49.21"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="130.38,-61.45 121.25,-66.82 131.74,-68.32 130.38,-61.45"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="251.8" y="-83.62" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> first_type</text>
|
||||
<text text-anchor="middle" x="251.8" y="-72.38" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey">second_type</text>
|
||||
<text text-anchor="middle" x="165.25" y="-76.13" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> first_type</text>
|
||||
<text text-anchor="middle" x="165.25" y="-64.88" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey">second_type</text>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="623.55,-64.25 491.3,-64.25 491.3,0 623.55,0 623.55,-64.25"/>
|
||||
<text text-anchor="start" x="499.3" y="-50.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_map</text>
|
||||
<text text-anchor="start" x="499.3" y="-39.5" font-family="Helvetica,sans-Serif" font-size="10.00">< int, std::pair< others</text>
|
||||
<text text-anchor="start" x="499.3" y="-28.25" font-family="Helvetica,sans-Serif" font-size="10.00">::Cache::D_Node< K, V ></text>
|
||||
<text text-anchor="start" x="499.3" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00"> *, others::Cache::D_Node</text>
|
||||
<text text-anchor="middle" x="557.42" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">< K, V > * > ></text>
|
||||
<polygon fill="white" stroke="#666666" points="549.75,-75.5 407,-75.5 407,0 549.75,0 549.75,-75.5"/>
|
||||
<text text-anchor="start" x="415" y="-62" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_map</text>
|
||||
<text text-anchor="start" x="415" y="-50.75" font-family="Helvetica,sans-Serif" font-size="10.00">< int, std::pair< others</text>
|
||||
<text text-anchor="start" x="415" y="-39.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Cache::D_Node< std::pair</text>
|
||||
<text text-anchor="start" x="415" y="-28.25" font-family="Helvetica,sans-Serif" font-size="10.00">< K, V > >< K, V > *, others</text>
|
||||
<text text-anchor="start" x="415" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">::Cache::D_Node< std::pair<</text>
|
||||
<text text-anchor="middle" x="478.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00"> K, V > >< K, V > * > ></text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6->Node1 -->
|
||||
<g id="edge6_Node000001_Node000006" class="edge">
|
||||
<g id="edge5_Node000001_Node000006" class="edge">
|
||||
<title>Node6->Node1</title>
|
||||
<g id="a_edge6_Node000001_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M635,-47.55C658.67,-52.31 684.49,-57.52 707.27,-62.1"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="635.91,-44.16 625.42,-45.62 634.53,-51.02 635.91,-44.16"/>
|
||||
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M561.28,-56.47C585.17,-61.93 610.92,-67.82 633.57,-73"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="562.1,-53.07 551.57,-54.25 560.54,-59.89 562.1,-53.07"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="665.55" y="-59.23" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> freq_map</text>
|
||||
<text text-anchor="middle" x="591.75" y="-70.45" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> freq_map</text>
|
||||
</g>
|
||||
<!-- Node7->Node6 -->
|
||||
<g id="edge7_Node000006_Node000007" class="edge">
|
||||
<g id="edge6_Node000006_Node000007" class="edge">
|
||||
<title>Node7->Node6</title>
|
||||
<g id="a_edge7_Node000006_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M424.3,-32.12C445.84,-32.12 469.57,-32.12 490.91,-32.12"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="424.45,-28.63 414.45,-32.13 424.45,-35.63 424.45,-28.63"/>
|
||||
<g id="a_edge6_Node000006_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M339.84,-37.75C361.33,-37.75 385.05,-37.75 406.64,-37.75"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="340,-34.25 330,-37.75 340,-41.25 340,-34.25"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="451.92" y="-33.88" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> elements</text>
|
||||
<text text-anchor="middle" x="367.62" y="-39.5" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> elements</text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
@@ -1,20 +1,20 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: others::Cache::LFUCache< K, V > Pages: 1 -->
|
||||
<svg width="846pt" height="152pt"
|
||||
viewBox="0.00 0.00 846.30 152.03" 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 148.03)">
|
||||
<svg width="773pt" height="191pt"
|
||||
viewBox="0.00 0.00 772.50 191.38" 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 187.38)">
|
||||
<title>others::Cache::LFUCache< K, V ></title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="LFUCache.">
|
||||
<polygon fill="#999999" stroke="#666666" points="838.3,-90.38 707.55,-90.38 707.55,-59.88 838.3,-59.88 838.3,-90.38"/>
|
||||
<text text-anchor="start" x="715.55" y="-76.88" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
|
||||
<text text-anchor="middle" x="772.92" y="-65.62" font-family="Helvetica,sans-Serif" font-size="10.00">< K, V ></text>
|
||||
<polygon fill="#999999" stroke="#666666" points="764.5,-103 633.75,-103 633.75,-72.5 764.5,-72.5 764.5,-103"/>
|
||||
<text text-anchor="start" x="641.75" y="-89.5" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::LFUCache</text>
|
||||
<text text-anchor="middle" x="699.12" y="-78.25" font-family="Helvetica,sans-Serif" font-size="10.00">< K, V ></text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -22,11 +22,12 @@
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="617.92,-135.62 496.92,-135.62 496.92,-82.62 617.92,-82.62 617.92,-135.62"/>
|
||||
<text text-anchor="start" x="504.92" y="-122.12" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_map</text>
|
||||
<text text-anchor="start" x="504.92" y="-110.88" font-family="Helvetica,sans-Serif" font-size="10.00">< K, std::pair< others</text>
|
||||
<text text-anchor="start" x="504.92" y="-99.62" font-family="Helvetica,sans-Serif" font-size="10.00">::Cache::D_Node< K, V</text>
|
||||
<text text-anchor="middle" x="557.42" y="-88.38" font-family="Helvetica,sans-Serif" font-size="10.00"> > *, int > ></text>
|
||||
<polygon fill="white" stroke="#666666" points="538.88,-157.88 417.88,-157.88 417.88,-93.62 538.88,-93.62 538.88,-157.88"/>
|
||||
<text text-anchor="start" x="425.88" y="-144.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_map</text>
|
||||
<text text-anchor="start" x="425.88" y="-133.12" font-family="Helvetica,sans-Serif" font-size="10.00">< K, std::pair< others</text>
|
||||
<text text-anchor="start" x="425.88" y="-121.88" font-family="Helvetica,sans-Serif" font-size="10.00">::Cache::D_Node< std::</text>
|
||||
<text text-anchor="start" x="425.88" y="-110.62" font-family="Helvetica,sans-Serif" font-size="10.00">pair< K, V > >< K, V ></text>
|
||||
<text text-anchor="middle" x="478.38" y="-99.38" font-family="Helvetica,sans-Serif" font-size="10.00"> *, int > ></text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -34,18 +35,18 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node2->Node1</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M629.5,-97.81C654.63,-93.8 682.75,-89.33 707.32,-85.41"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="629,-94.34 619.68,-99.37 630.1,-101.25 629,-94.34"/>
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M550.37,-113.42C577.09,-108.78 607.32,-103.52 633.44,-98.99"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="549.89,-109.95 540.64,-115.11 551.09,-116.84 549.89,-109.95"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="665.55" y="-96.92" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> node_map</text>
|
||||
<text text-anchor="middle" x="591.75" y="-111.9" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> node_map</text>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="28.8,-131.75 0,-131.75 0,-112.5 28.8,-112.5 28.8,-131.75"/>
|
||||
<text text-anchor="middle" x="14.4" y="-118.25" font-family="Helvetica,sans-Serif" font-size="10.00">K</text>
|
||||
<polygon fill="white" stroke="#bfbfbf" points="284.02,-183.38 255.22,-183.38 255.22,-164.12 284.02,-164.12 284.02,-183.38"/>
|
||||
<text text-anchor="middle" x="269.62" y="-169.88" font-family="Helvetica,sans-Serif" font-size="10.00">K</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -53,40 +54,21 @@
|
||||
<g id="edge2_Node000002_Node000003" class="edge">
|
||||
<title>Node3->Node2</title>
|
||||
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M40.4,-129.96C42.55,-130.43 44.7,-130.83 46.8,-131.12 56.37,-132.47 58.88,-131.18 68.55,-131.12 221.45,-130.24 260,-137.52 412.55,-127.12 440.3,-125.23 470.9,-121.62 496.72,-118.13"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="41.31,-126.58 30.75,-127.4 39.52,-133.35 41.31,-126.58"/>
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M295.64,-167.94C325.7,-160.96 377.16,-149.02 417.67,-139.61"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="294.94,-164.51 285.99,-170.18 296.52,-171.33 294.94,-164.51"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="251.8" y="-134.53" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> keys</text>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:href="../../de/d21/classothers_1_1_cache_1_1_d___node.html" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="206.05,-112.38 86.55,-112.38 86.55,-81.88 206.05,-81.88 206.05,-112.38"/>
|
||||
<text text-anchor="start" x="94.55" y="-98.88" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::D_Node</text>
|
||||
<text text-anchor="middle" x="146.3" y="-87.62" font-family="Helvetica,sans-Serif" font-size="10.00">< K, V ></text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node5 -->
|
||||
<g id="edge5_Node000005_Node000003" class="edge">
|
||||
<title>Node3->Node5</title>
|
||||
<g id="a_edge5_Node000005_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M39.77,-117.44C52.98,-114.89 69.92,-111.63 86.34,-108.47"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="39.46,-113.93 30.3,-119.26 40.78,-120.8 39.46,-113.93"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="57.67" y="-117.17" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> data</text>
|
||||
<text text-anchor="middle" x="367.62" y="-157.21" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> keys</text>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="412.55,-118 297.55,-118 297.55,-76.25 412.55,-76.25 412.55,-118"/>
|
||||
<text text-anchor="start" x="305.55" y="-104.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::pair< others::</text>
|
||||
<text text-anchor="start" x="305.55" y="-93.25" font-family="Helvetica,sans-Serif" font-size="10.00">Cache::D_Node< K, V</text>
|
||||
<text text-anchor="middle" x="355.05" y="-82" font-family="Helvetica,sans-Serif" font-size="10.00"> > *, int ></text>
|
||||
<polygon fill="white" stroke="#666666" points="327.12,-146.25 212.12,-146.25 212.12,-93.25 327.12,-93.25 327.12,-146.25"/>
|
||||
<text text-anchor="start" x="220.12" y="-132.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::pair< others::</text>
|
||||
<text text-anchor="start" x="220.12" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">Cache::D_Node< std::</text>
|
||||
<text text-anchor="start" x="220.12" y="-110.25" font-family="Helvetica,sans-Serif" font-size="10.00">pair< K, V > >< K, V</text>
|
||||
<text text-anchor="middle" x="269.62" y="-99" font-family="Helvetica,sans-Serif" font-size="10.00"> > *, int ></text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -94,77 +76,90 @@
|
||||
<g id="edge3_Node000002_Node000004" class="edge">
|
||||
<title>Node4->Node2</title>
|
||||
<g id="a_edge3_Node000002_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M424.23,-101.21C447.72,-102.61 473.83,-104.18 496.6,-105.54"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="424.64,-97.73 414.44,-100.62 424.22,-104.71 424.64,-97.73"/>
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M338.82,-121.73C364.23,-122.47 392.87,-123.3 417.48,-124.01"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="339,-118.23 328.91,-121.44 338.8,-125.23 339,-118.23"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="367.62" y="-124.86" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> elements</text>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:href="../../de/d21/classothers_1_1_cache_1_1_d___node.html" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="119.5,-94 0,-94 0,-63.5 119.5,-63.5 119.5,-94"/>
|
||||
<text text-anchor="start" x="8" y="-80.5" font-family="Helvetica,sans-Serif" font-size="10.00">others::Cache::D_Node</text>
|
||||
<text text-anchor="middle" x="59.75" y="-69.25" font-family="Helvetica,sans-Serif" font-size="10.00">< std::pair< K, V > ></text>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="451.92" y="-105.59" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> elements</text>
|
||||
</g>
|
||||
<!-- Node5->Node4 -->
|
||||
<g id="edge4_Node000004_Node000005" class="edge">
|
||||
<title>Node5->Node4</title>
|
||||
<g id="a_edge4_Node000004_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M217.83,-97.12C243.74,-97.12 272.73,-97.12 297.29,-97.12"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="218.06,-93.63 208.06,-97.13 218.06,-100.63 218.06,-93.63"/>
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M130.86,-92.58C157.26,-97.79 186.94,-103.64 211.97,-108.58"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="131.74,-89.18 121.25,-90.68 130.38,-96.05 131.74,-89.18"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="251.8" y="-98.88" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> first_type</text>
|
||||
<text text-anchor="middle" x="165.25" y="-105.88" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> first_type</text>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="412.55,-58.62 297.55,-58.62 297.55,-5.62 412.55,-5.62 412.55,-58.62"/>
|
||||
<text text-anchor="start" x="305.55" y="-45.12" font-family="Helvetica,sans-Serif" font-size="10.00">std::pair< others::</text>
|
||||
<text text-anchor="start" x="305.55" y="-33.88" font-family="Helvetica,sans-Serif" font-size="10.00">Cache::D_Node< K, V</text>
|
||||
<text text-anchor="start" x="305.55" y="-22.62" font-family="Helvetica,sans-Serif" font-size="10.00"> > *, others::Cache::</text>
|
||||
<text text-anchor="middle" x="355.05" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">D_Node< K, V > * ></text>
|
||||
<polygon fill="white" stroke="#666666" points="328.25,-75.5 211,-75.5 211,0 328.25,0 328.25,-75.5"/>
|
||||
<text text-anchor="start" x="219" y="-62" font-family="Helvetica,sans-Serif" font-size="10.00">std::pair< others::</text>
|
||||
<text text-anchor="start" x="219" y="-50.75" font-family="Helvetica,sans-Serif" font-size="10.00">Cache::D_Node< std::</text>
|
||||
<text text-anchor="start" x="219" y="-39.5" font-family="Helvetica,sans-Serif" font-size="10.00">pair< K, V > >< K, V</text>
|
||||
<text text-anchor="start" x="219" y="-28.25" font-family="Helvetica,sans-Serif" font-size="10.00"> > *, others::Cache::D</text>
|
||||
<text text-anchor="start" x="219" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">_Node< std::pair< K, V</text>
|
||||
<text text-anchor="middle" x="269.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00"> > >< K, V > * ></text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node7 -->
|
||||
<g id="edge8_Node000007_Node000005" class="edge">
|
||||
<g id="edge7_Node000007_Node000005" class="edge">
|
||||
<title>Node5->Node7</title>
|
||||
<g id="a_edge8_Node000007_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M202.09,-77.88C209.46,-75.38 216.92,-72.91 224.05,-70.62 247.92,-62.97 274.43,-55.02 297.25,-48.35"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="201.19,-74.48 192.86,-81.02 203.45,-81.11 201.19,-74.48"/>
|
||||
<g id="a_edge7_Node000007_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M131.02,-64.89C156.88,-59.79 185.87,-54.07 210.54,-49.21"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="130.38,-61.45 121.25,-66.82 131.74,-68.32 130.38,-61.45"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="251.8" y="-83.62" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> first_type</text>
|
||||
<text text-anchor="middle" x="251.8" y="-72.38" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey">second_type</text>
|
||||
<text text-anchor="middle" x="165.25" y="-76.13" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> first_type</text>
|
||||
<text text-anchor="middle" x="165.25" y="-64.88" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey">second_type</text>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="623.55,-64.25 491.3,-64.25 491.3,0 623.55,0 623.55,-64.25"/>
|
||||
<text text-anchor="start" x="499.3" y="-50.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_map</text>
|
||||
<text text-anchor="start" x="499.3" y="-39.5" font-family="Helvetica,sans-Serif" font-size="10.00">< int, std::pair< others</text>
|
||||
<text text-anchor="start" x="499.3" y="-28.25" font-family="Helvetica,sans-Serif" font-size="10.00">::Cache::D_Node< K, V ></text>
|
||||
<text text-anchor="start" x="499.3" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00"> *, others::Cache::D_Node</text>
|
||||
<text text-anchor="middle" x="557.42" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">< K, V > * > ></text>
|
||||
<polygon fill="white" stroke="#666666" points="549.75,-75.5 407,-75.5 407,0 549.75,0 549.75,-75.5"/>
|
||||
<text text-anchor="start" x="415" y="-62" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_map</text>
|
||||
<text text-anchor="start" x="415" y="-50.75" font-family="Helvetica,sans-Serif" font-size="10.00">< int, std::pair< others</text>
|
||||
<text text-anchor="start" x="415" y="-39.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Cache::D_Node< std::pair</text>
|
||||
<text text-anchor="start" x="415" y="-28.25" font-family="Helvetica,sans-Serif" font-size="10.00">< K, V > >< K, V > *, others</text>
|
||||
<text text-anchor="start" x="415" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">::Cache::D_Node< std::pair<</text>
|
||||
<text text-anchor="middle" x="478.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00"> K, V > >< K, V > * > ></text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6->Node1 -->
|
||||
<g id="edge6_Node000001_Node000006" class="edge">
|
||||
<g id="edge5_Node000001_Node000006" class="edge">
|
||||
<title>Node6->Node1</title>
|
||||
<g id="a_edge6_Node000001_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M635,-47.55C658.67,-52.31 684.49,-57.52 707.27,-62.1"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="635.91,-44.16 625.42,-45.62 634.53,-51.02 635.91,-44.16"/>
|
||||
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M561.28,-56.47C585.17,-61.93 610.92,-67.82 633.57,-73"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="562.1,-53.07 551.57,-54.25 560.54,-59.89 562.1,-53.07"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="665.55" y="-59.23" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> freq_map</text>
|
||||
<text text-anchor="middle" x="591.75" y="-70.45" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> freq_map</text>
|
||||
</g>
|
||||
<!-- Node7->Node6 -->
|
||||
<g id="edge7_Node000006_Node000007" class="edge">
|
||||
<g id="edge6_Node000006_Node000007" class="edge">
|
||||
<title>Node7->Node6</title>
|
||||
<g id="a_edge7_Node000006_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M424.3,-32.12C445.84,-32.12 469.57,-32.12 490.91,-32.12"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="424.45,-28.63 414.45,-32.13 424.45,-35.63 424.45,-28.63"/>
|
||||
<g id="a_edge6_Node000006_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M339.84,-37.75C361.33,-37.75 385.05,-37.75 406.64,-37.75"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="340,-34.25 330,-37.75 340,-41.25 340,-34.25"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="451.92" y="-33.88" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> elements</text>
|
||||
<text text-anchor="middle" x="367.62" y="-39.5" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> elements</text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/large_factorial.cpp Pages: 1 -->
|
||||
<svg width="479pt" height="138pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/large_factorial.cpp Pages: 1 -->
|
||||
<svg width="479pt" height="138pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
5
d4/d60/classunordered__set__coll__graph.map
Normal file
@@ -0,0 +1,5 @@
|
||||
<map id="unordered_set< K >" name="unordered_set< K >">
|
||||
<area shape="rect" id="Node000001" title="STL class." alt="" coords="5,94,142,120"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="54,5,93,31"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="76,47,76,94,71,94,71,47"/>
|
||||
</map>
|
||||
1
d4/d60/classunordered__set__coll__graph.md5
Normal file
@@ -0,0 +1 @@
|
||||
fde00f660c9111a2cf83d3e075fbc3d3
|
||||
66
d4/d60/classunordered__set__coll__graph.svg
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: unordered_set< K > Pages: 1 -->
|
||||
<svg width="110pt" height="94pt"
|
||||
viewBox="0.00 0.00 110.25 93.75" 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 89.75)">
|
||||
<title>unordered_set< K ></title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="STL class.">
|
||||
<polygon fill="#999999" stroke="#666666" points="102.25,-19.25 0,-19.25 0,0 102.25,0 102.25,-19.25"/>
|
||||
<text text-anchor="middle" x="51.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">unordered_set< K ></text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="65.53,-85.75 36.73,-85.75 36.73,-66.5 65.53,-66.5 65.53,-85.75"/>
|
||||
<text text-anchor="middle" x="51.12" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">K</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node1 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node2->Node1</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M51.12,-54.65C51.12,-42.82 51.12,-28.54 51.12,-19.52"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="47.63,-54.64 51.13,-64.64 54.63,-54.64 47.63,-54.64"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="63.12" y="-39" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> keys</text>
|
||||
</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>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
40
d4/d60/classunordered__set__coll__graph_org.svg
Normal file
@@ -0,0 +1,40 @@
|
||||
<?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.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: unordered_set< K > Pages: 1 -->
|
||||
<svg width="110pt" height="94pt"
|
||||
viewBox="0.00 0.00 110.25 93.75" 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 89.75)">
|
||||
<title>unordered_set< K ></title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="STL class.">
|
||||
<polygon fill="#999999" stroke="#666666" points="102.25,-19.25 0,-19.25 0,0 102.25,0 102.25,-19.25"/>
|
||||
<text text-anchor="middle" x="51.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">unordered_set< K ></text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:title=" ">
|
||||
<polygon fill="white" stroke="#bfbfbf" points="65.53,-85.75 36.73,-85.75 36.73,-66.5 65.53,-66.5 65.53,-85.75"/>
|
||||
<text text-anchor="middle" x="51.12" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">K</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node1 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node2->Node1</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M51.12,-54.65C51.12,-42.82 51.12,-28.54 51.12,-19.52"/>
|
||||
<polygon fill="#9a32cd" stroke="#9a32cd" points="47.63,-54.64 51.13,-64.64 54.63,-54.64 47.63,-54.64"/>
|
||||
</a>
|
||||
</g>
|
||||
<text text-anchor="middle" x="63.12" y="-39" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> keys</text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: machine_learning/kohonen_som_trace.cpp Pages: 1 -->
|
||||
<!--zoomable 94 -->
|
||||
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: machine_learning/kohonen_som_trace.cpp Pages: 1 -->
|
||||
<svg width="569pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: numerical_methods/qr_decompose.h File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -158,22 +158,22 @@ Namespaces</h2></td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:adfbdf47277c8cfee229b05b72f1f7834" id="r_adfbdf47277c8cfee229b05b72f1f7834"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:adfbdf47277c8cfee229b05b72f1f7834" id="r_adfbdf47277c8cfee229b05b72f1f7834"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:adfbdf47277c8cfee229b05b72f1f7834"><td class="memTemplItemLeft" align="right" valign="top">std::ostream & </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d2/d3b/namespaceqr__algorithm.html#adfbdf47277c8cfee229b05b72f1f7834">qr_algorithm::operator<<</a> (std::ostream &out, std::valarray< std::valarray< T > > const &v)</td></tr>
|
||||
<tr class="separator:adfbdf47277c8cfee229b05b72f1f7834"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a257425cb2365359da51c6fe6741834d8" id="r_a257425cb2365359da51c6fe6741834d8"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a257425cb2365359da51c6fe6741834d8" id="r_a257425cb2365359da51c6fe6741834d8"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a257425cb2365359da51c6fe6741834d8"><td class="memTemplItemLeft" align="right" valign="top">std::ostream & </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d2/d3b/namespaceqr__algorithm.html#a257425cb2365359da51c6fe6741834d8">qr_algorithm::operator<<</a> (std::ostream &out, std::valarray< T > const &v)</td></tr>
|
||||
<tr class="separator:a257425cb2365359da51c6fe6741834d8"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a8ea313a1a1b5f9d0e3e332c29c6446ec" id="r_a8ea313a1a1b5f9d0e3e332c29c6446ec"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a8ea313a1a1b5f9d0e3e332c29c6446ec" id="r_a8ea313a1a1b5f9d0e3e332c29c6446ec"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a8ea313a1a1b5f9d0e3e332c29c6446ec"><td class="memTemplItemLeft" align="right" valign="top">double </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec">qr_algorithm::vector_dot</a> (const std::valarray< T > &a, const std::valarray< T > &b)</td></tr>
|
||||
<tr class="separator:a8ea313a1a1b5f9d0e3e332c29c6446ec"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ad16da2183db22378435042f26af43d5f" id="r_ad16da2183db22378435042f26af43d5f"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:ad16da2183db22378435042f26af43d5f" id="r_ad16da2183db22378435042f26af43d5f"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:ad16da2183db22378435042f26af43d5f"><td class="memTemplItemLeft" align="right" valign="top">double </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d2/d3b/namespaceqr__algorithm.html#ad16da2183db22378435042f26af43d5f">qr_algorithm::vector_mag</a> (const std::valarray< T > &a)</td></tr>
|
||||
<tr class="separator:ad16da2183db22378435042f26af43d5f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a6d3c7dce1f142141f509d09f6c0e25dc" id="r_a6d3c7dce1f142141f509d09f6c0e25dc"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a6d3c7dce1f142141f509d09f6c0e25dc" id="r_a6d3c7dce1f142141f509d09f6c0e25dc"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a6d3c7dce1f142141f509d09f6c0e25dc"><td class="memTemplItemLeft" align="right" valign="top">std::valarray< T > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d2/d3b/namespaceqr__algorithm.html#a6d3c7dce1f142141f509d09f6c0e25dc">qr_algorithm::vector_proj</a> (const std::valarray< T > &a, const std::valarray< T > &b)</td></tr>
|
||||
<tr class="separator:a6d3c7dce1f142141f509d09f6c0e25dc"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a73ce637634fc49e1d10d190eb388ebf1" id="r_a73ce637634fc49e1d10d190eb388ebf1"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a73ce637634fc49e1d10d190eb388ebf1" id="r_a73ce637634fc49e1d10d190eb388ebf1"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a73ce637634fc49e1d10d190eb388ebf1"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d2/d3b/namespaceqr__algorithm.html#a73ce637634fc49e1d10d190eb388ebf1">qr_algorithm::qr_decompose</a> (const std::valarray< std::valarray< T > > &A, std::valarray< std::valarray< T > > *Q, std::valarray< std::valarray< T > > *R)</td></tr>
|
||||
<tr class="separator:a73ce637634fc49e1d10d190eb388ebf1"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
@@ -188,7 +188,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../d4/d68/qr__decompose_8h.html">qr_decompose.h</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
var qr__decompose_8h =
|
||||
[
|
||||
[ "operator<<", "d4/d68/qr__decompose_8h.html#adfbdf47277c8cfee229b05b72f1f7834", null ],
|
||||
[ "operator<<", "d4/d68/qr__decompose_8h.html#a257425cb2365359da51c6fe6741834d8", null ],
|
||||
[ "qr_decompose", "d4/d68/qr__decompose_8h.html#a73ce637634fc49e1d10d190eb388ebf1", null ],
|
||||
[ "vector_dot", "d4/d68/qr__decompose_8h.html#a8ea313a1a1b5f9d0e3e332c29c6446ec", null ],
|
||||
[ "vector_mag", "d4/d68/qr__decompose_8h.html#ad16da2183db22378435042f26af43d5f", null ],
|
||||
[ "vector_proj", "d4/d68/qr__decompose_8h.html#a6d3c7dce1f142141f509d09f6c0e25dc", null ]
|
||||
[ "qr_algorithm::operator<<", "d2/d3b/namespaceqr__algorithm.html#adfbdf47277c8cfee229b05b72f1f7834", null ],
|
||||
[ "qr_algorithm::operator<<", "d2/d3b/namespaceqr__algorithm.html#a257425cb2365359da51c6fe6741834d8", null ],
|
||||
[ "qr_algorithm::qr_decompose", "d2/d3b/namespaceqr__algorithm.html#a73ce637634fc49e1d10d190eb388ebf1", null ],
|
||||
[ "qr_algorithm::vector_dot", "d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec", null ],
|
||||
[ "qr_algorithm::vector_mag", "d2/d3b/namespaceqr__algorithm.html#ad16da2183db22378435042f26af43d5f", null ],
|
||||
[ "qr_algorithm::vector_proj", "d2/d3b/namespaceqr__algorithm.html#a6d3c7dce1f142141f509d09f6c0e25dc", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: numerical_methods/qr_decompose.h Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,8 @@ $(function(){initNavTree('d4/d68/qr__decompose_8h_source.html','../../'); initRe
|
||||
<div class="headertitle"><div class="title">qr_decompose.h</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d68/qr__decompose_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d68/qr__decompose_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#ifndef NUMERICAL_METHODS_QR_DECOMPOSE_H_</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#define NUMERICAL_METHODS_QR_DECOMPOSE_H_</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
|
||||
@@ -138,7 +139,7 @@ $(function(){initNavTree('d4/d68/qr__decompose_8h_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include <omp.h></span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d2/d3b/namespaceqr__algorithm.html">qr_algorithm</a> {</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00033" data-start="{" data-end="}">
|
||||
@@ -158,7 +159,7 @@ $(function(){initNavTree('d4/d68/qr__decompose_8h_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordflow">return</span> out;</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> </div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span></div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00053" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="../../d2/d3b/namespaceqr__algorithm.html#a257425cb2365359da51c6fe6741834d8"> 53</a></span>std::ostream &<a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#adfbdf47277c8cfee229b05b72f1f7834">operator<<</a>(std::ostream &out, std::valarray<T> <span class="keyword">const</span> &v) {</div>
|
||||
@@ -174,7 +175,7 @@ $(function(){initNavTree('d4/d68/qr__decompose_8h_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordflow">return</span> out;</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span></div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00076" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="../../d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec"> 76</a></span><span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec">vector_dot</a>(<span class="keyword">const</span> std::valarray<T> &a, <span class="keyword">const</span> std::valarray<T> &b) {</div>
|
||||
@@ -184,7 +185,7 @@ $(function(){initNavTree('d4/d68/qr__decompose_8h_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="comment">// 0.f);</span></div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> </div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span></div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00092" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"><a class="line" href="../../d2/d3b/namespaceqr__algorithm.html#ad16da2183db22378435042f26af43d5f"> 92</a></span><span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#ad16da2183db22378435042f26af43d5f">vector_mag</a>(<span class="keyword">const</span> std::valarray<T> &a) {</div>
|
||||
@@ -192,14 +193,14 @@ $(function(){initNavTree('d4/d68/qr__decompose_8h_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">return</span> std::sqrt(dot);</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span></div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00104" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"><a class="line" href="../../d2/d3b/namespaceqr__algorithm.html#a6d3c7dce1f142141f509d09f6c0e25dc"> 104</a></span>std::valarray<T> <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a6d3c7dce1f142141f509d09f6c0e25dc">vector_proj</a>(<span class="keyword">const</span> std::valarray<T> &a,</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keyword">const</span> std::valarray<T> &b) {</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keywordtype">double</span> num = <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec">vector_dot</a>(a, b);</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordtype">double</span> deno = <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a8ea313a1a1b5f9d0e3e332c29c6446ec">vector_dot</a>(b, b);</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> </div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span></div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keywordflow">if</span> (deno <= std::numeric_limits<double>::epsilon()) {</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> std::cerr << <span class="stringliteral">"["</span> << __func__ << <span class="stringliteral">"] Possible division by zero\n"</span>;</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordflow">return</span> a; <span class="comment">// return vector a back</span></div>
|
||||
@@ -210,7 +211,7 @@ $(function(){initNavTree('d4/d68/qr__decompose_8h_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordflow">return</span> b * scalar;</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> </div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span></div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00146" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"><a class="line" href="../../d2/d3b/namespaceqr__algorithm.html#a73ce637634fc49e1d10d190eb388ebf1"> 146</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a73ce637634fc49e1d10d190eb388ebf1">qr_decompose</a>(</div>
|
||||
@@ -291,7 +292,7 @@ $(function(){initNavTree('d4/d68/qr__decompose_8h_source.html','../../'); initRe
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../d4/d68/qr__decompose_8h.html">qr_decompose.h</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: greedy_algorithms/boruvkas_minimum_spanning_tree.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -317,7 +317,7 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 166</span> }</div>
|
||||
<div class="line"><span class="lineno"> 167</span> <span class="keywordflow">return</span> MST;</div>
|
||||
<div class="line"><span class="lineno"> 168</span>}</div>
|
||||
<div class="ttc" id="aboruvkas__minimum__spanning__tree_8cpp_html_a95de0f5e70e83164dbd1b4c515565e84"><div class="ttname"><a href="#a95de0f5e70e83164dbd1b4c515565e84">greedy_algorithms::boruvkas_minimum_spanning_tree::findParent</a></div><div class="ttdeci">int findParent(std::vector< std::pair< int, int > > parent, const int v)</div><div class="ttdoc">Recursively returns the vertex's parent at the root of the tree.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp_source.html#l00047">boruvkas_minimum_spanning_tree.cpp:47</a></div></div>
|
||||
<div class="ttc" id="aboruvkas__minimum__spanning__tree_8cpp_html_a95de0f5e70e83164dbd1b4c515565e84"><div class="ttname"><a href="#a95de0f5e70e83164dbd1b4c515565e84">greedy_algorithms::boruvkas_minimum_spanning_tree::findParent</a></div><div class="ttdeci">int findParent(std::vector< std::pair< int, int > > parent, const int v)</div><div class="ttdoc">Recursively returns the vertex's parent at the root of the tree.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp_source.html#l00047">boruvkas_minimum_spanning_tree.cpp:47</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -415,13 +415,13 @@ Functions</h2></td></tr>
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp_source.html#l00175">175</a> of file <a class="el" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp_source.html">boruvkas_minimum_spanning_tree.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 175</span> {</div>
|
||||
<div class="line"><span class="lineno"> 176</span> <span class="keywordtype">size_t</span> size = adj.size();</div>
|
||||
<div class="line"><span class="lineno"> 177</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a> = 0;</div>
|
||||
<div class="line"><span class="lineno"> 177</span> <span class="keywordtype">int</span> sum = 0;</div>
|
||||
<div class="line"><span class="lineno"> 178</span> </div>
|
||||
<div class="line"><span class="lineno"> 179</span> <span class="comment">// Moves through one side of the adj matrix, counting the sums of each edge</span></div>
|
||||
<div class="line"><span class="lineno"> 180</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < size; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 181</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i + 1; j < size; j++) {</div>
|
||||
<div class="line"><span class="lineno"> 182</span> <span class="keywordflow">if</span> (adj[i][j] < INT_MAX) {</div>
|
||||
<div class="line"><span class="lineno"> 183</span> <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a> += adj[i][j];</div>
|
||||
<div class="line"><span class="lineno"> 183</span> sum += adj[i][j];</div>
|
||||
<div class="line"><span class="lineno"> 184</span> }</div>
|
||||
<div class="line"><span class="lineno"> 185</span> }</div>
|
||||
<div class="line"><span class="lineno"> 186</span> }</div>
|
||||
@@ -449,7 +449,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -467,7 +467,7 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 202</span> };</div>
|
||||
<div class="line"><span class="lineno"> 203</span> std::vector<std::vector<int>> MST =</div>
|
||||
<div class="line"><span class="lineno"> 204</span> <a class="code hl_function" href="#a94c615fc66b72e0adbcbcb99aabb1a59">greedy_algorithms::boruvkas_minimum_spanning_tree::boruvkas</a>(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>);</div>
|
||||
<div class="line"><span class="lineno"> 205</span> assert(greedy_algorithms::boruvkas_minimum_spanning_tree::test_findGraphSum(</div>
|
||||
<div class="line"><span class="lineno"> 205</span> assert(<a class="code hl_function" href="#a2311b22324cf09926726e4ce1309af8b">greedy_algorithms::boruvkas_minimum_spanning_tree::test_findGraphSum</a>(</div>
|
||||
<div class="line"><span class="lineno"> 206</span> MST) == 13);</div>
|
||||
<div class="line"><span class="lineno"> 207</span> std::cout << <span class="stringliteral">"1st test passed!"</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 208</span> </div>
|
||||
@@ -477,11 +477,12 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 212</span> {6, 8, 0, 0, 9},</div>
|
||||
<div class="line"><span class="lineno"> 213</span> {0, 5, 7, 9, 0}};</div>
|
||||
<div class="line"><span class="lineno"> 214</span> MST = <a class="code hl_function" href="#a94c615fc66b72e0adbcbcb99aabb1a59">greedy_algorithms::boruvkas_minimum_spanning_tree::boruvkas</a>(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>);</div>
|
||||
<div class="line"><span class="lineno"> 215</span> assert(greedy_algorithms::boruvkas_minimum_spanning_tree::test_findGraphSum(</div>
|
||||
<div class="line"><span class="lineno"> 215</span> assert(<a class="code hl_function" href="#a2311b22324cf09926726e4ce1309af8b">greedy_algorithms::boruvkas_minimum_spanning_tree::test_findGraphSum</a>(</div>
|
||||
<div class="line"><span class="lineno"> 216</span> MST) == 16);</div>
|
||||
<div class="line"><span class="lineno"> 217</span> std::cout << <span class="stringliteral">"2nd test passed!"</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 218</span>}</div>
|
||||
<div class="ttc" id="aboruvkas__minimum__spanning__tree_8cpp_html_a94c615fc66b72e0adbcbcb99aabb1a59"><div class="ttname"><a href="#a94c615fc66b72e0adbcbcb99aabb1a59">greedy_algorithms::boruvkas_minimum_spanning_tree::boruvkas</a></div><div class="ttdeci">std::vector< std::vector< int > > boruvkas(std::vector< std::vector< int > > adj)</div><div class="ttdoc">the implementation of boruvka's algorithm</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp_source.html#l00060">boruvkas_minimum_spanning_tree.cpp:60</a></div></div>
|
||||
<div class="ttc" id="aboruvkas__minimum__spanning__tree_8cpp_html_a2311b22324cf09926726e4ce1309af8b"><div class="ttname"><a href="#a2311b22324cf09926726e4ce1309af8b">greedy_algorithms::boruvkas_minimum_spanning_tree::test_findGraphSum</a></div><div class="ttdeci">int test_findGraphSum(std::vector< std::vector< int > > adj)</div><div class="ttdoc">counts the sum of edges in the given tree</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp_source.html#l00175">boruvkas_minimum_spanning_tree.cpp:175</a></div></div>
|
||||
<div class="ttc" id="aboruvkas__minimum__spanning__tree_8cpp_html_a94c615fc66b72e0adbcbcb99aabb1a59"><div class="ttname"><a href="#a94c615fc66b72e0adbcbcb99aabb1a59">greedy_algorithms::boruvkas_minimum_spanning_tree::boruvkas</a></div><div class="ttdeci">std::vector< std::vector< int > > boruvkas(std::vector< std::vector< int > > adj)</div><div class="ttdoc">the implementation of boruvka's algorithm</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp_source.html#l00060">boruvkas_minimum_spanning_tree.cpp:60</a></div></div>
|
||||
<div class="ttc" id="anamespacegraph_html"><div class="ttname"><a href="../../df/dce/namespacegraph.html">graph</a></div><div class="ttdoc">Graph Algorithms.</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -492,7 +493,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_0eaa691bd54ab0922ca7f50599de6d22.html">greedy_algorithms</a></li><li class="navelem"><a class="el" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html">boruvkas_minimum_spanning_tree.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
var boruvkas__minimum__spanning__tree_8cpp =
|
||||
[
|
||||
[ "boruvkas", "d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a94c615fc66b72e0adbcbcb99aabb1a59", null ],
|
||||
[ "findParent", "d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a95de0f5e70e83164dbd1b4c515565e84", null ],
|
||||
[ "greedy_algorithms::boruvkas_minimum_spanning_tree::boruvkas", "d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a94c615fc66b72e0adbcbcb99aabb1a59", null ],
|
||||
[ "greedy_algorithms::boruvkas_minimum_spanning_tree::findParent", "d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a95de0f5e70e83164dbd1b4c515565e84", null ],
|
||||
[ "main", "d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test_findGraphSum", "d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a2311b22324cf09926726e4ce1309af8b", null ],
|
||||
[ "greedy_algorithms::boruvkas_minimum_spanning_tree::test_findGraphSum", "d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a2311b22324cf09926726e4ce1309af8b", null ],
|
||||
[ "tests", "d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: greedy_algorithms/boruvkas_minimum_spanning_tree.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,12 +124,13 @@ $(function(){initNavTree('d4/d6c/boruvkas__minimum__spanning__tree_8cpp_source.h
|
||||
<div class="headertitle"><div class="title">boruvkas_minimum_spanning_tree.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include <climits></span> </div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> </div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span></div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d2/d90/namespacegreedy__algorithms.html">greedy_algorithms</a> {</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d8/d64/namespaceboruvkas__minimum__spanning__tree.html">boruvkas_minimum_spanning_tree</a> {</div>
|
||||
<div class="foldopen" id="foldopen00047" data-start="{" data-end="}">
|
||||
@@ -141,7 +142,7 @@ $(function(){initNavTree('d4/d6c/boruvkas__minimum__spanning__tree_8cpp_source.h
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordflow">return</span> parent[v].first;</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span></div>
|
||||
<div class="foldopen" id="foldopen00060" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a94c615fc66b72e0adbcbcb99aabb1a59"> 60</a></span>std::vector<std::vector<int>> <a class="code hl_function" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a94c615fc66b72e0adbcbcb99aabb1a59">boruvkas</a>(std::vector<std::vector<int>> adj) {</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordtype">size_t</span> size = adj.size();</div>
|
||||
@@ -253,7 +254,7 @@ $(function(){initNavTree('d4/d6c/boruvkas__minimum__spanning__tree_8cpp_source.h
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <span class="keywordflow">return</span> MST;</div>
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> </div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span></div>
|
||||
<div class="foldopen" id="foldopen00175" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"><a class="line" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a2311b22324cf09926726e4ce1309af8b"> 175</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a2311b22324cf09926726e4ce1309af8b">test_findGraphSum</a>(std::vector<std::vector<int>> adj) {</div>
|
||||
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="keywordtype">size_t</span> size = adj.size();</div>
|
||||
@@ -272,7 +273,7 @@ $(function(){initNavTree('d4/d6c/boruvkas__minimum__spanning__tree_8cpp_source.h
|
||||
</div>
|
||||
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span>} <span class="comment">// namespace boruvkas_minimum_spanning_tree</span></div>
|
||||
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span>} <span class="comment">// namespace greedy_algorithms</span></div>
|
||||
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> </div>
|
||||
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span></div>
|
||||
<div class="foldopen" id="foldopen00196" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"><a class="line" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e"> 196</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>() {</div>
|
||||
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> std::cout << <span class="stringliteral">"Starting tests...\n\n"</span>;</div>
|
||||
@@ -282,8 +283,8 @@ $(function(){initNavTree('d4/d6c/boruvkas__minimum__spanning__tree_8cpp_source.h
|
||||
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> {INT_MAX, 5, 3, INT_MAX, 0},</div>
|
||||
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> };</div>
|
||||
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> std::vector<std::vector<int>> MST =</div>
|
||||
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> greedy_algorithms::boruvkas_minimum_spanning_tree::boruvkas(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>);</div>
|
||||
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> assert(greedy_algorithms::boruvkas_minimum_spanning_tree::test_findGraphSum(</div>
|
||||
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> <a class="code hl_function" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a94c615fc66b72e0adbcbcb99aabb1a59">greedy_algorithms::boruvkas_minimum_spanning_tree::boruvkas</a>(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>);</div>
|
||||
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> assert(<a class="code hl_function" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a2311b22324cf09926726e4ce1309af8b">greedy_algorithms::boruvkas_minimum_spanning_tree::test_findGraphSum</a>(</div>
|
||||
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> MST) == 13);</div>
|
||||
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> std::cout << <span class="stringliteral">"1st test passed!"</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> </div>
|
||||
@@ -292,13 +293,13 @@ $(function(){initNavTree('d4/d6c/boruvkas__minimum__spanning__tree_8cpp_source.h
|
||||
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> {0, 3, 0, 0, 7},</div>
|
||||
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> {6, 8, 0, 0, 9},</div>
|
||||
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> {0, 5, 7, 9, 0}};</div>
|
||||
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> MST = greedy_algorithms::boruvkas_minimum_spanning_tree::boruvkas(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>);</div>
|
||||
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> assert(greedy_algorithms::boruvkas_minimum_spanning_tree::test_findGraphSum(</div>
|
||||
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> MST = <a class="code hl_function" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a94c615fc66b72e0adbcbcb99aabb1a59">greedy_algorithms::boruvkas_minimum_spanning_tree::boruvkas</a>(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>);</div>
|
||||
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> assert(<a class="code hl_function" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a2311b22324cf09926726e4ce1309af8b">greedy_algorithms::boruvkas_minimum_spanning_tree::test_findGraphSum</a>(</div>
|
||||
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> MST) == 16);</div>
|
||||
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> std::cout << <span class="stringliteral">"2nd test passed!"</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> </div>
|
||||
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span></div>
|
||||
<div class="foldopen" id="foldopen00224" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"><a class="line" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 224</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> <a class="code hl_function" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -307,10 +308,10 @@ $(function(){initNavTree('d4/d6c/boruvkas__minimum__spanning__tree_8cpp_source.h
|
||||
</div>
|
||||
<div class="ttc" id="aboruvkas__minimum__spanning__tree_8cpp_html_a2311b22324cf09926726e4ce1309af8b"><div class="ttname"><a href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a2311b22324cf09926726e4ce1309af8b">greedy_algorithms::boruvkas_minimum_spanning_tree::test_findGraphSum</a></div><div class="ttdeci">int test_findGraphSum(std::vector< std::vector< int > > adj)</div><div class="ttdoc">counts the sum of edges in the given tree</div><div class="ttdef"><b>Definition</b> <a href="#l00175">boruvkas_minimum_spanning_tree.cpp:175</a></div></div>
|
||||
<div class="ttc" id="aboruvkas__minimum__spanning__tree_8cpp_html_a483bb8ccf42aaf7375a83e91490eda1e"><div class="ttname"><a href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a></div><div class="ttdeci">static void tests()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="#l00196">boruvkas_minimum_spanning_tree.cpp:196</a></div></div>
|
||||
<div class="ttc" id="aboruvkas__minimum__spanning__tree_8cpp_html_a94c615fc66b72e0adbcbcb99aabb1a59"><div class="ttname"><a href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a94c615fc66b72e0adbcbcb99aabb1a59">greedy_algorithms::boruvkas_minimum_spanning_tree::boruvkas</a></div><div class="ttdeci">std::vector< std::vector< int > > boruvkas(std::vector< std::vector< int > > adj)</div><div class="ttdoc">the implementation of boruvka's algorithm</div><div class="ttdef"><b>Definition</b> <a href="#l00060">boruvkas_minimum_spanning_tree.cpp:60</a></div></div>
|
||||
<div class="ttc" id="aboruvkas__minimum__spanning__tree_8cpp_html_a95de0f5e70e83164dbd1b4c515565e84"><div class="ttname"><a href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a95de0f5e70e83164dbd1b4c515565e84">greedy_algorithms::boruvkas_minimum_spanning_tree::findParent</a></div><div class="ttdeci">int findParent(std::vector< std::pair< int, int > > parent, const int v)</div><div class="ttdoc">Recursively returns the vertex's parent at the root of the tree.</div><div class="ttdef"><b>Definition</b> <a href="#l00047">boruvkas_minimum_spanning_tree.cpp:47</a></div></div>
|
||||
<div class="ttc" id="aboruvkas__minimum__spanning__tree_8cpp_html_a94c615fc66b72e0adbcbcb99aabb1a59"><div class="ttname"><a href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a94c615fc66b72e0adbcbcb99aabb1a59">greedy_algorithms::boruvkas_minimum_spanning_tree::boruvkas</a></div><div class="ttdeci">std::vector< std::vector< int > > boruvkas(std::vector< std::vector< int > > adj)</div><div class="ttdoc">the implementation of boruvka's algorithm</div><div class="ttdef"><b>Definition</b> <a href="#l00060">boruvkas_minimum_spanning_tree.cpp:60</a></div></div>
|
||||
<div class="ttc" id="aboruvkas__minimum__spanning__tree_8cpp_html_a95de0f5e70e83164dbd1b4c515565e84"><div class="ttname"><a href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#a95de0f5e70e83164dbd1b4c515565e84">greedy_algorithms::boruvkas_minimum_spanning_tree::findParent</a></div><div class="ttdeci">int findParent(std::vector< std::pair< int, int > > parent, const int v)</div><div class="ttdoc">Recursively returns the vertex's parent at the root of the tree.</div><div class="ttdef"><b>Definition</b> <a href="#l00047">boruvkas_minimum_spanning_tree.cpp:47</a></div></div>
|
||||
<div class="ttc" id="aboruvkas__minimum__spanning__tree_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> <a href="#l00224">boruvkas_minimum_spanning_tree.cpp:224</a></div></div>
|
||||
<div class="ttc" id="anamespaceboruvkas__minimum__spanning__tree_html"><div class="ttname"><a href="../../d8/d64/namespaceboruvkas__minimum__spanning__tree.html">boruvkas_minimum_spanning_tree</a></div><div class="ttdoc">Functions for the [Borůvkas Algorithm](https://en.wikipedia.org/wiki/Borůvka's_algorithm) implementat...</div></div>
|
||||
<div class="ttc" id="anamespaceboruvkas__minimum__spanning__tree_html"><div class="ttname"><a href="../../d8/d64/namespaceboruvkas__minimum__spanning__tree.html">boruvkas_minimum_spanning_tree</a></div><div class="ttdoc">Functions for the [Borůvkas Algorithm](https://en.wikipedia.org/wiki/Borůvka's_algorithm) implementat...</div></div>
|
||||
<div class="ttc" id="anamespacegraph_html"><div class="ttname"><a href="../../df/dce/namespacegraph.html">graph</a></div><div class="ttdoc">Graph Algorithms.</div></div>
|
||||
<div class="ttc" id="anamespacegreedy__algorithms_html"><div class="ttname"><a href="../../d2/d90/namespacegreedy__algorithms.html">greedy_algorithms</a></div><div class="ttdoc">for string class</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d1f/binary__addition_8cpp_source.html#l00027">binary_addition.cpp:27</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
@@ -319,7 +320,7 @@ $(function(){initNavTree('d4/d6c/boruvkas__minimum__spanning__tree_8cpp_source.h
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_0eaa691bd54ab0922ca7f50599de6d22.html">greedy_algorithms</a></li><li class="navelem"><a class="el" href="../../d4/d6c/boruvkas__minimum__spanning__tree_8cpp.html">boruvkas_minimum_spanning_tree.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
141
d4/d6d/struct_entry-members.html
Normal file
@@ -0,0 +1,141 @@
|
||||
<!-- 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>
|
||||
<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.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</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>
|
||||
<script type="text/javascript" src="../../navtree.js"></script>
|
||||
<script type="text/javascript" src="../../resize.js"></script>
|
||||
<script type="text/javascript" src="../../cookie.js"></script>
|
||||
<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/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" 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! -->
|
||||
<div id="titlearea">
|
||||
<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">TheAlgorithms/C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">All the algorithms implemented in C++</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(1); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="../../menudata.js"></script>
|
||||
<script type="text/javascript" src="../../menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('../../',true,false,'search.php','Search',true);
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||
<div id="nav-tree">
|
||||
<div id="nav-tree-contents">
|
||||
<div id="nav-sync" class="sync"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="splitbar" style="-moz-user-select:none;"
|
||||
class="ui-resizable-handle">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function(){initNavTree('dd/d3b/struct_entry.html','../../'); initResizable(true); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="doc-content">
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<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">
|
||||
<div class="headertitle"><div class="title">Entry Member List</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>This is the complete list of members for <a class="el" href="../../dd/d3b/struct_entry.html">Entry</a>, including all inherited members.</p>
|
||||
<table class="directory">
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../dd/d3b/struct_entry.html#a287b92112b6b43b34808a93778873475">Entry</a>(int key=notPresent)</td><td class="entry"><a class="el" href="../../dd/d3b/struct_entry.html">Entry</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">explicit</span></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../dd/d3b/struct_entry.html#ae114967c89dbba3b754dc4976bba3248">key</a></td><td class="entry"><a class="el" href="../../dd/d3b/struct_entry.html">Entry</a></td><td class="entry"></td></tr>
|
||||
</table></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/qr_eigen_values.cpp Pages: 1 -->
|
||||
<svg width="469pt" height="149pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/qr_eigen_values.cpp Pages: 1 -->
|
||||
<svg width="469pt" height="149pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: data_structures/skip_list.cpp Pages: 1 -->
|
||||
<svg width="369pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: data_structures/skip_list.cpp Pages: 1 -->
|
||||
<svg width="369pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sorting/shell_sort2.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -152,22 +152,22 @@ Namespaces</h2></td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:a951127aea9d7e1e53ea9ae0868633246" id="r_a951127aea9d7e1e53ea9ae0868633246"><td class="memTemplParams" colspan="2">template<class T > </td></tr>
|
||||
<tr class="memitem:a951127aea9d7e1e53ea9ae0868633246" id="r_a951127aea9d7e1e53ea9ae0868633246"><td class="memTemplParams" colspan="2">template<class T> </td></tr>
|
||||
<tr class="memitem:a951127aea9d7e1e53ea9ae0868633246"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a951127aea9d7e1e53ea9ae0868633246">show_data</a> (T *arr, size_t LEN)</td></tr>
|
||||
<tr class="separator:a951127aea9d7e1e53ea9ae0868633246"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a63aaff7cabfa3da2da8b9477b5fad9d6" id="r_a63aaff7cabfa3da2da8b9477b5fad9d6"><td class="memTemplParams" colspan="2">template<typename T , size_t N> </td></tr>
|
||||
<tr class="memitem:a63aaff7cabfa3da2da8b9477b5fad9d6" id="r_a63aaff7cabfa3da2da8b9477b5fad9d6"><td class="memTemplParams" colspan="2">template<typename T, size_t N> </td></tr>
|
||||
<tr class="memitem:a63aaff7cabfa3da2da8b9477b5fad9d6"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a63aaff7cabfa3da2da8b9477b5fad9d6">show_data</a> (T(&arr)[N])</td></tr>
|
||||
<tr class="separator:a63aaff7cabfa3da2da8b9477b5fad9d6"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a5669396c6a6b1e14b97589b6e37980aa" id="r_a5669396c6a6b1e14b97589b6e37980aa"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a5669396c6a6b1e14b97589b6e37980aa" id="r_a5669396c6a6b1e14b97589b6e37980aa"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a5669396c6a6b1e14b97589b6e37980aa"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d5/d91/namespacesorting.html#a5669396c6a6b1e14b97589b6e37980aa">sorting::shell_sort</a> (T *arr, size_t LEN)</td></tr>
|
||||
<tr class="separator:a5669396c6a6b1e14b97589b6e37980aa"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a4d76603c54d3dc56146e92d10a043924" id="r_a4d76603c54d3dc56146e92d10a043924"><td class="memTemplParams" colspan="2">template<typename T , size_t N> </td></tr>
|
||||
<tr class="memitem:a4d76603c54d3dc56146e92d10a043924" id="r_a4d76603c54d3dc56146e92d10a043924"><td class="memTemplParams" colspan="2">template<typename T, size_t N> </td></tr>
|
||||
<tr class="memitem:a4d76603c54d3dc56146e92d10a043924"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d5/d91/namespacesorting.html#a4d76603c54d3dc56146e92d10a043924">sorting::shell_sort</a> (T(&arr)[N])</td></tr>
|
||||
<tr class="separator:a4d76603c54d3dc56146e92d10a043924"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:af2c5b92cbfe73f63f6074c61b0a45331" id="r_af2c5b92cbfe73f63f6074c61b0a45331"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:af2c5b92cbfe73f63f6074c61b0a45331" id="r_af2c5b92cbfe73f63f6074c61b0a45331"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:af2c5b92cbfe73f63f6074c61b0a45331"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d5/d91/namespacesorting.html#af2c5b92cbfe73f63f6074c61b0a45331">sorting::shell_sort</a> (std::vector< T > *arr)</td></tr>
|
||||
<tr class="separator:af2c5b92cbfe73f63f6074c61b0a45331"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a7eb77daed2cf1513f6d68c47a1c2db1c" id="r_a7eb77daed2cf1513f6d68c47a1c2db1c"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a7eb77daed2cf1513f6d68c47a1c2db1c" id="r_a7eb77daed2cf1513f6d68c47a1c2db1c"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a7eb77daed2cf1513f6d68c47a1c2db1c"><td class="memTemplItemLeft" align="right" valign="top">int </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a> (const void *a, const void *b)</td></tr>
|
||||
<tr class="separator:a7eb77daed2cf1513f6d68c47a1c2db1c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a895b313cb2671e8f712040460325573e" id="r_a895b313cb2671e8f712040460325573e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a895b313cb2671e8f712040460325573e">test_int</a> (const int NUM_DATA)</td></tr>
|
||||
@@ -176,6 +176,9 @@ Functions</h2></td></tr>
|
||||
<tr class="separator:a22ea0d1f7943ebb4371d31e44b465b6d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a0ddf1224851353fc92bfbff6f499fa97" id="r_a0ddf1224851353fc92bfbff6f499fa97"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#a0ddf1224851353fc92bfbff6f499fa97">main</a> (int argc, char *argv[])</td></tr>
|
||||
<tr class="separator:a0ddf1224851353fc92bfbff6f499fa97"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a5669396c6a6b1e14b97589b6e37980aa" id="r_a5669396c6a6b1e14b97589b6e37980aa"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a5669396c6a6b1e14b97589b6e37980aa"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a5669396c6a6b1e14b97589b6e37980aa">shell_sort</a> (T *arr, size_t LEN)</td></tr>
|
||||
<tr class="separator:a5669396c6a6b1e14b97589b6e37980aa"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p><a href="https://en.wikipedia.org/wiki/Shell_sort" target="_blank">Shell sort</a> algorithm </p>
|
||||
@@ -189,7 +192,7 @@ Functions</h2></td></tr>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int compare </td>
|
||||
@@ -282,7 +285,7 @@ template<typename T > </div>
|
||||
<div class="line"><span class="lineno"> 219</span> std::cout << <span class="stringliteral">"Unsorted original data: "</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 220</span> <a class="code hl_function" href="#a951127aea9d7e1e53ea9ae0868633246">show_data</a>(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>, NUM_DATA);</div>
|
||||
<div class="line"><span class="lineno"> 221</span> std::clock_t start = std::clock();</div>
|
||||
<div class="line"><span class="lineno"> 222</span> shell_sort(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>, NUM_DATA); <span class="comment">// perform sorting</span></div>
|
||||
<div class="line"><span class="lineno"> 222</span> <a class="code hl_function" href="#a5669396c6a6b1e14b97589b6e37980aa">shell_sort</a>(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>, NUM_DATA); <span class="comment">// perform sorting</span></div>
|
||||
<div class="line"><span class="lineno"> 223</span> std::clock_t end = std::clock();</div>
|
||||
<div class="line"><span class="lineno"> 224</span> </div>
|
||||
<div class="line"><span class="lineno"> 225</span> std::cout << std::endl</div>
|
||||
@@ -298,17 +301,63 @@ template<typename T > </div>
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a6e1a77282bc65ad359d753d25df23243"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a></div><div class="ttdeci">int data[MAX]</div><div class="ttdoc">test data</div><div class="ttdef"><b>Definition</b> <a href="../../d1/df3/hash__search_8cpp_source.html#l00024">hash_search.cpp:24</a></div></div>
|
||||
<div class="ttc" id="aquick__sort__3_8cpp_html_a07e5c62de28aeddea986890ce7ac1bda"><div class="ttname"><a href="../../d3/d4c/quick__sort__3_8cpp.html#a07e5c62de28aeddea986890ce7ac1bda">test_int</a></div><div class="ttdeci">static void test_int()</div><div class="ttdef"><b>Definition</b> <a href="../../d3/d4c/quick__sort__3_8cpp_source.html#l00138">quick_sort_3.cpp:138</a></div></div>
|
||||
<div class="ttc" id="ashell__sort2_8cpp_html_a22ea0d1f7943ebb4371d31e44b465b6d"><div class="ttname"><a href="#a22ea0d1f7943ebb4371d31e44b465b6d">test_f</a></div><div class="ttdeci">void test_f(const int NUM_DATA)</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d7a/shell__sort2_8cpp_source.html#l00145">shell_sort2.cpp:145</a></div></div>
|
||||
<div class="ttc" id="ashell__sort2_8cpp_html_a5669396c6a6b1e14b97589b6e37980aa"><div class="ttname"><a href="#a5669396c6a6b1e14b97589b6e37980aa">shell_sort</a></div><div class="ttdeci">void shell_sort(T *arr, size_t LEN)</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d7a/shell__sort2_8cpp_source.html#l00045">shell_sort2.cpp:45</a></div></div>
|
||||
<div class="ttc" id="ashell__sort2_8cpp_html_a951127aea9d7e1e53ea9ae0868633246"><div class="ttname"><a href="#a951127aea9d7e1e53ea9ae0868633246">show_data</a></div><div class="ttdeci">void show_data(T *arr, size_t LEN)</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d7a/shell__sort2_8cpp_source.html#l00018">shell_sort2.cpp:18</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a5669396c6a6b1e14b97589b6e37980aa" name="a5669396c6a6b1e14b97589b6e37980aa"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a5669396c6a6b1e14b97589b6e37980aa">◆ </a></span>shell_sort()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void sorting::shell_sort </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">T *</td> <td class="paramname"><span class="paramname"><em>arr</em></span>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>LEN</em></span> )</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Optimized algorithm - takes half the time by utilizing Mar </p>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d7a/shell__sort2_8cpp_source.html#l00045">45</a> of file <a class="el" href="../../d4/d7a/shell__sort2_8cpp_source.html">shell_sort2.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 45</span> {</div>
|
||||
<div class="line"><span class="lineno"> 46</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> gaps[] = {701, 301, 132, 57, 23, 10, 4, 1};</div>
|
||||
<div class="line"><span class="lineno"> 47</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> gap_len = 8;</div>
|
||||
<div class="line"><span class="lineno"> 48</span> <span class="keywordtype">size_t</span> i, j, <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">g</a>;</div>
|
||||
<div class="line"><span class="lineno"> 49</span> </div>
|
||||
<div class="line"><span class="lineno"> 50</span> <span class="keywordflow">for</span> (g = 0; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">g</a> < gap_len; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">g</a>++) {</div>
|
||||
<div class="line"><span class="lineno"> 51</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> gap = gaps[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">g</a>];</div>
|
||||
<div class="line"><span class="lineno"> 52</span> <span class="keywordflow">for</span> (i = gap; i < LEN; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 53</span> T tmp = arr[i];</div>
|
||||
<div class="line"><span class="lineno"> 54</span> </div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="keywordflow">for</span> (j = i; j >= gap && (arr[j - gap] - tmp) > 0; j -= gap) {</div>
|
||||
<div class="line"><span class="lineno"> 56</span> arr[j] = arr[j - gap];</div>
|
||||
<div class="line"><span class="lineno"> 57</span> }</div>
|
||||
<div class="line"><span class="lineno"> 58</span> </div>
|
||||
<div class="line"><span class="lineno"> 59</span> arr[j] = tmp;</div>
|
||||
<div class="line"><span class="lineno"> 60</span> }</div>
|
||||
<div class="line"><span class="lineno"> 61</span> }</div>
|
||||
<div class="line"><span class="lineno"> 62</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> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00115">composite_simpson_rule.cpp:115</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a951127aea9d7e1e53ea9ae0868633246" name="a951127aea9d7e1e53ea9ae0868633246"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a951127aea9d7e1e53ea9ae0868633246">◆ </a></span>show_data() <span class="overload">[1/2]</span></h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<class T > </div>
|
||||
template<class T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void show_data </td>
|
||||
@@ -348,7 +397,7 @@ template<class T > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T , size_t N> </div>
|
||||
template<typename T, size_t N> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void show_data </td>
|
||||
@@ -403,7 +452,7 @@ template<typename T , size_t N> </div>
|
||||
<div class="line"><span class="lineno"> 155</span> </div>
|
||||
<div class="line"><span class="lineno"> 156</span> <span class="comment">/* sort using our implementation */</span></div>
|
||||
<div class="line"><span class="lineno"> 157</span> std::clock_t start = std::clock();</div>
|
||||
<div class="line"><span class="lineno"> 158</span> shell_sort(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>, NUM_DATA);</div>
|
||||
<div class="line"><span class="lineno"> 158</span> <a class="code hl_function" href="#a5669396c6a6b1e14b97589b6e37980aa">shell_sort</a>(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>, NUM_DATA);</div>
|
||||
<div class="line"><span class="lineno"> 159</span> std::clock_t end = std::clock();</div>
|
||||
<div class="line"><span class="lineno"> 160</span> <span class="keywordtype">double</span> elapsed_time = <span class="keyword">static_cast<</span><span class="keywordtype">double</span><span class="keyword">></span>(end - start) / CLOCKS_PER_SEC;</div>
|
||||
<div class="line"><span class="lineno"> 161</span> std::cout << <span class="stringliteral">"Time spent sorting using shell_sort2: "</span> << elapsed_time</div>
|
||||
@@ -459,7 +508,7 @@ template<typename T , size_t N> </div>
|
||||
<div class="line"><span class="lineno"> 114</span> </div>
|
||||
<div class="line"><span class="lineno"> 115</span> <span class="comment">/* sort using our implementation */</span></div>
|
||||
<div class="line"><span class="lineno"> 116</span> std::clock_t start = std::clock();</div>
|
||||
<div class="line"><span class="lineno"> 117</span> shell_sort(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>, NUM_DATA);</div>
|
||||
<div class="line"><span class="lineno"> 117</span> <a class="code hl_function" href="#a5669396c6a6b1e14b97589b6e37980aa">shell_sort</a>(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>, NUM_DATA);</div>
|
||||
<div class="line"><span class="lineno"> 118</span> std::clock_t end = std::clock();</div>
|
||||
<div class="line"><span class="lineno"> 119</span> <span class="keywordtype">double</span> elapsed_time = <span class="keyword">static_cast<</span><span class="keywordtype">double</span><span class="keyword">></span>(end - start) / CLOCKS_PER_SEC;</div>
|
||||
<div class="line"><span class="lineno"> 120</span> std::cout << <span class="stringliteral">"Time spent sorting using shell_sort2: "</span> << elapsed_time</div>
|
||||
@@ -491,7 +540,7 @@ template<typename T , size_t N> </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d4/d7a/shell__sort2_8cpp.html">shell_sort2.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -2,9 +2,10 @@ var shell__sort2_8cpp =
|
||||
[
|
||||
[ "compare", "d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c", null ],
|
||||
[ "main", "d4/d7a/shell__sort2_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97", null ],
|
||||
[ "shell_sort", "d4/d7a/shell__sort2_8cpp.html#af2c5b92cbfe73f63f6074c61b0a45331", null ],
|
||||
[ "shell_sort", "d4/d7a/shell__sort2_8cpp.html#a5669396c6a6b1e14b97589b6e37980aa", null ],
|
||||
[ "shell_sort", "d4/d7a/shell__sort2_8cpp.html#a4d76603c54d3dc56146e92d10a043924", null ],
|
||||
[ "sorting::shell_sort", "d5/d91/namespacesorting.html#af2c5b92cbfe73f63f6074c61b0a45331", null ],
|
||||
[ "sorting::shell_sort", "d5/d91/namespacesorting.html#a5669396c6a6b1e14b97589b6e37980aa", null ],
|
||||
[ "sorting::shell_sort", "d5/d91/namespacesorting.html#a4d76603c54d3dc56146e92d10a043924", null ],
|
||||
[ "show_data", "d4/d7a/shell__sort2_8cpp.html#a951127aea9d7e1e53ea9ae0868633246", null ],
|
||||
[ "show_data", "d4/d7a/shell__sort2_8cpp.html#a63aaff7cabfa3da2da8b9477b5fad9d6", null ],
|
||||
[ "test_f", "d4/d7a/shell__sort2_8cpp.html#a22ea0d1f7943ebb4371d31e44b465b6d", null ],
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sorting/shell_sort2.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,14 +124,14 @@ $(function(){initNavTree('d4/d7a/shell__sort2_8cpp_source.html','../../'); initR
|
||||
<div class="headertitle"><div class="title">shell_sort2.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d7a/shell__sort2_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d7a/shell__sort2_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include <cassert></span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include <cstdlib></span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include <ctime></span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <utility></span> <span class="comment">// for std::swap</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include <vector></span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="keyword">template</span> <<span class="keyword">class</span> T></div>
|
||||
<div class="foldopen" id="foldopen00018" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="../../d4/d7a/shell__sort2_8cpp.html#a951127aea9d7e1e53ea9ae0868633246"> 18</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a951127aea9d7e1e53ea9ae0868633246">show_data</a>(T *arr, <span class="keywordtype">size_t</span> LEN) {</div>
|
||||
@@ -143,14 +143,14 @@ $(function(){initNavTree('d4/d7a/shell__sort2_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> std::cout << std::endl;</div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> </div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span></div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keywordtype">size_t</span> N></div>
|
||||
<div class="foldopen" id="foldopen00032" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="../../d4/d7a/shell__sort2_8cpp.html#a63aaff7cabfa3da2da8b9477b5fad9d6"> 32</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a951127aea9d7e1e53ea9ae0868633246">show_data</a>(T (&arr)[N]) {</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a951127aea9d7e1e53ea9ae0868633246">show_data</a>(arr, N);</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span></div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d5/d91/namespacesorting.html">sorting</a> {</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00045" data-start="{" data-end="}">
|
||||
@@ -173,14 +173,14 @@ $(function(){initNavTree('d4/d7a/shell__sort2_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> }</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span></div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keywordtype">size_t</span> N></div>
|
||||
<div class="foldopen" id="foldopen00067" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="../../d5/d91/namespacesorting.html#a4d76603c54d3dc56146e92d10a043924"> 67</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#a5669396c6a6b1e14b97589b6e37980aa">shell_sort</a>(T (&arr)[N]) {</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#a5669396c6a6b1e14b97589b6e37980aa">shell_sort</a>(arr, N);</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span></div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00075" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="../../d5/d91/namespacesorting.html#af2c5b92cbfe73f63f6074c61b0a45331"> 75</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#a5669396c6a6b1e14b97589b6e37980aa">shell_sort</a>(std::vector<T> *arr) {</div>
|
||||
@@ -191,7 +191,7 @@ $(function(){initNavTree('d4/d7a/shell__sort2_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span>} <span class="comment">// namespace sorting</span></div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> </div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span><span class="keyword">using </span><a class="code hl_function" href="../../d5/d91/namespacesorting.html#a5669396c6a6b1e14b97589b6e37980aa">sorting::shell_sort</a>;</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> </div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span></div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00087" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c"> 87</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> *a, <span class="keyword">const</span> <span class="keywordtype">void</span> *b) {</div>
|
||||
@@ -208,7 +208,7 @@ $(function(){initNavTree('d4/d7a/shell__sort2_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="comment">// return arg1 - arg2; // erroneous shortcut (fails if INT_MIN is present)</span></div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> </div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span></div>
|
||||
<div class="foldopen" id="foldopen00105" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"><a class="line" href="../../d4/d7a/shell__sort2_8cpp.html#a895b313cb2671e8f712040460325573e"> 105</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d4c/quick__sort__3_8cpp.html#a07e5c62de28aeddea986890ce7ac1bda">test_int</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> NUM_DATA) {</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="comment">// int array = new int[NUM_DATA];</span></div>
|
||||
@@ -222,7 +222,7 @@ $(function(){initNavTree('d4/d7a/shell__sort2_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> </div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="comment">/* sort using our implementation */</span></div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> std::clock_t start = std::clock();</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> shell_sort(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>, NUM_DATA);</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a5669396c6a6b1e14b97589b6e37980aa">shell_sort</a>(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>, NUM_DATA);</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> std::clock_t end = std::clock();</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordtype">double</span> elapsed_time = <span class="keyword">static_cast<</span><span class="keywordtype">double</span><span class="keyword">></span>(end - start) / CLOCKS_PER_SEC;</div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> std::cout << <span class="stringliteral">"Time spent sorting using shell_sort2: "</span> << elapsed_time</div>
|
||||
@@ -246,7 +246,7 @@ $(function(){initNavTree('d4/d7a/shell__sort2_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keyword">delete</span>[] data2;</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> </div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span></div>
|
||||
<div class="foldopen" id="foldopen00145" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"><a class="line" href="../../d4/d7a/shell__sort2_8cpp.html#a22ea0d1f7943ebb4371d31e44b465b6d"> 145</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a22ea0d1f7943ebb4371d31e44b465b6d">test_f</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> NUM_DATA) {</div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="comment">// int array = new int[NUM_DATA];</span></div>
|
||||
@@ -261,7 +261,7 @@ $(function(){initNavTree('d4/d7a/shell__sort2_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> </div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="comment">/* sort using our implementation */</span></div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> std::clock_t start = std::clock();</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> shell_sort(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>, NUM_DATA);</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a5669396c6a6b1e14b97589b6e37980aa">shell_sort</a>(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>, NUM_DATA);</div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> std::clock_t end = std::clock();</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <span class="keywordtype">double</span> elapsed_time = <span class="keyword">static_cast<</span><span class="keywordtype">double</span><span class="keyword">></span>(end - start) / CLOCKS_PER_SEC;</div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> std::cout << <span class="stringliteral">"Time spent sorting using shell_sort2: "</span> << elapsed_time</div>
|
||||
@@ -285,7 +285,7 @@ $(function(){initNavTree('d4/d7a/shell__sort2_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> <span class="keyword">delete</span>[] data2;</div>
|
||||
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> </div>
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span></div>
|
||||
<div class="foldopen" id="foldopen00183" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"><a class="line" href="../../d4/d7a/shell__sort2_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97"> 183</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[]) {</div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="comment">// initialize random number generator - once per program</span></div>
|
||||
@@ -326,7 +326,7 @@ $(function(){initNavTree('d4/d7a/shell__sort2_8cpp_source.html','../../'); initR
|
||||
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> std::cout << <span class="stringliteral">"Unsorted original data: "</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a951127aea9d7e1e53ea9ae0868633246">show_data</a>(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>, NUM_DATA);</div>
|
||||
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> std::clock_t start = std::clock();</div>
|
||||
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> shell_sort(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>, NUM_DATA); <span class="comment">// perform sorting</span></div>
|
||||
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> <a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a5669396c6a6b1e14b97589b6e37980aa">shell_sort</a>(<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>, NUM_DATA); <span class="comment">// perform sorting</span></div>
|
||||
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> std::clock_t end = std::clock();</div>
|
||||
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> </div>
|
||||
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> std::cout << std::endl</div>
|
||||
@@ -346,6 +346,7 @@ $(function(){initNavTree('d4/d7a/shell__sort2_8cpp_source.html','../../'); initR
|
||||
<div class="ttc" id="anamespacesorting_html_a5669396c6a6b1e14b97589b6e37980aa"><div class="ttname"><a href="../../d5/d91/namespacesorting.html#a5669396c6a6b1e14b97589b6e37980aa">sorting::shell_sort</a></div><div class="ttdeci">void shell_sort(T *arr, size_t LEN)</div><div class="ttdef"><b>Definition</b> <a href="#l00045">shell_sort2.cpp:45</a></div></div>
|
||||
<div class="ttc" id="aquick__sort__3_8cpp_html_a07e5c62de28aeddea986890ce7ac1bda"><div class="ttname"><a href="../../d3/d4c/quick__sort__3_8cpp.html#a07e5c62de28aeddea986890ce7ac1bda">test_int</a></div><div class="ttdeci">static void test_int()</div><div class="ttdef"><b>Definition</b> <a href="../../d3/d4c/quick__sort__3_8cpp_source.html#l00138">quick_sort_3.cpp:138</a></div></div>
|
||||
<div class="ttc" id="ashell__sort2_8cpp_html_a22ea0d1f7943ebb4371d31e44b465b6d"><div class="ttname"><a href="../../d4/d7a/shell__sort2_8cpp.html#a22ea0d1f7943ebb4371d31e44b465b6d">test_f</a></div><div class="ttdeci">void test_f(const int NUM_DATA)</div><div class="ttdef"><b>Definition</b> <a href="#l00145">shell_sort2.cpp:145</a></div></div>
|
||||
<div class="ttc" id="ashell__sort2_8cpp_html_a5669396c6a6b1e14b97589b6e37980aa"><div class="ttname"><a href="../../d4/d7a/shell__sort2_8cpp.html#a5669396c6a6b1e14b97589b6e37980aa">shell_sort</a></div><div class="ttdeci">void shell_sort(T *arr, size_t LEN)</div><div class="ttdef"><b>Definition</b> <a href="#l00045">shell_sort2.cpp:45</a></div></div>
|
||||
<div class="ttc" id="ashell__sort2_8cpp_html_a7eb77daed2cf1513f6d68c47a1c2db1c"><div class="ttname"><a href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a></div><div class="ttdeci">int compare(const void *a, const void *b)</div><div class="ttdef"><b>Definition</b> <a href="#l00087">shell_sort2.cpp:87</a></div></div>
|
||||
<div class="ttc" id="ashell__sort2_8cpp_html_a951127aea9d7e1e53ea9ae0868633246"><div class="ttname"><a href="../../d4/d7a/shell__sort2_8cpp.html#a951127aea9d7e1e53ea9ae0868633246">show_data</a></div><div class="ttdeci">void show_data(T *arr, size_t LEN)</div><div class="ttdef"><b>Definition</b> <a href="#l00018">shell_sort2.cpp:18</a></div></div>
|
||||
<div class="ttc" id="astructcompare_html"><div class="ttname"><a href="../../d1/db3/structcompare.html">compare</a></div><div class="ttdef"><b>Definition</b> <a href="../../d5/d8e/huffman_8cpp_source.html#l00036">huffman.cpp:36</a></div></div>
|
||||
@@ -355,7 +356,7 @@ $(function(){initNavTree('d4/d7a/shell__sort2_8cpp_source.html','../../'); initR
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d4/d7a/shell__sort2_8cpp.html">shell_sort2.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/sum_of_digits.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -307,7 +307,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d4/d83/sum__of__digits_8cpp.html">sum_of_digits.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/sum_of_digits.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,10 +124,10 @@ $(function(){initNavTree('d4/d83/sum__of__digits_8cpp_source.html','../../'); in
|
||||
<div class="headertitle"><div class="title">sum_of_digits.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d83/sum__of__digits_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d83/sum__of__digits_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include <cassert></span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span></div>
|
||||
<div class="foldopen" id="foldopen00023" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="../../d4/d83/sum__of__digits_8cpp.html#a4619c78b6ad985713024f930f31c4395"> 23</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d83/sum__of__digits_8cpp.html#a4619c78b6ad985713024f930f31c4395">sum_of_digits</a>(<span class="keywordtype">int</span> num) {</div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="comment">// If num is negative then negative sign is neglected.</span></div>
|
||||
@@ -142,21 +142,21 @@ $(function(){initNavTree('d4/d83/sum__of__digits_8cpp_source.html','../../'); in
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordflow">return</span> sum;</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span></div>
|
||||
<div class="foldopen" id="foldopen00040" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="../../d4/d83/sum__of__digits_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0"> 40</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d83/sum__of__digits_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a>() {</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordtype">int</span> test_case_1 = <a class="code hl_function" href="../../d4/d83/sum__of__digits_8cpp.html#a4619c78b6ad985713024f930f31c4395">sum_of_digits</a>(119765);</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> assert(test_case_1 == 29);</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> </div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span></div>
|
||||
<div class="foldopen" id="foldopen00049" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="../../d4/d83/sum__of__digits_8cpp.html#a0283886819c7c140a023582b7269e2d0"> 49</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d83/sum__of__digits_8cpp.html#a0283886819c7c140a023582b7269e2d0">test2</a>() {</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordtype">int</span> test_case_2 = <a class="code hl_function" href="../../d4/d83/sum__of__digits_8cpp.html#a4619c78b6ad985713024f930f31c4395">sum_of_digits</a>(-12256);</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> assert(test_case_2 == 16);</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span></div>
|
||||
<div class="foldopen" id="foldopen00058" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="../../d4/d83/sum__of__digits_8cpp.html#ae1a3968e7947464bee7714f6d43b7002"> 58</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d83/sum__of__digits_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>() {</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="comment">// First test.</span></div>
|
||||
@@ -165,7 +165,7 @@ $(function(){initNavTree('d4/d83/sum__of__digits_8cpp_source.html','../../'); in
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <a class="code hl_function" href="../../d4/d83/sum__of__digits_8cpp.html#a0283886819c7c140a023582b7269e2d0">test2</a>();</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> </div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span></div>
|
||||
<div class="foldopen" id="foldopen00068" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="../../d4/d83/sum__of__digits_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 68</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d83/sum__of__digits_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <a class="code hl_function" href="../../d4/d83/sum__of__digits_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>();</div>
|
||||
@@ -184,7 +184,7 @@ $(function(){initNavTree('d4/d83/sum__of__digits_8cpp_source.html','../../'); in
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d4/d83/sum__of__digits_8cpp.html">sum_of_digits.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/large_number.h File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -165,7 +165,7 @@ Classes</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d4/d86/large__number_8h.html">large_number.h</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/large_number.h Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,8 @@ $(function(){initNavTree('d4/d86/large__number_8h_source.html','../../'); initRe
|
||||
<div class="headertitle"><div class="title">large_number.h</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d86/large__number_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d86/large__number_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#ifndef MATH_LARGE_NUMBER_H_</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#define MATH_LARGE_NUMBER_H_</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <algorithm></span></div>
|
||||
@@ -134,9 +135,9 @@ $(function(){initNavTree('d4/d86/large__number_8h_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <type_traits></span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <vector></span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span></div>
|
||||
<div class="foldopen" id="foldopen00024" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html"> 24</a></span><span class="keyword">class </span><a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> {</div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html"> 24</a></span><span class="keyword">class </span><a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> {</div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keyword">public</span>:</div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337"> 27</a></span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a>() { <a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a>.push_back(1); }</div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
|
||||
@@ -148,7 +149,7 @@ $(function(){initNavTree('d4/d86/large__number_8h_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="comment">// carry /= 10;</span></div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="comment">// } while (carry != 0);</span></div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="comment">// }</span></div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span></div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#af4598f1f2794b5e17e10c25e0501e41a"> 39</a></span> <span class="keyword">explicit</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#af4598f1f2794b5e17e10c25e0501e41a">large_number</a>(<span class="keywordtype">int</span> n) {</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordtype">int</span> carry = n;</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">do</span> {</div>
|
||||
@@ -156,13 +157,13 @@ $(function(){initNavTree('d4/d86/large__number_8h_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> carry /= 10;</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> } <span class="keywordflow">while</span> (carry != 0);</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> }</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> </div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span></div>
|
||||
<div class="foldopen" id="foldopen00048" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a0b1efd203274e38a67b78937dfb9b872"> 48</a></span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a0b1efd203274e38a67b78937dfb9b872">large_number</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> &a) : <a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a>(a.<a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a>) {}</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> </div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a0b1efd203274e38a67b78937dfb9b872"> 48</a></span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a0b1efd203274e38a67b78937dfb9b872">large_number</a>(<span class="keyword">const</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> &a) : <a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a>(a.<a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a>) {}</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span></div>
|
||||
<div class="foldopen" id="foldopen00051" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a76ddf1ed1b00fb8c107ea56f7f91e42f"> 51</a></span> <span class="keyword">explicit</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a76ddf1ed1b00fb8c107ea56f7f91e42f">large_number</a>(std::vector<unsigned char> &vec) : <a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a>(vec) {}</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span></div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keyword">explicit</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a>(<span class="keywordtype">char</span> <span class="keyword">const</span> *number_str) {</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = strlen(number_str); i > 0; i--) {</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordtype">char</span> a = number_str[i - 1] - <span class="charliteral">'0'</span>;</div>
|
||||
@@ -170,12 +171,12 @@ $(function(){initNavTree('d4/d86/large__number_8h_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a>.push_back(a);</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> }</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> }</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span></div>
|
||||
<div class="foldopen" id="foldopen00065" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a959c5c1a982949bbf98e1ea0f9afe6a9"> 65</a></span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a959c5c1a982949bbf98e1ea0f9afe6a9">test</a>() {</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> std::cout << <span class="stringliteral">"------ Checking `large_number` class implementations\t"</span></div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> a(40);</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> a(40);</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="comment">// 1. test multiplication</span></div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> a *= 10;</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordflow">if</span> (a != <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a>(400)) {</div>
|
||||
@@ -222,7 +223,7 @@ $(function(){initNavTree('d4/d86/large__number_8h_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> </div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span></div>
|
||||
<div class="foldopen" id="foldopen00118" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a60c436d1a1c5e3795d6177d3815ad615"> 118</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a60c436d1a1c5e3795d6177d3815ad615">add_digit</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> value) {</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordflow">if</span> (value > 9) {</div>
|
||||
@@ -233,25 +234,25 @@ $(function(){initNavTree('d4/d86/large__number_8h_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a>.push_back(value);</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> </div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span></div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#ac09a05ec4aafb4d9e0b4440d6f0e2a93"> 130</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#ac09a05ec4aafb4d9e0b4440d6f0e2a93">num_digits</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a>.size(); }</div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> </div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span></div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a8c381aa1ecc960cefd82ec72f59e0e08"> 137</a></span> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> &<a class="code hl_function" href="../../db/d82/classlarge__number.html#a8c381aa1ecc960cefd82ec72f59e0e08">operator[]</a>(<span class="keywordtype">size_t</span> n) { <span class="keywordflow">return</span> this-><a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a>[n]; }</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> </div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <span class="keyword">inline</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> &<a class="code hl_function" href="../../db/d82/classlarge__number.html#a8c381aa1ecc960cefd82ec72f59e0e08">operator[]</a>(<span class="keywordtype">size_t</span> n)<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keywordflow">return</span> this-><a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a>[n];</div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> }</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> </div>
|
||||
<div class="foldopen" id="foldopen00146" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a13282908dfc4888392ed3d1fc6aae492"> 146</a></span> <span class="keyword">friend</span> std::ostream &<a class="code hl_friend" href="../../db/d82/classlarge__number.html#a13282908dfc4888392ed3d1fc6aae492">operator<<</a>(std::ostream &out, <span class="keyword">const</span> <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> &a) {</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span></div>
|
||||
<div class="foldopen" id="foldopen00146" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a13282908dfc4888392ed3d1fc6aae492"> 146</a></span> <span class="keyword">friend</span> std::ostream &<a class="code hl_friend" href="../../db/d82/classlarge__number.html#a13282908dfc4888392ed3d1fc6aae492">operator<<</a>(std::ostream &out, <span class="keyword">const</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> &a) {</div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = a.num_digits(); i > 0; i--)</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> out << static_cast<int>(a[i - 1]);</div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordflow">return</span> out;</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> </div>
|
||||
<div class="foldopen" id="foldopen00155" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a7ba872b9a3ce1f3da6c06c5409663cca"> 155</a></span> <span class="keyword">friend</span> <span class="keywordtype">bool</span> <a class="code hl_friend" href="../../db/d82/classlarge__number.html#a7ba872b9a3ce1f3da6c06c5409663cca">operator==</a>(<a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> <span class="keyword">const</span> &a, <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> <span class="keyword">const</span> &b) {</div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span></div>
|
||||
<div class="foldopen" id="foldopen00155" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a7ba872b9a3ce1f3da6c06c5409663cca"> 155</a></span> <span class="keyword">friend</span> <span class="keywordtype">bool</span> <a class="code hl_friend" href="../../db/d82/classlarge__number.html#a7ba872b9a3ce1f3da6c06c5409663cca">operator==</a>(<a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> <span class="keyword">const</span> &a, <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> <span class="keyword">const</span> &b) {</div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keywordtype">size_t</span> N = a.num_digits();</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <span class="keywordflow">if</span> (N != b.<a class="code hl_function" href="../../db/d82/classlarge__number.html#ac09a05ec4aafb4d9e0b4440d6f0e2a93">num_digits</a>())</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
@@ -261,32 +262,32 @@ $(function(){initNavTree('d4/d86/large__number_8h_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> </div>
|
||||
<div class="foldopen" id="foldopen00168" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a72ae1ef050c4c28c50952ecab22d4b94"> 168</a></span> <span class="keyword">friend</span> <span class="keywordtype">bool</span> <a class="code hl_friend" href="../../db/d82/classlarge__number.html#a72ae1ef050c4c28c50952ecab22d4b94">operator!=</a>(<a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> <span class="keyword">const</span> &a, <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> <span class="keyword">const</span> &b) {</div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span></div>
|
||||
<div class="foldopen" id="foldopen00168" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a72ae1ef050c4c28c50952ecab22d4b94"> 168</a></span> <span class="keyword">friend</span> <span class="keywordtype">bool</span> <a class="code hl_friend" href="../../db/d82/classlarge__number.html#a72ae1ef050c4c28c50952ecab22d4b94">operator!=</a>(<a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> <span class="keyword">const</span> &a, <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> <span class="keyword">const</span> &b) {</div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <span class="keywordflow">return</span> !(a == b);</div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> </div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span></div>
|
||||
<div class="foldopen" id="foldopen00175" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a4757697b1f7584b69e779a72abc4ae2a"> 175</a></span> <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> &<a class="code hl_function" href="../../db/d82/classlarge__number.html#a4757697b1f7584b69e779a72abc4ae2a">operator++</a>() {</div>
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a4757697b1f7584b69e779a72abc4ae2a"> 175</a></span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> &<a class="code hl_function" href="../../db/d82/classlarge__number.html#a4757697b1f7584b69e779a72abc4ae2a">operator++</a>() {</div>
|
||||
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> (*this) += 1;</div>
|
||||
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
|
||||
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> </div>
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span></div>
|
||||
<div class="foldopen" id="foldopen00183" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a8d4364ee5a62964451d8cfee82649687"> 183</a></span> <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> &<a class="code hl_function" href="../../db/d82/classlarge__number.html#a8d4364ee5a62964451d8cfee82649687">operator++</a>(<span class="keywordtype">int</span>) {</div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="keyword">static</span> <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> tmp(<a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a>);</div>
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a8d4364ee5a62964451d8cfee82649687"> 183</a></span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> &<a class="code hl_function" href="../../db/d82/classlarge__number.html#a8d4364ee5a62964451d8cfee82649687">operator++</a>(<span class="keywordtype">int</span>) {</div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="keyword">static</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> tmp(<a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a>);</div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> ++(*this);</div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <span class="keywordflow">return</span> tmp;</div>
|
||||
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> </div>
|
||||
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span></div>
|
||||
<div class="foldopen" id="foldopen00192" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#aab5644405094740e34983cedfecb36cf"> 192</a></span> <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> &<a class="code hl_function" href="../../db/d82/classlarge__number.html#aab5644405094740e34983cedfecb36cf">operator+=</a>(<a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> n) {</div>
|
||||
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#aab5644405094740e34983cedfecb36cf"> 192</a></span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> &<a class="code hl_function" href="../../db/d82/classlarge__number.html#aab5644405094740e34983cedfecb36cf">operator+=</a>(<a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> n) {</div>
|
||||
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> <span class="comment">// if adding with another large_number</span></div>
|
||||
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> *b = <span class="keyword">reinterpret_cast<</span><a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> *<span class="keyword">></span>(&n);</div>
|
||||
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> *b = <span class="keyword">reinterpret_cast<</span><a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> *<span class="keyword">></span>(&n);</div>
|
||||
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> max_L = std::max(this-><a class="code hl_function" href="../../db/d82/classlarge__number.html#ac09a05ec4aafb4d9e0b4440d6f0e2a93">num_digits</a>(), b-><a class="code hl_function" href="../../db/d82/classlarge__number.html#ac09a05ec4aafb4d9e0b4440d6f0e2a93">num_digits</a>());</div>
|
||||
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> carry = 0;</div>
|
||||
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> <span class="keywordtype">size_t</span> i;</div>
|
||||
@@ -308,33 +309,33 @@ $(function(){initNavTree('d4/d86/large__number_8h_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> &<a class="code hl_function" href="../../db/d82/classlarge__number.html#aab5644405094740e34983cedfecb36cf">operator+=</a>(<span class="keywordtype">int</span> n) { <span class="keywordflow">return</span> (*<span class="keyword">this</span>) += <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a>(n); }</div>
|
||||
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> <span class="comment">// large_number &operator+=(uint64_t n) { return (*this) += large_number(n);</span></div>
|
||||
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> <span class="comment">// }</span></div>
|
||||
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> </div>
|
||||
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span></div>
|
||||
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
|
||||
<div class="foldopen" id="foldopen00220" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#abbd52948bee1b16543f1dae19aa9dd46"> 220</a></span> <span class="keyword">friend</span> <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> &<a class="code hl_friend" href="../../db/d82/classlarge__number.html#abbd52948bee1b16543f1dae19aa9dd46">operator+</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> &a, <span class="keyword">const</span> T &b) {</div>
|
||||
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> <span class="keyword">static</span> <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> c = a;</div>
|
||||
<div class="foldopen" id="foldopen00220" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#abbd52948bee1b16543f1dae19aa9dd46"> 220</a></span> <span class="keyword">friend</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> &<a class="code hl_friend" href="../../db/d82/classlarge__number.html#abbd52948bee1b16543f1dae19aa9dd46">operator+</a>(<span class="keyword">const</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> &a, <span class="keyword">const</span> T &b) {</div>
|
||||
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> <span class="keyword">static</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> c = a;</div>
|
||||
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> c += b;</div>
|
||||
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> <span class="keywordflow">return</span> c;</div>
|
||||
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> </div>
|
||||
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span></div>
|
||||
<div class="foldopen" id="foldopen00229" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#ab84f29685709cbb3b6fd29b7b4a7bc7b"> 229</a></span> <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> &<a class="code hl_function" href="../../db/d82/classlarge__number.html#ab84f29685709cbb3b6fd29b7b4a7bc7b">operator=</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> &b) {</div>
|
||||
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#ab84f29685709cbb3b6fd29b7b4a7bc7b"> 229</a></span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> &<a class="code hl_function" href="../../db/d82/classlarge__number.html#ab84f29685709cbb3b6fd29b7b4a7bc7b">operator=</a>(<span class="keyword">const</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> &b) {</div>
|
||||
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> this-><a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a> = b.<a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a>;</div>
|
||||
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
|
||||
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> </div>
|
||||
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span></div>
|
||||
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
|
||||
<div class="foldopen" id="foldopen00238" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a771e9b28cfddf1ad94668566e396e350"> 238</a></span> <a class="code hl_class" href="../../db/d82/classlarge__number.html">large_number</a> &<a class="code hl_function" href="../../db/d82/classlarge__number.html#a771e9b28cfddf1ad94668566e396e350">operator*=</a>(<span class="keyword">const</span> T n) {</div>
|
||||
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#a771e9b28cfddf1ad94668566e396e350"> 238</a></span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#a10119a83839e65962621b73df46a5337">large_number</a> &<a class="code hl_function" href="../../db/d82/classlarge__number.html#a771e9b28cfddf1ad94668566e396e350">operator*=</a>(<span class="keyword">const</span> T n) {</div>
|
||||
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> <span class="keyword">static_assert</span>(std::is_integral<T>::value,</div>
|
||||
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> <span class="stringliteral">"Must be integer addition unsigned integer types."</span>);</div>
|
||||
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> this-><a class="code hl_function" href="../../db/d82/classlarge__number.html#a2f5571e66305cf68bb8283e4aeda58bc">multiply</a>(n);</div>
|
||||
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
|
||||
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> </div>
|
||||
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span></div>
|
||||
<div class="foldopen" id="foldopen00248" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"><a class="line" href="../../db/d82/classlarge__number.html#ae35a55607cf52c0b0d485f2129bd39ac"> 248</a></span> <span class="keywordtype">char</span> <a class="code hl_function" href="../../db/d82/classlarge__number.html#ae35a55607cf52c0b0d485f2129bd39ac">digit_char</a>(<span class="keywordtype">size_t</span> i)<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> <span class="keywordflow">return</span> <a class="code hl_variable" href="../../db/d82/classlarge__number.html#af2b3ec9c35842d3a46ac7326f268af57">_digits</a>[<a class="code hl_function" href="../../db/d82/classlarge__number.html#ac09a05ec4aafb4d9e0b4440d6f0e2a93">num_digits</a>() - i - 1] + <span class="charliteral">'0'</span>;</div>
|
||||
@@ -406,7 +407,7 @@ $(function(){initNavTree('d4/d86/large__number_8h_source.html','../../'); initRe
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d4/d86/large__number_8h.html">large_number.h</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: others/lru_cache2.cpp Pages: 1 -->
|
||||
<svg width="292pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: others/lru_cache2.cpp Pages: 1 -->
|
||||
<svg width="292pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: bit_manipulation/gray_code.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,12 +124,13 @@ $(function(){initNavTree('d4/d8b/gray__code_8cpp_source.html','../../'); initRes
|
||||
<div class="headertitle"><div class="title">gray_code.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include <bitset></span> </div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d7/d81/namespacebit__manipulation.html">bit_manipulation</a> {</div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../de/d9b/namespacegray__code.html">gray_code</a> {</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span>std::vector<std::bitset<32>> gray_code_generation(<span class="keywordtype">int</span> n) {</div>
|
||||
@@ -151,8 +152,8 @@ $(function(){initNavTree('d4/d8b/gray__code_8cpp_source.html','../../'); initRes
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span>} </div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span>} <span class="comment">// namespace gray_code</span></div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span>} <span class="comment">// namespace bit_manipulation</span></div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="keyword">static</span> <span class="keywordtype">void</span> test() { </div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span></div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() { </div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> std::vector<std::bitset<32>> gray_code_negative_1 = {};</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> std::vector<std::bitset<32>> gray_code_0 = {};</div>
|
||||
@@ -199,11 +200,12 @@ $(function(){initNavTree('d4/d8b/gray__code_8cpp_source.html','../../'); initRes
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> assert(bit_manipulation::gray_code::gray_code_generation(4) == gray_code_4);</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> assert(bit_manipulation::gray_code::gray_code_generation(5) == gray_code_5);</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span>}</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> </div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span></div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span><span class="keywordtype">int</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> test(); <span class="comment">//Run self-test implementation</span></div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">//Run self-test implementation</span></div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span>}</div>
|
||||
<div class="ttc" id="agenerate__parentheses_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d1e/generate__parentheses_8cpp_source.html#l00082">generate_parentheses.cpp:82</a></div></div>
|
||||
<div class="ttc" id="agenerate__parentheses_8cpp_html_gae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d1e/generate__parentheses_8cpp_source.html#l00110">generate_parentheses.cpp:110</a></div></div>
|
||||
<div class="ttc" id="anamespacebit__manipulation_html"><div class="ttname"><a href="../../d7/d81/namespacebit__manipulation.html">bit_manipulation</a></div><div class="ttdoc">for assert</div></div>
|
||||
<div class="ttc" id="anamespacegray__code_html"><div class="ttname"><a href="../../de/d9b/namespacegray__code.html">gray_code</a></div><div class="ttdoc">Generate n-bit Gray code.</div></div>
|
||||
@@ -213,7 +215,7 @@ $(function(){initNavTree('d4/d8b/gray__code_8cpp_source.html','../../'); initRes
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_f3c4fbc4e901afa0a54d0623c5574aa7.html">bit_manipulation</a></li><li class="navelem"><b>gray_code.cpp</b></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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: geometry/jarvis_algorithm.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -221,7 +221,7 @@ Algorithm</h3>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -261,7 +261,7 @@ Algorithm</h3>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_e3380d2178455503f266746fb14246a5.html">geometry</a></li><li class="navelem"><a class="el" href="../../d4/d8d/jarvis__algorithm_8cpp.html">jarvis_algorithm.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: geometry/jarvis_algorithm.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,11 +124,12 @@ $(function(){initNavTree('d4/d8d/jarvis__algorithm_8cpp_source.html','../../');
|
||||
<div class="headertitle"><div class="title">jarvis_algorithm.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d8d/jarvis__algorithm_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d8d/jarvis__algorithm_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="preprocessor">#include <vector></span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="preprocessor">#include <cassert></span></div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span></div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d5/d5f/namespacegeometry.html">geometry</a> {</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keyword">namespace </span><a class="code hl_namespace" href="../../d5/da7/namespacejarvis.html">jarvis</a> {</div>
|
||||
<div class="foldopen" id="foldopen00047" data-start="{" data-end="};">
|
||||
@@ -136,9 +137,9 @@ $(function(){initNavTree('d4/d8d/jarvis__algorithm_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordtype">int</span> x, y;</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> };</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span></div>
|
||||
<div class="foldopen" id="foldopen00055" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="../../d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html"> 55</a></span> <span class="keyword">class </span><a class="code hl_class" href="../../d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html">Convexhull</a> {</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="../../d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html"> 55</a></span> <span class="keyword">class </span><a class="code hl_function" href="../../d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html#a8306e48040a8570e164c58d1c530f870">Convexhull</a> {</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> std::vector<Point> points;</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keywordtype">int</span> size;</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> </div>
|
||||
@@ -149,7 +150,7 @@ $(function(){initNavTree('d4/d8d/jarvis__algorithm_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> size = points.size();</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span></div>
|
||||
<div class="foldopen" id="foldopen00078" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="../../d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html#aeec46e86786ddd461464b07a77c4d5f1"> 78</a></span> std::vector<Point> <a class="code hl_function" href="../../d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html#aeec46e86786ddd461464b07a77c4d5f1">getConvexHull</a>()<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="comment">// Initialize Result</span></div>
|
||||
@@ -194,7 +195,7 @@ $(function(){initNavTree('d4/d8d/jarvis__algorithm_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">return</span> hull;</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> </div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span></div>
|
||||
<div class="foldopen" id="foldopen00133" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="../../d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html#a54df5f9a8f37170bd97c91127664655c"> 133</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html#a54df5f9a8f37170bd97c91127664655c">orientation</a>(<span class="keyword">const</span> <a class="code hl_struct" href="../../d9/d5a/structgeometry_1_1jarvis_1_1_point.html">Point</a> &p, <span class="keyword">const</span> <a class="code hl_struct" href="../../d9/d5a/structgeometry_1_1jarvis_1_1_point.html">Point</a> &q, <span class="keyword">const</span> <a class="code hl_struct" href="../../d9/d5a/structgeometry_1_1jarvis_1_1_point.html">Point</a> &r) {</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordtype">int</span> val = (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);</div>
|
||||
@@ -211,7 +212,7 @@ $(function(){initNavTree('d4/d8d/jarvis__algorithm_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> </div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> } <span class="comment">// namespace jarvis</span></div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span>} <span class="comment">// namespace geometry</span></div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> </div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span></div>
|
||||
<div class="foldopen" id="foldopen00151" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"><a class="line" href="../../d4/d8d/jarvis__algorithm_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 151</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d8d/jarvis__algorithm_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> std::vector<geometry::jarvis::Point> points = {{0, 3},</div>
|
||||
@@ -237,7 +238,7 @@ $(function(){initNavTree('d4/d8d/jarvis__algorithm_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> std::cout << <span class="stringliteral">"Test implementations passed!\n"</span>;</div>
|
||||
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> </div>
|
||||
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span></div>
|
||||
<div class="foldopen" id="foldopen00176" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"><a class="line" href="../../d4/d8d/jarvis__algorithm_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 176</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d8d/jarvis__algorithm_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <a class="code hl_function" href="../../d4/d8d/jarvis__algorithm_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>();</div>
|
||||
@@ -259,7 +260,7 @@ $(function(){initNavTree('d4/d8d/jarvis__algorithm_8cpp_source.html','../../');
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_e3380d2178455503f266746fb14246a5.html">geometry</a></li><li class="navelem"><a class="el" href="../../d4/d8d/jarvis__algorithm_8cpp.html">jarvis_algorithm.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
148
d4/d8f/classstats__computer1-members.html
Normal file
@@ -0,0 +1,148 @@
|
||||
<!-- 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>
|
||||
<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.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</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>
|
||||
<script type="text/javascript" src="../../navtree.js"></script>
|
||||
<script type="text/javascript" src="../../resize.js"></script>
|
||||
<script type="text/javascript" src="../../cookie.js"></script>
|
||||
<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/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" 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! -->
|
||||
<div id="titlearea">
|
||||
<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">TheAlgorithms/C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">All the algorithms implemented in C++</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(1); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="../../menudata.js"></script>
|
||||
<script type="text/javascript" src="../../menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('../../',true,false,'search.php','Search',true);
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||
<div id="nav-tree">
|
||||
<div id="nav-tree-contents">
|
||||
<div id="nav-sync" class="sync"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="splitbar" style="-moz-user-select:none;"
|
||||
class="ui-resizable-handle">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function(){initNavTree('d2/d0f/classstats__computer1.html','../../'); initResizable(true); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="doc-content">
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<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">
|
||||
<div class="headertitle"><div class="title">stats_computer1< T > Member List</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>This is the complete list of members for <a class="el" href="../../d2/d0f/classstats__computer1.html">stats_computer1< T ></a>, including all inherited members.</p>
|
||||
<table class="directory">
|
||||
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Ex</b> (defined in <a class="el" href="../../d2/d0f/classstats__computer1.html">stats_computer1< T ></a>)</td><td class="entry"><a class="el" href="../../d2/d0f/classstats__computer1.html">stats_computer1< T ></a></td><td class="entry"><span class="mlabel">private</span></td></tr>
|
||||
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>Ex2</b> (defined in <a class="el" href="../../d2/d0f/classstats__computer1.html">stats_computer1< T ></a>)</td><td class="entry"><a class="el" href="../../d2/d0f/classstats__computer1.html">stats_computer1< T ></a></td><td class="entry"><span class="mlabel">private</span></td></tr>
|
||||
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>K</b> (defined in <a class="el" href="../../d2/d0f/classstats__computer1.html">stats_computer1< T ></a>)</td><td class="entry"><a class="el" href="../../d2/d0f/classstats__computer1.html">stats_computer1< T ></a></td><td class="entry"><span class="mlabel">private</span></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d2/d0f/classstats__computer1.html#a390697dcee210b91823ceff04b25081b">mean</a>() const</td><td class="entry"><a class="el" href="../../d2/d0f/classstats__computer1.html">stats_computer1< T ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
|
||||
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>n</b> (defined in <a class="el" href="../../d2/d0f/classstats__computer1.html">stats_computer1< T ></a>)</td><td class="entry"><a class="el" href="../../d2/d0f/classstats__computer1.html">stats_computer1< T ></a></td><td class="entry"><span class="mlabel">private</span></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d2/d0f/classstats__computer1.html#aa13bf7c38de112f71921a5525d71a2f2">new_val</a>(T x)</td><td class="entry"><a class="el" href="../../d2/d0f/classstats__computer1.html">stats_computer1< T ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d2/d0f/classstats__computer1.html#a350bf6c429691d3578c4dfc6679a0797">operator>></a>(std::istream &input, stats_computer1 &stat)</td><td class="entry"><a class="el" href="../../d2/d0f/classstats__computer1.html">stats_computer1< T ></a></td><td class="entry"><span class="mlabel">friend</span></td></tr>
|
||||
<tr class="odd"><td class="entry"><a class="el" href="../../d2/d0f/classstats__computer1.html#af57e942d49f4fd70f059f224b4ac07e1">std</a>() const</td><td class="entry"><a class="el" href="../../d2/d0f/classstats__computer1.html">stats_computer1< T ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
|
||||
<tr class="even"><td class="entry"><a class="el" href="../../d2/d0f/classstats__computer1.html#a27f0a03e2fd2254f1c81fe668226bd92">variance</a>() const</td><td class="entry"><a class="el" href="../../d2/d0f/classstats__computer1.html">stats_computer1< T ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
|
||||
</table></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: bit_manipulation/travelling_salesman_using_bit_manipulation.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -219,7 +219,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -333,14 +333,14 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 80</span> 0) { <span class="comment">// this means that this perticular city is not visited.</span></div>
|
||||
<div class="line"><span class="lineno"> 81</span> std::uint64_t subProb =</div>
|
||||
<div class="line"><span class="lineno"> 82</span> dist[city][choice] +</div>
|
||||
<div class="line"><span class="lineno"> 83</span> <a class="code hl_function" href="#ad08f082be02c3437c2fe89cb035fcee1">travelling_salesman_using_bit_manipulation</a>(</div>
|
||||
<div class="line"><span class="lineno"> 83</span> travelling_salesman_using_bit_manipulation(</div>
|
||||
<div class="line"><span class="lineno"> 84</span> dist, setOfCities | (1 << choice), choice, n, <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>);</div>
|
||||
<div class="line"><span class="lineno"> 85</span> <span class="comment">// Here we are doing a recursive call to tsp with the updated set of</span></div>
|
||||
<div class="line"><span class="lineno"> 86</span> <span class="comment">// city/node and choice which tells that where we are currently.</span></div>
|
||||
<div class="line"><span class="lineno"> 87</span> ans = std::min(ans, subProb);</div>
|
||||
<div class="line"><span class="lineno"> 88</span> }</div>
|
||||
<div class="line"><span class="lineno"> 89</span> }</div>
|
||||
<div class="line"><span class="lineno"> 90</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[setOfCities][city] = ans;</div>
|
||||
<div class="line"><span class="lineno"> 90</span> dp[setOfCities][city] = ans;</div>
|
||||
<div class="line"><span class="lineno"> 91</span> <span class="keywordflow">return</span> ans;</div>
|
||||
<div class="line"><span class="lineno"> 92</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
@@ -352,7 +352,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_f3c4fbc4e901afa0a54d0623c5574aa7.html">bit_manipulation</a></li><li class="navelem"><a class="el" href="../../d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html">travelling_salesman_using_bit_manipulation.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -2,5 +2,5 @@ var travelling__salesman__using__bit__manipulation_8cpp =
|
||||
[
|
||||
[ "main", "d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test", "d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ],
|
||||
[ "travelling_salesman_using_bit_manipulation", "d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html#ad08f082be02c3437c2fe89cb035fcee1", null ]
|
||||
[ "bit_manipulation::travelling_salesman_using_bit_manipulation::travelling_salesman_using_bit_manipulation", "d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html#ad08f082be02c3437c2fe89cb035fcee1", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: bit_manipulation/travelling_salesman_using_bit_manipulation.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,16 +124,16 @@ $(function(){initNavTree('d4/d8f/travelling__salesman__using__bit__manipulation_
|
||||
<div class="headertitle"><div class="title">travelling_salesman_using_bit_manipulation.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include <algorithm></span> </div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#include <limits></span> </div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> </div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span></div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d7/d81/namespacebit__manipulation.html">bit_manipulation</a> {</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="keyword">namespace </span><a class="code hl_function" href="../../d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html#ad08f082be02c3437c2fe89cb035fcee1">travelling_salesman_using_bit_manipulation</a> {</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="keyword">namespace </span>travelling_salesman_using_bit_manipulation {</div>
|
||||
<div class="foldopen" id="foldopen00053" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="../../d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html#ad08f082be02c3437c2fe89cb035fcee1"> 53</a></span>std::uint64_t <a class="code hl_function" href="../../d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html#ad08f082be02c3437c2fe89cb035fcee1">travelling_salesman_using_bit_manipulation</a>(</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> std::vector<std::vector<uint32_t>></div>
|
||||
@@ -178,7 +178,7 @@ $(function(){initNavTree('d4/d8f/travelling__salesman__using__bit__manipulation_
|
||||
</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span>} <span class="comment">// namespace travelling_salesman_using_bit_manipulation</span></div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span>} <span class="comment">// namespace bit_manipulation</span></div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> </div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span></div>
|
||||
<div class="foldopen" id="foldopen00100" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="../../d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 100</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="comment">// 1st test-case</span></div>
|
||||
@@ -215,7 +215,7 @@ $(function(){initNavTree('d4/d8f/travelling__salesman__using__bit__manipulation_
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> </div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span></div>
|
||||
<div class="foldopen" id="foldopen00139" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"><a class="line" href="../../d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 139</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <a class="code hl_function" href="../../d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -233,7 +233,7 @@ $(function(){initNavTree('d4/d8f/travelling__salesman__using__bit__manipulation_
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_f3c4fbc4e901afa0a54d0623c5574aa7.html">bit_manipulation</a></li><li class="navelem"><a class="el" href="../../d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html">travelling_salesman_using_bit_manipulation.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: data_structures::SkipList Class Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -181,7 +181,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -218,7 +218,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -283,7 +283,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -293,16 +293,16 @@ Private Attributes</h2></td></tr>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 191</span> {</div>
|
||||
<div class="line"><span class="lineno"> 192</span> std::cout << <span class="stringliteral">"Displaying list:\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 193</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i <= <a class="code hl_variable" href="#a3e249c2c35a8b7f5ffd2d77fee60d650">level</a>; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 194</span> std::shared_ptr<Node> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = <a class="code hl_variable" href="#ad7e392386d7db622185d6f7c718e4f16">header</a>->forward[i];</div>
|
||||
<div class="line"><span class="lineno"> 194</span> std::shared_ptr<Node> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> = <a class="code hl_variable" href="#ad7e392386d7db622185d6f7c718e4f16">header</a>->forward[i];</div>
|
||||
<div class="line"><span class="lineno"> 195</span> std::cout << <span class="stringliteral">"Level "</span> << (i) << <span class="stringliteral">": "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 196</span> <span class="keywordflow">while</span> (<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> != <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><span class="lineno"> 197</span> std::cout << <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->key << <span class="stringliteral">" "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 198</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->forward[i];</div>
|
||||
<div class="line"><span class="lineno"> 196</span> <span class="keywordflow">while</span> (<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> != <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><span class="lineno"> 197</span> std::cout << <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->key << <span class="stringliteral">" "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 198</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->forward[i];</div>
|
||||
<div class="line"><span class="lineno"> 199</span> }</div>
|
||||
<div class="line"><span class="lineno"> 200</span> std::cout << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 201</span> }</div>
|
||||
<div class="line"><span class="lineno"> 202</span> }</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 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>
|
||||
@@ -328,7 +328,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -401,7 +401,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -438,7 +438,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -487,7 +487,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -513,7 +513,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -533,7 +533,7 @@ Private Attributes</h2></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"><a class="el" href="../../d4/d90/classdata__structures_1_1_skip_list.html">SkipList</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: vector_cross Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d4/d91/namespacevector__cross.html','../../'); initRes
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d4/d91/namespacevector__cross.html">vector_cross</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: data_structures::Bitset Pages: 1 -->
|
||||
<svg width="134pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: data_structures::Bitset Pages: 1 -->
|
||||
<svg width="134pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/primes_up_to_billion.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -246,7 +246,7 @@ Variables</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d4/d9c/primes__up__to__billion_8cpp.html">primes_up_to_billion.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||