mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-24 22:02:20 +08:00
Documentation for 0931d530ae
This commit is contained in:
@@ -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.5"/>
|
||||
<meta name="generator" content="Doxygen 1.9.6"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: math/extended_euclid_algorithm.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.5 -->
|
||||
<!-- Generated by Doxygen 1.9.6 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -126,12 +126,12 @@ Functions</h2></td></tr>
|
||||
<tr class="memitem:acba15ca55b3e7dcb91f3c65d72ba052d"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d9/d5d/extended__euclid__algorithm_8cpp.html#acba15ca55b3e7dcb91f3c65d72ba052d">extendedEuclid</a> (T A, T B, T *GCD, T2 *x, T2 *y)</td></tr>
|
||||
<tr class="separator:acba15ca55b3e7dcb91f3c65d72ba052d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d5d/extended__euclid__algorithm_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
|
||||
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft"> </td><td class="mdescRight">Main function. <a href="../../d9/d5d/extended__euclid__algorithm_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">More...</a><br /></td></tr>
|
||||
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft"> </td><td class="mdescRight">Main function. <br /></td></tr>
|
||||
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p >GCD using [extended Euclid's algorithm] (<a href="https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm">https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm</a>) </p>
|
||||
<p >Finding coefficients of a and b ie x and y in Bézout's identity </p><p class="formulaDsp">
|
||||
<div class="textblock"><p>GCD using [extended Euclid's algorithm] (<a href="https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm">https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm</a>) </p>
|
||||
<p>Finding coefficients of a and b ie x and y in Bézout's identity </p><p class="formulaDsp">
|
||||
\[\text{gcd}(a, b) = a \times x + b \times y \]
|
||||
</p>
|
||||
<p> This is also used in finding Modular multiplicative inverse of a number. (A * B)M == 1 Here B is the MMI of A for given M, so extendedEuclid (A, M) gives B. </p>
|
||||
@@ -181,7 +181,7 @@ template<typename T , typename T2 > </div>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Implementation using recursive algorithm</p>
|
||||
<p>Implementation using recursive algorithm</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramdir">[in]</td><td class="paramname">A</td><td>unsigned </td></tr>
|
||||
@@ -263,7 +263,7 @@ template<typename T1 , typename T2 > </div>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Implementation using iterative algorithm from <a href="https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm#Pseudocode" target="_blank">Wikipedia</a></p>
|
||||
<p>Implementation using iterative algorithm from <a href="https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm#Pseudocode" target="_blank">Wikipedia</a></p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramdir">[in]</td><td class="paramname">A</td><td>unsigned </td></tr>
|
||||
@@ -384,7 +384,7 @@ template<typename T , typename T2 > </div>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >function to update the coefficients per iteration </p><p class="formulaDsp">
|
||||
<p>function to update the coefficients per iteration </p><p class="formulaDsp">
|
||||
\[r_0,\,r = r,\, r_0 - \text{quotient}\times r\]
|
||||
</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
@@ -409,7 +409,7 @@ template<typename T , typename T2 > </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="../../d9/d5d/extended__euclid__algorithm_8cpp.html">extended_euclid_algorithm.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5 </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.6 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user