Givaro
Public Types | Public Member Functions | Data Fields | Protected Attributes
IntFactorDom< RandIter > Class Template Reference

Integer Factor Domain. More...

#include <givintfactor.h>

+ Inheritance diagram for IntFactorDom< RandIter >:
+ Collaboration diagram for IntFactorDom< RandIter >:

Public Types

typedef RandIter random_generator
typedef Integer Rep
typedef Rep Element

Public Member Functions

 IntFactorDom (RandIter g=RandIter())
Rep & factor (Rep &r, const Rep &n, unsigned long loops=0) const
Rep & iffactorprime (Rep &r, const Rep &n, unsigned long loops=0) const
Rep & primefactor (Rep &r, const Rep &n) const
template<class Container1 , class Container2 >
bool set (Container1 &setint, Container2 &setpwd, const Rep &a, unsigned long loops=0) const
 Factors with primes.
template<class Container >
void set (Container &, const Rep &) const
template<class Container >
void Erathostene (Container &, const Rep &) const
template<class Container , class Cont2 , class Cont3 >
Container & divisors (Container &L, const Cont2 &Lf, const Cont3 &Le) const
template<class Container >
Container & divisors (Container &, const Rep &) const
Rep & Erathostene (Rep &, const Rep &p) const
 returns a small factor
Rep & Pollard (const RandIter &, Rep &, const Rep &n, unsigned long threshold=0) const
Rep & Lenstra (const RandIter &, Rep &, const Rep &n, const Rep &B1=10000000, const unsigned long curves=30) const
std::ostream & write (std::ostream &o, const Rep &n) const
template<class Array >
std::ostream & write (std::ostream &o, Array &, const Rep &n) const
int isprime (const Rep &n, int r=5) const
unsigned int isprimepower (Rep &, const Rep &) const
template<class RandIter >
unsigned int Miller (RandIter &g, const Rep &n=5) const
template<class RandIter >
Rep & test_Lehmann (RandIter &g, Rep &, const Rep &n=5) const
template<class RandIter >
int Lehmann (RandIter &g, const Rep &n=5) const
int isprime_Tabule (const int n) const
int isprime_Tabule2 (const int n) const
Rep & nextprime (Rep &, const Rep &, int r=5) const
Rep & prevprime (Rep &, const Rep &, int r=5) const
Rep & nextprimein (Rep &, int r=5) const
Rep & prevprimein (Rep &, int r=5) const
int local_prime (const Rep &n, int r=5) const
int operator== (const IntegerDom &) const
int operator!= (const IntegerDom &) const
Rep & init (Rep &a) const
Rep & init (Rep &a, const Rep &b) const
Rep & read (Rep &a, const long i) const
Rep & read (Rep &a, const unsigned long i) const
Rep & read (Rep &a, const int i) const
Rep & read (Rep &a, const unsigned int i) const
std::istream & read (std::istream &i)
std::istream & read (std::istream &i, Rep &n) const
Rep & convert (Rep &a, const Rep &b) const
template<class XXX >
XXX & convert (XXX &x, const Rep &a) const
Rep & assign (Rep &a, const Rep &b) const
const Rep & access (const Rep &a) const
Rep & mul (Rep &r, const Rep &a, const Rep &b) const
Rep & div (Rep &r, const Rep &a, const Rep &b) const
Rep & mod (Rep &r, const Rep &a, const Rep &b) const
Rep & add (Rep &r, const Rep &a, const Rep &b) const
Rep & sub (Rep &r, const Rep &a, const Rep &b) const
Rep & divmod (Rep &q, Rep &r, const Rep &a, const Rep &b) const
Rep & divexact (Rep &q, const Rep &a, const Rep &b) const
Rep & mulin (Rep &r, const Rep &a) const
Rep & divin (Rep &r, const Rep &a) const
Rep & modin (Rep &r, const Rep &a) const
Rep & addin (Rep &r, const Rep &a) const
Rep & subin (Rep &r, const Rep &a) const
Rep & axpy (Rep &r, const Rep &a, const Rep &b, const Rep &c) const
Rep & maxpy (Rep &r, const Rep &a, const Rep &b, const Rep &c) const
Rep & maxpyin (Rep &r, const Rep &a, const Rep &b) const
Rep & axmy (Rep &r, const Rep &a, const Rep &b, const Rep &c) const
Rep & axpyin (Rep &r, const Rep &a, const Rep &b) const
Rep & axmyin (Rep &r, const Rep &a, const Rep &b) const
Rep & neg (Rep &r, const Rep &a) const
Rep & negin (Rep &r) const
Rep & gcd (Rep &g, Rep &u, Rep &v, const Rep &a, const Rep &b) const
Rep & gcd (Rep &g, const Rep &a, const Rep &b) const
Rep & lcm (Rep &l, const Rep &a, const Rep &b) const
Rep & lcmin (Rep &l, const Rep &a) const
Rep & inv (Rep &u, const Rep &a, const Rep &b) const
Rep & invin (Rep &u, const Rep &b) const
Rep & pow (Rep &r, const Rep &n, const long l) const
Rep & pow (Rep &r, const Rep &n, const unsigned long l) const
Rep & pow (Rep &r, const Rep &n, const int l) const
Rep & pow (Rep &r, const Rep &n, const unsigned int l) const
Rep & sqrt (Rep &s, const Rep &n) const
Rep & sqrt (Rep &s, Rep &r, const Rep &n) const
long logp (const Rep &a, const Rep &p) const
Rep & powmod (Rep &r, const Rep &n, const long e, const Rep &m) const
Rep & powmod (Rep &r, const Rep &n, const Rep &e, const Rep &m) const
unsigned long length (const Rep &a) const
int sign (const Rep &a) const
bool isZero (const Rep &a) const
bool isOne (const Rep &a) const
bool areEqual (const Rep &a, const Rep &b) const
bool areNEqual (const Rep &a, const Rep &b) const
bool isgeq (const Rep &a, const Rep &b) const
bool isgeq (const long b, const Rep &a) const
bool isgeq (const Rep &a, const long b) const
bool isleq (const Rep &a, const Rep &b) const
bool isleq (const long b, const Rep &a) const
bool isleq (const Rep &a, const long b) const
bool isgt (const Rep &a, const Rep &b) const
bool isgt (const long b, const Rep &a) const
bool isgt (const Rep &a, const long b) const
bool islt (const Rep &a, const Rep &b) const
bool islt (const long b, const Rep &a) const
bool islt (const Rep &a, const long b) const
template<class RandIter >
Rep & random (RandIter &, Rep &r, long s=1) const
template<class RandIter >
Rep & random (RandIter &, Rep &r, const Rep &b) const
template<class RandIter >
Rep & nonzerorandom (RandIter &, Rep &r, long s=1) const
template<class RandIter >
Rep & nonzerorandom (RandIter &, Rep &r, const Rep &b) const
std::ostream & write (std::ostream &o) const
std::ostream & write (std::ostream &o, const Rep &n) const

Data Fields

const Integer one
const Integer mOne
const Integer zero

Protected Attributes

RandIter _g

Detailed Description

template<class RandIter = GivRandom>
class Givaro::IntFactorDom< RandIter >

Integer Factor Domain.

Examples:
examples/Integer/ifactor.C, examples/Integer/ifactor_lenstra.C, and examples/Integer/ProbLucas.C.

Member Typedef Documentation

typedef RandIter random_generator

Reimplemented in IntRSADom< RandIter >.

typedef Integer Rep
inherited
typedef Rep Element
inherited

Constructor & Destructor Documentation

IntFactorDom ( RandIter  g = RandIter())
inline

Member Function Documentation

Rep& factor ( Rep &  r,
const Rep &  n,
unsigned long  loops = 0 
) const
inline
Rep& iffactorprime ( Rep &  r,
const Rep &  n,
unsigned long  loops = 0 
) const
inline
Rep& primefactor ( Rep &  r,
const Rep &  n 
) const
inline
bool set ( Container1 &  setint,
Container2 &  setpwd,
const Rep &  a,
unsigned long  loops = 0 
) const

Factors with primes.

void set ( Container &  Lf,
const Rep &  n 
) const
void Erathostene ( Container &  Lf,
const Rep &  p 
) const
Container & divisors ( Container &  L,
const Cont2 &  Lf,
const Cont3 &  Le 
) const
Container & divisors ( Container &  L,
const Rep &  n 
) const
Rep& Erathostene ( Rep &  ,
const Rep &  p 
) const

returns a small factor

IntFactorDom< RandIter >::Rep & Pollard ( const RandIter &  gen,
Rep &  g,
const Rep &  n,
unsigned long  threshold = 0 
) const
IntFactorDom< RandIter >::Rep & Lenstra ( const RandIter &  gen,
Rep &  g,
const Rep &  n,
const Rep &  B1 = 10000000,
const unsigned long  curves = 30 
) const
std::ostream & write ( std::ostream &  o,
const Rep &  n 
) const
std::ostream & write ( std::ostream &  o,
Array &  Lf,
const Rep &  n 
) const
int isprime ( const Rep &  n,
int  r = 5 
) const
inlineinherited
unsigned int isprimepower ( Rep &  q,
const Rep &  u 
) const
inherited
unsigned int Miller ( RandIter &  g,
const Rep &  n = 5 
) const
inherited
IntPrimeDom::Rep & test_Lehmann ( RandIter &  g,
Rep &  r,
const Rep &  n = 5 
) const
inherited
int Lehmann ( RandIter &  g,
const Rep &  n = 5 
) const
inherited
int isprime_Tabule ( const int  n) const
inherited
int isprime_Tabule2 ( const int  n) const
inherited
IntPrimeDom::Rep & nextprime ( Rep &  n,
const Rep &  p,
int  r = 5 
) const
inherited
IntPrimeDom::Rep & prevprime ( Rep &  n,
const Rep &  p,
int  r = 5 
) const
inherited
IntPrimeDom::Rep & nextprimein ( Rep &  n,
int  r = 5 
) const
inherited
IntPrimeDom::Rep & prevprimein ( Rep &  n,
int  r = 5 
) const
inherited
int local_prime ( const Rep &  n,
int  r = 5 
) const
inlineinherited
int operator== ( const IntegerDom &  ) const
inlineinherited
int operator!= ( const IntegerDom &  ) const
inlineinherited
Rep& init ( Rep &  a) const
inlineinherited
Rep& init ( Rep &  a,
const Rep &  b 
) const
inlineinherited
Rep& read ( Rep &  a,
const long  i 
) const
inlineinherited
Rep& read ( Rep &  a,
const unsigned long  i 
) const
inlineinherited
Rep& read ( Rep &  a,
const int  i 
) const
inlineinherited
Rep& read ( Rep &  a,
const unsigned int  i 
) const
inlineinherited
std::istream& read ( std::istream &  i)
inlineinherited
std::istream& read ( std::istream &  i,
Rep &  n 
) const
inlineinherited
Rep& convert ( Rep &  a,
const Rep &  b 
) const
inlineinherited
XXX& convert ( XXX &  x,
const Rep &  a 
) const
inlineinherited
Rep& assign ( Rep &  a,
const Rep &  b 
) const
inlineinherited
const Rep& access ( const Rep &  a) const
inlineinherited
Rep& mul ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const
inlineinherited
Rep& div ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const
inlineinherited
Rep& mod ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const
inlineinherited
Rep& add ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const
inlineinherited
Rep& sub ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const
inlineinherited
Rep& divmod ( Rep &  q,
Rep &  r,
const Rep &  a,
const Rep &  b 
) const
inlineinherited
Rep& divexact ( Rep &  q,
const Rep &  a,
const Rep &  b 
) const
inlineinherited
Rep& mulin ( Rep &  r,
const Rep &  a 
) const
inlineinherited
Rep& divin ( Rep &  r,
const Rep &  a 
) const
inlineinherited
Rep& modin ( Rep &  r,
const Rep &  a 
) const
inlineinherited
Rep& addin ( Rep &  r,
const Rep &  a 
) const
inlineinherited
Rep& subin ( Rep &  r,
const Rep &  a 
) const
inlineinherited
Rep& axpy ( Rep &  r,
const Rep &  a,
const Rep &  b,
const Rep &  c 
) const
inlineinherited
Rep& maxpy ( Rep &  r,
const Rep &  a,
const Rep &  b,
const Rep &  c 
) const
inlineinherited
Rep& maxpyin ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const
inlineinherited
Rep& axmy ( Rep &  r,
const Rep &  a,
const Rep &  b,
const Rep &  c 
) const
inlineinherited
Rep& axpyin ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const
inlineinherited
Rep& axmyin ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const
inlineinherited
Rep& neg ( Rep &  r,
const Rep &  a 
) const
inlineinherited
Rep& negin ( Rep &  r) const
inlineinherited
Rep& gcd ( Rep &  g,
Rep &  u,
Rep &  v,
const Rep &  a,
const Rep &  b 
) const
inlineinherited
Rep& gcd ( Rep &  g,
const Rep &  a,
const Rep &  b 
) const
inlineinherited
Rep& lcm ( Rep &  l,
const Rep &  a,
const Rep &  b 
) const
inlineinherited
Rep& lcmin ( Rep &  l,
const Rep &  a 
) const
inlineinherited
Rep& inv ( Rep &  u,
const Rep &  a,
const Rep &  b 
) const
inlineinherited
Rep& invin ( Rep &  u,
const Rep &  b 
) const
inlineinherited
Rep& pow ( Rep &  r,
const Rep &  n,
const long  l 
) const
inlineinherited
Rep& pow ( Rep &  r,
const Rep &  n,
const unsigned long  l 
) const
inlineinherited
Rep& pow ( Rep &  r,
const Rep &  n,
const int  l 
) const
inlineinherited
Rep& pow ( Rep &  r,
const Rep &  n,
const unsigned int  l 
) const
inlineinherited
Rep& sqrt ( Rep &  s,
const Rep &  n 
) const
inlineinherited
Rep& sqrt ( Rep &  s,
Rep &  r,
const Rep &  n 
) const
inlineinherited
long logp ( const Rep &  a,
const Rep &  p 
) const
inlineinherited
Rep& powmod ( Rep &  r,
const Rep &  n,
const long  e,
const Rep &  m 
) const
inlineinherited
Rep& powmod ( Rep &  r,
const Rep &  n,
const Rep &  e,
const Rep &  m 
) const
inlineinherited
unsigned long length ( const Rep &  a) const
inlineinherited
int sign ( const Rep &  a) const
inlineinherited
bool isZero ( const Rep &  a) const
inlineinherited
bool isOne ( const Rep &  a) const
inlineinherited
bool areEqual ( const Rep &  a,
const Rep &  b 
) const
inlineinherited
bool areNEqual ( const Rep &  a,
const Rep &  b 
) const
inlineinherited
bool isgeq ( const Rep &  a,
const Rep &  b 
) const
inlineinherited
bool isgeq ( const long  b,
const Rep &  a 
) const
inlineinherited
bool isgeq ( const Rep &  a,
const long  b 
) const
inlineinherited
bool isleq ( const Rep &  a,
const Rep &  b 
) const
inlineinherited
bool isleq ( const long  b,
const Rep &  a 
) const
inlineinherited
bool isleq ( const Rep &  a,
const long  b 
) const
inlineinherited
bool isgt ( const Rep &  a,
const Rep &  b 
) const
inlineinherited
bool isgt ( const long  b,
const Rep &  a 
) const
inlineinherited
bool isgt ( const Rep &  a,
const long  b 
) const
inlineinherited
bool islt ( const Rep &  a,
const Rep &  b 
) const
inlineinherited
bool islt ( const long  b,
const Rep &  a 
) const
inlineinherited
bool islt ( const Rep &  a,
const long  b 
) const
inlineinherited
Rep& random ( RandIter &  ,
Rep &  r,
long  s = 1 
) const
inlineinherited
Rep& random ( RandIter &  ,
Rep &  r,
const Rep &  b 
) const
inlineinherited
Rep& nonzerorandom ( RandIter &  ,
Rep &  r,
long  s = 1 
) const
inlineinherited
Rep& nonzerorandom ( RandIter &  ,
Rep &  r,
const Rep &  b 
) const
inlineinherited
std::ostream& write ( std::ostream &  o) const
inlineinherited
std::ostream& write ( std::ostream &  o,
const Rep &  n 
) const
inlineinherited

Field Documentation

RandIter _g
protected
const Integer one
inherited
const Integer mOne
inherited
const Integer zero
inherited

The documentation for this class was generated from the following files: