#include "config.hpp"
#include "type_traits.hpp"
#include "factory.hpp"
#include "cmp.hpp"
#include "vector.hpp"
#include "std_import.hpp"
#include "gcd.cpp"
Go to the source code of this file.
Namespaces | |
namespace | Arageli |
The Euclidean algorithm. | |
template<typename T, typename T_factory> | |
T | Arageli::euclid (T a, T b, const T_factory &tfctr) |
Processes the Euclidean algorithm on a and b. | |
template<typename T> | |
T | Arageli::euclid (const T &a, const T &b) |
Processes the Euclidean algorithm on a and b. | |
template<typename T, typename T_factory> | |
T | Arageli::euclid_binary (T a, T b, const T_factory &tfctr) |
Processes the Euclidean algorithm on a and b. | |
template<typename T> | |
T | Arageli::euclid_binary (const T &a, const T &b) |
Processes the Euclidean algorithm on a and b. | |
template<typename T, bool REFCNT, typename T_factory, typename T1, bool REFCNT1> | |
vector< T, REFCNT > | Arageli::euclid (const vector< T, REFCNT > &a, const vector< T1, REFCNT1 > &b, const T_factory &tfctr) |
Computes Euclidean algorithm for each corresponding pair of a and b. | |
template<typename T, bool REFCNT, typename T1, bool REFCNT1> | |
vector< T, REFCNT > | Arageli::euclid (const vector< T, REFCNT > &a, const vector< T1, REFCNT1 > &b) |
Computes Euclidean algorithm for each corresponding pair of a and b. | |
template<typename T, typename T_factory> | |
T | Arageli::euclid_bezout (const T &a, const T &b, T &u, T &v, const T_factory &tfctr) |
The greatest common divisor and Bezout's coefficients. | |
template<typename T> | |
T | Arageli::euclid_bezout (const T &a, const T &b, T &u, T &v) |
The greatest common divisor and Bezout's coefficients. | |
The GCD and LCM algorithms. | |
template<typename T, typename T_factory> | |
T | Arageli::gcd (const T &a, const T &b, const T_factory &tfctr, const type_category::type &) |
template<typename T, typename T_factory> | |
T | Arageli::gcd (const T &a, const T &b, const T_factory &tfctr, const type_category::integer &) |
template<typename T, typename T_factory> | |
T | Arageli::gcd (const T &a, const T &b, const T_factory &tfctr) |
Computes GCD for a and b. | |
template<typename T> | |
T | Arageli::gcd (const T &a, const T &b) |
Computes GCD for a and b. | |
template<typename T1, typename T2> | |
T1 | Arageli::gcd (const T1 &a, const T2 &b) |
Computes GCD for a and b. | |
template<typename T, bool REFCNT, typename T_factory> | |
T | Arageli::gcd (const vector< T, REFCNT > &x, const T_factory &tfctr) |
Computes GCD for all items of vector 'x'. | |
template<typename T, bool REFCNT> | |
T | Arageli::gcd (const vector< T, REFCNT > &x) |
Computes GCD for all items of vector 'x'. | |
template<typename T> | |
T | Arageli::gcd3 (const T &a, const T &b, const T &c) |
Compute GCD(a, b, c). | |
template<typename T> | |
T | Arageli::gcdex (const T &a, const T &b, T &u, T &v, T &w, T &z) |
Extended GCD; abs(u*z - w*v) == 1; a*w + b*z == 0. | |
template<typename T> | |
T | Arageli::gcdex (const T &a, const T &b, const T &N, T &u, T &v, T &w, T &z) |
template<typename T, bool REFCNT, typename T_factory, typename T1, bool REFCNT1> | |
vector< T, REFCNT > | Arageli::gcd_vec (const vector< T, REFCNT > &a, const vector< T1, REFCNT1 > &b, const T_factory &tfctr) |
Computes GCD for each corresponding pair of a and b. | |
template<typename T, bool REFCNT, typename T_factory, typename T1, bool REFCNT1> | |
vector< T, REFCNT > | Arageli::gcd (const vector< T, REFCNT > &a, const vector< T1, REFCNT1 > &b, const T_factory &tfctr) |
Computes GCD for each corresponding pair of a and b. | |
template<typename T, bool REFCNT, typename T_factory> | |
vector< T, REFCNT > | Arageli::gcd (const vector< T, REFCNT > &a, const vector< T, REFCNT > &b, const T_factory &tfctr) |
Computes GCD for each corresponding pair of a and b. | |
template<typename T, bool REFCNT, typename T1, bool REFCNT1> | |
vector< T, REFCNT > | Arageli::gcd (const vector< T, REFCNT > &a, const vector< T1, REFCNT1 > &b) |
Computes GCD for each corresponding pair of a and b. | |
template<typename T, bool REFCNT> | |
vector< T, REFCNT > | Arageli::gcd (const vector< T, REFCNT > &a, const vector< T, REFCNT > &b) |
Computes GCD for each corresponding pair of a and b. | |
template<typename T, typename T_factory> | |
T | Arageli::lcm (const T &a, const T &b, const T_factory &tfctr) |
Computes LCM for a and b. | |
template<typename T> | |
T | Arageli::lcm (const T &a, const T &b) |
Computes LCM for a and b. | |
template<typename T, bool REFCNT, typename T_factory> | |
T | Arageli::lcm (const vector< T, REFCNT > &x, const T_factory &tfctr) |
Computes LCM for all items of vector 'x'. | |
template<typename T, bool REFCNT> | |
T | Arageli::lcm (const vector< T, REFCNT > &x) |
Computes LCM for all items of vector 'x'. | |
template<typename T, bool REFCNT, typename T_factory, typename T1, bool REFCNT1> | |
vector< T, REFCNT > | Arageli::lcm_vec (const vector< T, REFCNT > &a, const vector< T1, REFCNT1 > &b, const T_factory &tfctr) |
Computes LCM for each corresponding pair of a and b. | |
template<typename T, bool REFCNT, typename T_factory, typename T1, bool REFCNT1> | |
vector< T, REFCNT > | Arageli::lcm (const vector< T, REFCNT > &a, const vector< T1, REFCNT1 > &b, const T_factory &tfctr) |
Computes LCM for each corresponding pair of a and b. | |
template<typename T, bool REFCNT, typename T_factory> | |
vector< T, REFCNT > | Arageli::lcm (const vector< T, REFCNT > &a, const vector< T, REFCNT > &b, const T_factory &tfctr) |
Computes LCM for each corresponding pair of a and b. | |
template<typename T, bool REFCNT, typename T1, bool REFCNT1> | |
vector< T, REFCNT > | Arageli::lcm (const vector< T, REFCNT > &a, const vector< T1, REFCNT1 > &b) |
Computes LCM for each corresponding pair of a and b. | |
template<typename T, bool REFCNT> | |
vector< T, REFCNT > | Arageli::lcm (const vector< T, REFCNT > &a, const vector< T, REFCNT > &b) |
A test for relative primality. | |
template<typename T, typename T_factory> | |
bool | Arageli::is_coprime (const T &a, const T &b, const T_factory &tfctr) |
Returns true if two objects are coprime. | |
template<typename T> | |
bool | Arageli::is_coprime (const T &a, const T &b) |
Returns true if two objects are coprime. | |
template<typename T, bool REFCNT, typename T_factory> | |
bool | Arageli::is_coprime (const vector< T, REFCNT > &x, const T_factory &tfctr) |
Returns true if all objects in the vector are coprime. | |
template<typename T, bool REFCNT> | |
bool | Arageli::is_coprime (const vector< T, REFCNT > &x) |
Returns true if all objects in the vector are coprime. | |
Defines | |
#define | ARAGELI_INCLUDE_CPP_WITH_EXPORT_TEMPLATE_GCD |