<divclass="center"><iframescrolling="no"frameborder="0"src="../../da/d3c/euclidean__algorithm__extended_8c__incl.svg"width="250"height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<trclass="memitem:aaa5f87fdd4cc35a6c77e255416de66ba"><tdclass="memItemLeft"align="right"valign="top">static void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="../../d5/df9/euclidean__algorithm__extended_8c.html#aaa5f87fdd4cc35a6c77e255416de66ba">single_test</a> (int a, int b, int gcd, int x, int y)</td></tr>
<trclass="memdesc:aaa5f87fdd4cc35a6c77e255416de66ba"><tdclass="mdescLeft"> </td><tdclass="mdescRight">perform one single check on the result of the algorithm with provided parameters and expected output <br/></td></tr>
<trclass="memdesc:aa8dca7b867074164d5f45b0f3851269d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Perform tests on known results. <br/></td></tr>
<trclass="memitem:a14f0d2347018c28ef17be3185b373d8f"><tdclass="memItemLeft"align="right"valign="top">static void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="../../d5/df9/euclidean__algorithm__extended_8c.html#a14f0d2347018c28ef17be3185b373d8f">xy_push</a> (int arr[2], int newval)</td></tr>
<trclass="memdesc:a14f0d2347018c28ef17be3185b373d8f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">gives queue-like behavior to an array of two ints, pushing an element onto the end and pushing one off the front <br/></td></tr>
<trclass="memitem:a2692f7190cf9d281ae23df491902d1c8"><tdclass="memItemLeft"align="right"valign="top">static void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="../../d5/df9/euclidean__algorithm__extended_8c.html#a2692f7190cf9d281ae23df491902d1c8">calculate_next_xy</a> (int quotient, int prev[2])</td></tr>
<trclass="memdesc:a2692f7190cf9d281ae23df491902d1c8"><tdclass="mdescLeft"> </td><tdclass="mdescRight">calculates the value of x or y and push those into the small 'queues' <br/></td></tr>
<trclass="memitem:a2e7f9cce2f756c6a016ae7e2592f9c5d"><tdclass="memItemLeft"align="right"valign="top"><aclass="el"href="../../d5/df9/euclidean__algorithm__extended_8c.html#a55267ed2a397f82118bb1140fa5336c0">euclidean_result_t</a> </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="../../d5/df9/euclidean__algorithm__extended_8c.html#a2e7f9cce2f756c6a016ae7e2592f9c5d">extended_euclidean_algorithm</a> (int a, int b)</td></tr>
<trclass="memdesc:a2e7f9cce2f756c6a016ae7e2592f9c5d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">performs the extended Euclidean algorithm on integer inputs a and b <br/></td></tr>
<divclass="textblock"><p>Program to perform the <ahref="https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm"target="_blank">extended Euclidean algorithm</a></p>
<p>The extended Euclidean algorithm, on top of finding the GCD (greatest common divisor) of two integers a and b, also finds the values x and y such that ax+by = gcd(a, b) </p>
<p>calculates the value of x or y and push those into the small 'queues' </p>
<p>Both x and y are found by taking their value from 2 iterations ago minus the product of their value from 1 iteration ago and the most recent quotient.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">quotient</td><td>the quotient from the latest iteration of the Euclidean algorithm </td></tr>
<tr><tdclass="paramname">prev</td><td>the 'queue' holding the values of the two previous iterations</td></tr>
<divclass="ttc"id="aeuclidean__algorithm__extended_8c_html_a14f0d2347018c28ef17be3185b373d8f"><divclass="ttname"><ahref="../../d5/df9/euclidean__algorithm__extended_8c.html#a14f0d2347018c28ef17be3185b373d8f">xy_push</a></div><divclass="ttdeci">static void xy_push(int arr[2], int newval)</div><divclass="ttdoc">gives queue-like behavior to an array of two ints, pushing an element onto the end and pushing one of...</div><divclass="ttdef"><b>Definition</b> euclidean_algorithm_extended.c:36</div></div>
<divclass="ttc"id="avector_8c_html_af2f92e8cc55e764980bc0573ab5cd06f"><divclass="ttname"><ahref="../../df/dfa/vector_8c.html#af2f92e8cc55e764980bc0573ab5cd06f">next</a></div><divclass="ttdeci">int next(Vector *vec)</div><divclass="ttdoc">This function gets the next item from the Vector each time it's called.</div><divclass="ttdef"><b>Definition</b> vector.c:102</div></div>
<divclass="center"><iframescrolling="no"frameborder="0"src="../../d5/df9/euclidean__algorithm__extended_8c_a2692f7190cf9d281ae23df491902d1c8_cgraph.svg"width="256"height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<divclass="ttc"id="aeuclidean__algorithm__extended_8c_html_a2692f7190cf9d281ae23df491902d1c8"><divclass="ttname"><ahref="../../d5/df9/euclidean__algorithm__extended_8c.html#a2692f7190cf9d281ae23df491902d1c8">calculate_next_xy</a></div><divclass="ttdeci">static void calculate_next_xy(int quotient, int prev[2])</div><divclass="ttdoc">calculates the value of x or y and push those into the small 'queues'</div><divclass="ttdef"><b>Definition</b> euclidean_algorithm_extended.c:54</div></div>
<divclass="ttc"id="astructeuclidean__result_html_ac6a0162c4014f399f847c83d312217a3"><divclass="ttname"><ahref="../../d8/d1e/structeuclidean__result.html#ac6a0162c4014f399f847c83d312217a3">euclidean_result::y</a></div><divclass="ttdeci">int y</div><divclass="ttdoc">the values x and y such that ax + by = gcd(a, b)</div><divclass="ttdef"><b>Definition</b> euclidean_algorithm_extended.c:24</div></div>
<divclass="ttc"id="astructeuclidean__result_html_af112efeacb49a666b59047336c968607"><divclass="ttname"><ahref="../../d8/d1e/structeuclidean__result.html#af112efeacb49a666b59047336c968607">euclidean_result::gcd</a></div><divclass="ttdeci">int gcd</div><divclass="ttdoc">the greatest common divisor calculated with the Euclidean algorithm</div><divclass="ttdef"><b>Definition</b> euclidean_algorithm_extended.c:22</div></div>
<divclass="center"><iframescrolling="no"frameborder="0"src="../../d5/df9/euclidean__algorithm__extended_8c_a2e7f9cce2f756c6a016ae7e2592f9c5d_cgraph.svg"width="440"height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<divclass="ttc"id="aeuclidean__algorithm__extended_8c_html_aa8dca7b867074164d5f45b0f3851269d"><divclass="ttname"><ahref="../../d5/df9/euclidean__algorithm__extended_8c.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><divclass="ttdeci">static void test()</div><divclass="ttdoc">Perform tests on known results.</div><divclass="ttdef"><b>Definition</b> euclidean_algorithm_extended.c:135</div></div>
<divclass="center"><divclass="zoom"><iframescrolling="no"frameborder="0"src="../../d5/df9/euclidean__algorithm__extended_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg"width="100%"height="364"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div></div>
<divclass="ttc"id="aeuclidean__algorithm__extended_8c_html_a2e7f9cce2f756c6a016ae7e2592f9c5d"><divclass="ttname"><ahref="../../d5/df9/euclidean__algorithm__extended_8c.html#a2e7f9cce2f756c6a016ae7e2592f9c5d">extended_euclidean_algorithm</a></div><divclass="ttdeci">euclidean_result_t extended_euclidean_algorithm(int a, int b)</div><divclass="ttdoc">performs the extended Euclidean algorithm on integer inputs a and b</div><divclass="ttdef"><b>Definition</b> euclidean_algorithm_extended.c:69</div></div>
<divclass="center"><iframescrolling="no"frameborder="0"src="../../d5/df9/euclidean__algorithm__extended_8c_aaa5f87fdd4cc35a6c77e255416de66ba_cgraph.svg"width="572"height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<divclass="ttc"id="aeuclidean__algorithm__extended_8c_html_aaa5f87fdd4cc35a6c77e255416de66ba"><divclass="ttname"><ahref="../../d5/df9/euclidean__algorithm__extended_8c.html#aaa5f87fdd4cc35a6c77e255416de66ba">single_test</a></div><divclass="ttdeci">static void single_test(int a, int b, int gcd, int x, int y)</div><divclass="ttdoc">perform one single check on the result of the algorithm with provided parameters and expected output</div><divclass="ttdef"><b>Definition</b> euclidean_algorithm_extended.c:121</div></div>
<divclass="center"><iframescrolling="no"frameborder="0"src="../../d5/df9/euclidean__algorithm__extended_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg"width="664"height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="../../doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.9.7 </li>