Effective implementation of algorithms (Master Thesis)
Effective and error-free implementation of algorithms
|
#include <extended_gcd.h>
Static Public Member Functions | |
template<typename T > | |
static std::pair< T, T > | extended_gcd_positive (T a, T b) |
template<typename T > | |
static std::pair< T, T > | extended_gcd (T a, T b) |
Class computing extended GCD using recursion
static std::pair<T, T> math::gcd::ExtendedGCD::extended_gcd | ( | T | a, |
T | b | ||
) | [inline, static] |
Returns extended gcd, i.e. pair(x, y) such that x * a + y * b == gcd(a, b)
Note: that returned values can be negative
Note: for both zero arguments function will return (0,0)
a | |
b |
static std::pair<T, T> math::gcd::ExtendedGCD::extended_gcd_positive | ( | T | a, |
T | b | ||
) | [inline, static] |
Returns extended gcd, i.e. pair(x, y) such that x * a + y * b == gcd(a, b)
Note: that returned values can be negative
Note: for both zero arguments function will return (0,0)
a | non-negative integer |
b | non-negative integer |