Borderbasix

Classes | Macros | Functions
BC.hpp File Reference
#include <assert.h>
#include "gmp.h"

Go to the source code of this file.

Classes

struct  Scl< T >
 

Macros

#define NRVAL(name)
 
#define NRCODE(code)
 
#define NONRCODE(code)   code
 

Functions

Scl< T > & operator- (const Scl< T > &b)
 
Scl< T > operator+ (const Scl< T > &b1, const Scl< T > &b2)
 
Scl< T > & operator- (const Scl< T > &b1, const Scl< T > &b2)
 
Scl< T > & operator* (const Scl< T > &b1, const Scl< T > &b2)
 
Scl< T > & operator/ (const Scl< T > &b1, const Scl< T > &b2)
 
Scl< T > & operator% (const Scl< T > &b1, const Scl< T > &b2)
 
Scl< T > & operator+ (const Scl< T > &b, unsigned long ul)
 
Scl< T > & operator- (const Scl< T > &b, unsigned long ul)
 
Scl< T > & operator* (const Scl< T > &b, unsigned long ul)
 
Scl< T > & operator/ (const Scl< T > &b, unsigned long ul)
 
Scl< T > & operator% (const Scl< T > &b, unsigned long ul)
 
Scl< T > & operator+ (unsigned long ul, const Scl< T > &b)
 
Scl< T > & operator* (unsigned long ul, const Scl< T > &b)
 
Scl< T > & operator+ (const Scl< T > &b, long sl)
 
Scl< T > & operator- (const Scl< T > &b, long sl)
 
Scl< T > & operator* (const Scl< T > &b, long sl)
 
Scl< T > & operator/ (const Scl< T > &b, long sl)
 
Scl< T > & operator% (const Scl< T > &b, long sl)
 
Scl< T > & operator+ (long sl, const Scl< T > &b)
 
Scl< T > & operator* (long sl, const Scl< T > &b)
 
Scl< T > & Div2Exp (const Scl< T > &b, unsigned long exponent_of_2)
 
Scl< T > & GCD (const Scl< T > &b1, const Scl< T > &b2)
 
Scl< T > & gcd (const Scl< T > &b1, const Scl< T > &b2)
 
Scl< T > & Mod2Exp (const Scl< T > &b, unsigned long exponent_of_2)
 
Scl< T > & Mul2Exp (const Scl< T > &b, unsigned long exponent_of_2)
 
Scl< T > & PowMod (const Scl< T > &b, const Scl< T > &exp, const Scl< T > &m)
 
Scl< T > & PowMod (const Scl< T > &b, unsigned long exp, const Scl< T > &m)
 
Scl< T > & abs (const Scl< T > &b)
 
Scl< T > & pow (const Scl< T > &base, unsigned long exp)
 
Scl< T > & quo (const Scl< T > &dividend, const Scl< T > &divisor)
 
Scl< T > & quo (const Scl< T > &dividend, unsigned long divisor)
 
Scl< T > & rem (const Scl< T > &dividend, const Scl< T > &divisor)
 
Scl< T > & sqrt (const Scl< T > &b)
 
unsigned long rem (const Scl< T > &b, unsigned long divisor)
 
Scl< T > & BigIntFactorial (unsigned long n)
 
unsigned long BigIntToUL (const Scl< T > &b)
 
signed long BigIntToSL (const Scl< T > &b)
 
size_t log (const Scl< T > &b)
 
size_t log (const Scl< T > &b, int base)
 
int sign (const Scl< T > &b)
 
int compare (const Scl< T > &b1, const Scl< T > &b2)
 
int compare (const Scl< T > &b, unsigned long ul)
 
int compare (const Scl< T > &b, long sl)
 
bool IsPositive (const Scl< T > &b)
 
bool IsNegative (const Scl< T > &b)
 
bool IsZero (const Scl< T > &b)
 
bool IsOne (const Scl< T > &b)
 
bool IsMinusOne (const Scl< T > &b)
 
bool IsOdd (const Scl< T > &b)
 
bool IsEven (const Scl< T > &b)
 
bool IsPerfectSquare (const Scl< T > &b)
 
bool IsProbablyPrime (const Scl< T > &b, int reps)
 
void SqrtRem (Scl< T > &sqrt, Scl< T > &rem, const Scl< T > &b)
 
void QuoRem (Scl< T > &q, Scl< T > &r, const Scl< T > &divdend, const Scl< T > &divisor)
 
unsigned long QuoRem (Scl< T > &q, Scl< T > &r, const Scl< T > &divdend, unsigned long divisor)
 
void DivMod (Scl< T > &q, Scl< T > &r, const Scl< T > &divdend, const Scl< T > &divisor)
 
void DivMod (Scl< T > &q, Scl< T > &r, const Scl< T > &divdend, unsigned long divisor)
 
void ExtGCD (Scl< T > &gcd, Scl< T > &a, Scl< T > &b, const Scl< T > &x, const Scl< T > &y)
 
void HalfExtGCD (Scl< T > &gcd, Scl< T > &a, const Scl< T > &x, const Scl< T > &y)
 
Scl< T > BigIntPow (unsigned long base, unsigned long exp) NRVAL(r)
 

Macro Definition Documentation

#define NONRCODE (   code)    code
#define NRCODE (   code)
#define NRVAL (   name)

Function Documentation

