Borderbasix

Public Member Functions | Public Attributes | Friends | List of all members
Scl< T > Struct Template Reference

#include <borderbasix/arithm/BC.hpp>

Public Member Functions

 Scl ()
 
 Scl (const Scl< T > &b)
 
 Scl (signed long sl)
 
 Scl (unsigned long ul)
 
 Scl (int si)
 
 Scl (const char *string, int base=10)
 
 Scl (MP_INT new_z)
 
 ~Scl ()
 
bool operator== (const Scl< T > &rhs) const
 
bool operator!= (const Scl< T > &rhs) const
 
bool operator> (const Scl< T > &rhs) const
 
bool operator>= (const Scl< T > &rhs) const
 
bool operator< (const Scl< T > &rhs) const
 
bool operator<= (const Scl< T > &rhs) const
 
bool operator== (long sl) const
 
bool operator!= (long sl) const
 
bool operator> (long sl) const
 
bool operator>= (long sl) const
 
bool operator< (long sl) const
 
bool operator<= (long sl) const
 
bool operator== (int si) const
 
bool operator!= (int si) const
 
bool operator> (int si) const
 
bool operator>= (int si) const
 
bool operator< (int si) const
 
bool operator<= (int si) const
 
bool operator== (unsigned long ul) const
 
bool operator!= (unsigned long ul) const
 
bool operator> (unsigned long ul) const
 
bool operator>= (unsigned long ul) const
 
bool operator< (unsigned long ul) const
 
bool operator<= (unsigned long ul) const
 
void operator= (const Scl< T > &rhs)
 
void operator+= (const Scl< T > &rhs)
 
void operator-= (const Scl< T > &rhs)
 
void operator*= (const Scl< T > &rhs)
 
void operator/= (const Scl< T > &rhs)
 
void operator%= (const Scl< T > &rhs)
 
void operator= (unsigned long rhs)
 
void operator+= (unsigned long rhs)
 
void operator-= (unsigned long rhs)
 
void operator*= (unsigned long rhs)
 
void operator/= (unsigned long rhs)
 
void operator%= (unsigned long rhs)
 
void operator= (long rhs)
 
void operator+= (long rhs)
 
void operator-= (long rhs)
 
void operator*= (long rhs)
 
void operator/= (long rhs)
 
void operator%= (long rhs)
 
void operator++ ()
 
void operator-- ()
 
void Div2Exp (unsigned long exponent_of_2)
 
void GCD (const Scl< T > &b2)
 
void Mod2Exp (unsigned long exponent_of_2)
 
void Mul2Exp (unsigned long exponent_of_2)
 
void PowMod (const Scl< T > &exp, const Scl< T > &m)
 
void PowMod (unsigned long exp, const Scl< T > &m)
 
void abs ()
 
void factorial (unsigned long n)
 
void negate ()
 
void pow (unsigned long exp)
 
void pow (unsigned long base, unsigned long exp)
 
void quo (const Scl< T > &divisor)
 
void quo (unsigned long divisor)
 
void rem (const Scl< T > &divisor)
 
unsigned long rem (unsigned long divisor)
 
void sqrt ()
 

Public Attributes

mpz z
 

Friends

ostream & operator<< (ostream &os, const Scl< T > &b)
 
istream & operator>> (istream &is, Scl< T > &b)
 
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=25)
 
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)
 

Constructor & Destructor Documentation

template<class T >
Scl< T >::Scl< T > ( )
inline
template<class T >
Scl< T >::Scl< T > ( const Scl< T > &  b)
inline
template<class T >
Scl< T >::Scl ( signed long  sl)
template<class T >
Scl< T >::Scl ( unsigned long  ul)
template<class T >
Scl< T >::Scl< T > ( int  si)
inline
template<class T >
Scl< T >::Scl< T > ( const char *  string,
int  base = 10 
)
inline
template<class T >
Scl< T >::Scl ( MP_INT  new_z)
inline
template<class T >
Scl< T >::~Scl< T > ( )
inline

Member Function Documentation

template<class T >
void Scl< T >::abs ( )
inline
template<class T >
void Scl< T >::Div2Exp ( unsigned long  exponent_of_2)
inline
template<class T >
void Scl< T >::factorial ( unsigned long  n)
inline
template<class T >
void Scl< T >::GCD ( const Scl< T > &  b2)
inline
template<class T >
void Scl< T >::Mod2Exp ( unsigned long  exponent_of_2)
inline
template<class T >
void Scl< T >::Mul2Exp ( unsigned long  exponent_of_2)
inline
template<class T >
void Scl< T >::negate ( )
inline
template<class T >
bool Scl< T >::operator!= ( const Scl< T > &  rhs) const
inline
template<class T >
bool Scl< T >::operator!= ( long  sl) const
inline
template<class T >
bool Scl< T >::operator!= ( int  si) const
inline
template<class T >
bool Scl< T >::operator!= ( unsigned long  ul) const
inline
template<class T >
void Scl< T >::operator%= ( const Scl< T > &  rhs)
inline
template<class T >
void Scl< T >::operator%= ( unsigned long  rhs)
inline
template<class T >
void Scl< T >::operator%= ( long  rhs)
template<class T >
void Scl< T >::operator*= ( const Scl< T > &  rhs)
inline
template<class T >
void Scl< T >::operator*= ( unsigned long  rhs)
inline
template<class T >
void Scl< T >::operator*= ( long  rhs)
inline
template<class T >
void Scl< T >::operator++ ( )
inline
template<class T >
void Scl< T >::operator+= ( const Scl< T > &  rhs)
inline
template<class T >
void Scl< T >::operator+= ( unsigned long  rhs)
inline
template<class T >
void Scl< T >::operator+= ( long  rhs)
inline
template<class T >
void Scl< T >::operator-- ( )
inline
template<class T >
void Scl< T >::operator-= ( const Scl< T > &  rhs)
inline
template<class T >
void Scl< T >::operator-= ( unsigned long  rhs)
inline
template<class T >
void Scl< T >::operator-= ( long  rhs)
inline
template<class T >
void Scl< T >::operator/= ( const Scl< T > &  rhs)
inline
template<class T >
void Scl< T >::operator/= ( unsigned long  rhs)
inline
template<class T >
void Scl< T >::operator/= ( long  rhs)
inline
template<class T >
bool Scl< T >::operator< ( const Scl< T > &  rhs) const
inline
template<class T >
bool Scl< T >::operator< ( long  sl) const
inline
template<class T >
bool Scl< T >::operator< ( int  si) const
inline
template<class T >
bool Scl< T >::operator< ( unsigned long  ul) const
inline
template<class T >
bool Scl< T >::operator<= ( const Scl< T > &  rhs) const
inline
template<class T >
bool Scl< T >::operator<= ( long  sl) const
inline
template<class T >
bool Scl< T >::operator<= ( int  si) const
inline
template<class T >
bool Scl< T >::operator<= ( unsigned long  ul) const
inline
template<class T >
void Scl< T >::operator= ( const Scl< T > &  rhs)
inline
template<class T >
void Scl< T >::operator= ( unsigned long  rhs)
inline
template<class T >
void Scl< T >::operator= ( long  rhs)
inline
template<class T >
bool Scl< T >::operator== ( const Scl< T > &  rhs) const
inline
template<class T >
bool Scl< T >::operator== ( long  sl) const
inline
template<class T >
bool Scl< T >::operator== ( int  si) const
inline
template<class T >
bool Scl< T >::operator== ( unsigned long  ul) const
inline
template<class T >
bool Scl< T >::operator> ( const Scl< T > &  rhs) const
inline
template<class T >
bool Scl< T >::operator> ( long  sl) const
inline
template<class T >
bool Scl< T >::operator> ( int  si) const
inline
template<class T >
bool Scl< T >::operator> ( unsigned long  ul) const
inline
template<class T >
bool Scl< T >::operator>= ( const Scl< T > &  rhs) const
inline
template<class T >
bool Scl< T >::operator>= ( long  sl) const
inline
template<class T >
bool Scl< T >::operator>= ( int  si) const
inline
template<class T >
bool Scl< T >::operator>= ( unsigned long  ul) const
inline
template<class T >
void Scl< T >::pow ( unsigned long  exp)
inline
template<class T >
void Scl< T >::pow ( unsigned long  base,
unsigned long  exp 
)
inline
template<class T >
void Scl< T >::PowMod ( const Scl< T > &  exp,
const Scl< T > &  m 
)
inline
template<class T >
void Scl< T >::PowMod ( unsigned long  exp,
const Scl< T > &  m 
)
inline
template<class T >
void Scl< T >::quo ( const Scl< T > &  divisor)
inline
template<class T >
void Scl< T >::quo ( unsigned long  divisor)
inline
template<class T >
void Scl< T >::rem ( const Scl< T > &  divisor)
inline
template<class T >
unsigned long Scl< T >::rem ( unsigned long  divisor)
inline
template<class T >
void Scl< T >::sqrt ( )
inline

