Documentation for 37a9811372

This commit is contained in:
realstealthninja
2024-10-21 13:23:10 +00:00
parent 8bec129b53
commit b98db53ab4
59 changed files with 1786 additions and 1122 deletions

View File

@@ -105,6 +105,7 @@ $(function(){initNavTree('d8/d53/modular__inverse__fermat__little__theorem_8cpp.
<div class="header">
<div class="summary">
<a href="#namespaces">Namespaces</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">modular_inverse_fermat_little_theorem.cpp File Reference</div></div>
</div><!--header-->
@@ -112,21 +113,40 @@ $(function(){initNavTree('d8/d53/modular__inverse__fermat__little__theorem_8cpp.
<p>C++ Program to find the modular inverse using <a href="https://en.wikipedia.org/wiki/Fermat%27s_little_theorem" target="_blank">Fermat's Little Theorem</a>
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;iostream&gt;</code><br />
<code>#include &lt;vector&gt;</code><br />
<div class="textblock"><code>#include &lt;cassert&gt;</code><br />
<code>#include &lt;cstdint&gt;</code><br />
<code>#include &lt;iostream&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for modular_inverse_fermat_little_theorem.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl.svg" width="187" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl.svg" width="255" height="126"><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">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d47/namespacemath.html">math</a></td></tr>
<tr class="memdesc:dd/d47/namespacemath"><td class="mdescLeft">&#160;</td><td class="mdescRight">for IO operations <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d50/namespacemodular__inverse__fermat.html">modular_inverse_fermat</a></td></tr>
<tr class="memdesc:d7/d50/namespacemodular__inverse__fermat"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate modular inverse using Fermat's Little Theorem. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a4c6eefd1254eab3e8d34bf02c205e0f4" id="r_a4c6eefd1254eab3e8d34bf02c205e0f4"><td class="memItemLeft" align="right" valign="top">int64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4c6eefd1254eab3e8d34bf02c205e0f4">binExpo</a> (int64_t a, int64_t b, int64_t m)</td></tr>
<tr class="separator:a4c6eefd1254eab3e8d34bf02c205e0f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a09660096b134753128952246f4f4e4bd" id="r_a09660096b134753128952246f4f4e4bd"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a09660096b134753128952246f4f4e4bd">isPrime</a> (int64_t m)</td></tr>
<tr class="separator:a09660096b134753128952246f4f4e4bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c62a87e79f29b98d8fe5b12eacdd928" id="r_a1c62a87e79f29b98d8fe5b12eacdd928"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1c62a87e79f29b98d8fe5b12eacdd928">math::modular_inverse_fermat::binExpo</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a> a, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a> b, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a> m)</td></tr>
<tr class="memdesc:a1c62a87e79f29b98d8fe5b12eacdd928"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate exponent with modulo using binary exponentiation in \(O(\log b)\) time. <br /></td></tr>
<tr class="separator:a1c62a87e79f29b98d8fe5b12eacdd928"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba4929409fee35c3cb559e962a544b3e" id="r_aba4929409fee35c3cb559e962a544b3e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aba4929409fee35c3cb559e962a544b3e">math::modular_inverse_fermat::isPrime</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a> m)</td></tr>
<tr class="memdesc:aba4929409fee35c3cb559e962a544b3e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if an integer is a prime number in \(O(\sqrt{m})\) time. <br /></td></tr>
<tr class="separator:aba4929409fee35c3cb559e962a544b3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae7e807e02c65c6fffd6162b4c66290c2" id="r_ae7e807e02c65c6fffd6162b4c66290c2"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae7e807e02c65c6fffd6162b4c66290c2">math::modular_inverse_fermat::modular_inverse</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a> a, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a> m)</td></tr>
<tr class="memdesc:ae7e807e02c65c6fffd6162b4c66290c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">calculates the modular inverse. <br /></td></tr>
<tr class="separator:ae7e807e02c65c6fffd6162b4c66290c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8dca7b867074164d5f45b0f3851269d" id="r_aa8dca7b867074164d5f45b0f3851269d"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa8dca7b867074164d5f45b0f3851269d">test</a> ()</td></tr>
<tr class="memdesc:aa8dca7b867074164d5f45b0f3851269d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Self-test implementation. <br /></td></tr>
<tr class="separator:aa8dca7b867074164d5f45b0f3851269d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4" id="r_ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function. <br /></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
@@ -153,7 +173,7 @@ Functions</h2></td></tr>
a^{m-2} &amp;&amp; a^{-1} \;\text{mod}\; m
\end{eqnarray*}
</p>
<p>We will find the exponent using binary exponentiation. Such that the algorithm works in \(O(\log m)\) time.</p>
<p>We will find the exponent using binary exponentiation such that the algorithm works in \(O(\log n)\) time.</p>
<p>Examples: -</p><ul>
<li>a = 3 and m = 7</li>
<li>\(a^{-1} \;\text{mod}\; m\) is equivalent to \(a^{m-2} \;\text{mod}\; m\)</li>
@@ -161,74 +181,104 @@ Functions</h2></td></tr>
Hence, \(3^{-1} \;\text{mod}\; 7 = 5\) or \(3 \times 5 \;\text{mod}\; 7 = 1 \;\text{mod}\; 7\) (as \(a\times a^{-1} = 1\)) </li>
</ul>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a4c6eefd1254eab3e8d34bf02c205e0f4" name="a4c6eefd1254eab3e8d34bf02c205e0f4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4c6eefd1254eab3e8d34bf02c205e0f4">&#9670;&#160;</a></span>binExpo()</h2>
<a id="a1c62a87e79f29b98d8fe5b12eacdd928" name="a1c62a87e79f29b98d8fe5b12eacdd928"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1c62a87e79f29b98d8fe5b12eacdd928">&#9670;&#160;</a></span>binExpo()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int64_t binExpo </td>
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a> math::modular_inverse_fermat::binExpo </td>
<td>(</td>
<td class="paramtype">int64_t</td> <td class="paramname"><span class="paramname"><em>a</em></span>, </td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a></td> <td class="paramname"><span class="paramname"><em>a</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int64_t</td> <td class="paramname"><span class="paramname"><em>b</em></span>, </td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a></td> <td class="paramname"><span class="paramname"><em>b</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int64_t</td> <td class="paramname"><span class="paramname"><em>m</em></span>&#160;)</td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a></td> <td class="paramname"><span class="paramname"><em>m</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Recursive function to calculate exponent in \(O(\log n)\) using binary exponent. </p>
<div class="fragment"><div class="line"><span class="lineno"> 52</span> {</div>
<div class="line"><span class="lineno"> 53</span> a %= m;</div>
<div class="line"><span class="lineno"> 54</span> int64_t res = 1;</div>
<div class="line"><span class="lineno"> 55</span> <span class="keywordflow">while</span> (b &gt; 0) {</div>
<div class="line"><span class="lineno"> 56</span> <span class="keywordflow">if</span> (b % 2) {</div>
<div class="line"><span class="lineno"> 57</span> res = res * a % m;</div>
<div class="line"><span class="lineno"> 58</span> }</div>
<div class="line"><span class="lineno"> 59</span> a = a * a % m;</div>
<div class="line"><span class="lineno"> 60</span> <span class="comment">// Dividing b by 2 is similar to right shift.</span></div>
<div class="line"><span class="lineno"> 61</span> b &gt;&gt;= 1;</div>
<div class="line"><span class="lineno"> 62</span> }</div>
<div class="line"><span class="lineno"> 63</span> <span class="keywordflow">return</span> res;</div>
<div class="line"><span class="lineno"> 64</span>}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a09660096b134753128952246f4f4e4bd" name="a09660096b134753128952246f4f4e4bd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a09660096b134753128952246f4f4e4bd">&#9670;&#160;</a></span>isPrime()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool isPrime </td>
<td>(</td>
<td class="paramtype">int64_t</td> <td class="paramname"><span class="paramname"><em>m</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Prime check in \(O(\sqrt{m})\) time. </p>
<div class="fragment"><div class="line"><span class="lineno"> 68</span> {</div>
<div class="line"><span class="lineno"> 69</span> <span class="keywordflow">if</span> (m &lt;= 1) {</div>
<div class="line"><span class="lineno"> 70</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><span class="lineno"> 71</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 72</span> <span class="keywordflow">for</span> (int64_t i = 2; i * i &lt;= m; i++) {</div>
<div class="line"><span class="lineno"> 73</span> <span class="keywordflow">if</span> (m % i == 0) {</div>
<div class="line"><span class="lineno"> 74</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><span class="lineno"> 75</span> }</div>
<div class="line"><span class="lineno"> 76</span> }</div>
<div class="line"><span class="lineno"> 77</span> }</div>
<div class="line"><span class="lineno"> 78</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<p>Calculate exponent with modulo using binary exponentiation in \(O(\log b)\) time. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">a</td><td>The base </td></tr>
<tr><td class="paramname">b</td><td>The exponent </td></tr>
<tr><td class="paramname">m</td><td>The modulo </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The result of \(a^{b} % m\) </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 67</span> {</div>
<div class="line"><span class="lineno"> 68</span> a %= m;</div>
<div class="line"><span class="lineno"> 69</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a> res = 1;</div>
<div class="line"><span class="lineno"> 70</span> <span class="keywordflow">while</span> (b &gt; 0) {</div>
<div class="line"><span class="lineno"> 71</span> <span class="keywordflow">if</span> (b % 2 != 0) {</div>
<div class="line"><span class="lineno"> 72</span> res = res * a % m;</div>
<div class="line"><span class="lineno"> 73</span> }</div>
<div class="line"><span class="lineno"> 74</span> a = a * a % m;</div>
<div class="line"><span class="lineno"> 75</span> <span class="comment">// Dividing b by 2 is similar to right shift by 1 bit</span></div>
<div class="line"><span class="lineno"> 76</span> b &gt;&gt;= 1;</div>
<div class="line"><span class="lineno"> 77</span> }</div>
<div class="line"><span class="lineno"> 78</span> <span class="keywordflow">return</span> res;</div>
<div class="line"><span class="lineno"> 79</span>}</div>
</div><!-- fragment -->
<div class="ttc" id="ainteger_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a></div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph.svg" width="280" height="68"><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="aba4929409fee35c3cb559e962a544b3e" name="aba4929409fee35c3cb559e962a544b3e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aba4929409fee35c3cb559e962a544b3e">&#9670;&#160;</a></span>isPrime()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool math::modular_inverse_fermat::isPrime </td>
<td>(</td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a></td> <td class="paramname"><span class="paramname"><em>m</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Check if an integer is a prime number in \(O(\sqrt{m})\) time. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">m</td><td>An intger to check for primality </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the number is prime </dd>
<dd>
false if the number is not prime </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 86</span> {</div>
<div class="line"><span class="lineno"> 87</span> <span class="keywordflow">if</span> (m &lt;= 1) {</div>
<div class="line"><span class="lineno"> 88</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><span class="lineno"> 89</span> } </div>
<div class="line"><span class="lineno"> 90</span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a> i = 2; i * i &lt;= m; i++) {</div>
<div class="line"><span class="lineno"> 91</span> <span class="keywordflow">if</span> (m % i == 0) {</div>
<div class="line"><span class="lineno"> 92</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><span class="lineno"> 93</span> }</div>
<div class="line"><span class="lineno"> 94</span> }</div>
<div class="line"><span class="lineno"> 95</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><span class="lineno"> 96</span>}</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="../../d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph.svg" width="164" height="76"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</div>
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
@@ -245,33 +295,108 @@ Hence, \(3^{-1} \;\text{mod}\; 7 = 5\) or \(3 \times 5 \;\text{mod}\; 7 = 1 \;\
</tr>
</table>
</div><div class="memdoc">
<p>Main function </p>
<div class="fragment"><div class="line"><span class="lineno"> 84</span> {</div>
<div class="line"><span class="lineno"> 85</span> int64_t a, m;</div>
<div class="line"><span class="lineno"> 86</span> <span class="comment">// Take input of a and m.</span></div>
<div class="line"><span class="lineno"> 87</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;Computing ((a^(-1))%(m)) using Fermat&#39;s Little Theorem&quot;</span>;</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; <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"> 89</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;Give input &#39;a&#39; and &#39;m&#39; space separated : &quot;</span>;</div>
<div class="line"><span class="lineno"> 90</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; a &gt;&gt; m;</div>
<div class="line"><span class="lineno"> 91</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#a09660096b134753128952246f4f4e4bd">isPrime</a>(m)) {</div>
<div class="line"><span class="lineno"> 92</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;The modular inverse of a with mod m is (a^(m-2)) : &quot;</span>;</div>
<div class="line"><span class="lineno"> 93</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="#a4c6eefd1254eab3e8d34bf02c205e0f4">binExpo</a>(a, m - 2, m) &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"> 94</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 95</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;m must be a prime number.&quot;</span>;</div>
<div class="line"><span class="lineno"> 96</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/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 97</span> }</div>
<div class="line"><span class="lineno"> 98</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="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="amodular__inverse__fermat__little__theorem_8cpp_html_a09660096b134753128952246f4f4e4bd"><div class="ttname"><a href="#a09660096b134753128952246f4f4e4bd">isPrime</a></div><div class="ttdeci">bool isPrime(int64_t m)</div><div class="ttdef"><b>Definition</b> modular_inverse_fermat_little_theorem.cpp:68</div></div>
<div class="ttc" id="amodular__inverse__fermat__little__theorem_8cpp_html_a4c6eefd1254eab3e8d34bf02c205e0f4"><div class="ttname"><a href="#a4c6eefd1254eab3e8d34bf02c205e0f4">binExpo</a></div><div class="ttdeci">int64_t binExpo(int64_t a, int64_t b, int64_t m)</div><div class="ttdef"><b>Definition</b> modular_inverse_fermat_little_theorem.cpp:52</div></div>
<p>Main function. </p>
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 137</span> {</div>
<div class="line"><span class="lineno"> 138</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementation</span></div>
<div class="line"><span class="lineno"> 139</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 140</span>}</div>
<div class="ttc" id="amodular__inverse__fermat__little__theorem_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementation.</div><div class="ttdef"><b>Definition</b> modular_inverse_fermat_little_theorem.cpp:122</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="../../d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="180" height="135"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="152" 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="ae7e807e02c65c6fffd6162b4c66290c2" name="ae7e807e02c65c6fffd6162b4c66290c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae7e807e02c65c6fffd6162b4c66290c2">&#9670;&#160;</a></span>modular_inverse()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a> math::modular_inverse_fermat::modular_inverse </td>
<td>(</td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a></td> <td class="paramname"><span class="paramname"><em>a</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::int64_t</a></td> <td class="paramname"><span class="paramname"><em>m</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>calculates the modular inverse. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">a</td><td>Integer value for the base </td></tr>
<tr><td class="paramname">m</td><td>Integer value for modulo </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The result that is the modular inverse of a modulo m </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 103</span> {</div>
<div class="line"><span class="lineno"> 104</span> <span class="keywordflow">while</span> (a &lt; 0) {</div>
<div class="line"><span class="lineno"> 105</span> a += m;</div>
<div class="line"><span class="lineno"> 106</span> }</div>
<div class="line"><span class="lineno"> 107</span> </div>
<div class="line"><span class="lineno"> 108</span> <span class="comment">// Check for invalid cases</span></div>
<div class="line"><span class="lineno"> 109</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="#aba4929409fee35c3cb559e962a544b3e">isPrime</a>(m) || a == 0) {</div>
<div class="line"><span class="lineno"> 110</span> <span class="keywordflow">return</span> -1; <span class="comment">// Invalid input</span></div>
<div class="line"><span class="lineno"> 111</span> }</div>
<div class="line"><span class="lineno"> 112</span> </div>
<div class="line"><span class="lineno"> 113</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dcf/binary__exponent_8cpp.html#aeb48dce0725e63d19147944f41843c73">binExpo</a>(a, m - 2, m); <span class="comment">// Fermat&#39;s Little Theorem</span></div>
<div class="line"><span class="lineno"> 114</span>}</div>
<div class="ttc" id="abinary__exponent_8cpp_html_aeb48dce0725e63d19147944f41843c73"><div class="ttname"><a href="../../de/dcf/binary__exponent_8cpp.html#aeb48dce0725e63d19147944f41843c73">binExpo</a></div><div class="ttdeci">int binExpo(int a, int b)</div><div class="ttdef"><b>Definition</b> binary_exponent.cpp:28</div></div>
<div class="ttc" id="amodular__inverse__fermat__little__theorem_8cpp_html_aba4929409fee35c3cb559e962a544b3e"><div class="ttname"><a href="#aba4929409fee35c3cb559e962a544b3e">math::modular_inverse_fermat::isPrime</a></div><div class="ttdeci">bool isPrime(std::int64_t m)</div><div class="ttdoc">Check if an integer is a prime number in time.</div><div class="ttdef"><b>Definition</b> modular_inverse_fermat_little_theorem.cpp:86</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="../../d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph.svg" width="380" height="150"><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="aa8dca7b867074164d5f45b0f3851269d" name="aa8dca7b867074164d5f45b0f3851269d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8dca7b867074164d5f45b0f3851269d">&#9670;&#160;</a></span>test()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void test </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Self-test implementation. </p>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 122</span> {</div>
<div class="line"><span class="lineno"> 123</span> assert(math::modular_inverse_fermat::modular_inverse(0, 97) == -1);</div>
<div class="line"><span class="lineno"> 124</span> assert(math::modular_inverse_fermat::modular_inverse(15, -2) == -1);</div>
<div class="line"><span class="lineno"> 125</span> assert(math::modular_inverse_fermat::modular_inverse(3, 10) == -1);</div>
<div class="line"><span class="lineno"> 126</span> assert(math::modular_inverse_fermat::modular_inverse(3, 7) == 5);</div>
<div class="line"><span class="lineno"> 127</span> assert(math::modular_inverse_fermat::modular_inverse(1, 101) == 1);</div>
<div class="line"><span class="lineno"> 128</span> assert(math::modular_inverse_fermat::modular_inverse(-1337, 285179) == 165519);</div>
<div class="line"><span class="lineno"> 129</span> assert(math::modular_inverse_fermat::modular_inverse(123456789, 998244353) == 25170271);</div>
<div class="line"><span class="lineno"> 130</span> assert(math::modular_inverse_fermat::modular_inverse(-9876543210, 1000000007) == 784794281);</div>
<div class="line"><span class="lineno"> 131</span>}</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->

View File

@@ -1,6 +1,8 @@
var modular__inverse__fermat__little__theorem_8cpp =
[
[ "binExpo", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#a4c6eefd1254eab3e8d34bf02c205e0f4", null ],
[ "isPrime", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#a09660096b134753128952246f4f4e4bd", null ],
[ "main", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ]
[ "binExpo", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#a1c62a87e79f29b98d8fe5b12eacdd928", null ],
[ "isPrime", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#aba4929409fee35c3cb559e962a544b3e", null ],
[ "main", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "modular_inverse", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#ae7e807e02c65c6fffd6162b4c66290c2", null ],
[ "test", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
];

View File

@@ -0,0 +1,6 @@
<map id="math::modular_inverse_fermat::binExpo" name="math::modular_inverse_fermat::binExpo">
<area shape="rect" id="Node000001" title="Calculate exponent with modulo using binary exponentiation in &#160;time." alt="" coords="5,22,159,62"/>
<area shape="rect" id="Node000002" href="$de/dcf/binary__exponent_8cpp.html#aeb48dce0725e63d19147944f41843c73" title=" " alt="" coords="207,29,275,55"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="159,40,191,40,191,45,159,45"/>
<area shape="poly" id="edge2_Node000002_Node000002" title=" " alt="" coords="214,30,208,21,212,11,223,5,241,3,260,5,270,12,268,16,258,10,241,8,224,10,216,15,214,20,218,28"/>
</map>

View File

@@ -0,0 +1 @@
ffd05ce4440be176113734b51fcbbe0c

View File

@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: math::modular_inverse_fermat::binExpo Pages: 1 -->
<svg width="210pt" height="51pt"
viewBox="0.00 0.00 210.25 50.88" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 46.88)">
<title>math::modular_inverse_fermat::binExpo</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Calculate exponent with modulo using binary exponentiation in &#160;time.">
<polygon fill="#999999" stroke="#666666" points="115,-30.5 0,-30.5 0,0 115,0 115,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">math::modular_inverse</text>
<text text-anchor="middle" x="57.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_fermat::binExpo</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../de/dcf/binary__exponent_8cpp.html#aeb48dce0725e63d19147944f41843c73" target="_top" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="202.25,-24.88 151,-24.88 151,-5.63 202.25,-5.63 202.25,-24.88"/>
<text text-anchor="middle" x="176.62" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">binExpo</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M115.35,-15.25C123.46,-15.25 131.61,-15.25 139.18,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="139.01,-18.75 149.01,-15.25 139.01,-11.75 139.01,-18.75"/>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node2 -->
<g id="edge2_Node000002_Node000002" class="edge">
<title>Node2&#45;&gt;Node2</title>
<g id="a_edge2_Node000002_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M157.98,-25.16C149.47,-33.77 155.69,-42.88 176.62,-42.88 188.08,-42.88 195.12,-40.15 197.77,-36.28"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="201.21,-35.63 195.61,-26.64 194.38,-37.16 201.21,-35.63"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: math::modular_inverse_fermat::binExpo Pages: 1 -->
<svg width="210pt" height="51pt"
viewBox="0.00 0.00 210.25 50.88" 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 46.88)">
<title>math::modular_inverse_fermat::binExpo</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Calculate exponent with modulo using binary exponentiation in &#160;time.">
<polygon fill="#999999" stroke="#666666" points="115,-30.5 0,-30.5 0,0 115,0 115,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">math::modular_inverse</text>
<text text-anchor="middle" x="57.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_fermat::binExpo</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../de/dcf/binary__exponent_8cpp.html#aeb48dce0725e63d19147944f41843c73" target="_top" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="202.25,-24.88 151,-24.88 151,-5.63 202.25,-5.63 202.25,-24.88"/>
<text text-anchor="middle" x="176.62" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">binExpo</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M115.35,-15.25C123.46,-15.25 131.61,-15.25 139.18,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="139.01,-18.75 149.01,-15.25 139.01,-11.75 139.01,-18.75"/>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node2 -->
<g id="edge2_Node000002_Node000002" class="edge">
<title>Node2&#45;&gt;Node2</title>
<g id="a_edge2_Node000002_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M157.98,-25.16C149.47,-33.77 155.69,-42.88 176.62,-42.88 188.08,-42.88 195.12,-40.15 197.77,-36.28"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="201.21,-35.63 195.61,-26.64 194.38,-37.16 201.21,-35.63"/>
</a>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -0,0 +1,4 @@
<map id="math::modular_inverse_fermat::isPrime" name="math::modular_inverse_fermat::isPrime">
<area shape="rect" id="Node000001" title="Check if an integer is a prime number in &#160;time." alt="" coords="5,29,159,70"/>
<area shape="poly" id="edge1_Node000001_Node000001" title=" " alt="" coords="52,29,51,19,56,11,66,5,82,3,99,5,109,11,106,16,97,10,82,8,68,10,59,14,56,20,57,28"/>
</map>

View File

@@ -0,0 +1 @@
6bc11f0296ee2fc351d4f5cb6f0ca359

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: math::modular_inverse_fermat::isPrime Pages: 1 -->
<svg width="123pt" height="57pt"
viewBox="0.00 0.00 123.00 56.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 52.5)">
<title>math::modular_inverse_fermat::isPrime</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Check if an integer is a prime number in &#160;time.">
<polygon fill="#999999" stroke="#666666" points="115,-30.5 0,-30.5 0,0 115,0 115,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">math::modular_inverse</text>
<text text-anchor="middle" x="57.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_fermat::isPrime</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.12,-30.99C32.96,-40.06 39.76,-48.5 57.5,-48.5 67.2,-48.5 73.63,-45.97 76.79,-42.2"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="80.25,-42.78 77.73,-32.49 73.28,-42.11 80.25,-42.78"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: math::modular_inverse_fermat::isPrime Pages: 1 -->
<svg width="123pt" height="57pt"
viewBox="0.00 0.00 123.00 56.50" 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 52.5)">
<title>math::modular_inverse_fermat::isPrime</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Check if an integer is a prime number in &#160;time.">
<polygon fill="#999999" stroke="#666666" points="115,-30.5 0,-30.5 0,0 115,0 115,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">math::modular_inverse</text>
<text text-anchor="middle" x="57.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_fermat::isPrime</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.12,-30.99C32.96,-40.06 39.76,-48.5 57.5,-48.5 67.2,-48.5 73.63,-45.97 76.79,-42.2"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="80.25,-42.78 77.73,-32.49 73.28,-42.11 80.25,-42.78"/>
</a>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,9 +1,5 @@
<map id="main" name="main">
<area shape="rect" id="Node000001" title=" " alt="" coords="5,55,55,80"/>
<area shape="rect" id="Node000002" href="$d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#a4c6eefd1254eab3e8d34bf02c205e0f4" title=" " alt="" coords="104,5,172,31"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="54,54,93,36,95,41,56,59"/>
<area shape="rect" id="Node000003" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="103,55,174,80"/>
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="55,65,87,65,87,70,55,70"/>
<area shape="rect" id="Node000004" href="$d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#a09660096b134753128952246f4f4e4bd" title=" " alt="" coords="106,104,171,130"/>
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="56,76,95,94,93,99,54,81"/>
<area shape="rect" id="Node000001" title="Main function." alt="" coords="5,5,55,31"/>
<area shape="rect" id="Node000002" href="$d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title="Self&#45;test implementation." alt="" coords="103,5,146,31"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="55,16,87,16,87,21,55,21"/>
</map>

View File

@@ -1 +1 @@
56ec41e0c570e465d9b60d882058e4d7
7c26bf167d094d5e36710e1d61d5adb7

View File

@@ -4,8 +4,8 @@
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: main Pages: 1 -->
<svg width="135pt" height="101pt"
viewBox="0.00 0.00 134.50 101.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg width="114pt" height="27pt"
viewBox="0.00 0.00 113.50 27.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
@@ -17,23 +17,23 @@
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 97.25)">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 23.25)">
<title>main</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title=" ">
<polygon fill="#999999" stroke="#666666" points="37,-56.25 0,-56.25 0,-37 37,-37 37,-56.25"/>
<text text-anchor="middle" x="18.5" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
<g id="a_Node000001"><a xlink:title="Main function.">
<polygon fill="#999999" stroke="#666666" points="37,-19.25 0,-19.25 0,0 37,0 37,-19.25"/>
<text text-anchor="middle" x="18.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#a4c6eefd1254eab3e8d34bf02c205e0f4" target="_top" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="125.38,-93.25 74.12,-93.25 74.12,-74 125.38,-74 125.38,-93.25"/>
<text text-anchor="middle" x="99.75" y="-79.75" font-family="Helvetica,sans-Serif" font-size="10.00">binExpo</text>
<g id="a_Node000002"><a xlink:href="../../d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" target="_top" xlink:title="Self&#45;test implementation.">
<polygon fill="white" stroke="#666666" points="105.5,-19.25 73,-19.25 73,0 105.5,0 105.5,-19.25"/>
<text text-anchor="middle" x="89.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
</a>
</g>
</g>
@@ -41,44 +41,8 @@
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.48,-55.02C46.14,-59.06 56.77,-64.03 66.74,-68.68"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="65.26,-71.85 75.8,-72.91 68.22,-65.51 65.26,-71.85"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="126.5,-56.25 73,-56.25 73,-37 126.5,-37 126.5,-56.25"/>
<text text-anchor="middle" x="99.75" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.48,-46.62C44.56,-46.62 52.97,-46.62 61.25,-46.62"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.21,-50.13 71.21,-46.63 61.21,-43.13 61.21,-50.13"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a xlink:href="../../d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#a09660096b134753128952246f4f4e4bd" target="_top" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="124.25,-19.25 75.25,-19.25 75.25,0 124.25,0 124.25,-19.25"/>
<text text-anchor="middle" x="99.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">isPrime</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node4 -->
<g id="edge3_Node000001_Node000004" class="edge">
<title>Node1&#45;&gt;Node4</title>
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.48,-38.23C46.14,-34.19 56.77,-29.22 66.74,-24.57"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="68.22,-27.74 75.8,-20.34 65.26,-21.4 68.22,-27.74"/>
<path fill="none" stroke="#63b8ff" d="M37.2,-9.62C44.58,-9.62 53.31,-9.62 61.45,-9.62"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.2,-13.13 71.2,-9.63 61.2,-6.13 61.2,-13.13"/>
</a>
</g>
</g>

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -4,25 +4,25 @@
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: main Pages: 1 -->
<svg width="135pt" height="101pt"
viewBox="0.00 0.00 134.50 101.25" 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 97.25)">
<svg width="114pt" height="27pt"
viewBox="0.00 0.00 113.50 27.25" 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 23.25)">
<title>main</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title=" ">
<polygon fill="#999999" stroke="#666666" points="37,-56.25 0,-56.25 0,-37 37,-37 37,-56.25"/>
<text text-anchor="middle" x="18.5" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
<g id="a_Node000001"><a xlink:title="Main function.">
<polygon fill="#999999" stroke="#666666" points="37,-19.25 0,-19.25 0,0 37,0 37,-19.25"/>
<text text-anchor="middle" x="18.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#a4c6eefd1254eab3e8d34bf02c205e0f4" target="_top" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="125.38,-93.25 74.12,-93.25 74.12,-74 125.38,-74 125.38,-93.25"/>
<text text-anchor="middle" x="99.75" y="-79.75" font-family="Helvetica,sans-Serif" font-size="10.00">binExpo</text>
<g id="a_Node000002"><a xlink:href="../../d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" target="_top" xlink:title="Self&#45;test implementation.">
<polygon fill="white" stroke="#666666" points="105.5,-19.25 73,-19.25 73,0 105.5,0 105.5,-19.25"/>
<text text-anchor="middle" x="89.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
</a>
</g>
</g>
@@ -30,44 +30,8 @@
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.48,-55.02C46.14,-59.06 56.77,-64.03 66.74,-68.68"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="65.26,-71.85 75.8,-72.91 68.22,-65.51 65.26,-71.85"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="126.5,-56.25 73,-56.25 73,-37 126.5,-37 126.5,-56.25"/>
<text text-anchor="middle" x="99.75" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.48,-46.62C44.56,-46.62 52.97,-46.62 61.25,-46.62"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.21,-50.13 71.21,-46.63 61.21,-43.13 61.21,-50.13"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a xlink:href="../../d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#a09660096b134753128952246f4f4e4bd" target="_top" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="124.25,-19.25 75.25,-19.25 75.25,0 124.25,0 124.25,-19.25"/>
<text text-anchor="middle" x="99.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">isPrime</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node4 -->
<g id="edge3_Node000001_Node000004" class="edge">
<title>Node1&#45;&gt;Node4</title>
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.48,-38.23C46.14,-34.19 56.77,-29.22 66.74,-24.57"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="68.22,-27.74 75.8,-20.34 65.26,-21.4 68.22,-27.74"/>
<path fill="none" stroke="#63b8ff" d="M37.2,-9.62C44.58,-9.62 53.31,-9.62 61.45,-9.62"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.2,-13.13 71.2,-9.63 61.2,-6.13 61.2,-13.13"/>
</a>
</g>
</g>

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,10 @@
<map id="math::modular_inverse_fermat::modular_inverse" name="math::modular_inverse_fermat::modular_inverse">
<area shape="rect" id="Node000001" title="calculates the modular inverse." alt="" coords="5,63,174,104"/>
<area shape="poly" id="edge5_Node000001_Node000001" title=" " alt="" coords="50,63,48,53,54,44,68,39,90,37,112,39,126,45,123,50,111,44,89,42,70,44,58,48,53,54,55,62"/>
<area shape="rect" id="Node000002" href="$de/dcf/binary__exponent_8cpp.html#aeb48dce0725e63d19147944f41843c73" title=" " alt="" coords="264,29,332,55"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="174,64,249,49,250,54,175,69"/>
<area shape="rect" id="Node000003" href="$d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#aba4929409fee35c3cb559e962a544b3e" title="Check if an integer is a prime number in &#160;time." alt="" coords="222,103,375,144"/>
<area shape="poly" id="edge3_Node000001_Node000003" title=" " alt="" coords="175,97,207,103,206,109,174,102"/>
<area shape="poly" id="edge2_Node000002_Node000002" title=" " alt="" coords="263,31,257,21,261,11,275,5,298,3,324,5,337,12,335,17,322,10,298,8,276,10,264,15,262,20,268,27"/>
<area shape="poly" id="edge4_Node000003_Node000003" title=" " alt="" coords="259,103,257,93,263,84,277,79,298,77,321,79,334,85,332,90,320,84,298,82,279,84,267,88,262,94,264,102"/>
</map>

View File

@@ -0,0 +1 @@
cebe99d531236e9949a4458c0aa57b4e

View File

@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: math::modular_inverse_fermat::modular_inverse Pages: 1 -->
<svg width="285pt" height="112pt"
viewBox="0.00 0.00 285.25 111.88" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 107.88)">
<title>math::modular_inverse_fermat::modular_inverse</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="calculates the modular inverse.">
<polygon fill="#999999" stroke="#666666" points="126.25,-60.5 0,-60.5 0,-30 126.25,-30 126.25,-60.5"/>
<text text-anchor="start" x="8" y="-47" font-family="Helvetica,sans-Serif" font-size="10.00">math::modular_inverse</text>
<text text-anchor="middle" x="63.12" y="-35.75" font-family="Helvetica,sans-Serif" font-size="10.00">_fermat::modular_inverse</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge5_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge5_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M35.37,-60.99C29.71,-70.06 38.96,-78.5 63.12,-78.5 76.34,-78.5 85.1,-75.97 89.39,-72.2"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="92.83,-72.86 90.68,-62.49 85.9,-71.94 92.83,-72.86"/>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../de/dcf/binary__exponent_8cpp.html#aeb48dce0725e63d19147944f41843c73" target="_top" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="245.38,-85.88 194.12,-85.88 194.12,-66.62 245.38,-66.62 245.38,-85.88"/>
<text text-anchor="middle" x="219.75" y="-72.38" font-family="Helvetica,sans-Serif" font-size="10.00">binExpo</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M126.57,-57.77C145.78,-61.62 166.25,-65.72 183.02,-69.09"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="181.99,-72.45 192.48,-70.98 183.37,-65.59 181.99,-72.45"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:href="../../d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#aba4929409fee35c3cb559e962a544b3e" target="_top" xlink:title="Check if an integer is a prime number in &#160;time.">
<polygon fill="white" stroke="#666666" points="277.25,-30.5 162.25,-30.5 162.25,0 277.25,0 277.25,-30.5"/>
<text text-anchor="start" x="170.25" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">math::modular_inverse</text>
<text text-anchor="middle" x="219.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_fermat::isPrime</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge3_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge3_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M126.57,-33.13C134.55,-31.59 142.74,-30 150.8,-28.43"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="151.43,-31.88 160.58,-26.54 150.09,-25.01 151.43,-31.88"/>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node2 -->
<g id="edge2_Node000002_Node000002" class="edge">
<title>Node2&#45;&gt;Node2</title>
<g id="a_edge2_Node000002_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M195.23,-86.16C184.04,-94.77 192.22,-103.88 219.75,-103.88 235.24,-103.88 244.6,-100.99 247.83,-96.94"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="251.21,-96 244.75,-87.6 244.56,-98.19 251.21,-96"/>
</a>
</g>
</g>
<!-- Node3&#45;&gt;Node3 -->
<g id="edge4_Node000003_Node000003" class="edge">
<title>Node3&#45;&gt;Node3</title>
<g id="a_edge4_Node000003_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M192,-30.99C186.33,-40.06 195.58,-48.5 219.75,-48.5 232.97,-48.5 241.72,-45.97 246.02,-42.2"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="249.46,-42.86 247.3,-32.49 242.52,-41.94 249.46,-42.86"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: math::modular_inverse_fermat::modular_inverse Pages: 1 -->
<svg width="285pt" height="112pt"
viewBox="0.00 0.00 285.25 111.88" 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 107.88)">
<title>math::modular_inverse_fermat::modular_inverse</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="calculates the modular inverse.">
<polygon fill="#999999" stroke="#666666" points="126.25,-60.5 0,-60.5 0,-30 126.25,-30 126.25,-60.5"/>
<text text-anchor="start" x="8" y="-47" font-family="Helvetica,sans-Serif" font-size="10.00">math::modular_inverse</text>
<text text-anchor="middle" x="63.12" y="-35.75" font-family="Helvetica,sans-Serif" font-size="10.00">_fermat::modular_inverse</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge5_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge5_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M35.37,-60.99C29.71,-70.06 38.96,-78.5 63.12,-78.5 76.34,-78.5 85.1,-75.97 89.39,-72.2"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="92.83,-72.86 90.68,-62.49 85.9,-71.94 92.83,-72.86"/>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../de/dcf/binary__exponent_8cpp.html#aeb48dce0725e63d19147944f41843c73" target="_top" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="245.38,-85.88 194.12,-85.88 194.12,-66.62 245.38,-66.62 245.38,-85.88"/>
<text text-anchor="middle" x="219.75" y="-72.38" font-family="Helvetica,sans-Serif" font-size="10.00">binExpo</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M126.57,-57.77C145.78,-61.62 166.25,-65.72 183.02,-69.09"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="181.99,-72.45 192.48,-70.98 183.37,-65.59 181.99,-72.45"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:href="../../d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#aba4929409fee35c3cb559e962a544b3e" target="_top" xlink:title="Check if an integer is a prime number in &#160;time.">
<polygon fill="white" stroke="#666666" points="277.25,-30.5 162.25,-30.5 162.25,0 277.25,0 277.25,-30.5"/>
<text text-anchor="start" x="170.25" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">math::modular_inverse</text>
<text text-anchor="middle" x="219.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_fermat::isPrime</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge3_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge3_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M126.57,-33.13C134.55,-31.59 142.74,-30 150.8,-28.43"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="151.43,-31.88 160.58,-26.54 150.09,-25.01 151.43,-31.88"/>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node2 -->
<g id="edge2_Node000002_Node000002" class="edge">
<title>Node2&#45;&gt;Node2</title>
<g id="a_edge2_Node000002_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M195.23,-86.16C184.04,-94.77 192.22,-103.88 219.75,-103.88 235.24,-103.88 244.6,-100.99 247.83,-96.94"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="251.21,-96 244.75,-87.6 244.56,-98.19 251.21,-96"/>
</a>
</g>
</g>
<!-- Node3&#45;&gt;Node3 -->
<g id="edge4_Node000003_Node000003" class="edge">
<title>Node3&#45;&gt;Node3</title>
<g id="a_edge4_Node000003_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M192,-30.99C186.33,-40.06 195.58,-48.5 219.75,-48.5 232.97,-48.5 241.72,-45.97 246.02,-42.2"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="249.46,-42.86 247.3,-32.49 242.52,-41.94 249.46,-42.86"/>
</a>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.2 KiB