Scl< T > abs ( const Scl< T > &  b)
inline
Scl< T > BigIntFactorial ( unsigned long  n)
inline
Scl<T> BigIntPow ( unsigned long  base,
unsigned long  exp 
)
inline
signed long BigIntToSL ( const Scl< T > &  b)
inline
unsigned long BigIntToUL ( const Scl< T > &  b)
inline
int compare ( const Scl< T > &  b1,
const Scl< T > &  b2 
)
inline
int compare ( const Scl< T > &  b,
unsigned long  ul 
)
inline
int compare ( const Scl< T > &  b,
long  sl 
)
inline
Scl< T > Div2Exp ( const Scl< T > &  b,
unsigned long  exponent_of_2 
)
inline
void DivMod ( Scl< T > &  q,
Scl< T > &  r,
const Scl< T > &  divdend,
const Scl< T > &  divisor 
)
inline
void DivMod ( Scl< T > &  q,
Scl< T > &  r,
const Scl< T > &  divdend,
unsigned long  divisor 
)
inline
void ExtGCD ( Scl< T > &  gcd,
Scl< T > &  a,
Scl< T > &  b,
const Scl< T > &  x,
const Scl< T > &  y 
)
inline
Scl< T > GCD ( const Scl< T > &  b1,
const Scl< T > &  b2 
)
inline
Scl< T > gcd ( const Scl< T > &  b1,
const Scl< T > &  b2 
)
inline
void HalfExtGCD ( Scl< T > &  gcd,
Scl< T > &  a,
const Scl< T > &  x,
const Scl< T > &  y 
)
inline
bool IsEven ( const Scl< T > &  b)
inline
bool IsMinusOne ( const Scl< T > &  b)
inline
bool IsNegative ( const Scl< T > &  b)
inline
bool IsOdd ( const Scl< T > &  b)
inline
bool IsOne ( const Scl< T > &  b)
inline
bool IsPerfectSquare ( const Scl< T > &  b)
inline
bool IsPositive ( const Scl< T > &  b)
inline
bool IsProbablyPrime ( const Scl< T > &  b,
int  reps = 25 
)
inline
bool IsZero ( const Scl< T > &  b)
inline
size_t log ( const Scl< T > &  b)
inline
size_t log ( const Scl< T > &  b,
int  base 
)
inline
Scl< T > Mod2Exp ( const Scl< T > &  b,
unsigned long  exponent_of_2 
)
inline
Scl< T > Mul2Exp ( const Scl< T > &  b,
unsigned long  exponent_of_2 
)
inline
Scl< T > operator% ( const Scl< T > &  b1,
const Scl< T > &  b2 
)
inline
Scl< T > operator% ( const Scl< T > &  b,
unsigned long  ul 
)
inline
Scl< T > operator% ( const Scl< T > &  b,
long  sl 
)
inline
Scl< T > operator* ( const Scl< T > &  b1,
const Scl< T > &  b2 
)
inline
Scl< T > operator* ( const Scl< T > &  b,
unsigned long  ul 
)
inline
Scl< T > operator* ( unsigned long  ul,
const Scl< T > &  b 
)
inline
Scl< T > operator* ( const Scl< T > &  b,
long  sl 
)
inline
Scl< T > operator* ( long  sl,
const Scl< T > &  b 
)
inline
Scl< T > operator+ ( const Scl< T > &  b1,
const Scl< T > &  b2 
)
inline
Scl< T > operator+ ( const Scl< T > &  b,
unsigned long  ul 
)
inline
Scl< T > operator+ ( unsigned long  ul,
const Scl< T > &  b 
)
inline
Scl< T > operator+ ( const Scl< T > &  b,
long  sl 
)
inline
Scl< T > operator+ ( long  sl,
const Scl< T > &  b 
)
inline
Scl< T > operator- ( const Scl< T > &  b)
inline
Scl< T > operator- ( const Scl< T > &  b1,
const Scl< T > &  b2 
)
inline
Scl< T > operator- ( const Scl< T > &  b,
unsigned long  ul 
)
inline
Scl< T > operator- ( const Scl< T > &  b,
long  sl 
)
inline
Scl< T > operator/ ( const Scl< T > &  b1,
const Scl< T > &  b2 
)
inline
Scl< T > operator/ ( const Scl< T > &  b,
unsigned long  ul 
)
inline
Scl< T > operator/ ( const Scl< T > &  b,
long  sl 
)
inline
Scl< T > pow ( const Scl< T > &  base,
unsigned long  exp 
)
inline
Scl< T > PowMod ( const Scl< T > &  b,
const Scl< T > &  exp,
const Scl< T > &  m 
)
inline
Scl< T > PowMod ( const Scl< T > &  b,
unsigned long  exp,
const Scl< T > &  m 
)
inline
Scl< T > quo ( const Scl< T > &  dividend,
const Scl< T > &  divisor 
)
inline
Scl< T > quo ( const Scl< T > &  dividend,
unsigned long  divisor 
)
inline
void QuoRem ( Scl< T > &  q,
Scl< T > &  r,
const Scl< T > &  divdend,
const Scl< T > &  divisor 
)
inline
unsigned long QuoRem ( Scl< T > &  q,
Scl< T > &  r,
const Scl< T > &  divdend,
unsigned long  divisor 
)
inline
Scl< T > rem ( const Scl< T > &  dividend,
const Scl< T > &  divisor 
)
inline
unsigned long rem ( const Scl< T > &  b,
unsigned long  divisor 
)
inline
int sign ( const Scl< T > &  b)
inline
Scl< T > sqrt ( const Scl< T > &  b)
inline
void SqrtRem ( Scl< T > &  sqrt,
Scl< T > &  rem,
const Scl< T > &  b 
)
inline
Home  |  Download & InstallContributions