ntheory.h File Reference
+ Include dependency graph for ntheory.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 SymEngine
 Main namespace for SymEngine package.
 

Functions

int SymEngine::probab_prime_p (const Integer &a, unsigned reps=25)
 Probabilistic Prime.
 
RCP< const Integer > SymEngine::nextprime (const Integer &a)
 
RCP< const Integer > SymEngine::gcd (const Integer &a, const Integer &b)
 Greatest Common Divisor.
 
RCP< const Integer > SymEngine::lcm (const Integer &a, const Integer &b)
 Least Common Multiple.
 
void SymEngine::gcd_ext (const Ptr< RCP< const Integer >> &g, const Ptr< RCP< const Integer >> &s, const Ptr< RCP< const Integer >> &t, const Integer &a, const Integer &b)
 Extended GCD.
 
RCP< const Integer > SymEngine::mod (const Integer &n, const Integer &d)
 modulo round toward zero
 
RCP< const Integer > SymEngine::quotient (const Integer &n, const Integer &d)
 
void SymEngine::quotient_mod (const Ptr< RCP< const Integer >> &q, const Ptr< RCP< const Integer >> &r, const Integer &n, const Integer &d)
 
RCP< const Integer > SymEngine::mod_f (const Integer &n, const Integer &d)
 modulo round toward -inf
 
RCP< const Integer > SymEngine::quotient_f (const Integer &n, const Integer &d)
 
void SymEngine::quotient_mod_f (const Ptr< RCP< const Integer >> &q, const Ptr< RCP< const Integer >> &r, const Integer &n, const Integer &d)
 
int SymEngine::mod_inverse (const Ptr< RCP< const Integer >> &b, const Integer &a, const Integer &m)
 inverse modulo
 
bool SymEngine::crt (const Ptr< RCP< const Integer >> &R, const std::vector< RCP< const Integer >> &rem, const std::vector< RCP< const Integer >> &mod)
 Chinese remainder function. Return true when a solution exists.
 
RCP< const Integer > SymEngine::fibonacci (unsigned long n)
 Fibonacci number.
 
void SymEngine::fibonacci2 (const Ptr< RCP< const Integer >> &g, const Ptr< RCP< const Integer >> &s, unsigned long n)
 Fibonacci n and n-1.
 
RCP< const Integer > SymEngine::lucas (unsigned long n)
 Lucas number.
 
void SymEngine::lucas2 (const Ptr< RCP< const Integer >> &g, const Ptr< RCP< const Integer >> &s, unsigned long n)
 Lucas number n and n-1.
 
RCP< const Integer > SymEngine::binomial (const Integer &n, unsigned long k)
 Binomial Coefficient.
 
RCP< const Integer > SymEngine::factorial (unsigned long n)
 Factorial.
 
bool SymEngine::divides (const Integer &a, const Integer &b)
 
int SymEngine::factor (const Ptr< RCP< const Integer >> &f, const Integer &n, double B1)
 
int SymEngine::factor_trial_division (const Ptr< RCP< const Integer >> &f, const Integer &n)
 
int SymEngine::factor_lehman_method (const Ptr< RCP< const Integer >> &f, const Integer &n)
 Factor using lehman's methods.
 
int SymEngine::factor_pollard_pm1_method (const Ptr< RCP< const Integer >> &f, const Integer &n, unsigned B=10, unsigned retries=5)
 Factor using Pollard's p-1 method.
 
int SymEngine::factor_pollard_rho_method (const Ptr< RCP< const Integer >> &f, const Integer &n, unsigned retries=5)
 Factor using Pollard's rho methods.
 
void SymEngine::prime_factors (std::vector< RCP< const Integer >> &primes, const Integer &n)
 Find prime factors of n
 
void SymEngine::prime_factor_multiplicities (map_integer_uint &primes, const Integer &n)
 Find multiplicities of prime factors of n
 
RCP< const Number > SymEngine::bernoulli (unsigned long n)
 
RCP< const Number > SymEngine::harmonic (unsigned long n, long m=1)
 Computes the sum of the inverses of the first perfect mth powers.
 
bool SymEngine::primitive_root (const Ptr< RCP< const Integer >> &g, const Integer &n)
 Computes a primitive root. Returns false if no primitive root exists.
 
void SymEngine::primitive_root_list (std::vector< RCP< const Integer >> &roots, const Integer &n)
 
RCP< const Integer > SymEngine::totient (const RCP< const Integer > &n)
 Euler's totient function.
 
RCP< const Integer > SymEngine::carmichael (const RCP< const Integer > &n)
 Carmichael function.
 
bool SymEngine::multiplicative_order (const Ptr< RCP< const Integer >> &o, const RCP< const Integer > &a, const RCP< const Integer > &n)
 Multiplicative order. Return false if order does not exist.
 
int SymEngine::legendre (const Integer &a, const Integer &n)
 Legendre Function.
 
int SymEngine::jacobi (const Integer &a, const Integer &n)
 Jacobi Function.
 
int SymEngine::kronecker (const Integer &a, const Integer &n)
 Kronecker Function.
 
void SymEngine::nthroot_mod_list (std::vector< RCP< const Integer >> &roots, const RCP< const Integer > &a, const RCP< const Integer > &n, const RCP< const Integer > &m)
 All Solutions to x**n == a mod m. Return false if none exists.
 
bool SymEngine::nthroot_mod (const Ptr< RCP< const Integer >> &root, const RCP< const Integer > &a, const RCP< const Integer > &n, const RCP< const Integer > &m)
 A solution to x**n == a mod m. Return false if none exists.
 
bool SymEngine::powermod (const Ptr< RCP< const Integer >> &powm, const RCP< const Integer > &a, const RCP< const Number > &b, const RCP< const Integer > &m)
 
void SymEngine::powermod_list (std::vector< RCP< const Integer >> &pows, const RCP< const Integer > &a, const RCP< const Number > &b, const RCP< const Integer > &m)
 
vec_integer_class SymEngine::quadratic_residues (const Integer &a)
 Finds all Quadratic Residues of a Positive Integer.
 
bool SymEngine::is_quad_residue (const Integer &a, const Integer &p)
 Returns true if 'a' is a quadratic residue of 'p'.
 
bool SymEngine::is_nth_residue (const Integer &a, const Integer &n, const Integer &mod)
 Returns true if 'a' is a nth power residue of 'mod'.
 
int SymEngine::mobius (const Integer &a)
 Mobius Function.
 
long SymEngine::mertens (const unsigned long a)
 

Detailed Description

Basic number theory functions

Definition in file ntheory.h.