linbox
ChineseRemainderParallel< CRABase > Struct Template Reference

#include <cra-domain-parallel.h>

+ Inheritance diagram for ChineseRemainderParallel< CRABase >:

Public Types

typedef CRABase::Domain Domain
 
typedef CRABase::DomainElement DomainElement
 
typedef ChineseRemainderSequential< CRABase > Father_t
 
typedef ChineseRemainderParallel< CRABase > Self_t
 

Public Member Functions

template<class Param>
 ChineseRemainderParallel (const Param &b)
 
 ChineseRemainderParallel (const CRABase &b)
 
template<class ResultType, class Function, class PrimeIterator>
ResultType & operator() (ResultType &res, Function &Iteration, PrimeIterator &primeiter)
 
template<class ResultType, class Function, class PrimeIterator>
bool operator() (int k, ResultType &res, Function &Iteration, PrimeIterator &primeiter, size_t NN=NUM_THREADS)
 
int iterCount () const
 How many iterations have been performed so far.
 
template<class ResultType, class Function, class PrimeIterator>
bool operator() (int k, ResultType &res, Function &Iteration, PrimeIterator &primeiter)
 Run the CRA loop a certain number of times.
 
template<class Param>
bool changeFactor (const Param &p)
 
template<class Param>
Param & getFactor (Param &p)
 
bool changePreconditioner (const Integer &f, const Integer &m=Integer(1))
 
IntegergetModulus (Integer &m)
 
IntegergetResidue (Integer &m)
 
Integerresult (Integer &m)
 
template<class Int, template< class, class > class Vect, template< class > class Alloc>
Vect< Int, Alloc< Int > > & result (Vect< Int, Alloc< Int > > &m)
 

Data Fields

const int MAXSKIP = 1000
 
const int MAXNONCOPRIME = 1000
 

Protected Member Functions

void doskip ()
 Call this when a bad prime is skipped.
 
template<class PrimeIterator>
auto get_coprime (PrimeIterator &primeiter) const -> decltype(*primeiter)
 Gets a prime from the iterator that is coprime to the curent modulus.
 

Protected Attributes

CRABase Builder_
 
int ngood_ = 0
 
int nbad_ = 0
 
int nskip_ = 0
 

Friends

std::ostream & operator<< (std::ostream &out, const Self_t &cra)
 

Member Typedef Documentation

◆ Domain

template<class CRABase>
typedef CRABase::Domain Domain

◆ DomainElement

template<class CRABase>
typedef CRABase::DomainElement DomainElement

◆ Father_t

template<class CRABase>
typedef ChineseRemainderSequential<CRABase> Father_t

◆ Self_t

template<class CRABase>
typedef ChineseRemainderParallel<CRABase> Self_t

Constructor & Destructor Documentation

◆ ChineseRemainderParallel() [1/2]

template<class CRABase>
template<class Param>
ChineseRemainderParallel ( const Param & b)
inline

◆ ChineseRemainderParallel() [2/2]

template<class CRABase>
ChineseRemainderParallel ( const CRABase & b)
inline

Member Function Documentation

◆ operator()() [1/3]

template<class CRABase>
template<class ResultType, class Function, class PrimeIterator>
ResultType & operator() ( ResultType & res,
Function & Iteration,
PrimeIterator & primeiter )
inline

◆ operator()() [2/3]

template<class CRABase>
template<class ResultType, class Function, class PrimeIterator>
bool operator() ( int k,
ResultType & res,
Function & Iteration,
PrimeIterator & primeiter,
size_t NN = NUM_THREADS )
inline

◆ doskip()

template<class CRABase>
void doskip ( )
inlineprotectedinherited

Call this when a bad prime is skipped.

◆ get_coprime()

template<class CRABase>
template<class PrimeIterator>
auto get_coprime ( PrimeIterator & primeiter) const -> decltype(*primeiter)
inlineprotectedinherited

Gets a prime from the iterator that is coprime to the curent modulus.

◆ iterCount()

template<class CRABase>
int iterCount ( ) const
inlineinherited

How many iterations have been performed so far.

(This used to be stored in the public field IterCounter.)

◆ operator()() [3/3]

template<class CRABase>
template<class ResultType, class Function, class PrimeIterator>
bool operator() ( int k,
ResultType & res,
Function & Iteration,
PrimeIterator & primeiter )
inlineinherited

Run the CRA loop a certain number of times.

This runs the CRA loop up to k times, or until termination if k is negative.

Parameters
kmaximum number of iterations, or run until termination if k is negative.
[out]resan integer
IterationFunction object of two arguments, Iteration(r, F), given prime field F it sets r to the residue(s) and returns an IterationResult to indicate how to incorporate the new residue. This loop may be parallelized. Iteration must be reentrant, thread safe. For example, Iteration may be returning the coefficients of the minimal polynomial of a matrix mod F.
primeiteriterator for generating primes.

◆ changeFactor()

template<class CRABase>
template<class Param>
bool changeFactor ( const Param & p)
inlineinherited

◆ getFactor()

template<class CRABase>
template<class Param>
Param & getFactor ( Param & p)
inlineinherited

◆ changePreconditioner()

template<class CRABase>
bool changePreconditioner ( const Integer & f,
const Integer & m = Integer(1) )
inlineinherited

◆ getModulus()

template<class CRABase>
Integer & getModulus ( Integer & m)
inlineinherited

◆ getResidue()

template<class CRABase>
Integer & getResidue ( Integer & m)
inlineinherited

◆ result() [1/2]

template<class CRABase>
Integer & result ( Integer & m)
inlineinherited

◆ result() [2/2]

template<class CRABase>
template<class Int, template< class, class > class Vect, template< class > class Alloc>
Vect< Int, Alloc< Int > > & result ( Vect< Int, Alloc< Int > > & m)
inlineinherited

Friends And Related Symbol Documentation

◆ operator<<

template<class CRABase>
std::ostream & operator<< ( std::ostream & out,
const Self_t & cra )
friend

Field Documentation

◆ MAXSKIP

template<class CRABase>
const int MAXSKIP = 1000
inherited

◆ MAXNONCOPRIME

template<class CRABase>
const int MAXNONCOPRIME = 1000
inherited

◆ Builder_

template<class CRABase>
CRABase Builder_
protectedinherited

◆ ngood_

template<class CRABase>
int ngood_ = 0
protectedinherited

◆ nbad_

template<class CRABase>
int nbad_ = 0
protectedinherited

◆ nskip_

template<class CRABase>
int nskip_ = 0
protectedinherited

The documentation for this struct was generated from the following file: