Documentation for db149bf3b7

This commit is contained in:
github-actions
2022-09-02 14:36:25 +00:00
parent ca6acdc719
commit 766f10286e
5464 changed files with 92674 additions and 78796 deletions

View File

@@ -1,9 +1,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: math/modular_division.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -41,10 +41,10 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<!-- Generated by Doxygen 1.9.5 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
@@ -84,9 +84,16 @@ $(document).ready(function(){initNavTree('df/d72/modular__division_8cpp.html','.
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
@@ -104,7 +111,7 @@ $(document).ready(function(){initNavTree('df/d72/modular__division_8cpp.html','.
</div><div class="textblock"><div class="dynheader">
Include dependency graph for modular_division.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d0/dcc/modular__division_8cpp__incl.svg" width="188" height="112"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d0/dcc/modular__division_8cpp__incl.svg" width="188" height="110"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div><table class="memberdecls">
@@ -137,7 +144,7 @@ Functions</h2></td></tr>
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/shubhamamsa" target="_blank">Shubham Yadav</a> </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a0ddf1224851353fc92bfbff6f499fa97" name="a0ddf1224851353fc92bfbff6f499fa97"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ddf1224851353fc92bfbff6f499fa97">&#9670;&nbsp;</a></span>main()</h2>
<h2 class="memtitle"><span class="permalink"><a href="#a0ddf1224851353fc92bfbff6f499fa97">&#9670;&#160;</a></span>main()</h2>
<div class="memitem">
<div class="memproto">
@@ -179,14 +186,14 @@ Functions</h2></td></tr>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d72/modular__division_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg" width="274" height="38"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d72/modular__division_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg" width="274" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div>
</div>
<a id="a905e368ae121beb7e7ea35349ddcdac7" name="a905e368ae121beb7e7ea35349ddcdac7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a905e368ae121beb7e7ea35349ddcdac7">&#9670;&nbsp;</a></span>mod_division()</h2>
<h2 class="memtitle"><span class="permalink"><a href="#a905e368ae121beb7e7ea35349ddcdac7">&#9670;&#160;</a></span>mod_division()</h2>
<div class="memitem">
<div class="memproto">
@@ -230,24 +237,24 @@ Here is the call graph for this function:</div>
<p >Calculate the inverse of b</p>
<p >Calculate the final result</p>
<div class="fragment"><div class="line"><span class="lineno"> 74</span> {</div>
<div class="line"><span class="lineno"> 75</span> uint64_t inverse = <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#a7cf5feaf168b88e74544da59ed830311">power</a>(b, p - 2, p) % p; <span class="comment">/// Calculate the inverse of b</span></div>
<div class="line"><span class="lineno"> 75</span> uint64_t inverse = <a class="code hl_function" href="../../df/def/power__for__huge__numbers_8cpp.html#ae249a2af508aa94266023ce8aa81426f">power</a>(b, p - 2, p) % p; <span class="comment">/// Calculate the inverse of b</span></div>
<div class="line"><span class="lineno"> 76</span> uint64_t <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> =</div>
<div class="line"><span class="lineno"> 77</span> ((a % p) * (inverse % p)) % p; <span class="comment">/// Calculate the final result</span></div>
<div class="line"><span class="lineno"> 78</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"> 79</span>}</div>
<div class="ttc" id="afibonacci__sum_8cpp_html_a7cf5feaf168b88e74544da59ed830311"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#a7cf5feaf168b88e74544da59ed830311">math::fibonacci_sum::power</a></div><div class="ttdeci">math::fibonacci_sum::matrix power(math::fibonacci_sum::matrix T, uint64_t ex)</div><div class="ttdef"><b>Definition:</b> fibonacci_sum.cpp:57</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 class="ttc" id="apower__for__huge__numbers_8cpp_html_ae249a2af508aa94266023ce8aa81426f"><div class="ttname"><a href="../../df/def/power__for__huge__numbers_8cpp.html#ae249a2af508aa94266023ce8aa81426f">power</a></div><div class="ttdeci">void power(int x, int n)</div><div class="ttdef"><b>Definition:</b> power_for_huge_numbers.cpp:56</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d72/modular__division_8cpp_a905e368ae121beb7e7ea35349ddcdac7_cgraph.svg" width="400" height="76"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d72/modular__division_8cpp_a905e368ae121beb7e7ea35349ddcdac7_cgraph.svg" width="167" height="75"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div>
</div>
<a id="a66cdf93153cbd1408bd74ac68961d179" name="a66cdf93153cbd1408bd74ac68961d179"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a66cdf93153cbd1408bd74ac68961d179">&#9670;&nbsp;</a></span>power()</h2>
<h2 class="memtitle"><span class="permalink"><a href="#a66cdf93153cbd1408bd74ac68961d179">&#9670;&#160;</a></span>power()</h2>
<div class="memitem">
<div class="memproto">
@@ -295,7 +302,7 @@ Here is the call graph for this function:</div>
<p >b must be even now</p>
<p >b = b/2</p>
<div class="fragment"><div class="line"><span class="lineno"> 49</span> {</div>
<div class="line"><span class="lineno"> 50</span> uint64_t <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a> = 1; <span class="comment">/// Initialize the answer to be returned</span></div>
<div class="line"><span class="lineno"> 50</span> uint64_t ans = 1; <span class="comment">/// Initialize the answer to be returned</span></div>
<div class="line"><span class="lineno"> 51</span> a = a % c; <span class="comment">/// Update a if it is more than or equal to c</span></div>
<div class="line"><span class="lineno"> 52</span> <span class="keywordflow">if</span> (a == 0) {</div>
<div class="line"><span class="lineno"> 53</span> <span class="keywordflow">return</span> 0; <span class="comment">/// In case a is divisible by c;</span></div>
@@ -303,26 +310,19 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 55</span> <span class="keywordflow">while</span> (b &gt; 0) {<span class="comment"></span></div>
<div class="line"><span class="lineno"> 56</span><span class="comment"> /// If b is odd, multiply a with answer</span></div>
<div class="line"><span class="lineno"> 57</span><span class="comment"></span> <span class="keywordflow">if</span> (b &amp; 1) {</div>
<div class="line"><span class="lineno"> 58</span> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a> = ((<a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a> % c) * (a % c)) % c;</div>
<div class="line"><span class="lineno"> 58</span> ans = ((ans % c) * (a % c)) % c;</div>
<div class="line"><span class="lineno"> 59</span> }<span class="comment"></span></div>
<div class="line"><span class="lineno"> 60</span><span class="comment"> /// b must be even now</span></div>
<div class="line"><span class="lineno"> 61</span><span class="comment"></span> b = b &gt;&gt; 1; <span class="comment">/// b = b/2</span></div>
<div class="line"><span class="lineno"> 62</span> a = ((a % c) * (a % c)) % c;</div>
<div class="line"><span class="lineno"> 63</span> }</div>
<div class="line"><span class="lineno"> 64</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>;</div>
<div class="line"><span class="lineno"> 64</span> <span class="keywordflow">return</span> ans;</div>
<div class="line"><span class="lineno"> 65</span>}</div>
<div class="ttc" id="amatrix__exponentiation_8cpp_html_ad8389ed58fd0ec66df248014775ad1fa"><div class="ttname"><a href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a></div><div class="ttdeci">ll ans(ll n)</div><div class="ttdef"><b>Definition:</b> matrix_exponentiation.cpp:91</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d72/modular__division_8cpp_a66cdf93153cbd1408bd74ac68961d179_cgraph.svg" width="258" height="52"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div><!-- fragment -->
</div>
</div>
<a id="aa8dca7b867074164d5f45b0f3851269d" name="aa8dca7b867074164d5f45b0f3851269d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8dca7b867074164d5f45b0f3851269d">&#9670;&nbsp;</a></span>test()</h2>
<h2 class="memtitle"><span class="permalink"><a href="#aa8dca7b867074164d5f45b0f3851269d">&#9670;&#160;</a></span>test()</h2>
<div class="memitem">
<div class="memproto">
@@ -367,7 +367,7 @@ Here is the call graph for this function:</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d72/modular__division_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="175" height="38"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d72/modular__division_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="175" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
@@ -379,7 +379,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="../../df/d72/modular__division_8cpp.html">modular_division.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5 </li>
</ul>
</div>
</body>