Friends And Related Function Documentation

template<class T >
signed long BigIntToSL ( const Scl< T > &  b)
friend
template<class T >
unsigned long BigIntToUL ( const Scl< T > &  b)
friend
template<class T >
int compare ( const Scl< T > &  b1,
const Scl< T > &  b2 
)
friend
template<class T >
int compare ( const Scl< T > &  b,
unsigned long  ul 
)
friend
template<class T >
int compare ( const Scl< T > &  b,
long  sl 
)
friend
template<class T >
void DivMod ( Scl< T > &  q,
Scl< T > &  r,
const Scl< T > &  divdend,
const Scl< T > &  divisor 
)
friend
template<class T >
void DivMod ( Scl< T > &  q,
Scl< T > &  r,
const Scl< T > &  divdend,
unsigned long  divisor 
)
friend
template<class T >
void ExtGCD ( Scl< T > &  gcd,
Scl< T > &  a,
Scl< T > &  b,
const Scl< T > &  x,
const Scl< T > &  y 
)
friend
template<class T >
void HalfExtGCD ( Scl< T > &  gcd,
Scl< T > &  a,
const Scl< T > &  x,
const Scl< T > &  y 
)
friend
template<class T >
bool IsEven ( const Scl< T > &  b)
friend
template<class T >
bool IsMinusOne ( const Scl< T > &  b)
friend
template<class T >
bool IsNegative ( const Scl< T > &  b)
friend
template<class T >
bool IsOdd ( const Scl< T > &  b)
friend
template<class T >
bool IsOne ( const Scl< T > &  b)
friend
template<class T >
bool IsPerfectSquare ( const Scl< T > &  b)
friend
template<class T >
bool IsPositive ( const Scl< T > &  b)
friend
template<class T >
bool IsProbablyPrime ( const Scl< T > &  b,
int  reps = 25 
)
friend
template<class T >
bool IsZero ( const Scl< T > &  b)
friend
template<class T >
size_t log ( const Scl< T > &  b)
friend
template<class T >
size_t log ( const Scl< T > &  b,
int  base 
)
friend
template<class T >
ostream& operator<< ( ostream &  os,
const Scl< T > &  b 
)
friend
template<class T >
istream& operator>> ( istream &  is,
Scl< T > &  b 
)
friend
template<class T >
void QuoRem ( Scl< T > &  q,
Scl< T > &  r,
const Scl< T > &  divdend,
const Scl< T > &  divisor 
)
friend
template<class T >
unsigned long QuoRem ( Scl< T > &  q,
Scl< T > &  r,
const Scl< T > &  divdend,
unsigned long  divisor 
)
friend
template<class T >
int sign ( const Scl< T > &  b)
friend
template<class T >
void SqrtRem ( Scl< T > &  sqrt,
Scl< T > &  rem,
const Scl< T > &  b 
)
friend

Member Data Documentation

template<class T >
mpz Scl< T >::z
Home  |  Download & InstallContributions