Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

CRA Class Template Reference

#include <cra.h>

List of all members.

template<class _Integer>
class LinBox::CRA< _Integer >


Public Types

typedef _Integer Integer
typedef std::vector< IntegerVector
typedef std::list< VectorLVector
typedef std::list< IntegerList
typedef std::vector< int > IntVector
typedef _Integer Integer
typedef std::vector< IntegerVector
typedef std::list< VectorLVector
typedef std::list< IntegerList
typedef std::vector< int > IntVector

Public Methods

 CRA (size_t n=0, unsigned int EARLY=1, const double BOUND=0)
 CRA (size_t n, unsigned int EARLY, const integer BOUND)
void initialize (size_t n, unsigned int EARLY, const integer BOUND)
void initialize (size_t n, unsigned int EARLY=1, const double BOUND=0)
template<class Vect, class Function, class RandPrime> Vect & operator() (Vect &res, const Function &F, RandPrime &genprime)
 The CRA loop.

void progress (const Integer &p, const Integer &d)
 Function for adding a new prime and it's residue to the CRA process.

template<class Vect> void progress (const Integer &p, const Vect &d)
 Taking a step when the CRA process is being applied ot a vector or list of values..

int steps ()
bool terminated ()
size_t stableSteps ()
 Number of progress steps without change in the combined residue.

integerresult (integer &d)
 result mod the lcm of the moduli.

template<class Vect> Vect & result (Vect &w)
 results mod the lcm of the moduli.

Integermodulus ()
 CRA ()
template<class V> void step (Integer p, const V &d)
int steps ()
bool terminated ()
size_t changelessness ()
template<class V> void result (V &w)
Integermodulus ()

Protected Methods

void buildTree (List &holdprime, LVector &holdres)
void combine (List &holdprime, LVector &holdres)
void buildTree (List &holdp, List &holdv)
void combine (List &holdp, List &holdv)
void normalize (Integer &res, const Integer &m)
void normalize (Vector &res, const Integer &m)
template<class Vect> void printVect (const Vect &v)
void debug ()
template<class Vect1, class Vect2> bool check (const Vect1 &v1, const Vect2 &v2, const Integer &p)
template<class Vect1, class Vect2> void dot (Integer &d, const Vect1 &v1, const Vect2 &v2)
void buildTree (List &holdprime, LVector &holdres)
void combine (List &holdprime, LVector &holdres)
void normalize (Integer &res, const Integer &m)
void normalize (Vector &res, const Integer &m)
template<class Vect> void printVect (const Vect &v)
void debug ()
template<class Vect1, class Vect2> bool check (const Vect1 &v1, const Vect2 &v2, const Integer &p)
template<class Vect1, class Vect2> void dot (Integer &d, const Vect1 &v1, const Vect2 &v2)

Protected Attributes

Integer m
double lm
Integer cert
std::vector< int > randv
unsigned int EARLY_TERM_THRESHOLD
double UPPER_BOUND
LVector holdres
List holdvalue
List holdprime
size_t occurency
int k
Integer cert1
Integer cert2
std::vector< int > randv1
std::vector< int > randv2
size_t isTerminating
bool first_call

Member Typedef Documentation

typedef _Integer Integer
 

typedef _Integer Integer
 

typedef std::vector<int> IntVector
 

typedef std::vector<int> IntVector
 

typedef std::list<Integer> List
 

typedef std::list<Integer> List
 

typedef std::list<Vector> LVector
 

typedef std::list<Vector> LVector
 

typedef std::vector<Integer> Vector
 

typedef std::vector<Integer> Vector
 


Constructor & Destructor Documentation

CRA size_t    n = 0,
unsigned int    EARLY = 1,
const double    BOUND = 0
[inline]
 

CRA size_t    n,
unsigned int    EARLY,
const integer    BOUND
[inline]
 

CRA   [inline]
 


Member Function Documentation

void buildTree List   holdprime,
LVector   holdres
[inline, protected]
 

void buildTree List   holdp,
List   holdv
[inline, protected]
 

void buildTree List   holdprime,
LVector   holdres
[inline, protected]
 

size_t changelessness   [inline]
 

bool check const Vect1 &    v1,
const Vect2 &    v2,
const Integer   p
[inline, protected]
 

bool check const Vect1 &    v1,
const Vect2 &    v2,
const Integer   p
[inline, protected]
 

void combine List   holdprime,
LVector   holdres
[inline, protected]
 

void combine List   holdp,
List   holdv
[inline, protected]
 

void combine List   holdprime,
LVector   holdres
[inline, protected]
 

void debug   [inline, protected]
 

void debug   [inline, protected]
 

void dot Integer   d,
const Vect1 &    v1,
const Vect2 &    v2
[inline, protected]
 

void dot Integer   d,
const Vect1 &    v1,
const Vect2 &    v2
[inline, protected]
 

void initialize size_t    n,
unsigned int    EARLY = 1,
const double    BOUND = 0
[inline]
 

void initialize size_t    n,
unsigned int    EARLY,
const integer    BOUND
[inline]
 

Integer& modulus   [inline]
 

Integer& modulus   [inline]
 

void normalize Vector   res,
const Integer   m
[inline, protected]
 

void normalize Integer   res,
const Integer   m
[inline, protected]
 

void normalize Vector   res,
const Integer   m
[inline, protected]
 

void normalize Integer   res,
const Integer   m
[inline, protected]
 

Vect& operator() Vect &    res,
const Function &    F,
RandPrime &    genprime
[inline]
 

The CRA loop.

Given a function to generate residues mod a single prime, this loop produces the residues resulting from the Chinese remainder process on sufficiently many primes to meet the termination condition.

ameter F - Function object of two arguments, F(r, p), given prime p it outputs residue(s) r.
This loop may be parallelized. F must be reentrant, thread safe. For example, F may be returning the coefficients of the minimal polynomial of a matrix mod p. Warning - we won't detect bad primes.
ameter genprime - RandIter object for generating primes.
Returns:
res - an integer or object of a class meeting the FixedVector interface (with iterator requirement relaxed to forward iterators). Vectors, SubVectors, STL lists may be used.

void printVect const Vect &    v [inline, protected]
 

void printVect const Vect &    v [inline, protected]
 

void progress const Integer   p,
const Vect &    d
[inline]
 

Taking a step when the CRA process is being applied ot a vector or list of values..

ameter p - A modulus. Process is most efficient if it is relatively prime to
all other moduli used.
ameter d - A residue sequence: images mod p of the desired value. May be a list, vector,
SubVector.

void progress const Integer   p,
const Integer   d
[inline]
 

Function for adding a new prime and it's residue to the CRA process.

ameter p - A modulus. Process is most efficient if it is relatively prime to
all other moduli used.
ameter d - A residue, image mod p of the desired value.

void result V &    w [inline]
 

Vect& result Vect &    w [inline]
 

results mod the lcm of the moduli.

A sequence of values mod the lcm of the progress step moduli each entry of which agrees with the corresponding (sequence position) residue mod the corresponding (progress step) modulus.

integer& result integer   d [inline]
 

result mod the lcm of the moduli.

A value mod the lcm of the progress step moduli which agrees with each residue mod the corresponding modulus.

size_t stableSteps   [inline]
 

Number of progress steps without change in the combined residue.

Allows flexibility in deciding early termination. (earlier early termination).

void step Integer    p,
const V &    d
[inline]
 

int steps   [inline]
 

int steps   [inline]
 

bool terminated   [inline]
 

bool terminated   [inline]
 


Member Data Documentation

Integer cert [protected]
 

Integer cert1 [protected]
 

Integer cert2 [protected]
 

unsigned int EARLY_TERM_THRESHOLD [protected]
 

bool first_call [protected]
 

List holdprime [protected]
 

LVector holdres [protected]
 

List holdvalue [protected]
 

size_t isTerminating [protected]
 

int k [protected]
 

double lm [protected]
 

Integer m [protected]
 

size_t occurency [protected]
 

std::vector<int> randv [protected]
 

std::vector<int> randv1 [protected]
 

std::vector<int> randv2 [protected]
 

double UPPER_BOUND [protected]
 


Generated on Mon Jun 20 09:16:57 2005 for linbox by doxygen1.2.18