Documentation for 53a6c16730

This commit is contained in:
github-actions
2022-01-16 16:05:19 +00:00
parent 778f1be9e5
commit 2cab28c905
3620 changed files with 52045 additions and 41188 deletions

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: machine_learning::aystar_search::AyStarSearch&lt; Puzzle &gt; Class Template Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -103,6 +103,12 @@ $(document).ready(function(){initNavTree('da/d02/classmachine__learning_1_1aysta
<p>A class defining <a href="https://en.wikipedia.org/wiki/A*_search_algorithm" target="_blank">A* search algorithm</a>. for some initial state and final state.
<a href="../../da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html#details">More...</a></p>
<div class="dynheader">
Collaboration diagram for machine_learning::aystar_search::AyStarSearch&lt; Puzzle &gt;:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d7/db3/classmachine__learning_1_1aystar__search_1_1_ay_star_search__coll__graph.svg" width="184" height="408"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="../../graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
@@ -178,7 +184,7 @@ template&lt;typename Puzzle &gt; </div>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html">machine_learning::aystar_search::AyStarSearch</a>&lt; Puzzle &gt;::<a class="el" href="../../da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html">AyStarSearch</a> </td>
<td class="memname"><a class="el" href="../../da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html">machine_learning::aystar_search::AyStarSearch</a>&lt; Puzzle &gt;::AyStarSearch </td>
<td>(</td>
<td class="paramtype">const Puzzle &amp;&#160;</td>
<td class="paramname"><em>initial</em>, </td>
@@ -210,10 +216,10 @@ template&lt;typename Puzzle &gt; </div>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a id="l00392" name="l00392"></a><span class="lineno"> 392</span> {</div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno"> 393</span> Initial = std::make_shared&lt;Info&gt;(initial);</div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno"> 394</span> Final = std::make_shared&lt;Info&gt;(<span class="keyword">final</span>);</div>
<div class="line"><a id="l00395" name="l00395"></a><span class="lineno"> 395</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 392</span> {</div>
<div class="line"><span class="lineno"> 393</span> Initial = std::make_shared&lt;Info&gt;(initial);</div>
<div class="line"><span class="lineno"> 394</span> Final = std::make_shared&lt;Info&gt;(<span class="keyword">final</span>);</div>
<div class="line"><span class="lineno"> 395</span> }</div>
</div><!-- fragment -->
</div>
</div>
@@ -265,101 +271,101 @@ template&lt;typename Puzzle &gt; </div>
<p >Stores the g_score</p>
<p >Stores the list to explore</p>
<p >Stores the list that are explored</p>
<div class="fragment"><div class="line"><a id="l00431" name="l00431"></a><span class="lineno"> 431</span> {</div>
<div class="line"><a id="l00432" name="l00432"></a><span class="lineno"> 432</span> MapOfPuzzleInfoWithPuzzleInfo</div>
<div class="line"><a id="l00433" name="l00433"></a><span class="lineno"> 433</span> parent_of; <span class="comment">/// Stores the parent of the states</span></div>
<div class="line"><a id="l00434" name="l00434"></a><span class="lineno"> 434</span> MapOfPuzzleInfoWithInteger g_score; <span class="comment">/// Stores the g_score</span></div>
<div class="line"><a id="l00435" name="l00435"></a><span class="lineno"> 435</span> SetOfPuzzleInfo open_list; <span class="comment">/// Stores the list to explore</span></div>
<div class="line"><a id="l00436" name="l00436"></a><span class="lineno"> 436</span> SetOfPuzzleInfo closed_list; <span class="comment">/// Stores the list that are explored</span></div>
<div class="line"><a id="l00437" name="l00437"></a><span class="lineno"> 437</span> </div>
<div class="line"><a id="l00438" name="l00438"></a><span class="lineno"> 438</span> <span class="comment">// Before starting the AyStartSearch, initialize the set and maps</span></div>
<div class="line"><a id="l00439" name="l00439"></a><span class="lineno"> 439</span> open_list.emplace(Initial);</div>
<div class="line"><a id="l00440" name="l00440"></a><span class="lineno"> 440</span> parent_of[Initial] = <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00441" name="l00441"></a><span class="lineno"> 441</span> g_score[Initial] = 0;</div>
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno"> 442</span> </div>
<div class="line"><a id="l00443" name="l00443"></a><span class="lineno"> 443</span> <span class="keywordflow">while</span> (!open_list.empty()) {</div>
<div class="line"><a id="l00444" name="l00444"></a><span class="lineno"> 444</span> <span class="comment">// Iterator for state having having lowest f_score.</span></div>
<div class="line"><a id="l00445" name="l00445"></a><span class="lineno"> 445</span> <span class="keyword">typename</span> SetOfPuzzleInfo::iterator it_low_f_score;</div>
<div class="line"><a id="l00446" name="l00446"></a><span class="lineno"> 446</span> uint32_t min_f_score = 1e9;</div>
<div class="line"><a id="l00447" name="l00447"></a><span class="lineno"> 447</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> iter = open_list.begin(); iter != open_list.end();</div>
<div class="line"><a id="l00448" name="l00448"></a><span class="lineno"> 448</span> ++iter) {</div>
<div class="line"><a id="l00449" name="l00449"></a><span class="lineno"> 449</span> <span class="comment">// f score here is evaluated by g score (depth) and h score</span></div>
<div class="line"><a id="l00450" name="l00450"></a><span class="lineno"> 450</span> <span class="comment">// (distance between current state and final state)</span></div>
<div class="line"><a id="l00451" name="l00451"></a><span class="lineno"> 451</span> uint32_t f_score = (*iter)-&gt;heuristic_value + (*iter)-&gt;depth;</div>
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno"> 452</span> <span class="keywordflow">if</span> (f_score &lt; min_f_score) {</div>
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno"> 453</span> min_f_score = f_score;</div>
<div class="line"><a id="l00454" name="l00454"></a><span class="lineno"> 454</span> it_low_f_score = iter;</div>
<div class="line"><a id="l00455" name="l00455"></a><span class="lineno"> 455</span> }</div>
<div class="line"><a id="l00456" name="l00456"></a><span class="lineno"> 456</span> }</div>
<div class="line"><a id="l00457" name="l00457"></a><span class="lineno"> 457</span> </div>
<div class="line"><a id="l00458" name="l00458"></a><span class="lineno"> 458</span> <span class="comment">// current_state, stores lowest f score so far for this state.</span></div>
<div class="line"><a id="l00459" name="l00459"></a><span class="lineno"> 459</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;Info&gt;</a> current_state = *it_low_f_score;</div>
<div class="line"><a id="l00460" name="l00460"></a><span class="lineno"> 460</span> </div>
<div class="line"><a id="l00461" name="l00461"></a><span class="lineno"> 461</span> <span class="comment">// if this current state is equal to final, return</span></div>
<div class="line"><a id="l00462" name="l00462"></a><span class="lineno"> 462</span> <span class="keywordflow">if</span> (*(current_state-&gt;state) == *(Final-&gt;state)) {</div>
<div class="line"><a id="l00463" name="l00463"></a><span class="lineno"> 463</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html#a0a26aa9ad3d73707370d9fe83707aca4">Solution</a>(current_state, parent_of);</div>
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno"> 464</span> }</div>
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno"> 465</span> <span class="comment">// else remove from open list as visited.</span></div>
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno"> 466</span> open_list.erase(it_low_f_score);</div>
<div class="line"><a id="l00467" name="l00467"></a><span class="lineno"> 467</span> <span class="comment">// if current_state has exceeded the allowed depth, skip</span></div>
<div class="line"><a id="l00468" name="l00468"></a><span class="lineno"> 468</span> <span class="comment">// neighbor checking</span></div>
<div class="line"><a id="l00469" name="l00469"></a><span class="lineno"> 469</span> <span class="keywordflow">if</span> (current_state-&gt;depth &gt;= permissible_depth) {</div>
<div class="line"><a id="l00470" name="l00470"></a><span class="lineno"> 470</span> <span class="keywordflow">continue</span>;</div>
<div class="line"><a id="l00471" name="l00471"></a><span class="lineno"> 471</span> }</div>
<div class="line"><a id="l00472" name="l00472"></a><span class="lineno"> 472</span> <span class="comment">// Generate all possible moves (neighbors) given the current</span></div>
<div class="line"><a id="l00473" name="l00473"></a><span class="lineno"> 473</span> <span class="comment">// state</span></div>
<div class="line"><a id="l00474" name="l00474"></a><span class="lineno"> 474</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;Puzzle&gt;</a> total_possible_moves =</div>
<div class="line"><a id="l00475" name="l00475"></a><span class="lineno"> 475</span> current_state-&gt;state-&gt;generate_possible_moves();</div>
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno"> 476</span> </div>
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno"> 477</span> <span class="keywordflow">for</span> (Puzzle &amp;neighbor : total_possible_moves) {</div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno"> 478</span> <span class="comment">// calculate score of neighbors with respect to</span></div>
<div class="line"><a id="l00479" name="l00479"></a><span class="lineno"> 479</span> <span class="comment">// current_state</span></div>
<div class="line"><a id="l00480" name="l00480"></a><span class="lineno"> 480</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;Info&gt;</a> Neighbor = std::make_shared&lt;Info&gt;(</div>
<div class="line"><a id="l00481" name="l00481"></a><span class="lineno"> 481</span> neighbor, dist(neighbor, *(Final-&gt;state)),</div>
<div class="line"><a id="l00482" name="l00482"></a><span class="lineno"> 482</span> current_state-&gt;depth + 1U);</div>
<div class="line"><a id="l00483" name="l00483"></a><span class="lineno"> 483</span> uint32_t temp_g_score = Neighbor-&gt;depth;</div>
<div class="line"><a id="l00484" name="l00484"></a><span class="lineno"> 484</span> </div>
<div class="line"><a id="l00485" name="l00485"></a><span class="lineno"> 485</span> <span class="comment">// Check whether this state is explored.</span></div>
<div class="line"><a id="l00486" name="l00486"></a><span class="lineno"> 486</span> <span class="comment">// If this state is discovered at greater depth, then discard,</span></div>
<div class="line"><a id="l00487" name="l00487"></a><span class="lineno"> 487</span> <span class="comment">// else remove from closed list and explore the node</span></div>
<div class="line"><a id="l00488" name="l00488"></a><span class="lineno"> 488</span> <span class="keyword">auto</span> closed_list_iter = closed_list.find(Neighbor);</div>
<div class="line"><a id="l00489" name="l00489"></a><span class="lineno"> 489</span> <span class="keywordflow">if</span> (closed_list_iter != closed_list.end()) {</div>
<div class="line"><a id="l00490" name="l00490"></a><span class="lineno"> 490</span> <span class="comment">// 1. If state in closed list has higher depth, then remove</span></div>
<div class="line"><a id="l00491" name="l00491"></a><span class="lineno"> 491</span> <span class="comment">// from list since we have found better option,</span></div>
<div class="line"><a id="l00492" name="l00492"></a><span class="lineno"> 492</span> <span class="comment">// 2. Else don&#39;t explore this state.</span></div>
<div class="line"><a id="l00493" name="l00493"></a><span class="lineno"> 493</span> <span class="keywordflow">if</span> (Neighbor-&gt;depth &lt; (*closed_list_iter)-&gt;depth) {</div>
<div class="line"><a id="l00494" name="l00494"></a><span class="lineno"> 494</span> closed_list.erase(closed_list_iter);</div>
<div class="line"><a id="l00495" name="l00495"></a><span class="lineno"> 495</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno"> 496</span> <span class="keywordflow">continue</span>;</div>
<div class="line"><a id="l00497" name="l00497"></a><span class="lineno"> 497</span> }</div>
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno"> 498</span> }</div>
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno"> 499</span> <span class="keyword">auto</span> neighbor_g_score_iter = g_score.find(Neighbor);</div>
<div class="line"><a id="l00500" name="l00500"></a><span class="lineno"> 500</span> <span class="comment">// if the neighbor is already created and has minimum</span></div>
<div class="line"><a id="l00501" name="l00501"></a><span class="lineno"> 501</span> <span class="comment">// g_score, then update g_score and f_score else insert new</span></div>
<div class="line"><a id="l00502" name="l00502"></a><span class="lineno"> 502</span> <span class="keywordflow">if</span> (neighbor_g_score_iter != g_score.end()) {</div>
<div class="line"><a id="l00503" name="l00503"></a><span class="lineno"> 503</span> <span class="keywordflow">if</span> (neighbor_g_score_iter-&gt;second &gt; temp_g_score) {</div>
<div class="line"><a id="l00504" name="l00504"></a><span class="lineno"> 504</span> neighbor_g_score_iter-&gt;second = temp_g_score;</div>
<div class="line"><a id="l00505" name="l00505"></a><span class="lineno"> 505</span> parent_of[Neighbor] = current_state;</div>
<div class="line"><a id="l00506" name="l00506"></a><span class="lineno"> 506</span> }</div>
<div class="line"><a id="l00507" name="l00507"></a><span class="lineno"> 507</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00508" name="l00508"></a><span class="lineno"> 508</span> g_score[Neighbor] = temp_g_score;</div>
<div class="line"><a id="l00509" name="l00509"></a><span class="lineno"> 509</span> parent_of[Neighbor] = current_state;</div>
<div class="line"><a id="l00510" name="l00510"></a><span class="lineno"> 510</span> }</div>
<div class="line"><a id="l00511" name="l00511"></a><span class="lineno"> 511</span> <span class="comment">// If this is a new state, insert into open_list</span></div>
<div class="line"><a id="l00512" name="l00512"></a><span class="lineno"> 512</span> <span class="comment">// else update if the this state has better g score than</span></div>
<div class="line"><a id="l00513" name="l00513"></a><span class="lineno"> 513</span> <span class="comment">// existing one.</span></div>
<div class="line"><a id="l00514" name="l00514"></a><span class="lineno"> 514</span> <span class="keyword">auto</span> iter = open_list.find(Neighbor);</div>
<div class="line"><a id="l00515" name="l00515"></a><span class="lineno"> 515</span> <span class="keywordflow">if</span> (iter == open_list.end()) {</div>
<div class="line"><a id="l00516" name="l00516"></a><span class="lineno"> 516</span> open_list.emplace(Neighbor);</div>
<div class="line"><a id="l00517" name="l00517"></a><span class="lineno"> 517</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((*iter)-&gt;depth &gt; Neighbor-&gt;depth) {</div>
<div class="line"><a id="l00518" name="l00518"></a><span class="lineno"> 518</span> (*iter)-&gt;depth = Neighbor-&gt;depth;</div>
<div class="line"><a id="l00519" name="l00519"></a><span class="lineno"> 519</span> }</div>
<div class="line"><a id="l00520" name="l00520"></a><span class="lineno"> 520</span> }</div>
<div class="line"><a id="l00521" name="l00521"></a><span class="lineno"> 521</span> closed_list.emplace(current_state);</div>
<div class="line"><a id="l00522" name="l00522"></a><span class="lineno"> 522</span> }</div>
<div class="line"><a id="l00523" name="l00523"></a><span class="lineno"> 523</span> <span class="comment">// Cannot find the solution, return empty vector</span></div>
<div class="line"><a id="l00524" name="l00524"></a><span class="lineno"> 524</span> <span class="keywordflow">return</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;Puzzle&gt;</a>(0);</div>
<div class="line"><a id="l00525" name="l00525"></a><span class="lineno"> 525</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 431</span> {</div>
<div class="line"><span class="lineno"> 432</span> MapOfPuzzleInfoWithPuzzleInfo</div>
<div class="line"><span class="lineno"> 433</span> parent_of; <span class="comment">/// Stores the parent of the states</span></div>
<div class="line"><span class="lineno"> 434</span> MapOfPuzzleInfoWithInteger g_score; <span class="comment">/// Stores the g_score</span></div>
<div class="line"><span class="lineno"> 435</span> SetOfPuzzleInfo open_list; <span class="comment">/// Stores the list to explore</span></div>
<div class="line"><span class="lineno"> 436</span> SetOfPuzzleInfo closed_list; <span class="comment">/// Stores the list that are explored</span></div>
<div class="line"><span class="lineno"> 437</span> </div>
<div class="line"><span class="lineno"> 438</span> <span class="comment">// Before starting the AyStartSearch, initialize the set and maps</span></div>
<div class="line"><span class="lineno"> 439</span> open_list.emplace(Initial);</div>
<div class="line"><span class="lineno"> 440</span> parent_of[Initial] = <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 441</span> g_score[Initial] = 0;</div>
<div class="line"><span class="lineno"> 442</span> </div>
<div class="line"><span class="lineno"> 443</span> <span class="keywordflow">while</span> (!open_list.empty()) {</div>
<div class="line"><span class="lineno"> 444</span> <span class="comment">// Iterator for state having having lowest f_score.</span></div>
<div class="line"><span class="lineno"> 445</span> <span class="keyword">typename</span> SetOfPuzzleInfo::iterator it_low_f_score;</div>
<div class="line"><span class="lineno"> 446</span> uint32_t min_f_score = 1e9;</div>
<div class="line"><span class="lineno"> 447</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> iter = open_list.begin(); iter != open_list.end();</div>
<div class="line"><span class="lineno"> 448</span> ++iter) {</div>
<div class="line"><span class="lineno"> 449</span> <span class="comment">// f score here is evaluated by g score (depth) and h score</span></div>
<div class="line"><span class="lineno"> 450</span> <span class="comment">// (distance between current state and final state)</span></div>
<div class="line"><span class="lineno"> 451</span> uint32_t f_score = (*iter)-&gt;heuristic_value + (*iter)-&gt;depth;</div>
<div class="line"><span class="lineno"> 452</span> <span class="keywordflow">if</span> (f_score &lt; min_f_score) {</div>
<div class="line"><span class="lineno"> 453</span> min_f_score = f_score;</div>
<div class="line"><span class="lineno"> 454</span> it_low_f_score = iter;</div>
<div class="line"><span class="lineno"> 455</span> }</div>
<div class="line"><span class="lineno"> 456</span> }</div>
<div class="line"><span class="lineno"> 457</span> </div>
<div class="line"><span class="lineno"> 458</span> <span class="comment">// current_state, stores lowest f score so far for this state.</span></div>
<div class="line"><span class="lineno"> 459</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;Info&gt;</a> current_state = *it_low_f_score;</div>
<div class="line"><span class="lineno"> 460</span> </div>
<div class="line"><span class="lineno"> 461</span> <span class="comment">// if this current state is equal to final, return</span></div>
<div class="line"><span class="lineno"> 462</span> <span class="keywordflow">if</span> (*(current_state-&gt;state) == *(Final-&gt;state)) {</div>
<div class="line"><span class="lineno"> 463</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html#a0a26aa9ad3d73707370d9fe83707aca4">Solution</a>(current_state, parent_of);</div>
<div class="line"><span class="lineno"> 464</span> }</div>
<div class="line"><span class="lineno"> 465</span> <span class="comment">// else remove from open list as visited.</span></div>
<div class="line"><span class="lineno"> 466</span> open_list.erase(it_low_f_score);</div>
<div class="line"><span class="lineno"> 467</span> <span class="comment">// if current_state has exceeded the allowed depth, skip</span></div>
<div class="line"><span class="lineno"> 468</span> <span class="comment">// neighbor checking</span></div>
<div class="line"><span class="lineno"> 469</span> <span class="keywordflow">if</span> (current_state-&gt;depth &gt;= permissible_depth) {</div>
<div class="line"><span class="lineno"> 470</span> <span class="keywordflow">continue</span>;</div>
<div class="line"><span class="lineno"> 471</span> }</div>
<div class="line"><span class="lineno"> 472</span> <span class="comment">// Generate all possible moves (neighbors) given the current</span></div>
<div class="line"><span class="lineno"> 473</span> <span class="comment">// state</span></div>
<div class="line"><span class="lineno"> 474</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;Puzzle&gt;</a> total_possible_moves =</div>
<div class="line"><span class="lineno"> 475</span> current_state-&gt;state-&gt;generate_possible_moves();</div>
<div class="line"><span class="lineno"> 476</span> </div>
<div class="line"><span class="lineno"> 477</span> <span class="keywordflow">for</span> (Puzzle &amp;neighbor : total_possible_moves) {</div>
<div class="line"><span class="lineno"> 478</span> <span class="comment">// calculate score of neighbors with respect to</span></div>
<div class="line"><span class="lineno"> 479</span> <span class="comment">// current_state</span></div>
<div class="line"><span class="lineno"> 480</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;Info&gt;</a> Neighbor = std::make_shared&lt;Info&gt;(</div>
<div class="line"><span class="lineno"> 481</span> neighbor, dist(neighbor, *(Final-&gt;state)),</div>
<div class="line"><span class="lineno"> 482</span> current_state-&gt;depth + 1U);</div>
<div class="line"><span class="lineno"> 483</span> uint32_t temp_g_score = Neighbor-&gt;depth;</div>
<div class="line"><span class="lineno"> 484</span> </div>
<div class="line"><span class="lineno"> 485</span> <span class="comment">// Check whether this state is explored.</span></div>
<div class="line"><span class="lineno"> 486</span> <span class="comment">// If this state is discovered at greater depth, then discard,</span></div>
<div class="line"><span class="lineno"> 487</span> <span class="comment">// else remove from closed list and explore the node</span></div>
<div class="line"><span class="lineno"> 488</span> <span class="keyword">auto</span> closed_list_iter = closed_list.find(Neighbor);</div>
<div class="line"><span class="lineno"> 489</span> <span class="keywordflow">if</span> (closed_list_iter != closed_list.end()) {</div>
<div class="line"><span class="lineno"> 490</span> <span class="comment">// 1. If state in closed list has higher depth, then remove</span></div>
<div class="line"><span class="lineno"> 491</span> <span class="comment">// from list since we have found better option,</span></div>
<div class="line"><span class="lineno"> 492</span> <span class="comment">// 2. Else don&#39;t explore this state.</span></div>
<div class="line"><span class="lineno"> 493</span> <span class="keywordflow">if</span> (Neighbor-&gt;depth &lt; (*closed_list_iter)-&gt;depth) {</div>
<div class="line"><span class="lineno"> 494</span> closed_list.erase(closed_list_iter);</div>
<div class="line"><span class="lineno"> 495</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 496</span> <span class="keywordflow">continue</span>;</div>
<div class="line"><span class="lineno"> 497</span> }</div>
<div class="line"><span class="lineno"> 498</span> }</div>
<div class="line"><span class="lineno"> 499</span> <span class="keyword">auto</span> neighbor_g_score_iter = g_score.find(Neighbor);</div>
<div class="line"><span class="lineno"> 500</span> <span class="comment">// if the neighbor is already created and has minimum</span></div>
<div class="line"><span class="lineno"> 501</span> <span class="comment">// g_score, then update g_score and f_score else insert new</span></div>
<div class="line"><span class="lineno"> 502</span> <span class="keywordflow">if</span> (neighbor_g_score_iter != g_score.end()) {</div>
<div class="line"><span class="lineno"> 503</span> <span class="keywordflow">if</span> (neighbor_g_score_iter-&gt;second &gt; temp_g_score) {</div>
<div class="line"><span class="lineno"> 504</span> neighbor_g_score_iter-&gt;second = temp_g_score;</div>
<div class="line"><span class="lineno"> 505</span> parent_of[Neighbor] = current_state;</div>
<div class="line"><span class="lineno"> 506</span> }</div>
<div class="line"><span class="lineno"> 507</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 508</span> g_score[Neighbor] = temp_g_score;</div>
<div class="line"><span class="lineno"> 509</span> parent_of[Neighbor] = current_state;</div>
<div class="line"><span class="lineno"> 510</span> }</div>
<div class="line"><span class="lineno"> 511</span> <span class="comment">// If this is a new state, insert into open_list</span></div>
<div class="line"><span class="lineno"> 512</span> <span class="comment">// else update if the this state has better g score than</span></div>
<div class="line"><span class="lineno"> 513</span> <span class="comment">// existing one.</span></div>
<div class="line"><span class="lineno"> 514</span> <span class="keyword">auto</span> iter = open_list.find(Neighbor);</div>
<div class="line"><span class="lineno"> 515</span> <span class="keywordflow">if</span> (iter == open_list.end()) {</div>
<div class="line"><span class="lineno"> 516</span> open_list.emplace(Neighbor);</div>
<div class="line"><span class="lineno"> 517</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((*iter)-&gt;depth &gt; Neighbor-&gt;depth) {</div>
<div class="line"><span class="lineno"> 518</span> (*iter)-&gt;depth = Neighbor-&gt;depth;</div>
<div class="line"><span class="lineno"> 519</span> }</div>
<div class="line"><span class="lineno"> 520</span> }</div>
<div class="line"><span class="lineno"> 521</span> closed_list.emplace(current_state);</div>
<div class="line"><span class="lineno"> 522</span> }</div>
<div class="line"><span class="lineno"> 523</span> <span class="comment">// Cannot find the solution, return empty vector</span></div>
<div class="line"><span class="lineno"> 524</span> <span class="keywordflow">return</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;Puzzle&gt;</a>(0);</div>
<div class="line"><span class="lineno"> 525</span> }</div>
<div class="ttc" id="aclassmachine__learning_1_1aystar__search_1_1_ay_star_search_html_a0a26aa9ad3d73707370d9fe83707aca4"><div class="ttname"><a href="../../da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html#a0a26aa9ad3d73707370d9fe83707aca4">machine_learning::aystar_search::AyStarSearch::Solution</a></div><div class="ttdeci">std::vector&lt; Puzzle &gt; Solution(std::shared_ptr&lt; Info &gt; FinalState, const MapOfPuzzleInfoWithPuzzleInfo &amp;parent_of)</div><div class="ttdoc">A helper solution: launches when a solution for AyStarSearch is found.</div><div class="ttdef"><b>Definition:</b> a_star_search.cpp:405</div></div>
<div class="ttc" id="ashared_ptr_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr</a></div></div>
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
@@ -384,7 +390,7 @@ template&lt;typename Puzzle &gt; </div>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; Puzzle &gt; <a class="el" href="../../da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html">machine_learning::aystar_search::AyStarSearch</a>&lt; Puzzle &gt;::<a class="el" href="../../dd/d4f/class_solution.html">Solution</a> </td>
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; Puzzle &gt; <a class="el" href="../../da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html">machine_learning::aystar_search::AyStarSearch</a>&lt; Puzzle &gt;<a class="el" href="../../dd/d4f/class_solution.html">::Solution</a> </td>
<td>(</td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr</a>&lt; <a class="el" href="../../da/d70/structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info.html">Info</a> &gt;&#160;</td>
<td class="paramname"><em>FinalState</em>, </td>
@@ -417,20 +423,20 @@ template&lt;typename Puzzle &gt; </div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the list of moves denoting moves from final state to initial state (in reverse) </dd></dl>
<div class="fragment"><div class="line"><a id="l00407" name="l00407"></a><span class="lineno"> 407</span> {</div>
<div class="line"><a id="l00408" name="l00408"></a><span class="lineno"> 408</span> <span class="comment">// Useful for traversing from final state to current state.</span></div>
<div class="line"><a id="l00409" name="l00409"></a><span class="lineno"> 409</span> <span class="keyword">auto</span> current_state = FinalState;</div>
<div class="line"><a id="l00410" name="l00410"></a><span class="lineno"> 410</span> <span class="comment">/*</span></div>
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno"> 411</span><span class="comment"> * For storing the solution tree starting from initial state to</span></div>
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno"> 412</span><span class="comment"> * final state</span></div>
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno"> 413</span><span class="comment"> */</span></div>
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno"> 414</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;Puzzle&gt;</a> answer;</div>
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno"> 415</span> <span class="keywordflow">while</span> (current_state != <span class="keyword">nullptr</span>) {</div>
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno"> 416</span> answer.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/emplace_back.html">emplace_back</a>(*current_state-&gt;state);</div>
<div class="line"><a id="l00417" name="l00417"></a><span class="lineno"> 417</span> current_state = parent_of.find(current_state)-&gt;second;</div>
<div class="line"><a id="l00418" name="l00418"></a><span class="lineno"> 418</span> }</div>
<div class="line"><a id="l00419" name="l00419"></a><span class="lineno"> 419</span> <span class="keywordflow">return</span> answer;</div>
<div class="line"><a id="l00420" name="l00420"></a><span class="lineno"> 420</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 407</span> {</div>
<div class="line"><span class="lineno"> 408</span> <span class="comment">// Useful for traversing from final state to current state.</span></div>
<div class="line"><span class="lineno"> 409</span> <span class="keyword">auto</span> current_state = FinalState;</div>
<div class="line"><span class="lineno"> 410</span> <span class="comment">/*</span></div>
<div class="line"><span class="lineno"> 411</span><span class="comment"> * For storing the solution tree starting from initial state to</span></div>
<div class="line"><span class="lineno"> 412</span><span class="comment"> * final state</span></div>
<div class="line"><span class="lineno"> 413</span><span class="comment"> */</span></div>
<div class="line"><span class="lineno"> 414</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;Puzzle&gt;</a> answer;</div>
<div class="line"><span class="lineno"> 415</span> <span class="keywordflow">while</span> (current_state != <span class="keyword">nullptr</span>) {</div>
<div class="line"><span class="lineno"> 416</span> answer.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/emplace_back.html">emplace_back</a>(*current_state-&gt;state);</div>
<div class="line"><span class="lineno"> 417</span> current_state = parent_of.find(current_state)-&gt;second;</div>
<div class="line"><span class="lineno"> 418</span> }</div>
<div class="line"><span class="lineno"> 419</span> <span class="keywordflow">return</span> answer;</div>
<div class="line"><span class="lineno"> 420</span> }</div>
<div class="ttc" id="aemplace_back_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/emplace_back.html">std::vector::emplace_back</a></div><div class="ttdeci">T emplace_back(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
@@ -450,7 +456,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d8/d77/namespacemachine__learning.html">machine_learning</a></li><li class="navelem"><b>aystar_search</b></li><li class="navelem"><a class="el" href="../../da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html">AyStarSearch</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -1,5 +1,5 @@
<map id="machine_learning::aystar_search::AyStarSearch::Solution" name="machine_learning::aystar_search::AyStarSearch::Solution">
<area shape="rect" id="node1" title="A helper solution: launches when a solution for AyStarSearch is found." alt="" coords="5,16,172,72"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/emplace_back.html#" title=" " alt="" coords="220,5,396,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/map/find.html#" title=" " alt="" coords="257,56,359,83"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/emplace_back#" title=" " alt="" coords="220,5,396,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/map/find#" title=" " alt="" coords="257,56,359,83"/>
</map>

View File

@@ -1 +1 @@
fa104f62e0167a8f92371e84db46bd57
92011cb893b3951d553b7529cf00a761

View File

@@ -23,7 +23,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/emplace_back.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/emplace_back#" xlink:title=" ">
<polygon fill="white" stroke="black" points="161,-38.5 161,-57.5 293,-57.5 293,-38.5 161,-38.5"/>
<text text-anchor="middle" x="227" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::emplace_back</text>
</a>
@@ -38,7 +38,7 @@
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/map/find.html#" xlink:title=" ">
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/map/find#" xlink:title=" ">
<polygon fill="white" stroke="black" points="188.5,-0.5 188.5,-19.5 265.5,-19.5 265.5,-0.5 188.5,-0.5"/>
<text text-anchor="middle" x="227" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::map::find</text>
</a>

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -1,13 +1,13 @@
<map id="machine_learning::aystar_search::AyStarSearch::a_star_search" name="machine_learning::aystar_search::AyStarSearch::a_star_search">
<area shape="rect" id="node1" title=" " alt="" coords="5,193,172,249"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/set/begin.html#" title=" " alt="" coords="251,5,356,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/set/emplace.html#" title=" " alt="" coords="242,56,365,83"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/set/empty.html#" title=" " alt="" coords="248,107,359,133"/>
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/set/end.html#" title=" " alt="" coords="256,157,351,184"/>
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/map/end.html#" title=" " alt="" coords="252,208,355,235"/>
<area shape="rect" id="node7" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/set/erase.html#" title=" " alt="" coords="250,259,357,285"/>
<area shape="rect" id="node8" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/set/find.html#" title=" " alt="" coords="256,309,351,336"/>
<area shape="rect" id="node9" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/map/find.html#" title=" " alt="" coords="471,368,574,395"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/set/begin#" title=" " alt="" coords="251,5,356,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/set/emplace#" title=" " alt="" coords="242,56,365,83"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/set/empty#" title=" " alt="" coords="248,107,359,133"/>
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/set/end#" title=" " alt="" coords="256,157,351,184"/>
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/map/end#" title=" " alt="" coords="252,208,355,235"/>
<area shape="rect" id="node7" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/set/erase#" title=" " alt="" coords="250,259,357,285"/>
<area shape="rect" id="node8" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/set/find#" title=" " alt="" coords="256,309,351,336"/>
<area shape="rect" id="node9" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/map/find#" title=" " alt="" coords="471,368,574,395"/>
<area shape="rect" id="node10" href="$da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html#a0a26aa9ad3d73707370d9fe83707aca4" title="A helper solution: launches when a solution for AyStarSearch is found." alt="" coords="220,411,387,467"/>
<area shape="rect" id="node11" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/emplace_back.html#" title=" " alt="" coords="435,425,611,452"/>
<area shape="rect" id="node11" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/emplace_back#" title=" " alt="" coords="435,425,611,452"/>
</map>

View File

@@ -1 +1 @@
917ef1f6aec9dcbb1295ded3f018b12e
a5507952063797991a67793209834842

View File

@@ -23,7 +23,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/set/begin.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/set/begin#" xlink:title=" ">
<polygon fill="white" stroke="black" points="184,-326.5 184,-345.5 263,-345.5 263,-326.5 184,-326.5"/>
<text text-anchor="middle" x="223.5" y="-333.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::set::begin</text>
</a>
@@ -38,7 +38,7 @@
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/set/emplace.html#" xlink:title=" ">
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/set/emplace#" xlink:title=" ">
<polygon fill="white" stroke="black" points="177.5,-288.5 177.5,-307.5 269.5,-307.5 269.5,-288.5 177.5,-288.5"/>
<text text-anchor="middle" x="223.5" y="-295.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::set::emplace</text>
</a>
@@ -53,7 +53,7 @@
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/set/empty.html#" xlink:title=" ">
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/set/empty#" xlink:title=" ">
<polygon fill="white" stroke="black" points="182,-250.5 182,-269.5 265,-269.5 265,-250.5 182,-250.5"/>
<text text-anchor="middle" x="223.5" y="-257.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::set::empty</text>
</a>
@@ -68,7 +68,7 @@
<!-- Node5 -->
<g id="node5" class="node">
<title>Node5</title>
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/set/end.html#" xlink:title=" ">
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/set/end#" xlink:title=" ">
<polygon fill="white" stroke="black" points="188,-212.5 188,-231.5 259,-231.5 259,-212.5 188,-212.5"/>
<text text-anchor="middle" x="223.5" y="-219.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::set::end</text>
</a>
@@ -83,7 +83,7 @@
<!-- Node6 -->
<g id="node6" class="node">
<title>Node6</title>
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/map/end.html#" xlink:title=" ">
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/map/end#" xlink:title=" ">
<polygon fill="white" stroke="black" points="185,-174.5 185,-193.5 262,-193.5 262,-174.5 185,-174.5"/>
<text text-anchor="middle" x="223.5" y="-181.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::map::end</text>
</a>
@@ -98,7 +98,7 @@
<!-- Node7 -->
<g id="node7" class="node">
<title>Node7</title>
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/set/erase.html#" xlink:title=" ">
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/set/erase#" xlink:title=" ">
<polygon fill="white" stroke="black" points="183.5,-136.5 183.5,-155.5 263.5,-155.5 263.5,-136.5 183.5,-136.5"/>
<text text-anchor="middle" x="223.5" y="-143.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::set::erase</text>
</a>
@@ -113,7 +113,7 @@
<!-- Node8 -->
<g id="node8" class="node">
<title>Node8</title>
<g id="a_node8"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/set/find.html#" xlink:title=" ">
<g id="a_node8"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/set/find#" xlink:title=" ">
<polygon fill="white" stroke="black" points="188,-98.5 188,-117.5 259,-117.5 259,-98.5 188,-98.5"/>
<text text-anchor="middle" x="223.5" y="-105.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::set::find</text>
</a>
@@ -128,7 +128,7 @@
<!-- Node9 -->
<g id="node9" class="node">
<title>Node9</title>
<g id="a_node9"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/map/find.html#" xlink:title=" ">
<g id="a_node9"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/map/find#" xlink:title=" ">
<polygon fill="white" stroke="black" points="349.5,-54.5 349.5,-73.5 426.5,-73.5 426.5,-54.5 349.5,-54.5"/>
<text text-anchor="middle" x="388" y="-61.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::map::find</text>
</a>
@@ -166,7 +166,7 @@
<!-- Node11 -->
<g id="node11" class="node">
<title>Node11</title>
<g id="a_node11"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/emplace_back.html#" xlink:title=" ">
<g id="a_node11"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/emplace_back#" xlink:title=" ">
<polygon fill="white" stroke="black" points="322,-11.5 322,-30.5 454,-30.5 454,-11.5 322,-11.5"/>
<text text-anchor="middle" x="388" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::emplace_back</text>
</a>

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: operations_on_datastructures::circular_linked_list::Node Struct Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -163,10 +163,10 @@ int64_t&#160;</td><td class="memItemRight" valign="bottom"><b>data</b></td></tr>
</dl>
<p >&lt; Set value of <a class="el" href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a> data</p>
<p >&lt; Initialize successor</p>
<div class="fragment"><div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> {</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <a class="code hl_variable" href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a7461292b8b91aed86404d0ab019dfdd1">data</a> = _data; <span class="comment">///&lt; Set value of Node data</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <a class="code hl_variable" href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a7c867b8e1034a6f5da490c8b8c09cb77">next</a> = <span class="keyword">nullptr</span>; <span class="comment">///&lt; Initialize successor</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 39</span> {</div>
<div class="line"><span class="lineno"> 40</span> <a class="code hl_variable" href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a7461292b8b91aed86404d0ab019dfdd1">data</a> = _data; <span class="comment">///&lt; Set value of Node data</span></div>
<div class="line"><span class="lineno"> 41</span> <a class="code hl_variable" href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a7c867b8e1034a6f5da490c8b8c09cb77">next</a> = <span class="keyword">nullptr</span>; <span class="comment">///&lt; Initialize successor</span></div>
<div class="line"><span class="lineno"> 42</span> }</div>
<div class="ttc" id="astructoperations__on__datastructures_1_1circular__linked__list_1_1_node_html_a7461292b8b91aed86404d0ab019dfdd1"><div class="ttname"><a href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a7461292b8b91aed86404d0ab019dfdd1">operations_on_datastructures::circular_linked_list::Node::data</a></div><div class="ttdeci">int64_t data</div><div class="ttdoc">The value of the Node.</div><div class="ttdef"><b>Definition:</b> circular_linked_list.cpp:33</div></div>
<div class="ttc" id="astructoperations__on__datastructures_1_1circular__linked__list_1_1_node_html_a7c867b8e1034a6f5da490c8b8c09cb77"><div class="ttname"><a href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a7c867b8e1034a6f5da490c8b8c09cb77">operations_on_datastructures::circular_linked_list::Node::next</a></div><div class="ttdeci">Node * next</div><div class="ttdoc">The Node's successor.</div><div class="ttdef"><b>Definition:</b> circular_linked_list.cpp:34</div></div>
</div><!-- fragment -->
@@ -216,10 +216,10 @@ int64_t&#160;</td><td class="memItemRight" valign="bottom"><b>data</b></td></tr>
</dl>
<p >&lt; Set value of <a class="el" href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a> data</p>
<p >&lt; Initialize successor</p>
<div class="fragment"><div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> {</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <a class="code hl_variable" href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a7461292b8b91aed86404d0ab019dfdd1">data</a> = _data; <span class="comment">///&lt; Set value of Node data</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <a class="code hl_variable" href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a7c867b8e1034a6f5da490c8b8c09cb77">next</a> = _next; <span class="comment">///&lt; Initialize successor</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 48</span> {</div>
<div class="line"><span class="lineno"> 49</span> <a class="code hl_variable" href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a7461292b8b91aed86404d0ab019dfdd1">data</a> = _data; <span class="comment">///&lt; Set value of Node data</span></div>
<div class="line"><span class="lineno"> 50</span> <a class="code hl_variable" href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a7c867b8e1034a6f5da490c8b8c09cb77">next</a> = _next; <span class="comment">///&lt; Initialize successor</span></div>
<div class="line"><span class="lineno"> 51</span> }</div>
</div><!-- fragment -->
</div>
</div>
@@ -232,7 +232,7 @@ int64_t&#160;</td><td class="memItemRight" valign="bottom"><b>data</b></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../da/d6d/namespaceoperations__on__datastructures.html">operations_on_datastructures</a></li><li class="navelem"><b>circular_linked_list</b></li><li class="navelem"><a class="el" href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__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.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: probability::geometric_dist::geometric_distribution Class Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -172,7 +172,7 @@ float&#160;</td><td class="memItemRight" valign="bottom"><b>p</b></td></tr>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span>: <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>(<a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>) {}</div>
<div class="fragment"><div class="line"><span class="lineno"> 64</span>: <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>(<a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>) {}</div>
<div class="ttc" id="aclassprobability_1_1geometric__dist_1_1geometric__distribution_html_ad5ed23a251dbe55ad1ed06bf1a465ad3"><div class="ttname"><a href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">probability::geometric_dist::geometric_distribution::p</a></div><div class="ttdeci">float p</div><div class="ttdoc">The succes probability p.</div><div class="ttdef"><b>Definition:</b> geometric_dist.cpp:57</div></div>
</div><!-- fragment -->
</div>
@@ -210,9 +210,9 @@ float&#160;</td><td class="memItemRight" valign="bottom"><b>p</b></td></tr>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The probability to have success within k trials </dd></dl>
<div class="fragment"><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> <span class="keywordflow">return</span> 1.0f - <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>((1.0f - <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>), <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(k));</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 104</span> {</div>
<div class="line"><span class="lineno"> 105</span> <span class="keywordflow">return</span> 1.0f - <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>((1.0f - <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>), <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(k));</div>
<div class="line"><span class="lineno"> 106</span> }</div>
<div class="ttc" id="apow_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a></div><div class="ttdeci">T pow(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
@@ -248,12 +248,12 @@ Here is the call graph for this function:</div>
<p>Generates a (discrete) sample according to the geometrical distribution. </p>
<dl class="section return"><dt>Returns</dt><dd>A geometrically distributed number in [1,\infty) </dd></dl>
<div class="fragment"><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> <span class="keywordtype">float</span> uniform_sample = <a class="code hl_function" href="../../de/d72/geometric__dist_8cpp.html#a82964ca6180507deb5fafc71050012ba">generate_uniform</a>();</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>(</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <a class="code hl_function" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#aaf762e88c66918d7afda4234f28a7ddf">inverse_cumulative_distribution</a>(uniform_sample)) +</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> 1;</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 125</span> {</div>
<div class="line"><span class="lineno"> 126</span> <span class="keywordtype">float</span> uniform_sample = <a class="code hl_function" href="../../de/d72/geometric__dist_8cpp.html#a82964ca6180507deb5fafc71050012ba">generate_uniform</a>();</div>
<div class="line"><span class="lineno"> 127</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>(</div>
<div class="line"><span class="lineno"> 128</span> <a class="code hl_function" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#aaf762e88c66918d7afda4234f28a7ddf">inverse_cumulative_distribution</a>(uniform_sample)) +</div>
<div class="line"><span class="lineno"> 129</span> 1;</div>
<div class="line"><span class="lineno"> 130</span> }</div>
<div class="ttc" id="aclassprobability_1_1geometric__dist_1_1geometric__distribution_html_aaf762e88c66918d7afda4234f28a7ddf"><div class="ttname"><a href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#aaf762e88c66918d7afda4234f28a7ddf">probability::geometric_dist::geometric_distribution::inverse_cumulative_distribution</a></div><div class="ttdeci">float inverse_cumulative_distribution(const float &amp;cdf) const</div><div class="ttdoc">The inverse cumulative distribution function.</div><div class="ttdef"><b>Definition:</b> geometric_dist.cpp:116</div></div>
<div class="ttc" id="ageometric__dist_8cpp_html_a82964ca6180507deb5fafc71050012ba"><div class="ttname"><a href="../../de/d72/geometric__dist_8cpp.html#a82964ca6180507deb5fafc71050012ba">probability::geometric_dist::generate_uniform</a></div><div class="ttdeci">float generate_uniform()</div><div class="ttdoc">Returns a random number between [0,1].</div><div class="ttdef"><b>Definition:</b> geometric_dist.cpp:48</div></div>
</div><!-- fragment --><div class="dynheader">
@@ -290,7 +290,7 @@ Here is the call graph for this function:</div>
<p>The expected value of a geometrically distributed random variable X. </p>
<dl class="section return"><dt>Returns</dt><dd>E[X] = 1/p </dd></dl>
<div class="fragment"><div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span>{ <span class="keywordflow">return</span> 1.0f / <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>; }</div>
<div class="fragment"><div class="line"><span class="lineno"> 71</span>{ <span class="keywordflow">return</span> 1.0f / <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>; }</div>
</div><!-- fragment -->
</div>
</div>
@@ -326,9 +326,9 @@ Here is the call graph for this function:</div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of (exact) trials. </dd></dl>
<div class="fragment"><div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> {</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">std::log</a>(1.0f - cdf) / <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">std::log</a>(1.0f - <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>);</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 116</span> {</div>
<div class="line"><span class="lineno"> 117</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">std::log</a>(1.0f - cdf) / <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">std::log</a>(1.0f - <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>);</div>
<div class="line"><span class="lineno"> 118</span> }</div>
<div class="ttc" id="alog_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/log.html">std::log</a></div><div class="ttdeci">T log(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
@@ -371,9 +371,9 @@ Here is the call graph for this function:</div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A number between [0,1] according to p * (1-p)^{k-1} </dd></dl>
<div class="fragment"><div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> {</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>((1.0f - <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>), <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(k - 1)) * <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>;</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 93</span> {</div>
<div class="line"><span class="lineno"> 94</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>((1.0f - <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>), <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(k - 1)) * <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>;</div>
<div class="line"><span class="lineno"> 95</span> }</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
@@ -426,13 +426,13 @@ Here is the call graph for this function:</div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The probability of having success within a range of tries [min_tries, max_tries] </dd></dl>
<div class="fragment"><div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> {</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="keywordtype">float</span> cdf_lower = <a class="code hl_function" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#a08328dc7d62188427111f176b56a105a">cumulative_distribution</a>(min_tries - 1);</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordtype">float</span> cdf_upper = max_tries == <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/numeric_limits/max.html">std::numeric_limits&lt;uint32_t&gt;::max</a>()</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> ? 1.0f</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> : <a class="code hl_function" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#a08328dc7d62188427111f176b56a105a">cumulative_distribution</a>(max_tries);</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="keywordflow">return</span> cdf_upper - cdf_lower;</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 147</span> {</div>
<div class="line"><span class="lineno"> 148</span> <span class="keywordtype">float</span> cdf_lower = <a class="code hl_function" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#a08328dc7d62188427111f176b56a105a">cumulative_distribution</a>(min_tries - 1);</div>
<div class="line"><span class="lineno"> 149</span> <span class="keywordtype">float</span> cdf_upper = max_tries == <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/numeric_limits/max.html">std::numeric_limits&lt;uint32_t&gt;::max</a>()</div>
<div class="line"><span class="lineno"> 150</span> ? 1.0f</div>
<div class="line"><span class="lineno"> 151</span> : <a class="code hl_function" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#a08328dc7d62188427111f176b56a105a">cumulative_distribution</a>(max_tries);</div>
<div class="line"><span class="lineno"> 152</span> <span class="keywordflow">return</span> cdf_upper - cdf_lower;</div>
<div class="line"><span class="lineno"> 153</span> }</div>
<div class="ttc" id="aclassprobability_1_1geometric__dist_1_1geometric__distribution_html_a08328dc7d62188427111f176b56a105a"><div class="ttname"><a href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#a08328dc7d62188427111f176b56a105a">probability::geometric_dist::geometric_distribution::cumulative_distribution</a></div><div class="ttdeci">float cumulative_distribution(const uint32_t &amp;k) const</div><div class="ttdoc">The cumulative distribution function.</div><div class="ttdef"><b>Definition:</b> geometric_dist.cpp:104</div></div>
<div class="ttc" id="amax_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/numeric_limits/max.html">std::numeric_limits::max</a></div><div class="ttdeci">T max(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
@@ -469,7 +469,7 @@ Here is the call graph for this function:</div>
<p>The standard deviation of a geometrically distributed random variable X. </p>
<dl class="section return"><dt>Returns</dt><dd>\sigma = \sqrt{V[X]} </dd></dl>
<div class="fragment"><div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(<a class="code hl_function" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#aea8b0d649f0dc9a6f8baf3341a0b4960">variance</a>()); }</div>
<div class="fragment"><div class="line"><span class="lineno"> 84</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(<a class="code hl_function" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#aea8b0d649f0dc9a6f8baf3341a0b4960">variance</a>()); }</div>
<div class="ttc" id="aclassprobability_1_1geometric__dist_1_1geometric__distribution_html_aea8b0d649f0dc9a6f8baf3341a0b4960"><div class="ttname"><a href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#aea8b0d649f0dc9a6f8baf3341a0b4960">probability::geometric_dist::geometric_distribution::variance</a></div><div class="ttdeci">float variance() const</div><div class="ttdoc">The variance of a geometrically distributed random variable X.</div><div class="ttdef"><b>Definition:</b> geometric_dist.cpp:77</div></div>
<div class="ttc" id="asqrt_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a></div><div class="ttdeci">T sqrt(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
@@ -506,7 +506,7 @@ Here is the call graph for this function:</div>
<p>The variance of a geometrically distributed random variable X. </p>
<dl class="section return"><dt>Returns</dt><dd>V[X] = (1 - p) / p^2 </dd></dl>
<div class="fragment"><div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span>{ <span class="keywordflow">return</span> (1.0f - <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>) / (<a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a> * <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>); }</div>
<div class="fragment"><div class="line"><span class="lineno"> 77</span>{ <span class="keywordflow">return</span> (1.0f - <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>) / (<a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a> * <a class="code hl_variable" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#ad5ed23a251dbe55ad1ed06bf1a465ad3">p</a>); }</div>
</div><!-- fragment -->
</div>
</div>
@@ -519,7 +519,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d4/ded/namespaceprobability.html">probability</a></li><li class="navelem"><b>geometric_dist</b></li><li class="navelem"><a class="el" href="../../da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html">geometric_distribution</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -1,4 +1,4 @@
<map id="probability::geometric_dist::geometric_distribution::cumulative_distribution" name="probability::geometric_dist::geometric_distribution::cumulative_distribution">
<area shape="rect" id="node1" title="The cumulative distribution function." alt="" coords="5,5,191,61"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow.html#" title=" " alt="" coords="239,20,311,47"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow#" title=" " alt="" coords="239,20,311,47"/>
</map>

View File

@@ -1 +1 @@
4e897037faf2a81dbb68b7693f538e7f
2acd25f2e0d57aeb6c8fff21c6f67e28

View File

@@ -23,7 +23,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow#" xlink:title=" ">
<polygon fill="white" stroke="black" points="175,-11.5 175,-30.5 229,-30.5 229,-11.5 175,-11.5"/>
<text text-anchor="middle" x="202" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::pow</text>
</a>

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -1,5 +1,5 @@
<map id="probability::geometric_dist::geometric_distribution::standard_deviation" name="probability::geometric_dist::geometric_distribution::standard_deviation">
<area shape="rect" id="node1" title="The standard deviation of a geometrically distributed random variable X." alt="" coords="5,24,191,80"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt.html#" title=" " alt="" coords="296,5,367,32"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt#" title=" " alt="" coords="296,5,367,32"/>
<area shape="rect" id="node3" href="$da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#aea8b0d649f0dc9a6f8baf3341a0b4960" title="The variance of a geometrically distributed random variable X." alt="" coords="239,56,424,112"/>
</map>

View File

@@ -1 +1 @@
e7c646d423869971dc703d2dbc8d0c79
64bacd78a372669bfe588a32bb72b31b

View File

@@ -23,7 +23,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt#" xlink:title=" ">
<polygon fill="white" stroke="black" points="218,-60.5 218,-79.5 271,-79.5 271,-60.5 218,-60.5"/>
<text text-anchor="middle" x="244.5" y="-67.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
</a>

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -1,6 +1,6 @@
<map id="probability::geometric_dist::geometric_distribution::range_tries" name="probability::geometric_dist::geometric_distribution::range_tries">
<area shape="rect" id="node1" title="This function computes the probability to have success in a given range of tries." alt="" coords="5,39,191,95"/>
<area shape="rect" id="node2" href="$da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#a08328dc7d62188427111f176b56a105a" title="The cumulative distribution function." alt="" coords="239,5,424,61"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/types/numeric_limits/max.html#" title=" " alt="" coords="249,85,414,112"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow.html#" title=" " alt="" coords="472,20,544,47"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/types/numeric_limits/max#" title=" " alt="" coords="249,85,414,112"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow#" title=" " alt="" coords="472,20,544,47"/>
</map>

View File

@@ -1 +1 @@
a06d984c27be68a19539343ce4cc843b
d38732e58077c2c55d81b14a64f48210

View File

@@ -40,7 +40,7 @@
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/types/numeric_limits/max.html#" xlink:title=" ">
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/types/numeric_limits/max#" xlink:title=" ">
<polygon fill="white" stroke="black" points="182.5,-0.5 182.5,-19.5 306.5,-19.5 306.5,-0.5 182.5,-0.5"/>
<text text-anchor="middle" x="244.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::numeric_limits::max</text>
</a>
@@ -55,7 +55,7 @@
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow.html#" xlink:title=" ">
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow#" xlink:title=" ">
<polygon fill="white" stroke="black" points="350,-49.5 350,-68.5 404,-68.5 404,-49.5 350,-49.5"/>
<text text-anchor="middle" x="377" y="-56.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::pow</text>
</a>

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -2,5 +2,5 @@
<area shape="rect" id="node1" title="Generates a (discrete) sample according to the geometrical distribution." alt="" coords="5,59,191,115"/>
<area shape="rect" id="node2" href="$de/d72/geometric__dist_8cpp.html#a82964ca6180507deb5fafc71050012ba" title="Returns a random number between [0,1]." alt="" coords="265,29,424,71"/>
<area shape="rect" id="node3" href="$da/d19/classprobability_1_1geometric__dist_1_1geometric__distribution.html#aaf762e88c66918d7afda4234f28a7ddf" title="The inverse cumulative distribution function." alt="" coords="239,95,451,151"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/log.html#" title=" " alt="" coords="499,110,564,137"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/log#" title=" " alt="" coords="499,110,564,137"/>
</map>

View File

@@ -1 +1 @@
f1eefa1194636f76aac37dfc34dab3c4
60c5752304fcd42ecfc281c0bfdcc3a8

View File

@@ -62,7 +62,7 @@
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/log.html#" xlink:title=" ">
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/log#" xlink:title=" ">
<polygon fill="white" stroke="black" points="370,-11.5 370,-30.5 419,-30.5 419,-11.5 370,-11.5"/>
<text text-anchor="middle" x="394.5" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::log</text>
</a>

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -1,4 +1,4 @@
<map id="probability::geometric_dist::geometric_distribution::inverse_cumulative_distribution" name="probability::geometric_dist::geometric_distribution::inverse_cumulative_distribution">
<area shape="rect" id="node1" title="The inverse cumulative distribution function." alt="" coords="5,5,217,61"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/log.html#" title=" " alt="" coords="265,20,331,47"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/log#" title=" " alt="" coords="265,20,331,47"/>
</map>

View File

@@ -1 +1 @@
76bd31b125f441a91f170918951c8002
12d8a1b7b61c333dfdd8bd2a933b27ee

View File

@@ -23,7 +23,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/log.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/log#" xlink:title=" ">
<polygon fill="white" stroke="black" points="195,-11.5 195,-30.5 244,-30.5 244,-11.5 195,-11.5"/>
<text text-anchor="middle" x="219.5" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::log</text>
</a>

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -1,4 +1,4 @@
<map id="probability::geometric_dist::geometric_distribution::probability_density" name="probability::geometric_dist::geometric_distribution::probability_density">
<area shape="rect" id="node1" title="The probability density function." alt="" coords="5,5,191,61"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow.html#" title=" " alt="" coords="239,20,311,47"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow#" title=" " alt="" coords="239,20,311,47"/>
</map>

View File

@@ -1 +1 @@
6552b600c577bdff25fef46e0bceeab6
6f857e725c6d61c8ea6fb0988768d8c3

View File

@@ -23,7 +23,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow#" xlink:title=" ">
<polygon fill="white" stroke="black" points="175,-11.5 175,-30.5 229,-30.5 229,-11.5 175,-11.5"/>
<text text-anchor="middle" x="202" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::pow</text>
</a>

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: math/eulers_totient_function.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -164,17 +164,17 @@ Some known values are:</p><ul>
</div><div class="memdoc">
<p>Main function. </p>
<div class="fragment"><div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> {</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> uint64_t n;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordflow">if</span> (argc &lt; 2) {</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Enter the number: &quot;</span>;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> n = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/strtoul.html">strtoull</a>(argv[1], <span class="keyword">nullptr</span>, 10);</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> }</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; n;</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <a class="code hl_function" href="../../da/d23/eulers__totient__function_8cpp.html#a35e4874a3e1d67eb708dc57944c8aea0">phiFunction</a>(n);</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 48</span> {</div>
<div class="line"><span class="lineno"> 49</span> uint64_t n;</div>
<div class="line"><span class="lineno"> 50</span> <span class="keywordflow">if</span> (argc &lt; 2) {</div>
<div class="line"><span class="lineno"> 51</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Enter the number: &quot;</span>;</div>
<div class="line"><span class="lineno"> 52</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 53</span> n = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/byte/strtoul.html">strtoull</a>(argv[1], <span class="keyword">nullptr</span>, 10);</div>
<div class="line"><span class="lineno"> 54</span> }</div>
<div class="line"><span class="lineno"> 55</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; n;</div>
<div class="line"><span class="lineno"> 56</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <a class="code hl_function" href="../../da/d23/eulers__totient__function_8cpp.html#a35e4874a3e1d67eb708dc57944c8aea0">phiFunction</a>(n);</div>
<div class="line"><span class="lineno"> 57</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 58</span>}</div>
<div class="ttc" id="abasic_istream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a></div></div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="aeulers__totient__function_8cpp_html_a35e4874a3e1d67eb708dc57944c8aea0"><div class="ttname"><a href="../../da/d23/eulers__totient__function_8cpp.html#a35e4874a3e1d67eb708dc57944c8aea0">phiFunction</a></div><div class="ttdeci">uint64_t phiFunction(uint64_t n)</div><div class="ttdef"><b>Definition:</b> eulers_totient_function.cpp:32</div></div>
@@ -204,20 +204,20 @@ Here is the call graph for this function:</div>
</table>
</div><div class="memdoc">
<p >Function to caculate Euler's totient phi </p>
<div class="fragment"><div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> {</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> uint64_t <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = n;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordflow">for</span> (uint64_t i = 2; i * i &lt;= n; i++) {</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordflow">if</span> (n % i == 0) {</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordflow">while</span> (n % i == 0) {</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> n /= i;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> }</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> -= <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> / i;</div>
<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 class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keywordflow">if</span> (n &gt; 1)</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> -= <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> / n;</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 32</span> {</div>
<div class="line"><span class="lineno"> 33</span> uint64_t <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = n;</div>
<div class="line"><span class="lineno"> 34</span> <span class="keywordflow">for</span> (uint64_t i = 2; i * i &lt;= n; i++) {</div>
<div class="line"><span class="lineno"> 35</span> <span class="keywordflow">if</span> (n % i == 0) {</div>
<div class="line"><span class="lineno"> 36</span> <span class="keywordflow">while</span> (n % i == 0) {</div>
<div class="line"><span class="lineno"> 37</span> n /= i;</div>
<div class="line"><span class="lineno"> 38</span> }</div>
<div class="line"><span class="lineno"> 39</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> -= <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> / i;</div>
<div class="line"><span class="lineno"> 40</span> }</div>
<div class="line"><span class="lineno"> 41</span> }</div>
<div class="line"><span class="lineno"> 42</span> <span class="keywordflow">if</span> (n &gt; 1)</div>
<div class="line"><span class="lineno"> 43</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> -= <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> / n;</div>
<div class="line"><span class="lineno"> 44</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
<div class="line"><span class="lineno"> 45</span>}</div>
<div class="ttc" id="afibonacci__sum_8cpp_html_aadb40ac4c74a7efc0680b83eeee138aa"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">math::fibonacci_sum::result</a></div><div class="ttdeci">uint64_t result(uint64_t n)</div><div class="ttdef"><b>Definition:</b> fibonacci_sum.cpp:76</div></div>
</div><!-- fragment -->
</div>
@@ -228,7 +228,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../da/d23/eulers__totient__function_8cpp.html">eulers_totient_function.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: math/sqrt_double.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -134,14 +134,14 @@ Functions</h2></td></tr>
</table>
</div><div class="memdoc">
<p >main function </p>
<div class="fragment"><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="keywordtype">double</span> n{};</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; n;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> assert(n &gt;= 0);</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="comment">// Change this line for a better precision</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a>.precision(12);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/fixed.html">std::fixed</a> &lt;&lt; <a class="code hl_function" href="../../da/d24/sqrt__double_8cpp.html#ae662282ad0740d2063ac404ca3bd74fc">Sqrt</a>(n);</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 42</span> {</div>
<div class="line"><span class="lineno"> 43</span> <span class="keywordtype">double</span> n{};</div>
<div class="line"><span class="lineno"> 44</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; n;</div>
<div class="line"><span class="lineno"> 45</span> assert(n &gt;= 0);</div>
<div class="line"><span class="lineno"> 46</span> <span class="comment">// Change this line for a better precision</span></div>
<div class="line"><span class="lineno"> 47</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a>.precision(12);</div>
<div class="line"><span class="lineno"> 48</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/fixed.html">std::fixed</a> &lt;&lt; <a class="code hl_function" href="../../da/d24/sqrt__double_8cpp.html#ae662282ad0740d2063ac404ca3bd74fc">Sqrt</a>(n);</div>
<div class="line"><span class="lineno"> 49</span>}</div>
<div class="ttc" id="abasic_istream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a></div></div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="afixed_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/fixed.html">std::fixed</a></div><div class="ttdeci">T fixed(T... args)</div></div>
@@ -171,30 +171,30 @@ Here is the call graph for this function:</div>
</table>
</div><div class="memdoc">
<p >Bisection method implemented for the function \(x^2-a=0\) whose roots are \(\pm\sqrt{a}\) and only the positive root is returned. </p>
<div class="fragment"><div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> {</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keywordflow">if</span> (a &gt; 0 &amp;&amp; a &lt; 1) {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordflow">return</span> 1 / <a class="code hl_function" href="../../da/d24/sqrt__double_8cpp.html#ae662282ad0740d2063ac404ca3bd74fc">Sqrt</a>(1 / a);</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> }</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> = 0, r = a;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="comment">/* Epsilon is the precision.</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment"> A great precision is</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment"> between 1e-7 and 1e-12.</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment"> double epsilon = 1e-12;</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment"> */</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordtype">double</span> epsilon = 1e-12;</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordflow">while</span> (l &lt;= r) {</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordtype">double</span> mid = (<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> + r) / 2;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordflow">if</span> (mid * mid &gt; a) {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> r = mid;</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordflow">if</span> (a - mid * mid &lt; epsilon) {</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordflow">return</span> mid;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> }</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> = mid;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</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="keywordflow">return</span> -1;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 16</span> {</div>
<div class="line"><span class="lineno"> 17</span> <span class="keywordflow">if</span> (a &gt; 0 &amp;&amp; a &lt; 1) {</div>
<div class="line"><span class="lineno"> 18</span> <span class="keywordflow">return</span> 1 / <a class="code hl_function" href="../../da/d24/sqrt__double_8cpp.html#ae662282ad0740d2063ac404ca3bd74fc">Sqrt</a>(1 / a);</div>
<div class="line"><span class="lineno"> 19</span> }</div>
<div class="line"><span class="lineno"> 20</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> = 0, r = a;</div>
<div class="line"><span class="lineno"> 21</span> <span class="comment">/* Epsilon is the precision.</span></div>
<div class="line"><span class="lineno"> 22</span><span class="comment"> A great precision is</span></div>
<div class="line"><span class="lineno"> 23</span><span class="comment"> between 1e-7 and 1e-12.</span></div>
<div class="line"><span class="lineno"> 24</span><span class="comment"> double epsilon = 1e-12;</span></div>
<div class="line"><span class="lineno"> 25</span><span class="comment"> */</span></div>
<div class="line"><span class="lineno"> 26</span> <span class="keywordtype">double</span> epsilon = 1e-12;</div>
<div class="line"><span class="lineno"> 27</span> <span class="keywordflow">while</span> (l &lt;= r) {</div>
<div class="line"><span class="lineno"> 28</span> <span class="keywordtype">double</span> mid = (<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> + r) / 2;</div>
<div class="line"><span class="lineno"> 29</span> <span class="keywordflow">if</span> (mid * mid &gt; a) {</div>
<div class="line"><span class="lineno"> 30</span> r = mid;</div>
<div class="line"><span class="lineno"> 31</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 32</span> <span class="keywordflow">if</span> (a - mid * mid &lt; epsilon) {</div>
<div class="line"><span class="lineno"> 33</span> <span class="keywordflow">return</span> mid;</div>
<div class="line"><span class="lineno"> 34</span> }</div>
<div class="line"><span class="lineno"> 35</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> = mid;</div>
<div class="line"><span class="lineno"> 36</span> }</div>
<div class="line"><span class="lineno"> 37</span> }</div>
<div class="line"><span class="lineno"> 38</span> <span class="keywordflow">return</span> -1;</div>
<div class="line"><span class="lineno"> 39</span>}</div>
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a6d8df83a6f26ce24a75d3b358b7f5b8a"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">numerical_methods::simpson_method::l</a></div><div class="ttdeci">double l(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition:</b> composite_simpson_rule.cpp:119</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
@@ -211,7 +211,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../da/d24/sqrt__double_8cpp.html">sqrt_double.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -1,5 +1,5 @@
<map id="main" name="main">
<area shape="rect" id="node1" title=" " alt="" coords="5,43,56,69"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/fixed.html#" title=" " alt="" coords="104,5,180,32"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/fixed#" title=" " alt="" coords="104,5,180,32"/>
<area shape="rect" id="node3" href="$da/d24/sqrt__double_8cpp.html#ae662282ad0740d2063ac404ca3bd74fc" title=" " alt="" coords="119,80,165,107"/>
</map>

View File

@@ -1 +1 @@
06ef7e8fa10ba826c829428dba33d325
20c338c7c2db67d8396378a93300464a

View File

@@ -21,7 +21,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/fixed.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/fixed#" xlink:title=" ">
<polygon fill="white" stroke="black" points="74,-56.5 74,-75.5 131,-75.5 131,-56.5 74,-56.5"/>
<text text-anchor="middle" x="102.5" y="-63.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::fixed</text>
</a>

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,6 @@
<map id="data_structures::trie_using_hashmap::Trie" name="data_structures::trie_using_hashmap::Trie">
<area shape="rect" id="node1" title="Trie class, implementation of trie using hashmap in each trie node for all the characters of char16_t..." alt="" coords="286,5,437,47"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/memory/shared_ptr" title=" " alt="" coords="5,86,168,142"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_map" title=" " alt="" coords="277,71,445,157"/>
<area shape="rect" id="node3" href="$d5/d12/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node.html" title="struct representing a trie node." alt="" coords="543,153,732,195"/>
</map>

View File

@@ -0,0 +1 @@
6fb90c86f1cb2790b0272672923c7967

View File

@@ -0,0 +1,173 @@
<?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 2.50.0 (20211204.2007)
-->
<!-- Title: data_structures::trie_using_hashmap::Trie Pages: 1 -->
<!--zoomable 150 -->
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" onload="init(evt)">
<style type="text/css"><![CDATA[
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="text/javascript"><![CDATA[
var edges = document.getElementsByTagName('g');
if (edges && edges.length) {
for (var i=0;i<edges.length;i++) {
if (edges[i].id.substr(0,4)=='edge') {
edges[i].setAttribute('class','edge');
}
}
}
]]></script>
<defs>
<circle id="rim" cx="0" cy="0" r="7"/>
<circle id="rim2" cx="0" cy="0" r="3.5"/>
<g id="zoomPlus">
<use xlink:href="#rim" fill="#404040">
<set attributeName="fill" to="#808080" begin="zoomplus.mouseover" end="zoomplus.mouseout"/>
</use>
<path d="M-4,0h8M0,-4v8" fill="none" stroke="white" stroke-width="1.5" pointer-events="none"/>
</g>
<g id="zoomMin">
<use xlink:href="#rim" fill="#404040">
<set attributeName="fill" to="#808080" begin="zoomminus.mouseover" end="zoomminus.mouseout"/>
</use>
<path d="M-4,0h8" fill="none" stroke="white" stroke-width="1.5" pointer-events="none"/>
</g>
<g id="dirArrow">
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
</g>
<g id="resetDef">
<use xlink:href="#rim2" fill="#404040">
<set attributeName="fill" to="#808080" begin="reset.mouseover" end="reset.mouseout"/>
</use>
</g>
</defs>
<script type="text/javascript">
var viewWidth = 553;
var viewHeight = 150;
var sectionId = 'dynsection-0';
</script>
<script xlink:href="../../svgpan.js"/>
<svg id="graph" class="graph">
<g id="viewport">
<title>data_structures::trie_using_hashmap::Trie</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-146 549,-146 549,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Trie class, implementation of trie using hashmap in each trie node for all the characters of char16_t...">
<polygon fill="#bfbfbf" stroke="black" points="210.5,-111.5 210.5,-141.5 323.5,-141.5 323.5,-111.5 210.5,-111.5"/>
<text text-anchor="start" x="218.5" y="-129.5" font-family="Helvetica,sans-Serif" font-size="10.00">data_structures::trie</text>
<text text-anchor="middle" x="267" y="-118.5" font-family="Helvetica,sans-Serif" font-size="10.00">_using_hashmap::Trie</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/memory/shared_ptr" xlink:title=" ">
<polygon fill="white" stroke="black" points="0,-40 0,-81 122,-81 122,-40 0,-40"/>
<text text-anchor="start" x="8" y="-69" font-family="Helvetica,sans-Serif" font-size="10.00">std::shared_ptr&lt; data</text>
<text text-anchor="start" x="8" y="-58" font-family="Helvetica,sans-Serif" font-size="10.00">_structures::trie_using</text>
<text text-anchor="middle" x="61" y="-47" font-family="Helvetica,sans-Serif" font-size="10.00">_hashmap::Trie::Node &gt;</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node1 -->
<g id="edge1" class="edge">
<title>Node2&#45;&gt;Node1</title>
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M131.77,-83.07C160.77,-92.45 193.64,-103.09 219.59,-111.48"/>
<polygon fill="#9a32cd" stroke="#9a32cd" points="132.7,-79.69 122.1,-79.95 130.54,-86.35 132.7,-79.69"/>
<text text-anchor="middle" x="163" y="-101.5" font-family="Helvetica,sans-Serif" font-size="10.00"> root_node</text>
</g>
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_map" xlink:title=" ">
<polygon fill="white" stroke="black" points="204,-29 204,-92 330,-92 330,-29 204,-29"/>
<text text-anchor="start" x="212" y="-80" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_map</text>
<text text-anchor="start" x="212" y="-69" font-family="Helvetica,sans-Serif" font-size="10.00">&lt; char16_t, std::shared</text>
<text text-anchor="start" x="212" y="-58" font-family="Helvetica,sans-Serif" font-size="10.00">_ptr&lt; data_structures::</text>
<text text-anchor="start" x="212" y="-47" font-family="Helvetica,sans-Serif" font-size="10.00">trie_using_hashmap::Trie</text>
<text text-anchor="middle" x="267" y="-36" font-family="Helvetica,sans-Serif" font-size="10.00">::Node &gt; &gt;</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node4 -->
<g id="edge4" class="edge">
<title>Node2&#45;&gt;Node4</title>
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M132.25,-60.5C155.52,-60.5 181.24,-60.5 203.85,-60.5"/>
<polygon fill="#9a32cd" stroke="#9a32cd" points="132.1,-57 122.1,-60.5 132.1,-64 132.1,-57"/>
<text text-anchor="middle" x="163" y="-63.5" font-family="Helvetica,sans-Serif" font-size="10.00"> elements</text>
</g>
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a xlink:href="../../d5/d12/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node.html" target="_top" xlink:title="struct representing a trie node.">
<polygon fill="white" stroke="black" points="403,-0.5 403,-30.5 545,-30.5 545,-0.5 403,-0.5"/>
<text text-anchor="start" x="411" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">data_structures::trie</text>
<text text-anchor="middle" x="474" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">_using_hashmap::Trie::Node</text>
</a>
</g>
</g>
<!-- Node3&#45;&gt;Node2 -->
<g id="edge2" class="edge">
<title>Node3&#45;&gt;Node2</title>
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M392.59,-5.04C338.8,-0.08 266.66,2.61 204,-8.5 169.88,-14.55 133.19,-28.19 105.66,-39.98"/>
<polygon fill="#9a32cd" stroke="#9a32cd" points="392.47,-8.54 402.76,-6.02 393.14,-1.58 392.47,-8.54"/>
<text text-anchor="middle" x="267" y="-11.5" font-family="Helvetica,sans-Serif" font-size="10.00"> ptr</text>
</g>
<!-- Node4&#45;&gt;Node3 -->
<g id="edge3" class="edge">
<title>Node4&#45;&gt;Node3</title>
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M339.85,-44.73C360.79,-40.13 383.61,-35.12 404.35,-30.57"/>
<polygon fill="#9a32cd" stroke="#9a32cd" points="339.08,-41.31 330.06,-46.88 340.58,-48.15 339.08,-41.31"/>
<text text-anchor="middle" x="366.5" y="-44.5" font-family="Helvetica,sans-Serif" font-size="10.00"> children</text>
</g>
</g>
</svg>
<g id="navigator" transform="translate(0 0)" fill="#404254">
<rect fill="#f2f5e9" fill-opacity="0.5" stroke="#606060" stroke-width=".5" x="0" y="0" width="60" height="60"/>
<use id="zoomplus" xlink:href="#zoomPlus" x="17" y="9" onmousedown="handleZoom(evt,'in')"/>
<use id="zoomminus" xlink:href="#zoomMin" x="42" y="9" onmousedown="handleZoom(evt,'out')"/>
<use id="reset" xlink:href="#resetDef" x="30" y="36" onmousedown="handleReset()"/>
<g id="arrowUp" xlink:href="#dirArrow" transform="translate(30 24)" onmousedown="handlePan(0,-1)">
<use xlink:href="#rim" fill="#404040">
<set attributeName="fill" to="#808080" begin="arrowUp.mouseover" end="arrowUp.mouseout"/>
</use>
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
</g>
<g id="arrowRight" xlink:href="#dirArrow" transform="rotate(90) translate(36 -43)" onmousedown="handlePan(1,0)">
<use xlink:href="#rim" fill="#404040">
<set attributeName="fill" to="#808080" begin="arrowRight.mouseover" end="arrowRight.mouseout"/>
</use>
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
</g>
<g id="arrowDown" xlink:href="#dirArrow" transform="rotate(180) translate(-30 -48)" onmousedown="handlePan(0,1)">
<use xlink:href="#rim" fill="#404040">
<set attributeName="fill" to="#808080" begin="arrowDown.mouseover" end="arrowDown.mouseout"/>
</use>
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
</g>
<g id="arrowLeft" xlink:href="#dirArrow" transform="rotate(270) translate(-36 17)" onmousedown="handlePan(-1,0)">
<use xlink:href="#rim" fill="#404040">
<set attributeName="fill" to="#808080" begin="arrowLeft.mouseover" end="arrowLeft.mouseout"/>
</use>
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
</g>
</g>
<svg viewBox="0 0 15 15" width="100%" height="30px" preserveAspectRatio="xMaxYMin meet">
<g id="arrow_out" transform="scale(0.3 0.3)">
<a xlink:href="classdata__structures_1_1trie__using__hashmap_1_1_trie__coll__graph_org.svg" target="_base">
<rect id="button" ry="5" rx="5" y="6" x="6" height="38" width="38"
fill="#f2f5e9" fill-opacity="0.5" stroke="#606060" stroke-width="1.0"/>
<path id="arrow"
d="M 11.500037,31.436501 C 11.940474,20.09759 22.043105,11.32322 32.158766,21.979434 L 37.068811,17.246167 C 37.068811,17.246167 37.088388,32 37.088388,32 L 22.160133,31.978069 C 22.160133,31.978069 26.997745,27.140456 26.997745,27.140456 C 18.528582,18.264221 13.291696,25.230495 11.500037,31.436501 z"
style="fill:#404040;"/>
</a>
</g>
</svg>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,85 @@
<?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 2.50.0 (20211204.2007)
-->
<!-- Title: data_structures::trie_using_hashmap::Trie Pages: 1 -->
<svg width="553pt" height="150pt"
viewBox="0.00 0.00 553.00 150.00" 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 146)">
<title>data_structures::trie_using_hashmap::Trie</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-146 549,-146 549,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Trie class, implementation of trie using hashmap in each trie node for all the characters of char16_t...">
<polygon fill="#bfbfbf" stroke="black" points="210.5,-111.5 210.5,-141.5 323.5,-141.5 323.5,-111.5 210.5,-111.5"/>
<text text-anchor="start" x="218.5" y="-129.5" font-family="Helvetica,sans-Serif" font-size="10.00">data_structures::trie</text>
<text text-anchor="middle" x="267" y="-118.5" font-family="Helvetica,sans-Serif" font-size="10.00">_using_hashmap::Trie</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/memory/shared_ptr" xlink:title=" ">
<polygon fill="white" stroke="black" points="0,-40 0,-81 122,-81 122,-40 0,-40"/>
<text text-anchor="start" x="8" y="-69" font-family="Helvetica,sans-Serif" font-size="10.00">std::shared_ptr&lt; data</text>
<text text-anchor="start" x="8" y="-58" font-family="Helvetica,sans-Serif" font-size="10.00">_structures::trie_using</text>
<text text-anchor="middle" x="61" y="-47" font-family="Helvetica,sans-Serif" font-size="10.00">_hashmap::Trie::Node &gt;</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node1 -->
<g id="edge1" class="edge">
<title>Node2&#45;&gt;Node1</title>
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M131.77,-83.07C160.77,-92.45 193.64,-103.09 219.59,-111.48"/>
<polygon fill="#9a32cd" stroke="#9a32cd" points="132.7,-79.69 122.1,-79.95 130.54,-86.35 132.7,-79.69"/>
<text text-anchor="middle" x="163" y="-101.5" font-family="Helvetica,sans-Serif" font-size="10.00"> root_node</text>
</g>
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_map" xlink:title=" ">
<polygon fill="white" stroke="black" points="204,-29 204,-92 330,-92 330,-29 204,-29"/>
<text text-anchor="start" x="212" y="-80" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_map</text>
<text text-anchor="start" x="212" y="-69" font-family="Helvetica,sans-Serif" font-size="10.00">&lt; char16_t, std::shared</text>
<text text-anchor="start" x="212" y="-58" font-family="Helvetica,sans-Serif" font-size="10.00">_ptr&lt; data_structures::</text>
<text text-anchor="start" x="212" y="-47" font-family="Helvetica,sans-Serif" font-size="10.00">trie_using_hashmap::Trie</text>
<text text-anchor="middle" x="267" y="-36" font-family="Helvetica,sans-Serif" font-size="10.00">::Node &gt; &gt;</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node4 -->
<g id="edge4" class="edge">
<title>Node2&#45;&gt;Node4</title>
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M132.25,-60.5C155.52,-60.5 181.24,-60.5 203.85,-60.5"/>
<polygon fill="#9a32cd" stroke="#9a32cd" points="132.1,-57 122.1,-60.5 132.1,-64 132.1,-57"/>
<text text-anchor="middle" x="163" y="-63.5" font-family="Helvetica,sans-Serif" font-size="10.00"> elements</text>
</g>
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a xlink:href="../../d5/d12/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node.html" target="_top" xlink:title="struct representing a trie node.">
<polygon fill="white" stroke="black" points="403,-0.5 403,-30.5 545,-30.5 545,-0.5 403,-0.5"/>
<text text-anchor="start" x="411" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">data_structures::trie</text>
<text text-anchor="middle" x="474" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">_using_hashmap::Trie::Node</text>
</a>
</g>
</g>
<!-- Node3&#45;&gt;Node2 -->
<g id="edge2" class="edge">
<title>Node3&#45;&gt;Node2</title>
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M392.59,-5.04C338.8,-0.08 266.66,2.61 204,-8.5 169.88,-14.55 133.19,-28.19 105.66,-39.98"/>
<polygon fill="#9a32cd" stroke="#9a32cd" points="392.47,-8.54 402.76,-6.02 393.14,-1.58 392.47,-8.54"/>
<text text-anchor="middle" x="267" y="-11.5" font-family="Helvetica,sans-Serif" font-size="10.00"> ptr</text>
</g>
<!-- Node4&#45;&gt;Node3 -->
<g id="edge3" class="edge">
<title>Node4&#45;&gt;Node3</title>
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M339.85,-44.73C360.79,-40.13 383.61,-35.12 404.35,-30.57"/>
<polygon fill="#9a32cd" stroke="#9a32cd" points="339.08,-41.31 330.06,-46.88 340.58,-48.15 339.08,-41.31"/>
<text text-anchor="middle" x="366.5" y="-44.5" font-family="Helvetica,sans-Serif" font-size="10.00"> children</text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

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

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: math/volume.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -176,10 +176,10 @@ Functions</h2></td></tr>
<p>Main function. </p>
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
<div class="fragment"><div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> {</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> <a class="code hl_function" href="../../da/d39/volume_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 235</span> {</div>
<div class="line"><span class="lineno"> 236</span> <a class="code hl_function" href="../../da/d39/volume_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
<div class="line"><span class="lineno"> 237</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 238</span>}</div>
<div class="ttc" id="avolume_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../da/d39/volume_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> volume.cpp:112</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
@@ -215,124 +215,124 @@ Here is the call graph for this function:</div>
<p>Self-test implementations. </p>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> {</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="comment">// Input variables</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> uint32_t int_length = 0; <span class="comment">// 32 bit integer length input</span></div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> uint32_t int_width = 0; <span class="comment">// 32 bit integer width input</span></div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> uint32_t int_base = 0; <span class="comment">// 32 bit integer base input</span></div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> uint32_t int_height = 0; <span class="comment">// 32 bit integer height input</span></div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> uint32_t int_depth = 0; <span class="comment">// 32 bit integer depth input</span></div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> </div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordtype">double</span> double_radius = NAN; <span class="comment">// double radius input</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordtype">double</span> double_height = NAN; <span class="comment">// double height input</span></div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> </div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="comment">// Output variables</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> uint32_t int_expected = 0; <span class="comment">// 32 bit integer expected output</span></div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> uint32_t int_volume = 0; <span class="comment">// 32 bit integer output</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> </div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keywordtype">double</span> double_expected = NAN; <span class="comment">// double expected output</span></div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keywordtype">double</span> double_volume = NAN; <span class="comment">// double output</span></div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> </div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="comment">// 1st test</span></div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> int_length = 5;</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> int_expected = 125;</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> int_volume = <a class="code hl_function" href="../../dd/d47/namespacemath.html#ae413098478fa38acaac887b7654f0725">math::cube_volume</a>(int_length);</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> </div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;VOLUME OF A CUBE&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Length: &quot;</span> &lt;&lt; int_length &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; int_expected &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; int_volume &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> assert(int_volume == int_expected);</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</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="comment">// 2nd test</span></div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> int_length = 4;</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> int_width = 3;</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> int_height = 5;</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> int_expected = 60;</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> int_volume = <a class="code hl_function" href="../../dd/d47/namespacemath.html#a3fdc74c24697ec5bb5c3698c96117c12">math::rect_prism_volume</a>(int_length, int_width, int_height);</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> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;VOLUME OF A RECTANGULAR PRISM&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Length: &quot;</span> &lt;&lt; int_length &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Width: &quot;</span> &lt;&lt; int_width &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Height: &quot;</span> &lt;&lt; int_height &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; int_expected &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; int_volume &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> assert(int_volume == int_expected);</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<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">// 3rd test</span></div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> double_radius = 5;</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> double_height = 7;</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> double_expected = 183.16666666666666; <span class="comment">// truncated to 14 decimal places</span></div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> double_volume = <a class="code hl_function" href="../../dd/d47/namespacemath.html#a3fe35440c27758ecc2287e08217d63a7">math::cone_volume</a>(double_radius, double_height);</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> </div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;VOLUME OF A CONE&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Radius: &quot;</span> &lt;&lt; double_radius &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Height: &quot;</span> &lt;&lt; double_height &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; double_expected &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; double_volume &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> assert(double_volume == double_expected);</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> </div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="comment">// 4th test</span></div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> int_base = 3;</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> int_height = 4;</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> int_depth = 5;</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> int_expected = 30;</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> int_volume = <a class="code hl_function" href="../../dd/d47/namespacemath.html#a2d704a7b72a6b2db8b76c8581b577b2c">math::triangle_prism_volume</a>(int_base, int_height, int_depth);</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> </div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;VOLUME OF A TRIANGULAR PRISM&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Base: &quot;</span> &lt;&lt; int_base &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Height: &quot;</span> &lt;&lt; int_height &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Depth: &quot;</span> &lt;&lt; int_depth &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; int_expected &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; int_volume &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> assert(int_volume == int_expected);</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> </div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> <span class="comment">// 5th test</span></div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> int_length = 10;</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> int_width = 3;</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> int_height = 5;</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> int_expected = 50;</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> int_volume = <a class="code hl_function" href="../../dd/d47/namespacemath.html#a94db02b3c9e55a69ac1696f30e2f761c">math::pyramid_volume</a>(int_length, int_width, int_height);</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> </div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;VOLUME OF A PYRAMID&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Length: &quot;</span> &lt;&lt; int_length &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Width: &quot;</span> &lt;&lt; int_width &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Height: &quot;</span> &lt;&lt; int_height &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; int_expected &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; int_volume &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> assert(int_volume == int_expected);</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> </div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> <span class="comment">// 6th test</span></div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> double_radius = 3;</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> double_expected = 113.04;</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> double_volume = <a class="code hl_function" href="../../dd/d47/namespacemath.html#a34d66a77c19ce9b8b3a3d14352b34551">math::sphere_volume</a>(double_radius);</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> </div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;VOLUME OF A SPHERE&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Radius: &quot;</span> &lt;&lt; double_radius &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; double_expected &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; double_volume &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> assert(double_volume == double_expected);</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> </div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> <span class="comment">// 7th test</span></div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> double_radius = 5;</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> double_height = 2;</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> double_expected = 157;</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> double_volume = <a class="code hl_function" href="../../dd/d47/namespacemath.html#abde24398be43538c62e4a496968e60ca">math::cylinder_volume</a>(double_radius, double_height);</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> </div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;VOLUME OF A CYLINDER&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Radius: &quot;</span> &lt;&lt; double_radius &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Height: &quot;</span> &lt;&lt; double_height &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; double_expected &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; double_volume &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> assert(double_volume == double_expected);</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 112</span> {</div>
<div class="line"><span class="lineno"> 113</span> <span class="comment">// Input variables</span></div>
<div class="line"><span class="lineno"> 114</span> uint32_t int_length = 0; <span class="comment">// 32 bit integer length input</span></div>
<div class="line"><span class="lineno"> 115</span> uint32_t int_width = 0; <span class="comment">// 32 bit integer width input</span></div>
<div class="line"><span class="lineno"> 116</span> uint32_t int_base = 0; <span class="comment">// 32 bit integer base input</span></div>
<div class="line"><span class="lineno"> 117</span> uint32_t int_height = 0; <span class="comment">// 32 bit integer height input</span></div>
<div class="line"><span class="lineno"> 118</span> uint32_t int_depth = 0; <span class="comment">// 32 bit integer depth input</span></div>
<div class="line"><span class="lineno"> 119</span> </div>
<div class="line"><span class="lineno"> 120</span> <span class="keywordtype">double</span> double_radius = NAN; <span class="comment">// double radius input</span></div>
<div class="line"><span class="lineno"> 121</span> <span class="keywordtype">double</span> double_height = NAN; <span class="comment">// double height input</span></div>
<div class="line"><span class="lineno"> 122</span> </div>
<div class="line"><span class="lineno"> 123</span> <span class="comment">// Output variables</span></div>
<div class="line"><span class="lineno"> 124</span> uint32_t int_expected = 0; <span class="comment">// 32 bit integer expected output</span></div>
<div class="line"><span class="lineno"> 125</span> uint32_t int_volume = 0; <span class="comment">// 32 bit integer output</span></div>
<div class="line"><span class="lineno"> 126</span> </div>
<div class="line"><span class="lineno"> 127</span> <span class="keywordtype">double</span> double_expected = NAN; <span class="comment">// double expected output</span></div>
<div class="line"><span class="lineno"> 128</span> <span class="keywordtype">double</span> double_volume = NAN; <span class="comment">// double output</span></div>
<div class="line"><span class="lineno"> 129</span> </div>
<div class="line"><span class="lineno"> 130</span> <span class="comment">// 1st test</span></div>
<div class="line"><span class="lineno"> 131</span> int_length = 5;</div>
<div class="line"><span class="lineno"> 132</span> int_expected = 125;</div>
<div class="line"><span class="lineno"> 133</span> int_volume = <a class="code hl_function" href="../../dd/d47/namespacemath.html#ae413098478fa38acaac887b7654f0725">math::cube_volume</a>(int_length);</div>
<div class="line"><span class="lineno"> 134</span> </div>
<div class="line"><span class="lineno"> 135</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;VOLUME OF A CUBE&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 136</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Length: &quot;</span> &lt;&lt; int_length &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 137</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; int_expected &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 138</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; int_volume &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 139</span> assert(int_volume == int_expected);</div>
<div class="line"><span class="lineno"> 140</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 141</span> </div>
<div class="line"><span class="lineno"> 142</span> <span class="comment">// 2nd test</span></div>
<div class="line"><span class="lineno"> 143</span> int_length = 4;</div>
<div class="line"><span class="lineno"> 144</span> int_width = 3;</div>
<div class="line"><span class="lineno"> 145</span> int_height = 5;</div>
<div class="line"><span class="lineno"> 146</span> int_expected = 60;</div>
<div class="line"><span class="lineno"> 147</span> int_volume = <a class="code hl_function" href="../../dd/d47/namespacemath.html#a3fdc74c24697ec5bb5c3698c96117c12">math::rect_prism_volume</a>(int_length, int_width, int_height);</div>
<div class="line"><span class="lineno"> 148</span> </div>
<div class="line"><span class="lineno"> 149</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;VOLUME OF A RECTANGULAR PRISM&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 150</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Length: &quot;</span> &lt;&lt; int_length &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 151</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Width: &quot;</span> &lt;&lt; int_width &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 152</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Height: &quot;</span> &lt;&lt; int_height &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 153</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; int_expected &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 154</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; int_volume &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 155</span> assert(int_volume == int_expected);</div>
<div class="line"><span class="lineno"> 156</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 157</span> </div>
<div class="line"><span class="lineno"> 158</span> <span class="comment">// 3rd test</span></div>
<div class="line"><span class="lineno"> 159</span> double_radius = 5;</div>
<div class="line"><span class="lineno"> 160</span> double_height = 7;</div>
<div class="line"><span class="lineno"> 161</span> double_expected = 183.16666666666666; <span class="comment">// truncated to 14 decimal places</span></div>
<div class="line"><span class="lineno"> 162</span> double_volume = <a class="code hl_function" href="../../dd/d47/namespacemath.html#a3fe35440c27758ecc2287e08217d63a7">math::cone_volume</a>(double_radius, double_height);</div>
<div class="line"><span class="lineno"> 163</span> </div>
<div class="line"><span class="lineno"> 164</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;VOLUME OF A CONE&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 165</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Radius: &quot;</span> &lt;&lt; double_radius &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 166</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Height: &quot;</span> &lt;&lt; double_height &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 167</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; double_expected &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 168</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; double_volume &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 169</span> assert(double_volume == double_expected);</div>
<div class="line"><span class="lineno"> 170</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 171</span> </div>
<div class="line"><span class="lineno"> 172</span> <span class="comment">// 4th test</span></div>
<div class="line"><span class="lineno"> 173</span> int_base = 3;</div>
<div class="line"><span class="lineno"> 174</span> int_height = 4;</div>
<div class="line"><span class="lineno"> 175</span> int_depth = 5;</div>
<div class="line"><span class="lineno"> 176</span> int_expected = 30;</div>
<div class="line"><span class="lineno"> 177</span> int_volume = <a class="code hl_function" href="../../dd/d47/namespacemath.html#a2d704a7b72a6b2db8b76c8581b577b2c">math::triangle_prism_volume</a>(int_base, int_height, int_depth);</div>
<div class="line"><span class="lineno"> 178</span> </div>
<div class="line"><span class="lineno"> 179</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;VOLUME OF A TRIANGULAR PRISM&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 180</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Base: &quot;</span> &lt;&lt; int_base &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 181</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Height: &quot;</span> &lt;&lt; int_height &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 182</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Depth: &quot;</span> &lt;&lt; int_depth &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 183</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; int_expected &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 184</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; int_volume &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 185</span> assert(int_volume == int_expected);</div>
<div class="line"><span class="lineno"> 186</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 187</span> </div>
<div class="line"><span class="lineno"> 188</span> <span class="comment">// 5th test</span></div>
<div class="line"><span class="lineno"> 189</span> int_length = 10;</div>
<div class="line"><span class="lineno"> 190</span> int_width = 3;</div>
<div class="line"><span class="lineno"> 191</span> int_height = 5;</div>
<div class="line"><span class="lineno"> 192</span> int_expected = 50;</div>
<div class="line"><span class="lineno"> 193</span> int_volume = <a class="code hl_function" href="../../dd/d47/namespacemath.html#a94db02b3c9e55a69ac1696f30e2f761c">math::pyramid_volume</a>(int_length, int_width, int_height);</div>
<div class="line"><span class="lineno"> 194</span> </div>
<div class="line"><span class="lineno"> 195</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;VOLUME OF A PYRAMID&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 196</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Length: &quot;</span> &lt;&lt; int_length &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 197</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Width: &quot;</span> &lt;&lt; int_width &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 198</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Height: &quot;</span> &lt;&lt; int_height &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 199</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; int_expected &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 200</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; int_volume &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 201</span> assert(int_volume == int_expected);</div>
<div class="line"><span class="lineno"> 202</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 203</span> </div>
<div class="line"><span class="lineno"> 204</span> <span class="comment">// 6th test</span></div>
<div class="line"><span class="lineno"> 205</span> double_radius = 3;</div>
<div class="line"><span class="lineno"> 206</span> double_expected = 113.04;</div>
<div class="line"><span class="lineno"> 207</span> double_volume = <a class="code hl_function" href="../../dd/d47/namespacemath.html#a34d66a77c19ce9b8b3a3d14352b34551">math::sphere_volume</a>(double_radius);</div>
<div class="line"><span class="lineno"> 208</span> </div>
<div class="line"><span class="lineno"> 209</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;VOLUME OF A SPHERE&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 210</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Radius: &quot;</span> &lt;&lt; double_radius &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 211</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; double_expected &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 212</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; double_volume &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 213</span> assert(double_volume == double_expected);</div>
<div class="line"><span class="lineno"> 214</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 215</span> </div>
<div class="line"><span class="lineno"> 216</span> <span class="comment">// 7th test</span></div>
<div class="line"><span class="lineno"> 217</span> double_radius = 5;</div>
<div class="line"><span class="lineno"> 218</span> double_height = 2;</div>
<div class="line"><span class="lineno"> 219</span> double_expected = 157;</div>
<div class="line"><span class="lineno"> 220</span> double_volume = <a class="code hl_function" href="../../dd/d47/namespacemath.html#abde24398be43538c62e4a496968e60ca">math::cylinder_volume</a>(double_radius, double_height);</div>
<div class="line"><span class="lineno"> 221</span> </div>
<div class="line"><span class="lineno"> 222</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;VOLUME OF A CYLINDER&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 223</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Radius: &quot;</span> &lt;&lt; double_radius &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 224</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Input Height: &quot;</span> &lt;&lt; double_height &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 225</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; double_expected &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 226</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; double_volume &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 227</span> assert(double_volume == double_expected);</div>
<div class="line"><span class="lineno"> 228</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 229</span>}</div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
<div class="ttc" id="anamespacemath_html_a2d704a7b72a6b2db8b76c8581b577b2c"><div class="ttname"><a href="../../dd/d47/namespacemath.html#a2d704a7b72a6b2db8b76c8581b577b2c">math::triangle_prism_volume</a></div><div class="ttdeci">T triangle_prism_volume(T base, T height, T depth)</div><div class="ttdoc">The volume of a triangular prism.</div><div class="ttdef"><b>Definition:</b> volume.cpp:67</div></div>
@@ -357,7 +357,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../da/d39/volume_8cpp.html">volume.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -3,11 +3,11 @@
<area shape="rect" id="node2" href="$dd/d47/namespacemath.html#a3fe35440c27758ecc2287e08217d63a7" title="The volume of a cone" alt="" coords="114,173,250,200"/>
<area shape="rect" id="node5" href="$dd/d47/namespacemath.html#ae413098478fa38acaac887b7654f0725" title="The volume of a cube" alt="" coords="114,275,250,301"/>
<area shape="rect" id="node6" href="$dd/d47/namespacemath.html#abde24398be43538c62e4a496968e60ca" title="The volume of a cylinder" alt="" coords="105,224,259,251"/>
<area shape="rect" id="node7" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="146,376,218,403"/>
<area shape="rect" id="node7" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="146,376,218,403"/>
<area shape="rect" id="node8" href="$dd/d47/namespacemath.html#a94db02b3c9e55a69ac1696f30e2f761c" title="The volume of a pyramid" alt="" coords="105,5,259,32"/>
<area shape="rect" id="node9" href="$dd/d47/namespacemath.html#a3fdc74c24697ec5bb5c3698c96117c12" title="The volume of a rectangular prism." alt="" coords="97,56,267,83"/>
<area shape="rect" id="node10" href="$dd/d47/namespacemath.html#a34d66a77c19ce9b8b3a3d14352b34551" title="The volume of a sphere" alt="" coords="109,325,255,352"/>
<area shape="rect" id="node11" href="$dd/d47/namespacemath.html#a2d704a7b72a6b2db8b76c8581b577b2c" title="The volume of a triangular prism." alt="" coords="112,107,252,149"/>
<area shape="rect" id="node3" href="$d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83" title=" " alt="" coords="322,115,379,141"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow.html#" title=" " alt="" coords="315,249,387,276"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow#" title=" " alt="" coords="315,249,387,276"/>
</map>

View File

@@ -1 +1 @@
7b0fda5c9a3d29d4ea02d6d8c733dd11
69c3cba8c6f7ea9c470901c0974e418d

View File

@@ -66,7 +66,7 @@
<!-- Node7 -->
<g id="node7" class="node">
<title>Node7</title>
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
<polygon fill="white" stroke="black" points="105.5,-0.5 105.5,-19.5 159.5,-19.5 159.5,-0.5 105.5,-0.5"/>
<text text-anchor="middle" x="132.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>
@@ -157,7 +157,7 @@
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow.html#" xlink:title=" ">
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow#" xlink:title=" ">
<polygon fill="white" stroke="black" points="232,-95.5 232,-114.5 286,-114.5 286,-95.5 232,-95.5"/>
<text text-anchor="middle" x="259" y="-102.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::pow</text>
</a>

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -4,11 +4,11 @@
<area shape="rect" id="node3" href="$dd/d47/namespacemath.html#a3fe35440c27758ecc2287e08217d63a7" title="The volume of a cone" alt="" coords="213,173,349,200"/>
<area shape="rect" id="node6" href="$dd/d47/namespacemath.html#ae413098478fa38acaac887b7654f0725" title="The volume of a cube" alt="" coords="213,275,349,301"/>
<area shape="rect" id="node7" href="$dd/d47/namespacemath.html#abde24398be43538c62e4a496968e60ca" title="The volume of a cylinder" alt="" coords="204,224,357,251"/>
<area shape="rect" id="node8" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="245,376,317,403"/>
<area shape="rect" id="node8" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="245,376,317,403"/>
<area shape="rect" id="node9" href="$dd/d47/namespacemath.html#a94db02b3c9e55a69ac1696f30e2f761c" title="The volume of a pyramid" alt="" coords="203,5,358,32"/>
<area shape="rect" id="node10" href="$dd/d47/namespacemath.html#a3fdc74c24697ec5bb5c3698c96117c12" title="The volume of a rectangular prism." alt="" coords="196,56,365,83"/>
<area shape="rect" id="node11" href="$dd/d47/namespacemath.html#a34d66a77c19ce9b8b3a3d14352b34551" title="The volume of a sphere" alt="" coords="207,325,354,352"/>
<area shape="rect" id="node12" href="$dd/d47/namespacemath.html#a2d704a7b72a6b2db8b76c8581b577b2c" title="The volume of a triangular prism." alt="" coords="211,107,351,149"/>
<area shape="rect" id="node4" href="$d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83" title=" " alt="" coords="421,115,478,141"/>
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow.html#" title=" " alt="" coords="413,249,485,276"/>
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/pow#" title=" " alt="" coords="413,249,485,276"/>
</map>

View File

@@ -1 +1 @@
cd656c3a4ac5bc77f63aec69e49a99fe
a7288f68e9095abaf569e781cca264a2

View File

@@ -81,7 +81,7 @@
<!-- Node8 -->
<g id="node8" class="node">
<title>Node8</title>
<g id="a_node8"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<g id="a_node8"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
<polygon fill="white" stroke="black" points="179.5,-0.5 179.5,-19.5 233.5,-19.5 233.5,-0.5 179.5,-0.5"/>
<text text-anchor="middle" x="206.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>
@@ -172,7 +172,7 @@
<!-- Node5 -->
<g id="node5" class="node">
<title>Node5</title>
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow.html#" xlink:title=" ">
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/pow#" xlink:title=" ">
<polygon fill="white" stroke="black" points="306,-95.5 306,-114.5 360,-114.5 360,-95.5 306,-95.5"/>
<text text-anchor="middle" x="333" y="-102.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::pow</text>
</a>

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: ciphers/uint128_t.hpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -245,24 +245,24 @@ Functions</h2></td></tr>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string denoting the addition of both the strings </dd></dl>
<div class="fragment"><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> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> third;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> int16_t <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a> = 0, carry = 0;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordflow">for</span> (int32_t i = <span class="keyword">static_cast&lt;</span>int32_t<span class="keyword">&gt;</span>(first.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>()) - 1,</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> j = <span class="keyword">static_cast&lt;</span>int32_t<span class="keyword">&gt;</span>(second.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>()) - 1;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> i &gt;= 0 || j &gt;= 0; --i, --j) {</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a> = ((i &gt;= 0 ? first[i] - <span class="charliteral">&#39;0&#39;</span> : 0) + (j &gt;= 0 ? second[j] - <span class="charliteral">&#39;0&#39;</span> : 0) +</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> carry);</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> carry = <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a> / 10;</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a> %= 10;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> third.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/push_back.html">push_back</a>(<a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a> + <span class="charliteral">&#39;0&#39;</span>);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> }</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">if</span> (carry) {</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> third.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/push_back.html">push_back</a>(<span class="charliteral">&#39;1&#39;</span>);</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> }</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/reverse.html">std::reverse</a>(third.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/begin.html">begin</a>(), third.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/end.html">end</a>());</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordflow">return</span> third;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 37</span> {</div>
<div class="line"><span class="lineno"> 38</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> third;</div>
<div class="line"><span class="lineno"> 39</span> int16_t <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a> = 0, carry = 0;</div>
<div class="line"><span class="lineno"> 40</span> <span class="keywordflow">for</span> (int32_t i = <span class="keyword">static_cast&lt;</span>int32_t<span class="keyword">&gt;</span>(first.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>()) - 1,</div>
<div class="line"><span class="lineno"> 41</span> j = <span class="keyword">static_cast&lt;</span>int32_t<span class="keyword">&gt;</span>(second.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">size</a>()) - 1;</div>
<div class="line"><span class="lineno"> 42</span> i &gt;= 0 || j &gt;= 0; --i, --j) {</div>
<div class="line"><span class="lineno"> 43</span> <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a> = ((i &gt;= 0 ? first[i] - <span class="charliteral">&#39;0&#39;</span> : 0) + (j &gt;= 0 ? second[j] - <span class="charliteral">&#39;0&#39;</span> : 0) +</div>
<div class="line"><span class="lineno"> 44</span> carry);</div>
<div class="line"><span class="lineno"> 45</span> carry = <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a> / 10;</div>
<div class="line"><span class="lineno"> 46</span> <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a> %= 10;</div>
<div class="line"><span class="lineno"> 47</span> third.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/push_back.html">push_back</a>(<a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a> + <span class="charliteral">&#39;0&#39;</span>);</div>
<div class="line"><span class="lineno"> 48</span> }</div>
<div class="line"><span class="lineno"> 49</span> <span class="keywordflow">if</span> (carry) {</div>
<div class="line"><span class="lineno"> 50</span> third.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/push_back.html">push_back</a>(<span class="charliteral">&#39;1&#39;</span>);</div>
<div class="line"><span class="lineno"> 51</span> }</div>
<div class="line"><span class="lineno"> 52</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/reverse.html">std::reverse</a>(third.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/begin.html">begin</a>(), third.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/end.html">end</a>());</div>
<div class="line"><span class="lineno"> 53</span> <span class="keywordflow">return</span> third;</div>
<div class="line"><span class="lineno"> 54</span>}</div>
<div class="ttc" id="abasic_string_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a></div></div>
<div class="ttc" id="abegin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string/begin.html">std::string::begin</a></div><div class="ttdeci">T begin(T... args)</div></div>
<div class="ttc" id="aend_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string/end.html">std::string::end</a></div><div class="ttdeci">T end(T... args)</div></div>
@@ -314,9 +314,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01078" name="l01078"></a><span class="lineno"> 1078</span> {</div>
<div class="line"><a id="l01079" name="l01079"></a><span class="lineno"> 1079</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) != q;</div>
<div class="line"><a id="l01080" name="l01080"></a><span class="lineno"> 1080</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1078</span> {</div>
<div class="line"><span class="lineno"> 1079</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) != q;</div>
<div class="line"><span class="lineno"> 1080</span>}</div>
<div class="ttc" id="aclassuint128__t_html"><div class="ttname"><a href="../../db/d9a/classuint128__t.html">uint128_t</a></div><div class="ttdoc">class for 128-bit unsigned integer</div><div class="ttdef"><b>Definition:</b> uint128_t.hpp:59</div></div>
</div><!-- fragment -->
</div>
@@ -356,9 +356,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01033" name="l01033"></a><span class="lineno"> 1033</span> {</div>
<div class="line"><a id="l01034" name="l01034"></a><span class="lineno"> 1034</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) % q;</div>
<div class="line"><a id="l01035" name="l01035"></a><span class="lineno"> 1035</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1033</span> {</div>
<div class="line"><span class="lineno"> 1034</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) % q;</div>
<div class="line"><span class="lineno"> 1035</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -397,9 +397,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01040" name="l01040"></a><span class="lineno"> 1040</span> {</div>
<div class="line"><a id="l01041" name="l01041"></a><span class="lineno"> 1041</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) &amp; q;</div>
<div class="line"><a id="l01042" name="l01042"></a><span class="lineno"> 1042</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1040</span> {</div>
<div class="line"><span class="lineno"> 1041</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) &amp; q;</div>
<div class="line"><span class="lineno"> 1042</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -438,9 +438,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01059" name="l01059"></a><span class="lineno"> 1059</span> {</div>
<div class="line"><a id="l01060" name="l01060"></a><span class="lineno"> 1060</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) &amp;&amp; q;</div>
<div class="line"><a id="l01061" name="l01061"></a><span class="lineno"> 1061</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1059</span> {</div>
<div class="line"><span class="lineno"> 1060</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) &amp;&amp; q;</div>
<div class="line"><span class="lineno"> 1061</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -479,9 +479,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01021" name="l01021"></a><span class="lineno"> 1021</span> {</div>
<div class="line"><a id="l01022" name="l01022"></a><span class="lineno"> 1022</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) * q;</div>
<div class="line"><a id="l01023" name="l01023"></a><span class="lineno"> 1023</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1021</span> {</div>
<div class="line"><span class="lineno"> 1022</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) * q;</div>
<div class="line"><span class="lineno"> 1023</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -520,9 +520,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01009" name="l01009"></a><span class="lineno"> 1009</span> {</div>
<div class="line"><a id="l01010" name="l01010"></a><span class="lineno"> 1010</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) + q;</div>
<div class="line"><a id="l01011" name="l01011"></a><span class="lineno"> 1011</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1009</span> {</div>
<div class="line"><span class="lineno"> 1010</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) + q;</div>
<div class="line"><span class="lineno"> 1011</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -561,9 +561,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01015" name="l01015"></a><span class="lineno"> 1015</span> {</div>
<div class="line"><a id="l01016" name="l01016"></a><span class="lineno"> 1016</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) - q;</div>
<div class="line"><a id="l01017" name="l01017"></a><span class="lineno"> 1017</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1015</span> {</div>
<div class="line"><span class="lineno"> 1016</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) - q;</div>
<div class="line"><span class="lineno"> 1017</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -602,9 +602,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01027" name="l01027"></a><span class="lineno"> 1027</span> {</div>
<div class="line"><a id="l01028" name="l01028"></a><span class="lineno"> 1028</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) / q;</div>
<div class="line"><a id="l01029" name="l01029"></a><span class="lineno"> 1029</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1027</span> {</div>
<div class="line"><span class="lineno"> 1028</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) / q;</div>
<div class="line"><span class="lineno"> 1029</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -643,9 +643,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01084" name="l01084"></a><span class="lineno"> 1084</span> {</div>
<div class="line"><a id="l01085" name="l01085"></a><span class="lineno"> 1085</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) &lt; q;</div>
<div class="line"><a id="l01086" name="l01086"></a><span class="lineno"> 1086</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1084</span> {</div>
<div class="line"><span class="lineno"> 1085</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) &lt; q;</div>
<div class="line"><span class="lineno"> 1086</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -684,9 +684,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01090" name="l01090"></a><span class="lineno"> 1090</span> {</div>
<div class="line"><a id="l01091" name="l01091"></a><span class="lineno"> 1091</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) &lt;= q;</div>
<div class="line"><a id="l01092" name="l01092"></a><span class="lineno"> 1092</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1090</span> {</div>
<div class="line"><span class="lineno"> 1091</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) &lt;= q;</div>
<div class="line"><span class="lineno"> 1092</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -725,9 +725,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01072" name="l01072"></a><span class="lineno"> 1072</span> {</div>
<div class="line"><a id="l01073" name="l01073"></a><span class="lineno"> 1073</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) == q;</div>
<div class="line"><a id="l01074" name="l01074"></a><span class="lineno"> 1074</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1072</span> {</div>
<div class="line"><span class="lineno"> 1073</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) == q;</div>
<div class="line"><span class="lineno"> 1074</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -766,9 +766,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01096" name="l01096"></a><span class="lineno"> 1096</span> {</div>
<div class="line"><a id="l01097" name="l01097"></a><span class="lineno"> 1097</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) &gt; q;</div>
<div class="line"><a id="l01098" name="l01098"></a><span class="lineno"> 1098</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1096</span> {</div>
<div class="line"><span class="lineno"> 1097</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) &gt; q;</div>
<div class="line"><span class="lineno"> 1098</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -807,9 +807,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01102" name="l01102"></a><span class="lineno"> 1102</span> {</div>
<div class="line"><a id="l01103" name="l01103"></a><span class="lineno"> 1103</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) &gt;= q;</div>
<div class="line"><a id="l01104" name="l01104"></a><span class="lineno"> 1104</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1102</span> {</div>
<div class="line"><span class="lineno"> 1103</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) &gt;= q;</div>
<div class="line"><span class="lineno"> 1104</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -848,9 +848,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01052" name="l01052"></a><span class="lineno"> 1052</span> {</div>
<div class="line"><a id="l01053" name="l01053"></a><span class="lineno"> 1053</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) ^ q;</div>
<div class="line"><a id="l01054" name="l01054"></a><span class="lineno"> 1054</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1052</span> {</div>
<div class="line"><span class="lineno"> 1053</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) ^ q;</div>
<div class="line"><span class="lineno"> 1054</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -889,9 +889,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01046" name="l01046"></a><span class="lineno"> 1046</span> {</div>
<div class="line"><a id="l01047" name="l01047"></a><span class="lineno"> 1047</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) | q;</div>
<div class="line"><a id="l01048" name="l01048"></a><span class="lineno"> 1048</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1046</span> {</div>
<div class="line"><span class="lineno"> 1047</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) | q;</div>
<div class="line"><span class="lineno"> 1048</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -930,9 +930,9 @@ template&lt;typename T , typename = typename std::enable_if&lt;
</tr>
</table>
</div><div class="memdoc">
<div class="fragment"><div class="line"><a id="l01065" name="l01065"></a><span class="lineno"> 1065</span> {</div>
<div class="line"><a id="l01066" name="l01066"></a><span class="lineno"> 1066</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) || q;</div>
<div class="line"><a id="l01067" name="l01067"></a><span class="lineno"> 1067</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 1065</span> {</div>
<div class="line"><span class="lineno"> 1066</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(p) || q;</div>
<div class="line"><span class="lineno"> 1067</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -942,7 +942,7 @@ template&lt;typename T , typename = typename std::enable_if&lt;
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_4d6e05837bf820fb089a8a8cdf2f42b7.html">ciphers</a></li><li class="navelem"><a class="el" href="../../da/d41/uint128__t_8hpp.html">uint128_t.hpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -1,9 +1,9 @@
<map id="add" name="add">
<area shape="rect" id="node1" title="Adding two string." alt="" coords="5,132,48,159"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/begin.html#" title=" " alt="" coords="115,5,233,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/end.html#" title=" " alt="" coords="119,56,229,83"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/push_back.html#" title=" " alt="" coords="99,107,249,133"/>
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/reverse.html#" title=" " alt="" coords="129,157,219,184"/>
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/size.html#" title=" " alt="" coords="118,208,230,235"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/begin#" title=" " alt="" coords="115,5,233,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/end#" title=" " alt="" coords="119,56,229,83"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/push_back#" title=" " alt="" coords="99,107,249,133"/>
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/reverse#" title=" " alt="" coords="129,157,219,184"/>
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/size#" title=" " alt="" coords="118,208,230,235"/>
<area shape="rect" id="node7" href="$d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35" title=" " alt="" coords="96,259,252,285"/>
</map>

View File

@@ -1 +1 @@
19a694775ab854678641dd37aa60cc1d
45989eadca8b25cc3132ab7de02d7545

View File

@@ -21,7 +21,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/begin.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/begin#" xlink:title=" ">
<polygon fill="white" stroke="black" points="82,-190.5 82,-209.5 171,-209.5 171,-190.5 82,-190.5"/>
<text text-anchor="middle" x="126.5" y="-197.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::string::begin</text>
</a>
@@ -36,7 +36,7 @@
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/end.html#" xlink:title=" ">
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/end#" xlink:title=" ">
<polygon fill="white" stroke="black" points="85.5,-152.5 85.5,-171.5 167.5,-171.5 167.5,-152.5 85.5,-152.5"/>
<text text-anchor="middle" x="126.5" y="-159.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::string::end</text>
</a>
@@ -51,7 +51,7 @@
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/push_back.html#" xlink:title=" ">
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/push_back#" xlink:title=" ">
<polygon fill="white" stroke="black" points="70,-114.5 70,-133.5 183,-133.5 183,-114.5 70,-114.5"/>
<text text-anchor="middle" x="126.5" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::string::push_back</text>
</a>
@@ -66,7 +66,7 @@
<!-- Node5 -->
<g id="node5" class="node">
<title>Node5</title>
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/reverse.html#" xlink:title=" ">
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/reverse#" xlink:title=" ">
<polygon fill="white" stroke="black" points="92.5,-76.5 92.5,-95.5 160.5,-95.5 160.5,-76.5 92.5,-76.5"/>
<text text-anchor="middle" x="126.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::reverse</text>
</a>
@@ -81,7 +81,7 @@
<!-- Node6 -->
<g id="node6" class="node">
<title>Node6</title>
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/size.html#" xlink:title=" ">
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/size#" xlink:title=" ">
<polygon fill="white" stroke="black" points="84.5,-38.5 84.5,-57.5 168.5,-57.5 168.5,-38.5 84.5,-38.5"/>
<text text-anchor="middle" x="126.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::string::size</text>
</a>

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: ciphers/uint128_t.hpp Source File</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -1303,7 +1303,7 @@ $(document).ready(function(){initNavTree('da/d41/uint128__t_8hpp_source.html','.
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_4d6e05837bf820fb089a8a8cdf2f42b7.html">ciphers</a></li><li class="navelem"><a class="el" href="../../da/d41/uint128__t_8hpp.html">uint128_t.hpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: graph/depth_first_search_with_stack.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -217,16 +217,16 @@ constexpr int64_t&#160;</td><td class="memItemRight" valign="bottom"><b>INF</b>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> {</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="comment">/*</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><span class="comment"> *</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span><span class="comment"> * Here we are considering undirected graph that&#39;s the</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="comment"> * reason we are adding v to the adjacency list representation of u</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span><span class="comment"> * and also adding u to the adjacency list representation of v</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span><span class="comment"> *</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span><span class="comment"> */</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> (*adj)[u - 1].push_back(v - 1);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 64</span> {</div>
<div class="line"><span class="lineno"> 65</span> <span class="comment">/*</span></div>
<div class="line"><span class="lineno"> 66</span><span class="comment"> *</span></div>
<div class="line"><span class="lineno"> 67</span><span class="comment"> * Here we are considering undirected graph that&#39;s the</span></div>
<div class="line"><span class="lineno"> 68</span><span class="comment"> * reason we are adding v to the adjacency list representation of u</span></div>
<div class="line"><span class="lineno"> 69</span><span class="comment"> * and also adding u to the adjacency list representation of v</span></div>
<div class="line"><span class="lineno"> 70</span><span class="comment"> *</span></div>
<div class="line"><span class="lineno"> 71</span><span class="comment"> */</span></div>
<div class="line"><span class="lineno"> 72</span> (*adj)[u - 1].push_back(v - 1);</div>
<div class="line"><span class="lineno"> 73</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -270,35 +270,35 @@ constexpr int64_t&#160;</td><td class="memItemRight" valign="bottom"><b>INF</b>
<p >push the node to the final result vector</p>
<p >exploring the neighbours of the current node</p>
<p ><a class="el" href="../../db/d8b/struct_node.html">Node</a> has been explored</p>
<div class="fragment"><div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> {<span class="comment"></span></div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span><span class="comment"> /// checked[i] stores the status of each node</span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a> checked(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.size(), <a class="code hl_variable" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#afb80b42b42381658a12a57a975ecd0c7">WHITE</a>), traversed_path;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> </div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> checked[start] = <a class="code hl_variable" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#a43e30173f12330e85cce6239a277527e">GREY</a>;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/stack.html">std::stack&lt;size_t&gt;</a> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>;</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a5705c3926dcf5fd3f9c964467a50b81d">push</a>(start);</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span><span class="comment"></span> </div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span><span class="comment"> /// while stack is not empty we keep exploring the node on top of stack</span></div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span><span class="comment"></span> <span class="keywordflow">while</span> (!<a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.empty()) {</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keywordtype">int</span> act = <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a21c0bb6ce7dcfe445cc12031977ea344">top</a>();</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a6cd4b95d5de00d41b2491392338384dc">pop</a>();</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> </div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordflow">if</span> (checked[act] == <a class="code hl_variable" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#a43e30173f12330e85cce6239a277527e">GREY</a>) {<span class="comment"></span></div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span><span class="comment"> /// push the node to the final result vector</span></div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span><span class="comment"></span> traversed_path.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(act + 1);</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span><span class="comment"></span> </div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="comment"> /// exploring the neighbours of the current node</span></div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span><span class="comment"></span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> it : <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>[act]) {</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a5705c3926dcf5fd3f9c964467a50b81d">push</a>(it);</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordflow">if</span> (checked[it] != <a class="code hl_variable" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#a7f1cd94cf4da32933e8551cb3577e18b">BLACK</a>) {</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> checked[it] = <a class="code hl_variable" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#a43e30173f12330e85cce6239a277527e">GREY</a>;</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> }</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> }</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> checked[act] = <a class="code hl_variable" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#a7f1cd94cf4da32933e8551cb3577e18b">BLACK</a>; <span class="comment">/// Node has been explored</span></div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> }</div>
<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> <span class="keywordflow">return</span> traversed_path;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 87</span> {<span class="comment"></span></div>
<div class="line"><span class="lineno"> 88</span><span class="comment"> /// checked[i] stores the status of each node</span></div>
<div class="line"><span class="lineno"> 89</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a> checked(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.size(), <a class="code hl_variable" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#afb80b42b42381658a12a57a975ecd0c7">WHITE</a>), traversed_path;</div>
<div class="line"><span class="lineno"> 90</span> </div>
<div class="line"><span class="lineno"> 91</span> checked[start] = <a class="code hl_variable" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#a43e30173f12330e85cce6239a277527e">GREY</a>;</div>
<div class="line"><span class="lineno"> 92</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/stack.html">std::stack&lt;size_t&gt;</a> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>;</div>
<div class="line"><span class="lineno"> 93</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a5705c3926dcf5fd3f9c964467a50b81d">push</a>(start);</div>
<div class="line"><span class="lineno"> 94</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 95</span><span class="comment"> /// while stack is not empty we keep exploring the node on top of stack</span></div>
<div class="line"><span class="lineno"> 96</span><span class="comment"></span> <span class="keywordflow">while</span> (!<a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.empty()) {</div>
<div class="line"><span class="lineno"> 97</span> <span class="keywordtype">int</span> act = <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a21c0bb6ce7dcfe445cc12031977ea344">top</a>();</div>
<div class="line"><span class="lineno"> 98</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a6cd4b95d5de00d41b2491392338384dc">pop</a>();</div>
<div class="line"><span class="lineno"> 99</span> </div>
<div class="line"><span class="lineno"> 100</span> <span class="keywordflow">if</span> (checked[act] == <a class="code hl_variable" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#a43e30173f12330e85cce6239a277527e">GREY</a>) {<span class="comment"></span></div>
<div class="line"><span class="lineno"> 101</span><span class="comment"> /// push the node to the final result vector</span></div>
<div class="line"><span class="lineno"> 102</span><span class="comment"></span> traversed_path.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(act + 1);</div>
<div class="line"><span class="lineno"> 103</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 104</span><span class="comment"> /// exploring the neighbours of the current node</span></div>
<div class="line"><span class="lineno"> 105</span><span class="comment"></span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> it : <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>[act]) {</div>
<div class="line"><span class="lineno"> 106</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a5705c3926dcf5fd3f9c964467a50b81d">push</a>(it);</div>
<div class="line"><span class="lineno"> 107</span> <span class="keywordflow">if</span> (checked[it] != <a class="code hl_variable" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#a7f1cd94cf4da32933e8551cb3577e18b">BLACK</a>) {</div>
<div class="line"><span class="lineno"> 108</span> checked[it] = <a class="code hl_variable" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#a43e30173f12330e85cce6239a277527e">GREY</a>;</div>
<div class="line"><span class="lineno"> 109</span> }</div>
<div class="line"><span class="lineno"> 110</span> }</div>
<div class="line"><span class="lineno"> 111</span> checked[act] = <a class="code hl_variable" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#a7f1cd94cf4da32933e8551cb3577e18b">BLACK</a>; <span class="comment">/// Node has been explored</span></div>
<div class="line"><span class="lineno"> 112</span> }</div>
<div class="line"><span class="lineno"> 113</span> }</div>
<div class="line"><span class="lineno"> 114</span> <span class="keywordflow">return</span> traversed_path;</div>
<div class="line"><span class="lineno"> 115</span>}</div>
<div class="ttc" id="aclassstack_html"><div class="ttname"><a href="../../d1/dc2/classstack.html">stack</a></div><div class="ttdef"><b>Definition:</b> stack.h:26</div></div>
<div class="ttc" id="aclassstack_html_a21c0bb6ce7dcfe445cc12031977ea344"><div class="ttname"><a href="../../d1/dc2/classstack.html#a21c0bb6ce7dcfe445cc12031977ea344">stack::top</a></div><div class="ttdeci">Type top()</div><div class="ttdef"><b>Definition:</b> stack.h:93</div></div>
<div class="ttc" id="aclassstack_html_a5705c3926dcf5fd3f9c964467a50b81d"><div class="ttname"><a href="../../d1/dc2/classstack.html#a5705c3926dcf5fd3f9c964467a50b81d">stack::push</a></div><div class="ttdeci">void push(Type item)</div><div class="ttdef"><b>Definition:</b> stack.h:83</div></div>
@@ -342,41 +342,41 @@ Here is the call graph for this function:</div>
<p >taking input for the edges</p>
<p >taking input for the starting position</p>
<p >Printing the order of traversal</p>
<div class="fragment"><div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> {</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>(); <span class="comment">// execute the tests</span></div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> </div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="keywordtype">size_t</span> vertices = 0, edges = 0, start_pos = 1;</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a> traversal;</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> </div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Enter the Vertices : &quot;</span>;</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; vertices;</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Enter the Edges : &quot;</span>;</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; edges;</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span><span class="comment"></span> </div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span><span class="comment"> /// creating a graph</span></div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;std::vector&lt;size_t&gt;</a> &gt; adj(vertices, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a>());</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span><span class="comment"></span> </div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span><span class="comment"> /// taking input for the edges</span></div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Enter the vertices which have edges between them : &quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> <span class="keywordflow">while</span> (edges--) {</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> <span class="keywordtype">size_t</span> u = 0, v = 0;</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; u &gt;&gt; v;</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;adj, u, v);</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> }</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span><span class="comment"></span> </div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span><span class="comment"> /// taking input for the starting position</span></div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Enter the starting vertex [1,n]: &quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; start_pos;</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> start_pos -= 1;</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> traversal = <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#a5738da9f508f6a9e87f123c9fb6f2ea9">graph::depth_first_search::dfs</a>(adj, start_pos);</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span><span class="comment"></span> </div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span><span class="comment"> /// Printing the order of traversal</span></div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span><span class="comment"></span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> x : traversal) {</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; x &lt;&lt; <span class="charliteral">&#39; &#39;</span>;</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> }</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> </div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 173</span> {</div>
<div class="line"><span class="lineno"> 174</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>(); <span class="comment">// execute the tests</span></div>
<div class="line"><span class="lineno"> 175</span> </div>
<div class="line"><span class="lineno"> 176</span> <span class="keywordtype">size_t</span> vertices = 0, edges = 0, start_pos = 1;</div>
<div class="line"><span class="lineno"> 177</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a> traversal;</div>
<div class="line"><span class="lineno"> 178</span> </div>
<div class="line"><span class="lineno"> 179</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Enter the Vertices : &quot;</span>;</div>
<div class="line"><span class="lineno"> 180</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; vertices;</div>
<div class="line"><span class="lineno"> 181</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Enter the Edges : &quot;</span>;</div>
<div class="line"><span class="lineno"> 182</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; edges;</div>
<div class="line"><span class="lineno"> 183</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 184</span><span class="comment"> /// creating a graph</span></div>
<div class="line"><span class="lineno"> 185</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;std::vector&lt;size_t&gt;</a> &gt; adj(vertices, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a>());</div>
<div class="line"><span class="lineno"> 186</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 187</span><span class="comment"> /// taking input for the edges</span></div>
<div class="line"><span class="lineno"> 188</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Enter the vertices which have edges between them : &quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 189</span> <span class="keywordflow">while</span> (edges--) {</div>
<div class="line"><span class="lineno"> 190</span> <span class="keywordtype">size_t</span> u = 0, v = 0;</div>
<div class="line"><span class="lineno"> 191</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; u &gt;&gt; v;</div>
<div class="line"><span class="lineno"> 192</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;adj, u, v);</div>
<div class="line"><span class="lineno"> 193</span> }</div>
<div class="line"><span class="lineno"> 194</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 195</span><span class="comment"> /// taking input for the starting position</span></div>
<div class="line"><span class="lineno"> 196</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Enter the starting vertex [1,n]: &quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 197</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; start_pos;</div>
<div class="line"><span class="lineno"> 198</span> start_pos -= 1;</div>
<div class="line"><span class="lineno"> 199</span> traversal = <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#a5738da9f508f6a9e87f123c9fb6f2ea9">graph::depth_first_search::dfs</a>(adj, start_pos);</div>
<div class="line"><span class="lineno"> 200</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 201</span><span class="comment"> /// Printing the order of traversal</span></div>
<div class="line"><span class="lineno"> 202</span><span class="comment"></span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> x : traversal) {</div>
<div class="line"><span class="lineno"> 203</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; x &lt;&lt; <span class="charliteral">&#39; &#39;</span>;</div>
<div class="line"><span class="lineno"> 204</span> }</div>
<div class="line"><span class="lineno"> 205</span> </div>
<div class="line"><span class="lineno"> 206</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 207</span>}</div>
<div class="ttc" id="abasic_istream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a></div></div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="adepth__first__search__with__stack_8cpp_html_a483bb8ccf42aaf7375a83e91490eda1e"><div class="ttname"><a href="../../da/d4b/depth__first__search__with__stack_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a></div><div class="ttdeci">static void tests()</div><div class="ttdef"><b>Definition:</b> depth_first_search_with_stack.cpp:123</div></div>
@@ -421,51 +421,51 @@ Here is the call graph for this function:</div>
<p >for the above sample data, this is the expected output</p>
<p >Test 3</p>
<p >for the above sample data, this is the expected output</p>
<div class="fragment"><div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> {</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="keywordtype">size_t</span> start_pos;</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span><span class="comment"></span> </div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span><span class="comment"> /// Test 1</span></div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Case 1: &quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> start_pos = 1;</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;std::vector&lt;size_t&gt;</a> &gt; g1(3, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a>());</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> </div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g1, 1, 2);</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g1, 2, 3);</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g1, 3, 1);</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> </div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a> expected1 {1, 2, 3}; <span class="comment">/// for the above sample data, this is the expected output</span></div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> assert(graph::depth_first_search::dfs(g1, start_pos - 1) == expected1);</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span><span class="comment"></span> </div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span><span class="comment"> /// Test 2</span></div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Case 2: &quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> start_pos = 1;</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;std::vector&lt;size_t&gt;</a> &gt; g2(4, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a>());</div>
<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> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g2, 1, 2);</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g2, 1, 3);</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g2, 2, 4);</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g2, 4, 1);</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> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a> expected2 {1, 3, 2, 4}; <span class="comment">/// for the above sample data, this is the expected output</span></div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> assert(graph::depth_first_search::dfs(g2, start_pos - 1) == expected2);</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span><span class="comment"></span> </div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span><span class="comment"> /// Test 3</span></div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Case 3: &quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> start_pos = 2;</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;std::vector&lt;size_t&gt;</a> &gt; g3(4, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a>());</div>
<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> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g3, 1, 2);</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g3, 1, 3);</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g3, 2, 4);</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g3, 4, 1);</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> </div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a> expected3 {2, 4, 1, 3}; <span class="comment">/// for the above sample data, this is the expected output</span></div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> assert(graph::depth_first_search::dfs(g3, start_pos - 1) == expected3);</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> </div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 123</span> {</div>
<div class="line"><span class="lineno"> 124</span> <span class="keywordtype">size_t</span> start_pos;</div>
<div class="line"><span class="lineno"> 125</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 126</span><span class="comment"> /// Test 1</span></div>
<div class="line"><span class="lineno"> 127</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Case 1: &quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 128</span> start_pos = 1;</div>
<div class="line"><span class="lineno"> 129</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;std::vector&lt;size_t&gt;</a> &gt; g1(3, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a>());</div>
<div class="line"><span class="lineno"> 130</span> </div>
<div class="line"><span class="lineno"> 131</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g1, 1, 2);</div>
<div class="line"><span class="lineno"> 132</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g1, 2, 3);</div>
<div class="line"><span class="lineno"> 133</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g1, 3, 1);</div>
<div class="line"><span class="lineno"> 134</span> </div>
<div class="line"><span class="lineno"> 135</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a> expected1 {1, 2, 3}; <span class="comment">/// for the above sample data, this is the expected output</span></div>
<div class="line"><span class="lineno"> 136</span> assert(graph::depth_first_search::dfs(g1, start_pos - 1) == expected1);</div>
<div class="line"><span class="lineno"> 137</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 138</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 139</span><span class="comment"> /// Test 2</span></div>
<div class="line"><span class="lineno"> 140</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Case 2: &quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 141</span> start_pos = 1;</div>
<div class="line"><span class="lineno"> 142</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;std::vector&lt;size_t&gt;</a> &gt; g2(4, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a>());</div>
<div class="line"><span class="lineno"> 143</span> </div>
<div class="line"><span class="lineno"> 144</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g2, 1, 2);</div>
<div class="line"><span class="lineno"> 145</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g2, 1, 3);</div>
<div class="line"><span class="lineno"> 146</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g2, 2, 4);</div>
<div class="line"><span class="lineno"> 147</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g2, 4, 1);</div>
<div class="line"><span class="lineno"> 148</span> </div>
<div class="line"><span class="lineno"> 149</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a> expected2 {1, 3, 2, 4}; <span class="comment">/// for the above sample data, this is the expected output</span></div>
<div class="line"><span class="lineno"> 150</span> assert(graph::depth_first_search::dfs(g2, start_pos - 1) == expected2);</div>
<div class="line"><span class="lineno"> 151</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 152</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 153</span><span class="comment"> /// Test 3</span></div>
<div class="line"><span class="lineno"> 154</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Case 3: &quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 155</span> start_pos = 2;</div>
<div class="line"><span class="lineno"> 156</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;std::vector&lt;size_t&gt;</a> &gt; g3(4, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a>());</div>
<div class="line"><span class="lineno"> 157</span> </div>
<div class="line"><span class="lineno"> 158</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g3, 1, 2);</div>
<div class="line"><span class="lineno"> 159</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g3, 1, 3);</div>
<div class="line"><span class="lineno"> 160</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g3, 2, 4);</div>
<div class="line"><span class="lineno"> 161</span> <a class="code hl_function" href="../../da/d4b/depth__first__search__with__stack_8cpp.html#aadebe9c855821d6515ca5b171222ef7b">graph::depth_first_search::addEdge</a>(&amp;g3, 4, 1);</div>
<div class="line"><span class="lineno"> 162</span> </div>
<div class="line"><span class="lineno"> 163</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;size_t&gt;</a> expected3 {2, 4, 1, 3}; <span class="comment">/// for the above sample data, this is the expected output</span></div>
<div class="line"><span class="lineno"> 164</span> assert(graph::depth_first_search::dfs(g3, start_pos - 1) == expected3);</div>
<div class="line"><span class="lineno"> 165</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 166</span> </div>
<div class="line"><span class="lineno"> 167</span>}</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
@@ -505,7 +505,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_12552d7fa429bf94a2e32e5cf39f7e69.html">graph</a></li><li class="navelem"><a class="el" href="../../da/d4b/depth__first__search__with__stack_8cpp.html">depth_first_search_with_stack.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -1,4 +1,4 @@
<map id="tests" name="tests">
<area shape="rect" id="node1" title=" " alt="" coords="5,5,56,32"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="104,5,176,32"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="104,5,176,32"/>
</map>

