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

ChineseRemainder Struct Template Reference

#include <cra-domain.h>

List of all members.

template<class Domain>
struct LinBox::ChineseRemainder< Domain >


Public Types

typedef Domain::Element DomainElement
typedef unsigned long BaseRing

Public Methods

 ChineseRemainder (const unsigned long EARLY=DEFAULT_EARLY_TERM_THRESHOLD, const size_t n=1)
 ChineseRemainder (const double BOUND)
void initialize (const unsigned long EARLY=1, const size_t n=1, const double BOUND=0.0)
template<class Function, class RandPrime> Integeroperator() (Integer &res, const Function &Iteration, RandPrime &genprime)
 The CRA loop.

template<template< class T > class Vect, class Function, class RandPrime> Vect< Integer > & operator() (Vect< Integer > &res, const Function &Iteration, RandPrime &genprime)
template<class VectOrInt> void progress (const Domain &D, const VectOrInt &e)
 Function for adding a new prime and it's residue to the CRA process.

int steps ()
template<class VectOrInt> VectOrInt & result (VectOrInt &d)
 result mod the lcm of the moduli.

bool terminated ()
bool noncoprime (const Integer &i) const

Protected Methods

bool Early_noncoprimality (const Integer &i) const
bool Full_noncoprimality (const Integer &i) const
void Full_progress (const Domain &D, const DomainElement &e)
template<template< class T > class Vect> void Full_progress (const Domain &D, const Vect< DomainElement > &e)
IntegerFull_result (Integer &d)
template<template< class T > class Vect> Vect< Integer > & Full_result (Vect< Integer > &d)
bool Full_terminated ()
template<template< class T > class Vect> void Early_progress (const Domain &D, const Vect< DomainElement > &e)
template<template< class T > class Vect> void First_Early_progress (const Domain &D, const Vect< DomainElement > &e)
void Early_progress (const Domain &D, const DomainElement &e)
void First_Early_progress (const Domain &D, const DomainElement &e)
template<template< class T > class Vect> Vect< Integer > & Early_result (Vect< Integer > &d)
IntegerEarly_result (Integer &d)
bool Early_terminated ()
Integerfieldreconstruct (Integer &res, const Domain &D1, const DomainElement &u1, const Integer &r0, const Integer &P0)
IntegerEarly_normalized_fieldreconstruct (Integer &res, const Integer &P0, const Domain &D1, const DomainElement &u1, const Integer &M1)
Integerfieldreconstruct (Integer &res, const Domain &D1, const DomainElement &u1, DomainElement &u0, DomainElement &m0, const Integer &r0, const Integer &P0)
Integernormalized_fieldreconstruct (Integer &res, const Domain &D1, const DomainElement &u1, DomainElement &u0, DomainElement &m0, const Integer &r0, const Integer &P0, const Integer &m1)
Integersmallbigreconstruct (Integer &u1, const Integer &m1, const Integer &u0, const Integer &m0)
Integernormalize (Integer &u1, Integer &tmp, const Integer &m1)
Integernormalizesmallbigreconstruct (Integer &u1, const Integer &m1, const Integer &u0, const Integer &m0)
template<template< class T > class Vect1, class Vect2> DomainElementdot (DomainElement &z, const Domain &D, const Vect1< DomainElement > &v1, const Vect2 &v2)

Protected Attributes

unsigned int occurency
double dSizes0
Integer nextm
Integer Modulo0
Integer Table0
bool Occupation0
std::vector< unsigned long > randv
std::vector< double > dSizes
std::vector< LazyProductModulo
std::vector< std::vector<
Integer > > 
Table
std::vector< bool > Occupation
unsigned int EARLY_TERM_THRESHOLD
double LOGARITHMIC_UPPER_BOUND
unsigned int step

Member Typedef Documentation

typedef unsigned long BaseRing
 

typedef Domain::Element DomainElement
 


Constructor & Destructor Documentation

ChineseRemainder const unsigned long    EARLY = DEFAULT_EARLY_TERM_THRESHOLD,
const size_t    n = 1
[inline]
 

ChineseRemainder const double    BOUND [inline]
 


Member Function Documentation

DomainElement& dot DomainElement   z,
const Domain &    D,
const Vect1< DomainElement > &    v1,
const Vect2 &    v2
[inline, protected]
 

bool Early_noncoprimality const Integer   i const [inline, protected]
 

Integer& Early_normalized_fieldreconstruct Integer   res,
const Integer   P0,
const Domain &    D1,
const DomainElement   u1,
const Integer   M1
[inline, protected]
 

void Early_progress const Domain &    D,
const DomainElement   e
[inline, protected]
 

void Early_progress const Domain &    D,
const Vect< DomainElement > &    e
[inline, protected]
 

Integer& Early_result Integer   d [inline, protected]
 

Vect<Integer>& Early_result Vect< Integer > &    d [inline, protected]
 

bool Early_terminated   [inline, protected]
 

Integer& fieldreconstruct Integer   res,
const Domain &    D1,
const DomainElement   u1,
DomainElement   u0,
DomainElement   m0,
const Integer   r0,
const Integer   P0
[inline, protected]
 

Integer& fieldreconstruct Integer   res,
const Domain &    D1,
const DomainElement   u1,
const Integer   r0,
const Integer   P0
[inline, protected]
 

void First_Early_progress const Domain &    D,
const DomainElement   e
[inline, protected]
 

void First_Early_progress const Domain &    D,
const Vect< DomainElement > &    e
[inline, protected]
 

bool Full_noncoprimality const Integer   i const [inline, protected]
 

void Full_progress const Domain &    D,
const Vect< DomainElement > &    e
[inline, protected]
 

void Full_progress const Domain &    D,
const DomainElement   e
[inline, protected]
 

Vect<Integer>& Full_result Vect< Integer > &    d [inline, protected]
 

Integer& Full_result Integer   d [inline, protected]
 

bool Full_terminated   [inline, protected]
 

void initialize const unsigned long    EARLY = 1,
const size_t    n = 1,
const double    BOUND = 0.0
[inline]
 

bool noncoprime const Integer   i const [inline]
 

Integer& normalize Integer   u1,
Integer   tmp,
const Integer   m1
[inline, protected]
 

Integer& normalized_fieldreconstruct Integer   res,
const Domain &    D1,
const DomainElement   u1,
DomainElement   u0,
DomainElement   m0,
const Integer   r0,
const Integer   P0,
const Integer   m1
[inline, protected]
 

Integer& normalizesmallbigreconstruct Integer   u1,
const Integer   m1,
const Integer   u0,
const Integer   m0
[inline, protected]
 

Vect<Integer>& operator() Vect< Integer > &    res,
const Function &    Iteration,
RandPrime &    genprime
[inline]
 

Integer& operator() Integer   res,
const Function &    Iteration,
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

void progress const Domain &    D,
const VectOrInt &    e
[inline]
 

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

ameter D - A domain (e.g. a Field).
ameter e - A residue, image in the domain D of the desired value.

VectOrInt& result VectOrInt &    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.

Integer& smallbigreconstruct Integer   u1,
const Integer   m1,
const Integer   u0,
const Integer   m0
[inline, protected]
 

int steps   [inline]
 

bool terminated   [inline]
 


Member Data Documentation

std::vector< double > dSizes [protected]
 

double dSizes0 [protected]
 

unsigned int EARLY_TERM_THRESHOLD [protected]
 

double LOGARITHMIC_UPPER_BOUND [protected]
 

std::vector< LazyProduct > Modulo [protected]
 

Integer Modulo0 [protected]
 

Integer nextm [protected]
 

std::vector< bool > Occupation [protected]
 

bool Occupation0 [protected]
 

unsigned int occurency [protected]
 

std::vector< unsigned long > randv [protected]
 

unsigned int step [protected]
 

std::vector< std::vector<Integer> > Table [protected]
 

Integer Table0 [protected]
 


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