View File

@@ -1 +1 @@
4f703bcdd25f0ee1bcb2525ee66905d0
a9de42c298fc71dec78e452c9b7f5aac

View File

@@ -21,7 +21,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
<polygon fill="white" stroke="black" points="74,-0.5 74,-19.5 128,-19.5 128,-0.5 74,-0.5"/>
<text text-anchor="middle" x="101" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -2,8 +2,8 @@
<area shape="rect" id="node1" title="Explores the given vertex, exploring a vertex means traversing over all the vertices which are connec..." alt="" coords="5,99,128,141"/>
<area shape="rect" id="node2" href="$d1/dc2/classstack.html#a6cd4b95d5de00d41b2491392338384dc" title=" " alt="" coords="212,31,295,57"/>
<area shape="rect" id="node5" href="$d1/dc2/classstack.html#a5705c3926dcf5fd3f9c964467a50b81d" title=" " alt="" coords="208,81,299,108"/>
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/push_back.html#" title=" " alt="" coords="176,132,331,159"/>
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/push_back#" title=" " alt="" coords="176,132,331,159"/>
<area shape="rect" id="node7" href="$d1/dc2/classstack.html#a21c0bb6ce7dcfe445cc12031977ea344" title=" " alt="" coords="213,183,293,209"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="415,5,487,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="415,5,487,32"/>
<area shape="rect" id="node4" href="$d1/dc2/classstack.html#a066e4505155b009913c47b2648b1067a" title=" " alt="" coords="379,56,523,83"/>
</map>

View File

@@ -1 +1 @@
d874023f150d00ee467da5fbf3763964
a7aff224cbd56260c74915aaa61ec77e

View File

@@ -58,7 +58,7 @@
<!-- Node6 -->
<g id="node6" class="node">
<title>Node6</title>
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back.html#" xlink:title=" ">
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back#" xlink:title=" ">
<polygon fill="white" stroke="black" points="128,-38.5 128,-57.5 244,-57.5 244,-38.5 128,-38.5"/>
<text text-anchor="middle" x="186" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::push_back</text>
</a>
@@ -88,7 +88,7 @@
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
<polygon fill="white" stroke="black" points="307,-133.5 307,-152.5 361,-152.5 361,-133.5 307,-133.5"/>
<text text-anchor="middle" x="334" y="-140.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -1,5 +1,5 @@
<map id="main" name="main">
<area shape="rect" id="node1" title="Main function." alt="" coords="5,5,56,32"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="203,5,275,32"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="203,5,275,32"/>
<area shape="rect" id="node3" href="$da/d4b/depth__first__search__with__stack_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e" title=" " alt="" coords="104,31,155,57"/>
</map>

View File

@@ -1 +1 @@
9c40f79556f7f979646b6492bbd3d097
a81e17efb0c0ead8848b30e5906c61ad

View File

@@ -21,7 +21,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
<polygon fill="white" stroke="black" points="148,-19.5 148,-38.5 202,-38.5 202,-19.5 148,-19.5"/>
<text text-anchor="middle" x="175" y="-26.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -152,10 +152,10 @@ Functions</h2></td></tr>
<p>Main function. </p>
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
<div class="fragment"><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> <a class="code hl_function" href="../../da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 95</span> {</div>
<div class="line"><span class="lineno"> 96</span> <a class="code hl_function" href="../../da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
<div class="line"><span class="lineno"> 97</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 98</span>}</div>
<div class="ttc" id="acount__of__trailing__ciphers__in__factorial__n_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../da/d50/count__of__trailing__ciphers__in__factorial__n_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> count_of_trailing_ciphers_in_factorial_n.cpp:59</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
@@ -190,18 +190,18 @@ Here is the call graph for this function:</div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>count, Number of ciphers in <code>n!</code>. </dd></dl>
<div class="fragment"><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> <span class="comment">// count is to store the number of 5&#39;s in factorial(n)</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> uint64_t count = 0;</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="comment">// Keep dividing n by powers of</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="comment">// 5 and update count</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordflow">for</span> (uint64_t i = 5; n / i &gt;= 1; i *= 5) {</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> count += <span class="keyword">static_cast&lt;</span>uint64_t<span class="keyword">&gt;</span>(n) / i;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> }</div>
<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="keywordflow">return</span> count;</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 40</span> {</div>
<div class="line"><span class="lineno"> 41</span> <span class="comment">// count is to store the number of 5&#39;s in factorial(n)</span></div>
<div class="line"><span class="lineno"> 42</span> uint64_t count = 0;</div>
<div class="line"><span class="lineno"> 43</span> </div>
<div class="line"><span class="lineno"> 44</span> <span class="comment">// Keep dividing n by powers of</span></div>
<div class="line"><span class="lineno"> 45</span> <span class="comment">// 5 and update count</span></div>
<div class="line"><span class="lineno"> 46</span> <span class="keywordflow">for</span> (uint64_t i = 5; n / i &gt;= 1; i *= 5) {</div>
<div class="line"><span class="lineno"> 47</span> count += <span class="keyword">static_cast&lt;</span>uint64_t<span class="keyword">&gt;</span>(n) / i;</div>
<div class="line"><span class="lineno"> 48</span> }</div>
<div class="line"><span class="lineno"> 49</span> </div>
<div class="line"><span class="lineno"> 50</span> <span class="keywordflow">return</span> count;</div>
<div class="line"><span class="lineno"> 51</span>}</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
@@ -236,37 +236,37 @@ Here is the call graph for this function:</div>
<p>Self-test implementations. </p>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><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> <span class="comment">// 1st test</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;1st test &quot;</span>;</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> assert(bit_manipulation::count_of_trailing_ciphers_in_factorial_n::</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <a class="code hl_function" href="../../da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html#a0d5e1d651d0d30bd682f176d8f2b83d0">numberOfCiphersInFactorialN</a>(395) == 97);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="comment">// 2nd test</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;2nd test &quot;</span>;</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> assert(bit_manipulation::count_of_trailing_ciphers_in_factorial_n::</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <a class="code hl_function" href="../../da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html#a0d5e1d651d0d30bd682f176d8f2b83d0">numberOfCiphersInFactorialN</a>(977) == 242);</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> </div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="comment">// 3rd test</span></div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;3rd test &quot;</span>;</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> assert(bit_manipulation::count_of_trailing_ciphers_in_factorial_n::</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <a class="code hl_function" href="../../da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html#a0d5e1d651d0d30bd682f176d8f2b83d0">numberOfCiphersInFactorialN</a>(871) == 215);</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> </div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="comment">// 4th test</span></div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;4th test &quot;</span>;</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> assert(bit_manipulation::count_of_trailing_ciphers_in_factorial_n::</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <a class="code hl_function" href="../../da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html#a0d5e1d651d0d30bd682f176d8f2b83d0">numberOfCiphersInFactorialN</a>(239) == 57);</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> </div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="comment">// 5th test</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;5th test &quot;</span>;</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> assert(bit_manipulation::count_of_trailing_ciphers_in_factorial_n::</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <a class="code hl_function" href="../../da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html#a0d5e1d651d0d30bd682f176d8f2b83d0">numberOfCiphersInFactorialN</a>(0) == 0);</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 59</span> {</div>
<div class="line"><span class="lineno"> 60</span> <span class="comment">// 1st test</span></div>
<div class="line"><span class="lineno"> 61</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;1st test &quot;</span>;</div>
<div class="line"><span class="lineno"> 62</span> assert(bit_manipulation::count_of_trailing_ciphers_in_factorial_n::</div>
<div class="line"><span class="lineno"> 63</span> <a class="code hl_function" href="../../da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html#a0d5e1d651d0d30bd682f176d8f2b83d0">numberOfCiphersInFactorialN</a>(395) == 97);</div>
<div class="line"><span class="lineno"> 64</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 65</span> </div>
<div class="line"><span class="lineno"> 66</span> <span class="comment">// 2nd test</span></div>
<div class="line"><span class="lineno"> 67</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;2nd test &quot;</span>;</div>
<div class="line"><span class="lineno"> 68</span> assert(bit_manipulation::count_of_trailing_ciphers_in_factorial_n::</div>
<div class="line"><span class="lineno"> 69</span> <a class="code hl_function" href="../../da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html#a0d5e1d651d0d30bd682f176d8f2b83d0">numberOfCiphersInFactorialN</a>(977) == 242);</div>
<div class="line"><span class="lineno"> 70</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 71</span> </div>
<div class="line"><span class="lineno"> 72</span> <span class="comment">// 3rd test</span></div>
<div class="line"><span class="lineno"> 73</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;3rd test &quot;</span>;</div>
<div class="line"><span class="lineno"> 74</span> assert(bit_manipulation::count_of_trailing_ciphers_in_factorial_n::</div>
<div class="line"><span class="lineno"> 75</span> <a class="code hl_function" href="../../da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html#a0d5e1d651d0d30bd682f176d8f2b83d0">numberOfCiphersInFactorialN</a>(871) == 215);</div>
<div class="line"><span class="lineno"> 76</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 77</span> </div>
<div class="line"><span class="lineno"> 78</span> <span class="comment">// 4th test</span></div>
<div class="line"><span class="lineno"> 79</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;4th test &quot;</span>;</div>
<div class="line"><span class="lineno"> 80</span> assert(bit_manipulation::count_of_trailing_ciphers_in_factorial_n::</div>
<div class="line"><span class="lineno"> 81</span> <a class="code hl_function" href="../../da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html#a0d5e1d651d0d30bd682f176d8f2b83d0">numberOfCiphersInFactorialN</a>(239) == 57);</div>
<div class="line"><span class="lineno"> 82</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 83</span> </div>
<div class="line"><span class="lineno"> 84</span> <span class="comment">// 5th test</span></div>
<div class="line"><span class="lineno"> 85</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;5th test &quot;</span>;</div>
<div class="line"><span class="lineno"> 86</span> assert(bit_manipulation::count_of_trailing_ciphers_in_factorial_n::</div>
<div class="line"><span class="lineno"> 87</span> <a class="code hl_function" href="../../da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html#a0d5e1d651d0d30bd682f176d8f2b83d0">numberOfCiphersInFactorialN</a>(0) == 0);</div>
<div class="line"><span class="lineno"> 88</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 89</span>}</div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="acount__of__trailing__ciphers__in__factorial__n_8cpp_html_a0d5e1d651d0d30bd682f176d8f2b83d0"><div class="ttname"><a href="../../da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html#a0d5e1d651d0d30bd682f176d8f2b83d0">bit_manipulation::count_of_trailing_ciphers_in_factorial_n::numberOfCiphersInFactorialN</a></div><div class="ttdeci">uint64_t numberOfCiphersInFactorialN(uint64_t n)</div><div class="ttdoc">Function to count the number of the trailing ciphers.</div><div class="ttdef"><b>Definition:</b> count_of_trailing_ciphers_in_factorial_n.cpp:40</div></div>
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
@@ -285,7 +285,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_f3c4fbc4e901afa0a54d0623c5574aa7.html">bit_manipulation</a></li><li class="navelem"><a class="el" href="../../da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html">count_of_trailing_ciphers_in_factorial_n.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -1,4 +1,4 @@
<map id="test" name="test">
<area shape="rect" id="node1" title="Self&#45;test implementations." alt="" coords="5,5,49,32"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="97,5,169,32"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="97,5,169,32"/>
</map>

View File

@@ -1 +1 @@
e183666d54c346b35c418105d98411c7
b0dc874831a2dd2acf585064047c8738

View File

@@ -21,7 +21,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
<polygon fill="white" stroke="black" points="69,-0.5 69,-19.5 123,-19.5 123,-0.5 69,-0.5"/>
<text text-anchor="middle" x="96" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -1,5 +1,5 @@
<map id="main" name="main">
<area shape="rect" id="node1" title="Main function." alt="" coords="5,5,56,32"/>
<area shape="rect" id="node2" href="$da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title="Self&#45;test implementations." alt="" coords="104,5,148,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="196,5,268,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="196,5,268,32"/>
</map>

View File

@@ -1 +1 @@
ae306171747f327fd8eb406c9d83a127
74fc644288f0a249af5a921c113cf361

View File

@@ -36,7 +36,7 @@
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
<polygon fill="white" stroke="black" points="143,-0.5 143,-19.5 197,-19.5 197,-0.5 143,-0.5"/>
<text text-anchor="middle" x="170" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: dynamic_programming/minimum_edit_distance.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -204,43 +204,43 @@ Algorithm</h3>
<p >If last characters are same, ignore last char and recur for remaining string</p>
<p >If the last character is different, consider all possibilities and find the minimum</p>
<p >returning the minimum cost of operations needed to convert str1 to str2</p>
<div class="fragment"><div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> {<span class="comment"></span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span><span class="comment"> /// Create a table to store results of subproblems</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;std::vector&lt;uint64_t&gt;</a>&gt;<a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>(m+1, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;uint64_t&gt;</a>(n+1)); <span class="comment">/// creasting 2D vector dp to store the results of subproblems</span></div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span><span class="comment"></span> </div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span><span class="comment"> /// Fill d[][] in bottom up manner</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span><span class="comment"></span> <span class="keywordflow">for</span> (uint64_t i = 0; i &lt;= m; i++) {</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">for</span> (uint64_t j = 0; j &lt;= n; j++) {<span class="comment"></span></div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span><span class="comment"> /// If first string is empty, only option is to</span></div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span><span class="comment"> /// insert all characters of second string</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="comment"></span> <span class="keywordflow">if</span> (i == 0) {</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = j; <span class="comment">/// Minimum operations = j</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> }</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="comment"></span> </div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span><span class="comment"> /// If second string is empty, only option is to</span></div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span><span class="comment"> /// remove all characters of second string</span></div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (j == 0) {</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = i; <span class="comment">/// Minimum operations = i</span></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"></span> </div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span><span class="comment"> /// If last characters are same, ignore last char</span></div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span><span class="comment"> /// and recur for remaining string</span></div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (str1[i - 1] == str2[j - 1]) {</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i - 1][j - 1];</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> }</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span><span class="comment"></span> </div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span><span class="comment"> /// If the last character is different, consider all</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span><span class="comment"> /// possibilities and find the minimum</span></div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span><span class="comment"></span> <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = 1 + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">min</a>(<a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j - 1], <span class="comment">// Insert</span></div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i - 1][j], <span class="comment">// Remove</span></div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i - 1][j - 1]); <span class="comment">// Replace</span></div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> }</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> }</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> }</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> </div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordflow">return</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[m][n]; <span class="comment">/// returning the minimum cost of operations needed to convert str1 to str2</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 88</span> {<span class="comment"></span></div>
<div class="line"><span class="lineno"> 89</span><span class="comment"> /// Create a table to store results of subproblems</span></div>
<div class="line"><span class="lineno"> 90</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;std::vector&lt;uint64_t&gt;</a>&gt;<a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>(m+1, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;uint64_t&gt;</a>(n+1)); <span class="comment">/// creasting 2D vector dp to store the results of subproblems</span></div>
<div class="line"><span class="lineno"> 91</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 92</span><span class="comment"> /// Fill d[][] in bottom up manner</span></div>
<div class="line"><span class="lineno"> 93</span><span class="comment"></span> <span class="keywordflow">for</span> (uint64_t i = 0; i &lt;= m; i++) {</div>
<div class="line"><span class="lineno"> 94</span> <span class="keywordflow">for</span> (uint64_t j = 0; j &lt;= n; j++) {<span class="comment"></span></div>
<div class="line"><span class="lineno"> 95</span><span class="comment"> /// If first string is empty, only option is to</span></div>
<div class="line"><span class="lineno"> 96</span><span class="comment"> /// insert all characters of second string</span></div>
<div class="line"><span class="lineno"> 97</span><span class="comment"></span> <span class="keywordflow">if</span> (i == 0) {</div>
<div class="line"><span class="lineno"> 98</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = j; <span class="comment">/// Minimum operations = j</span></div>
<div class="line"><span class="lineno"> 99</span> }</div>
<div class="line"><span class="lineno"> 100</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 101</span><span class="comment"> /// If second string is empty, only option is to</span></div>
<div class="line"><span class="lineno"> 102</span><span class="comment"> /// remove all characters of second string</span></div>
<div class="line"><span class="lineno"> 103</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (j == 0) {</div>
<div class="line"><span class="lineno"> 104</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = i; <span class="comment">/// Minimum operations = i</span></div>
<div class="line"><span class="lineno"> 105</span> }</div>
<div class="line"><span class="lineno"> 106</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 107</span><span class="comment"> /// If last characters are same, ignore last char</span></div>
<div class="line"><span class="lineno"> 108</span><span class="comment"> /// and recur for remaining string</span></div>
<div class="line"><span class="lineno"> 109</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (str1[i - 1] == str2[j - 1]) {</div>
<div class="line"><span class="lineno"> 110</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i - 1][j - 1];</div>
<div class="line"><span class="lineno"> 111</span> }</div>
<div class="line"><span class="lineno"> 112</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 113</span><span class="comment"> /// If the last character is different, consider all</span></div>
<div class="line"><span class="lineno"> 114</span><span class="comment"> /// possibilities and find the minimum</span></div>
<div class="line"><span class="lineno"> 115</span><span class="comment"></span> <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 116</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = 1 + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">min</a>(<a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j - 1], <span class="comment">// Insert</span></div>
<div class="line"><span class="lineno"> 117</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i - 1][j], <span class="comment">// Remove</span></div>
<div class="line"><span class="lineno"> 118</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i - 1][j - 1]); <span class="comment">// Replace</span></div>
<div class="line"><span class="lineno"> 119</span> }</div>
<div class="line"><span class="lineno"> 120</span> }</div>
<div class="line"><span class="lineno"> 121</span> }</div>
<div class="line"><span class="lineno"> 122</span> </div>
<div class="line"><span class="lineno"> 123</span> <span class="keywordflow">return</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[m][n]; <span class="comment">/// returning the minimum cost of operations needed to convert str1 to str2</span></div>
<div class="line"><span class="lineno"> 124</span>}</div>
<div class="ttc" id="amin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a></div><div class="ttdeci">T min(T... args)</div></div>
<div class="ttc" id="anamespacedp_html"><div class="ttname"><a href="../../df/d88/namespacedp.html">dp</a></div><div class="ttdoc">for std::vector</div><div class="ttdef"><b>Definition:</b> partition_problem.cpp:39</div></div>
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
@@ -282,10 +282,10 @@ Algorithm</h3>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
<div class="fragment"><div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> {</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <a class="code hl_function" href="../../da/d52/minimum__edit__distance_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 160</span> {</div>
<div class="line"><span class="lineno"> 161</span> <a class="code hl_function" href="../../da/d52/minimum__edit__distance_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
<div class="line"><span class="lineno"> 162</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 163</span>}</div>
<div class="ttc" id="aminimum__edit__distance_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../da/d52/minimum__edit__distance_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> minimum_edit_distance.cpp:132</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
@@ -345,17 +345,17 @@ z if <code>z</code> is the minimum value </dd></dl>
<p >returns x, if x is the minimum value</p>
<p >returns y, if y is the minimum value</p>
<p >returns z if z is the minimum value</p>
<div class="fragment"><div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> {</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keywordflow">if</span> (x &lt;= y &amp;&amp; x &lt;= z) {</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> x; <span class="comment">/// returns x, if x is the minimum value</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> }</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keywordflow">if</span> (y &lt;= x &amp;&amp; y &lt;= z) {</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="keywordflow">return</span> y; <span class="comment">/// returns y, if y is the minimum value</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> }</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordflow">return</span> z; <span class="comment">/// returns z if z is the minimum value</span></div>
<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>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 63</span> {</div>
<div class="line"><span class="lineno"> 64</span> <span class="keywordflow">if</span> (x &lt;= y &amp;&amp; x &lt;= z) {</div>
<div class="line"><span class="lineno"> 65</span> <span class="keywordflow">return</span> x; <span class="comment">/// returns x, if x is the minimum value</span></div>
<div class="line"><span class="lineno"> 66</span> }</div>
<div class="line"><span class="lineno"> 67</span> <span class="keywordflow">if</span> (y &lt;= x &amp;&amp; y &lt;= z) {</div>
<div class="line"><span class="lineno"> 68</span> <span class="keywordflow">return</span> y; <span class="comment">/// returns y, if y is the minimum value</span></div>
<div class="line"><span class="lineno"> 69</span> }</div>
<div class="line"><span class="lineno"> 70</span> <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 71</span> <span class="keywordflow">return</span> z; <span class="comment">/// returns z if z is the minimum value</span></div>
<div class="line"><span class="lineno"> 72</span> }</div>
<div class="line"><span class="lineno"> 73</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -384,27 +384,27 @@ z if <code>z</code> is the minimum value </dd></dl>
<p>Self-test implementations. </p>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> {</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="comment">// 1st test</span></div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str1 = <span class="stringliteral">&quot;INTENTION&quot;</span>; <span class="comment">// Sample input of 1st string</span></div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str2 = <span class="stringliteral">&quot;EXECUTION&quot;</span>; <span class="comment">// Sample input of 2nd string</span></div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> uint64_t expected_output1 = 5; <span class="comment">// Expected minimum cost</span></div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> uint64_t output1 = <a class="code hl_function" href="../../da/d52/minimum__edit__distance_8cpp.html#ade2fcfe0359f3c7691bfaa04b14943e2">dynamic_programming::minimum_edit_distance::editDistDP</a>(</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> str1, str2, str1.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>(), str2.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>()); <span class="comment">// calling the editDistDP function and storing the result on output1</span></div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> assert(output1 == expected_output1); <span class="comment">// comparing the output with the expected output</span></div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Minimum Number of Operations Required: &quot;</span> &lt;&lt; output1</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> </div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="comment">// 2nd test</span></div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str3 = <span class="stringliteral">&quot;SATURDAY&quot;</span>;</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str4 = <span class="stringliteral">&quot;SUNDAY&quot;</span>;</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> uint64_t expected_output2 = 3;</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> uint64_t output2 = <a class="code hl_function" href="../../da/d52/minimum__edit__distance_8cpp.html#ade2fcfe0359f3c7691bfaa04b14943e2">dynamic_programming::minimum_edit_distance::editDistDP</a>(</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> str3, str4, str3.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>(), str4.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>());</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> assert(output2 == expected_output2);</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Minimum Number of Operations Required: &quot;</span> &lt;&lt; output2</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 132</span> {</div>
<div class="line"><span class="lineno"> 133</span> <span class="comment">// 1st test</span></div>
<div class="line"><span class="lineno"> 134</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str1 = <span class="stringliteral">&quot;INTENTION&quot;</span>; <span class="comment">// Sample input of 1st string</span></div>
<div class="line"><span class="lineno"> 135</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str2 = <span class="stringliteral">&quot;EXECUTION&quot;</span>; <span class="comment">// Sample input of 2nd string</span></div>
<div class="line"><span class="lineno"> 136</span> uint64_t expected_output1 = 5; <span class="comment">// Expected minimum cost</span></div>
<div class="line"><span class="lineno"> 137</span> uint64_t output1 = <a class="code hl_function" href="../../da/d52/minimum__edit__distance_8cpp.html#ade2fcfe0359f3c7691bfaa04b14943e2">dynamic_programming::minimum_edit_distance::editDistDP</a>(</div>
<div class="line"><span class="lineno"> 138</span> str1, str2, str1.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>(), str2.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>()); <span class="comment">// calling the editDistDP function and storing the result on output1</span></div>
<div class="line"><span class="lineno"> 139</span> assert(output1 == expected_output1); <span class="comment">// comparing the output with the expected output</span></div>
<div class="line"><span class="lineno"> 140</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Minimum Number of Operations Required: &quot;</span> &lt;&lt; output1</div>
<div class="line"><span class="lineno"> 141</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 142</span> </div>
<div class="line"><span class="lineno"> 143</span> <span class="comment">// 2nd test</span></div>
<div class="line"><span class="lineno"> 144</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str3 = <span class="stringliteral">&quot;SATURDAY&quot;</span>;</div>
<div class="line"><span class="lineno"> 145</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str4 = <span class="stringliteral">&quot;SUNDAY&quot;</span>;</div>
<div class="line"><span class="lineno"> 146</span> uint64_t expected_output2 = 3;</div>
<div class="line"><span class="lineno"> 147</span> uint64_t output2 = <a class="code hl_function" href="../../da/d52/minimum__edit__distance_8cpp.html#ade2fcfe0359f3c7691bfaa04b14943e2">dynamic_programming::minimum_edit_distance::editDistDP</a>(</div>
<div class="line"><span class="lineno"> 148</span> str3, str4, str3.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>(), str4.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>());</div>
<div class="line"><span class="lineno"> 149</span> assert(output2 == expected_output2);</div>
<div class="line"><span class="lineno"> 150</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Minimum Number of Operations Required: &quot;</span> &lt;&lt; output2</div>
<div class="line"><span class="lineno"> 151</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 152</span>}</div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="abasic_string_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a></div></div>
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
@@ -425,7 +425,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><a class="el" href="../../da/d52/minimum__edit__distance_8cpp.html">minimum_edit_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.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -1,6 +1,6 @@
<map id="main" name="main">
<area shape="rect" id="node1" title="main function" alt="" coords="5,31,56,57"/>
<area shape="rect" id="node2" href="$da/d52/minimum__edit__distance_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title="Self&#45;test implementations." alt="" coords="104,31,148,57"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="221,5,293,32"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/size.html#" title=" " alt="" coords="196,56,319,83"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="221,5,293,32"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/size#" title=" " alt="" coords="196,56,319,83"/>
</map>

View File

@@ -1 +1 @@
1d870b19e256347c9c55e5ac4895c7ea
b65f88da3d9e8c18c472ae86b2e33ab7

View File

@@ -36,7 +36,7 @@
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
<polygon fill="white" stroke="black" points="162,-38.5 162,-57.5 216,-57.5 216,-38.5 162,-38.5"/>
<text text-anchor="middle" x="189" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>
@@ -51,7 +51,7 @@
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/size.html#" xlink:title=" ">
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/size#" xlink:title=" ">
<polygon fill="white" stroke="black" points="143,-0.5 143,-19.5 235,-19.5 235,-0.5 143,-0.5"/>
<text text-anchor="middle" x="189" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::string::length</text>
</a>

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -1,5 +1,5 @@
<map id="test" name="test">
<area shape="rect" id="node1" title="Self&#45;test implementations." alt="" coords="5,31,49,57"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="123,5,195,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/size.html#" title=" " alt="" coords="97,56,220,83"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="123,5,195,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/string/basic_string/size#" title=" " alt="" coords="97,56,220,83"/>
</map>

View File

@@ -1 +1 @@
5d4300b05742c51159ae7bfa132fa0d6
daf6a832a3240912dd32ecd339913c62

View File

@@ -21,7 +21,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
<polygon fill="white" stroke="black" points="88,-38.5 88,-57.5 142,-57.5 142,-38.5 88,-38.5"/>
<text text-anchor="middle" x="115" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>
@@ -36,7 +36,7 @@
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/size.html#" xlink:title=" ">
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/string/basic_string/size#" xlink:title=" ">
<polygon fill="white" stroke="black" points="69,-0.5 69,-19.5 161,-19.5 161,-0.5 69,-0.5"/>
<text text-anchor="middle" x="115" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::string::length</text>
</a>

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: Complex Class Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -201,16 +201,16 @@ double&#160;</td><td class="memItemRight" valign="bottom"><b>im</b></td></tr>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> {</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">if</span> (!is_polar) {</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> re = x;</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> im = y;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> }</div>
<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> re = x * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/cos.html">std::cos</a>(y);</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> im = x * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sin.html">std::sin</a>(y);</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 43</span> {</div>
<div class="line"><span class="lineno"> 44</span> <span class="keywordflow">if</span> (!is_polar) {</div>
<div class="line"><span class="lineno"> 45</span> re = x;</div>
<div class="line"><span class="lineno"> 46</span> im = y;</div>
<div class="line"><span class="lineno"> 47</span> <span class="keywordflow">return</span>;</div>
<div class="line"><span class="lineno"> 48</span> }</div>
<div class="line"><span class="lineno"> 49</span> </div>
<div class="line"><span class="lineno"> 50</span> re = x * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/cos.html">std::cos</a>(y);</div>
<div class="line"><span class="lineno"> 51</span> im = x * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sin.html">std::sin</a>(y);</div>
<div class="line"><span class="lineno"> 52</span> }</div>
<div class="ttc" id="acos_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/cos.html">std::cos</a></div><div class="ttdeci">T cos(T... args)</div></div>
<div class="ttc" id="asin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/sin.html">std::sin</a></div><div class="ttdeci">T sin(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
@@ -253,7 +253,7 @@ Here is the call graph for this function:</div>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span>: re(other.<a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>()), im(other.<a class="code hl_function" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">imag</a>()) {}</div>
<div class="fragment"><div class="line"><span class="lineno"> 58</span>: re(other.<a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>()), im(other.<a class="code hl_function" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">imag</a>()) {}</div>
<div class="ttc" id="aclass_complex_html_a312e4b19146128408fb06e0150b0faf6"><div class="ttname"><a href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">Complex::real</a></div><div class="ttdeci">double real() const</div><div class="ttdoc">Member function to get real value of our complex number. Member function (getter) to access the class...</div><div class="ttdef"><b>Definition:</b> complex_numbers.cpp:64</div></div>
<div class="ttc" id="aclass_complex_html_af8aacf982e2e6c142921bc850f6dc974"><div class="ttname"><a href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">Complex::imag</a></div><div class="ttdeci">double imag() const</div><div class="ttdoc">Member function to get imaginary value of our complex number. Member function (getter) to access the ...</div><div class="ttdef"><b>Definition:</b> complex_numbers.cpp:70</div></div>
</div><!-- fragment -->
@@ -285,9 +285,9 @@ Here is the call graph for this function:</div>
<p>Member function to give the modulus of our complex number. Member function to which gives the absolute value (modulus) of our complex number. </p>
<dl class="section return"><dt>Returns</dt><dd>\( \sqrt{z \bar{z}} \) where \( z \) is our complex number. </dd></dl>
<div class="fragment"><div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> {</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(this-&gt;re * this-&gt;re + this-&gt;im * this-&gt;im);</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 79</span> {</div>
<div class="line"><span class="lineno"> 80</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(this-&gt;re * this-&gt;re + this-&gt;im * this-&gt;im);</div>
<div class="line"><span class="lineno"> 81</span> }</div>
<div class="ttc" id="asqrt_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a></div><div class="ttdeci">T sqrt(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
@@ -323,7 +323,7 @@ Here is the call graph for this function:</div>
<p>Member function to give the argument of our complex number. </p>
<dl class="section return"><dt>Returns</dt><dd>Argument of our <a class="el" href="../../da/d5a/class_complex.html" title="Class Complex to represent complex numbers as a field.">Complex</a> number in radians. </dd></dl>
<div class="fragment"><div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/atan2.html">std::atan2</a>(this-&gt;im, this-&gt;re); }</div>
<div class="fragment"><div class="line"><span class="lineno"> 87</span>{ <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/atan2.html">std::atan2</a>(this-&gt;im, this-&gt;re); }</div>
<div class="ttc" id="aatan2_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/atan2.html">std::atan2</a></div><div class="ttdeci">T atan2(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
@@ -358,7 +358,7 @@ Here is the call graph for this function:</div>
</div><div class="memdoc">
<p>Member function to get imaginary value of our complex number. Member function (getter) to access the class' im value. </p>
<div class="fragment"><div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span>{ <span class="keywordflow">return</span> this-&gt;im; }</div>
<div class="fragment"><div class="line"><span class="lineno"> 70</span>{ <span class="keywordflow">return</span> this-&gt;im; }</div>
</div><!-- fragment -->
</div>
</div>
@@ -394,11 +394,11 @@ Here is the call graph for this function:</div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>result current number times other number. </dd></dl>
<div class="fragment"><div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> {</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>(this-&gt;re * other.re - this-&gt;im * other.im,</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> this-&gt;re * other.im + this-&gt;im * other.re);</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 117</span> {</div>
<div class="line"><span class="lineno"> 118</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>(this-&gt;re * other.re - this-&gt;im * other.im,</div>
<div class="line"><span class="lineno"> 119</span> this-&gt;re * other.im + this-&gt;im * other.re);</div>
<div class="line"><span class="lineno"> 120</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
<div class="line"><span class="lineno"> 121</span> }</div>
<div class="ttc" id="aclass_complex_html"><div class="ttname"><a href="../../da/d5a/class_complex.html">Complex</a></div><div class="ttdoc">Class Complex to represent complex numbers as a field.</div><div class="ttdef"><b>Definition:</b> complex_numbers.cpp:20</div></div>
<div class="ttc" id="afibonacci__sum_8cpp_html_aadb40ac4c74a7efc0680b83eeee138aa"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">math::fibonacci_sum::result</a></div><div class="ttdeci">uint64_t result(uint64_t n)</div><div class="ttdef"><b>Definition:</b> fibonacci_sum.cpp:76</div></div>
</div><!-- fragment -->
@@ -436,10 +436,10 @@ Here is the call graph for this function:</div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>result current number plus other number </dd></dl>
<div class="fragment"><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> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>(this-&gt;re + other.re, this-&gt;im + other.im);</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 95</span> {</div>
<div class="line"><span class="lineno"> 96</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>(this-&gt;re + other.re, this-&gt;im + other.im);</div>
<div class="line"><span class="lineno"> 97</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
<div class="line"><span class="lineno"> 98</span> }</div>
</div><!-- fragment -->
</div>
</div>
@@ -475,10 +475,10 @@ Here is the call graph for this function:</div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>result current number subtract other number </dd></dl>
<div class="fragment"><div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> {</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>(this-&gt;re - other.re, this-&gt;im - other.im);</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 106</span> {</div>
<div class="line"><span class="lineno"> 107</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>(this-&gt;re - other.re, this-&gt;im - other.im);</div>
<div class="line"><span class="lineno"> 108</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
<div class="line"><span class="lineno"> 109</span> }</div>
</div><!-- fragment -->
</div>
</div>
@@ -514,18 +514,18 @@ Here is the call graph for this function:</div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>result Current number divided by other number. </dd></dl>
<div class="fragment"><div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> {</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = *<span class="keyword">this</span> * ~other;</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordtype">double</span> denominator =</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> other.<a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>() * other.<a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>() + other.<a class="code hl_function" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">imag</a>() * other.<a class="code hl_function" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">imag</a>();</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="keywordflow">if</span> (denominator != 0) {</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a>(<a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.real() / denominator,</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.imag() / denominator);</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <span class="keywordflow">throw</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/error/invalid_argument.html">std::invalid_argument</a>(<span class="stringliteral">&quot;Undefined Value&quot;</span>);</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> }</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 142</span> {</div>
<div class="line"><span class="lineno"> 143</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = *<span class="keyword">this</span> * ~other;</div>
<div class="line"><span class="lineno"> 144</span> <span class="keywordtype">double</span> denominator =</div>
<div class="line"><span class="lineno"> 145</span> other.<a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>() * other.<a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>() + other.<a class="code hl_function" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">imag</a>() * other.<a class="code hl_function" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">imag</a>();</div>
<div class="line"><span class="lineno"> 146</span> <span class="keywordflow">if</span> (denominator != 0) {</div>
<div class="line"><span class="lineno"> 147</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> = <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a>(<a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.real() / denominator,</div>
<div class="line"><span class="lineno"> 148</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.imag() / denominator);</div>
<div class="line"><span class="lineno"> 149</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
<div class="line"><span class="lineno"> 150</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 151</span> <span class="keywordflow">throw</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/error/invalid_argument.html">std::invalid_argument</a>(<span class="stringliteral">&quot;Undefined Value&quot;</span>);</div>
<div class="line"><span class="lineno"> 152</span> }</div>
<div class="line"><span class="lineno"> 153</span> }</div>
<div class="ttc" id="aclass_complex_html_a3cfc522c782726f49ee20af17b77f867"><div class="ttname"><a href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex::Complex</a></div><div class="ttdeci">Complex(double x=0.f, double y=0.f, bool is_polar=false)</div><div class="ttdoc">Complex Constructor which initialises our complex number.</div><div class="ttdef"><b>Definition:</b> complex_numbers.cpp:43</div></div>
<div class="ttc" id="ainvalid_argument_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/error/invalid_argument.html">std::invalid_argument</a></div></div>
</div><!-- fragment --><div class="dynheader">
@@ -562,11 +562,11 @@ Here is the call graph for this function:</div>
</div><div class="memdoc">
<p>Operator overload of '=' on <a class="el" href="../../da/d5a/class_complex.html" title="Class Complex to represent complex numbers as a field.">Complex</a> class. Operator overload to be able to copy RHS instance of <a class="el" href="../../da/d5a/class_complex.html" title="Class Complex to represent complex numbers as a field.">Complex</a> to LHS instance of <a class="el" href="../../da/d5a/class_complex.html" title="Class Complex to represent complex numbers as a field.">Complex</a>. </p>
<div class="fragment"><div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> {</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> this-&gt;re = other.<a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>();</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> this-&gt;im = other.<a class="code hl_function" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">imag</a>();</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 160</span> {</div>
<div class="line"><span class="lineno"> 161</span> this-&gt;re = other.<a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>();</div>
<div class="line"><span class="lineno"> 162</span> this-&gt;im = other.<a class="code hl_function" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">imag</a>();</div>
<div class="line"><span class="lineno"> 163</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><span class="lineno"> 164</span> }</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
@@ -601,10 +601,10 @@ Here is the call graph for this function:</div>
<p>Operator overload of '~' on <a class="el" href="../../da/d5a/class_complex.html" title="Class Complex to represent complex numbers as a field.">Complex</a> class. Operator overload of the BITWISE NOT which gives us the conjugate of our complex number. NOTE: This is overloading the BITWISE operator but its not a BITWISE operation in this definition. </p>
<dl class="section return"><dt>Returns</dt><dd>result The conjugate of our complex number. </dd></dl>
<div class="fragment"><div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> {</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>(this-&gt;re, -(this-&gt;im));</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> }</div>
<div class="fragment"><div class="line"><span class="lineno"> 130</span> {</div>
<div class="line"><span class="lineno"> 131</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>(this-&gt;re, -(this-&gt;im));</div>
<div class="line"><span class="lineno"> 132</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
<div class="line"><span class="lineno"> 133</span> }</div>
</div><!-- fragment -->
</div>
</div>
@@ -632,7 +632,7 @@ Here is the call graph for this function:</div>
</div><div class="memdoc">
<p>Member function to get real value of our complex number. Member function (getter) to access the class' re value. </p>
<div class="fragment"><div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span>{ <span class="keywordflow">return</span> this-&gt;re; }</div>
<div class="fragment"><div class="line"><span class="lineno"> 64</span>{ <span class="keywordflow">return</span> this-&gt;re; }</div>
</div><!-- fragment -->
</div>
</div>
@@ -645,7 +645,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../da/d5a/class_complex.html">Complex</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -1,5 +1,5 @@
<map id="Complex::Complex" name="Complex::Complex">
<area shape="rect" id="node1" title="Complex Constructor which initialises our complex number." alt="" coords="5,31,140,57"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/cos.html#" title=" " alt="" coords="188,5,257,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sin.html#" title=" " alt="" coords="190,56,255,83"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/cos#" title=" " alt="" coords="188,5,257,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sin#" title=" " alt="" coords="190,56,255,83"/>
</map>

View File

@@ -1 +1 @@
bae3b34ea69e8fd9a3a780233057dcb2
7d9ee0550a2f7989b1d030123f12091e

View File

@@ -21,7 +21,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/cos.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/cos#" xlink:title=" ">
<polygon fill="white" stroke="black" points="137,-38.5 137,-57.5 189,-57.5 189,-38.5 137,-38.5"/>
<text text-anchor="middle" x="163" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::cos</text>
</a>
@@ -36,7 +36,7 @@
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sin.html#" xlink:title=" ">
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sin#" xlink:title=" ">
<polygon fill="white" stroke="black" points="138.5,-0.5 138.5,-19.5 187.5,-19.5 187.5,-0.5 138.5,-0.5"/>
<text text-anchor="middle" x="163" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::sin</text>
</a>

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -3,6 +3,6 @@
<area shape="rect" id="node2" href="$da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867" title="Complex Constructor which initialises our complex number." alt="" coords="187,31,321,57"/>
<area shape="rect" id="node5" href="$da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974" title="Member function to get imaginary value of our complex number. Member function (getter) to access the ..." alt="" coords="199,81,309,108"/>
<area shape="rect" id="node6" href="$da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6" title="Member function to get real value of our complex number. Member function (getter) to access the class..." alt="" coords="203,132,305,159"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/cos.html#" title=" " alt="" coords="369,5,439,32"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sin.html#" title=" " alt="" coords="371,56,437,83"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/cos#" title=" " alt="" coords="369,5,439,32"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sin#" title=" " alt="" coords="371,56,437,83"/>
</map>

View File

@@ -1 +1 @@
09f9b20362fb790c68d214be6a0d979f
0c606ca1683fb5186f5454d7ed7d4938

View File

@@ -66,7 +66,7 @@
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/cos.html#" xlink:title=" ">
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/cos#" xlink:title=" ">
<polygon fill="white" stroke="black" points="273,-95.5 273,-114.5 325,-114.5 325,-95.5 273,-95.5"/>
<text text-anchor="middle" x="299" y="-102.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::cos</text>
</a>
@@ -81,7 +81,7 @@
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sin.html#" xlink:title=" ">
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sin#" xlink:title=" ">
<polygon fill="white" stroke="black" points="274.5,-57.5 274.5,-76.5 323.5,-76.5 323.5,-57.5 274.5,-57.5"/>
<text text-anchor="middle" x="299" y="-64.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::sin</text>
</a>

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@@ -1,4 +1,4 @@
<map id="Complex::arg" name="Complex::arg">
<area shape="rect" id="node1" title="Member function to give the argument of our complex number." alt="" coords="5,5,105,32"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/atan2.html#" title=" " alt="" coords="153,5,233,32"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/atan2#" title=" " alt="" coords="153,5,233,32"/>
</map>

View File

@@ -1 +1 @@
194d55393cf36eacaf798fd245a99ed4
f79f5f41e85972a82601ad4ffcac99b5

View File

@@ -21,7 +21,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/atan2.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/atan2#" xlink:title=" ">
<polygon fill="white" stroke="black" points="111,-0.5 111,-19.5 171,-19.5 171,-0.5 111,-0.5"/>
<text text-anchor="middle" x="141" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::atan2</text>
</a>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -1,4 +1,4 @@
<map id="Complex::abs" name="Complex::abs">
<area shape="rect" id="node1" title="Member function to give the modulus of our complex number. Member function to which gives the absolut..." alt="" coords="5,5,108,32"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt.html#" title=" " alt="" coords="156,5,227,32"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/sqrt#" title=" " alt="" coords="156,5,227,32"/>
</map>

View File

@@ -1 +1 @@
5cd0da3854a713ba704d46989b2f4296
16cbfb0940209e468548a45e6d66521f

View File

@@ -21,7 +21,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/sqrt#" xlink:title=" ">
<polygon fill="white" stroke="black" points="113,-0.5 113,-19.5 166,-19.5 166,-0.5 113,-0.5"/>
<text text-anchor="middle" x="139.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::sqrt</text>
</a>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: search::sublist_search::Node Struct Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -128,7 +128,7 @@ uint32_t&#160;</td><td class="memItemRight" valign="bottom"><b>data</b> = 0</td>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d9/dca/namespacesearch.html">search</a></li><li class="navelem"><b>sublist_search</b></li><li class="navelem"><a class="el" href="../../da/d61/structsearch_1_1sublist__search_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.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: Member List</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -113,7 +113,7 @@ $(document).ready(function(){initNavTree('d8/d28/classrange__queries_1_1per_seg_
<!-- 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.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: operations_on_datastructures Namespace Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
@@ -177,29 +177,29 @@ Functions</h2></td></tr>
<p >&lt; Add the element if it is unique</p>
<p >&lt; Increment index of first array</p>
<p >&lt; Increment index of second array too</p>
<div class="fragment"><div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> {</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;int32_t&gt;</a> res; <span class="comment">///&lt; Vector to hold the intersection</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordtype">size_t</span> f_index = 0; <span class="comment">///&lt; Index for the first array</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordtype">size_t</span> s_index = 0; <span class="comment">///&lt; Index for the second array</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordtype">size_t</span> f_length = first.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); <span class="comment">///&lt; Length of first array</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordtype">size_t</span> s_length = second.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); <span class="comment">///&lt; Length of second array</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> </div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keywordflow">while</span> (f_index &lt; f_length &amp;&amp; s_index &lt; s_length) {</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordflow">if</span> (first[f_index] &lt; second[s_index]) {</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> f_index++; <span class="comment">///&lt; Increment index of second array</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first[f_index] &gt; second[s_index]) {</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> s_index++; <span class="comment">///&lt; Increment index of second array</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordflow">if</span> ((res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() == 0) || (first[f_index] != res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/back.html">back</a>())) {</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> first[f_index]); <span class="comment">///&lt; Add the element if it is unique</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> }</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> f_index++; <span class="comment">///&lt; Increment index of first array</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> s_index++; <span class="comment">///&lt; Increment index of second array too</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> }</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> }</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordflow">return</span> res;</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 50</span> {</div>
<div class="line"><span class="lineno"> 51</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;int32_t&gt;</a> res; <span class="comment">///&lt; Vector to hold the intersection</span></div>
<div class="line"><span class="lineno"> 52</span> <span class="keywordtype">size_t</span> f_index = 0; <span class="comment">///&lt; Index for the first array</span></div>
<div class="line"><span class="lineno"> 53</span> <span class="keywordtype">size_t</span> s_index = 0; <span class="comment">///&lt; Index for the second array</span></div>
<div class="line"><span class="lineno"> 54</span> <span class="keywordtype">size_t</span> f_length = first.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); <span class="comment">///&lt; Length of first array</span></div>
<div class="line"><span class="lineno"> 55</span> <span class="keywordtype">size_t</span> s_length = second.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); <span class="comment">///&lt; Length of second array</span></div>
<div class="line"><span class="lineno"> 56</span> </div>
<div class="line"><span class="lineno"> 57</span> <span class="keywordflow">while</span> (f_index &lt; f_length &amp;&amp; s_index &lt; s_length) {</div>
<div class="line"><span class="lineno"> 58</span> <span class="keywordflow">if</span> (first[f_index] &lt; second[s_index]) {</div>
<div class="line"><span class="lineno"> 59</span> f_index++; <span class="comment">///&lt; Increment index of second array</span></div>
<div class="line"><span class="lineno"> 60</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first[f_index] &gt; second[s_index]) {</div>
<div class="line"><span class="lineno"> 61</span> s_index++; <span class="comment">///&lt; Increment index of second array</span></div>
<div class="line"><span class="lineno"> 62</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 63</span> <span class="keywordflow">if</span> ((res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() == 0) || (first[f_index] != res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/back.html">back</a>())) {</div>
<div class="line"><span class="lineno"> 64</span> res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(</div>
<div class="line"><span class="lineno"> 65</span> first[f_index]); <span class="comment">///&lt; Add the element if it is unique</span></div>
<div class="line"><span class="lineno"> 66</span> }</div>
<div class="line"><span class="lineno"> 67</span> f_index++; <span class="comment">///&lt; Increment index of first array</span></div>
<div class="line"><span class="lineno"> 68</span> s_index++; <span class="comment">///&lt; Increment index of second array too</span></div>
<div class="line"><span class="lineno"> 69</span> }</div>
<div class="line"><span class="lineno"> 70</span> }</div>
<div class="line"><span class="lineno"> 71</span> <span class="keywordflow">return</span> res;</div>
<div class="line"><span class="lineno"> 72</span>}</div>
<div class="ttc" id="aback_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/back.html">std::vector::back</a></div><div class="ttdeci">T back(T... args)</div></div>
<div class="ttc" id="apush_back_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">std::vector::push_back</a></div><div class="ttdeci">T push_back(T... args)</div></div>
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/size.html">std::vector::size</a></div><div class="ttdeci">T size(T... args)</div></div>
@@ -266,46 +266,46 @@ Here is the call graph for this function:</div>
<p >&lt; Add the element if it is unique</p>
<p >&lt; Add remaining elements</p>
<p >&lt; Add the element if it is unique</p>
<div class="fragment"><div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> {</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;int32_t&gt;</a> res; <span class="comment">///&lt; Vector to hold the union</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordtype">size_t</span> f_index = 0; <span class="comment">///&lt; Index for the first array</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordtype">size_t</span> s_index = 0; <span class="comment">///&lt; Index for the second array</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordtype">size_t</span> f_length = first.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); <span class="comment">///&lt; Length of first array</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordtype">size_t</span> s_length = second.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); <span class="comment">///&lt; Length of second array</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> int32_t next = 0; <span class="comment">///&lt; Integer to store value of the next element</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordflow">while</span> (f_index &lt; f_length &amp;&amp; s_index &lt; s_length) {</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordflow">if</span> (first[f_index] &lt; second[s_index]) {</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> next = first[f_index]; <span class="comment">///&lt; Append from first array</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> f_index++; <span class="comment">///&lt; Increment index of second array</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first[f_index] &gt; second[s_index]) {</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> next = second[s_index]; <span class="comment">///&lt; Append from second array</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> s_index++; <span class="comment">///&lt; Increment index of second array</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a> = first[f_index]; <span class="comment">///&lt; Element is the same in both</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> f_index++; <span class="comment">///&lt; Increment index of first array</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> s_index++; <span class="comment">///&lt; Increment index of second array too</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> }</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordflow">if</span> ((res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() == 0) || (next != res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/back.html">back</a>())) {</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(next); <span class="comment">///&lt; Add the element if it is unique</span></div>
<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> }</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordflow">while</span> (f_index &lt; f_length) {</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a> = first[f_index]; <span class="comment">///&lt; Add remaining elements</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordflow">if</span> ((res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() == 0) || (next != res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/back.html">back</a>())) {</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(next); <span class="comment">///&lt; Add the element if it is unique</span></div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> }</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> f_index++;</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="keywordflow">while</span> (s_index &lt; s_length) {</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a> = second[s_index]; <span class="comment">///&lt; Add remaining elements</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordflow">if</span> ((res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() == 0) || (next != res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/back.html">back</a>())) {</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(next); <span class="comment">///&lt; Add the element if it is unique</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> }</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> s_index++;</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> <span class="keywordflow">return</span> res;</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 50</span> {</div>
<div class="line"><span class="lineno"> 51</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;int32_t&gt;</a> res; <span class="comment">///&lt; Vector to hold the union</span></div>
<div class="line"><span class="lineno"> 52</span> <span class="keywordtype">size_t</span> f_index = 0; <span class="comment">///&lt; Index for the first array</span></div>
<div class="line"><span class="lineno"> 53</span> <span class="keywordtype">size_t</span> s_index = 0; <span class="comment">///&lt; Index for the second array</span></div>
<div class="line"><span class="lineno"> 54</span> <span class="keywordtype">size_t</span> f_length = first.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); <span class="comment">///&lt; Length of first array</span></div>
<div class="line"><span class="lineno"> 55</span> <span class="keywordtype">size_t</span> s_length = second.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); <span class="comment">///&lt; Length of second array</span></div>
<div class="line"><span class="lineno"> 56</span> int32_t next = 0; <span class="comment">///&lt; Integer to store value of the next element</span></div>
<div class="line"><span class="lineno"> 57</span> </div>
<div class="line"><span class="lineno"> 58</span> <span class="keywordflow">while</span> (f_index &lt; f_length &amp;&amp; s_index &lt; s_length) {</div>
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">if</span> (first[f_index] &lt; second[s_index]) {</div>
<div class="line"><span class="lineno"> 60</span> next = first[f_index]; <span class="comment">///&lt; Append from first array</span></div>
<div class="line"><span class="lineno"> 61</span> f_index++; <span class="comment">///&lt; Increment index of second array</span></div>
<div class="line"><span class="lineno"> 62</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first[f_index] &gt; second[s_index]) {</div>
<div class="line"><span class="lineno"> 63</span> next = second[s_index]; <span class="comment">///&lt; Append from second array</span></div>
<div class="line"><span class="lineno"> 64</span> s_index++; <span class="comment">///&lt; Increment index of second array</span></div>
<div class="line"><span class="lineno"> 65</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 66</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a> = first[f_index]; <span class="comment">///&lt; Element is the same in both</span></div>
<div class="line"><span class="lineno"> 67</span> f_index++; <span class="comment">///&lt; Increment index of first array</span></div>
<div class="line"><span class="lineno"> 68</span> s_index++; <span class="comment">///&lt; Increment index of second array too</span></div>
<div class="line"><span class="lineno"> 69</span> }</div>
<div class="line"><span class="lineno"> 70</span> <span class="keywordflow">if</span> ((res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() == 0) || (next != res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/back.html">back</a>())) {</div>
<div class="line"><span class="lineno"> 71</span> res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(next); <span class="comment">///&lt; Add the element if it is unique</span></div>
<div class="line"><span class="lineno"> 72</span> }</div>
<div class="line"><span class="lineno"> 73</span> }</div>
<div class="line"><span class="lineno"> 74</span> <span class="keywordflow">while</span> (f_index &lt; f_length) {</div>
<div class="line"><span class="lineno"> 75</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a> = first[f_index]; <span class="comment">///&lt; Add remaining elements</span></div>
<div class="line"><span class="lineno"> 76</span> <span class="keywordflow">if</span> ((res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() == 0) || (next != res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/back.html">back</a>())) {</div>
<div class="line"><span class="lineno"> 77</span> res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(next); <span class="comment">///&lt; Add the element if it is unique</span></div>
<div class="line"><span class="lineno"> 78</span> }</div>
<div class="line"><span class="lineno"> 79</span> f_index++;</div>
<div class="line"><span class="lineno"> 80</span> }</div>
<div class="line"><span class="lineno"> 81</span> <span class="keywordflow">while</span> (s_index &lt; s_length) {</div>
<div class="line"><span class="lineno"> 82</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/next.html">next</a> = second[s_index]; <span class="comment">///&lt; Add remaining elements</span></div>
<div class="line"><span class="lineno"> 83</span> <span class="keywordflow">if</span> ((res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() == 0) || (next != res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/back.html">back</a>())) {</div>
<div class="line"><span class="lineno"> 84</span> res.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(next); <span class="comment">///&lt; Add the element if it is unique</span></div>
<div class="line"><span class="lineno"> 85</span> }</div>
<div class="line"><span class="lineno"> 86</span> s_index++;</div>
<div class="line"><span class="lineno"> 87</span> }</div>
<div class="line"><span class="lineno"> 88</span> <span class="keywordflow">return</span> res;</div>
<div class="line"><span class="lineno"> 89</span>}</div>
<div class="ttc" id="anext_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/iterator/next.html">std::next</a></div><div class="ttdeci">T next(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
@@ -354,12 +354,12 @@ Here is the call graph for this function:</div>
<p >Print newline</p>
<p >Print each value in the array</p>
<p >Print newline</p>
<div class="fragment"><div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordflow">for</span> (int32_t i : array) {</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; i &lt;&lt; <span class="stringliteral">&quot; &quot;</span>; <span class="comment">/// Print each value in the array</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> }</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>; <span class="comment">/// Print newline</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 29</span> {</div>
<div class="line"><span class="lineno"> 30</span> <span class="keywordflow">for</span> (int32_t i : array) {</div>
<div class="line"><span class="lineno"> 31</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; i &lt;&lt; <span class="stringliteral">&quot; &quot;</span>; <span class="comment">/// Print each value in the array</span></div>
<div class="line"><span class="lineno"> 32</span> }</div>
<div class="line"><span class="lineno"> 33</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>; <span class="comment">/// Print newline</span></div>
<div class="line"><span class="lineno"> 34</span>}</div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
</div><!-- fragment -->
</div>
@@ -403,20 +403,20 @@ Here is the call graph for this function:</div>
<p >&lt; Result array</p>
<p >&lt; Add values after the shift index</p>
<p >&lt; Add the values from the start</p>
<div class="fragment"><div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> {</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">if</span> (array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() &lt;= shift) {</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">return</span> {}; <span class="comment">///&lt; We got an invalid shift, return empty array</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;int32_t&gt;</a> res(array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>()); <span class="comment">///&lt; Result array</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = shift; i &lt; array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); i++) {</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> res[i - shift] = array[i]; <span class="comment">///&lt; Add values after the shift index</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> }</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 = 0; i &lt; shift; i++) {</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> res[array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() - shift + i] =</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> array[i]; <span class="comment">///&lt; Add the values from the start</span></div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> }</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordflow">return</span> res;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 47</span> {</div>
<div class="line"><span class="lineno"> 48</span> <span class="keywordflow">if</span> (array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() &lt;= shift) {</div>
<div class="line"><span class="lineno"> 49</span> <span class="keywordflow">return</span> {}; <span class="comment">///&lt; We got an invalid shift, return empty array</span></div>
<div class="line"><span class="lineno"> 50</span> }</div>
<div class="line"><span class="lineno"> 51</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;int32_t&gt;</a> res(array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>()); <span class="comment">///&lt; Result array</span></div>
<div class="line"><span class="lineno"> 52</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = shift; i &lt; array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); i++) {</div>
<div class="line"><span class="lineno"> 53</span> res[i - shift] = array[i]; <span class="comment">///&lt; Add values after the shift index</span></div>
<div class="line"><span class="lineno"> 54</span> }</div>
<div class="line"><span class="lineno"> 55</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; shift; i++) {</div>
<div class="line"><span class="lineno"> 56</span> res[array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() - shift + i] =</div>
<div class="line"><span class="lineno"> 57</span> array[i]; <span class="comment">///&lt; Add the values from the start</span></div>
<div class="line"><span class="lineno"> 58</span> }</div>
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">return</span> res;</div>
<div class="line"><span class="lineno"> 60</span>}</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
@@ -465,20 +465,20 @@ Here is the call graph for this function:</div>
<p >&lt; Result array</p>
<p >&lt; Add values after the shift index</p>
<p >&lt; Add the values from the start</p>
<div class="fragment"><div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> {</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">if</span> (array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() &lt;= shift) {</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordflow">return</span> {}; <span class="comment">///&lt; We got an invalid shift, return empty array</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> }</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;int32_t&gt;</a> res(array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>()); <span class="comment">///&lt; Result array</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = shift; i &lt; array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); i++) {</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> res[i] = array[i - shift]; <span class="comment">///&lt; Add values after the shift index</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> }</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; shift; i++) {</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> res[i] =</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> array[array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() - shift + i]; <span class="comment">///&lt; Add the values from the start</span></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> <span class="keywordflow">return</span> res;</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 48</span> {</div>
<div class="line"><span class="lineno"> 49</span> <span class="keywordflow">if</span> (array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() &lt;= shift) {</div>
<div class="line"><span class="lineno"> 50</span> <span class="keywordflow">return</span> {}; <span class="comment">///&lt; We got an invalid shift, return empty array</span></div>
<div class="line"><span class="lineno"> 51</span> }</div>
<div class="line"><span class="lineno"> 52</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;int32_t&gt;</a> res(array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>()); <span class="comment">///&lt; Result array</span></div>
<div class="line"><span class="lineno"> 53</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = shift; i &lt; array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); i++) {</div>
<div class="line"><span class="lineno"> 54</span> res[i] = array[i - shift]; <span class="comment">///&lt; Add values after the shift index</span></div>
<div class="line"><span class="lineno"> 55</span> }</div>
<div class="line"><span class="lineno"> 56</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; shift; i++) {</div>
<div class="line"><span class="lineno"> 57</span> res[i] =</div>
<div class="line"><span class="lineno"> 58</span> array[array.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() - shift + i]; <span class="comment">///&lt; Add the values from the start</span></div>
<div class="line"><span class="lineno"> 59</span> }</div>
<div class="line"><span class="lineno"> 60</span> <span class="keywordflow">return</span> res;</div>
<div class="line"><span class="lineno"> 61</span>}</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
@@ -494,7 +494,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../da/d6d/namespaceoperations__on__datastructures.html">operations_on_datastructures</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>

View File

@@ -1,4 +1,4 @@
<map id="operations_on_datastructures::shift_right" name="operations_on_datastructures::shift_right">
<area shape="rect" id="node1" title="Shifts the given vector to the right by the shift amount and returns a new vector with the result...." alt="" coords="5,5,199,47"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size.html#" title=" " alt="" coords="247,13,363,39"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size#" title=" " alt="" coords="247,13,363,39"/>
</map>

View File

@@ -1 +1 @@
438c9e31e6172e0f667bd95d8c762b26
868301309f834eed03102c0e67b40678

View File

@@ -22,7 +22,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size#" xlink:title=" ">
<polygon fill="white" stroke="black" points="181,-6 181,-25 268,-25 268,-6 181,-6"/>
<text text-anchor="middle" x="224.5" y="-13" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
</a>

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -1,6 +1,6 @@
<map id="operations_on_datastructures::get_union" name="operations_on_datastructures::get_union">
<area shape="rect" id="node1" title="Gets the union of two sorted arrays, and returns them in a vector." alt="" coords="5,49,199,90"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/back.html#" title=" " alt="" coords="264,5,384,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/push_back.html#" title=" " alt="" coords="247,56,401,83"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size.html#" title=" " alt="" coords="266,107,382,133"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/back#" title=" " alt="" coords="264,5,384,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/push_back#" title=" " alt="" coords="247,56,401,83"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size#" title=" " alt="" coords="266,107,382,133"/>
</map>

View File

@@ -1 +1 @@
c8231bf6aeb9db2f04b06867c09f7db2
de2006ca208fa33e98ccebf9d6fe3e23

View File

@@ -22,7 +22,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/back.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/back#" xlink:title=" ">
<polygon fill="white" stroke="black" points="194,-76.5 194,-95.5 284,-95.5 284,-76.5 194,-76.5"/>
<text text-anchor="middle" x="239" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::back</text>
</a>
@@ -37,7 +37,7 @@
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back.html#" xlink:title=" ">
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back#" xlink:title=" ">
<polygon fill="white" stroke="black" points="181,-38.5 181,-57.5 297,-57.5 297,-38.5 181,-38.5"/>
<text text-anchor="middle" x="239" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::push_back</text>
</a>
@@ -52,7 +52,7 @@
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size#" xlink:title=" ">
<polygon fill="white" stroke="black" points="195.5,-0.5 195.5,-19.5 282.5,-19.5 282.5,-0.5 195.5,-0.5"/>
<text text-anchor="middle" x="239" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
</a>

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -1,6 +1,6 @@
<map id="operations_on_datastructures::get_intersection" name="operations_on_datastructures::get_intersection">
<area shape="rect" id="node1" title="Gets the intersection of two sorted arrays, and returns them in a vector." alt="" coords="5,49,199,90"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/back.html#" title=" " alt="" coords="264,5,384,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/push_back.html#" title=" " alt="" coords="247,56,401,83"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size.html#" title=" " alt="" coords="266,107,382,133"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/back#" title=" " alt="" coords="264,5,384,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/push_back#" title=" " alt="" coords="247,56,401,83"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size#" title=" " alt="" coords="266,107,382,133"/>
</map>

View File

@@ -1 +1 @@
51f472c36fb78d4588fd0728c554f742
c6f39a2c6b3167b9dd78ce01aa482f3c

View File

@@ -22,7 +22,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/back.html#" xlink:title=" ">
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/back#" xlink:title=" ">
<polygon fill="white" stroke="black" points="194,-76.5 194,-95.5 284,-95.5 284,-76.5 194,-76.5"/>
<text text-anchor="middle" x="239" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::back</text>
</a>
@@ -37,7 +37,7 @@
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back.html#" xlink:title=" ">
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back#" xlink:title=" ">
<polygon fill="white" stroke="black" points="181,-38.5 181,-57.5 297,-57.5 297,-38.5 181,-38.5"/>
<text text-anchor="middle" x="239" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::push_back</text>
</a>
@@ -52,7 +52,7 @@
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size#" xlink:title=" ">
<polygon fill="white" stroke="black" points="195.5,-0.5 195.5,-19.5 282.5,-19.5 282.5,-0.5 195.5,-0.5"/>
<text text-anchor="middle" x="239" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
</a>

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -1,4 +1,4 @@
<map id="operations_on_datastructures::shift_left" name="operations_on_datastructures::shift_left">
<area shape="rect" id="node1" title="Shifts the given vector to the left by the shift amount and returns a new vector with the result...." alt="" coords="5,5,199,47"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size.html#" title=" " alt="" coords="247,13,363,39"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size#" title=" " alt="" coords="247,13,363,39"/>
</map>

View File

@@ -1 +1 @@
620af06cdd5679a92bf5c83c1e58a9d0
15d77e81f3505404b1c81a36cf90b9b7

Some files were not shown because too many files have changed in this diff Show More