linbox
ChineseRemainderSequential< CRABase > Struct Template Reference

No doc. More...

#include <cra-domain-sequential.h>

+ Inheritance diagram for ChineseRemainderSequential< CRABase >:

Data Structures

struct  PrimeSampler
 Helper class to sample unique primes. More...
 
struct  PrimeSampler< PrimeIterator, true >
 Helper class to sample unique primes. More...
 

Public Types

typedef CRABase::Domain Domain
 
typedef CRABase::DomainElement DomainElement
 

Public Member Functions

template<typename... Args>
 ChineseRemainderSequential (Args &&... args)
 Pass-through constructor to create the underlying builder.
 
int iterCount () const
 How many iterations have been performed so far.
 
template<class ResultType, class Function, class PrimeIterator>
ResultType & operator() (ResultType &res, Function &Iteration, PrimeIterator &primeiter)
 The Chinese Remaindering Algorithm loop.
 
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
 

Detailed Description

template<class CRABase>
struct LinBox::ChineseRemainderSequential< CRABase >

No doc.

Member Typedef Documentation

◆ Domain

template<class CRABase>
typedef CRABase::Domain Domain

◆ DomainElement

template<class CRABase>
typedef CRABase::DomainElement DomainElement

Constructor & Destructor Documentation

◆ ChineseRemainderSequential()

template<class CRABase>
template<typename... Args>
ChineseRemainderSequential ( Args &&... args)
inline

Pass-through constructor to create the underlying builder.

Member Function Documentation

◆ doskip()

template<class CRABase>
void doskip ( )
inlineprotected

Call this when a bad prime is skipped.

◆ get_coprime()

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

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

◆ iterCount()

template<class CRABase>
int iterCount ( ) const
inline

How many iterations have been performed so far.

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

◆ operator()() [1/2]

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

The Chinese Remaindering Algorithm 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.

Parameters
[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.

◆ operator()() [2/2]

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

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)
inline

◆ getFactor()

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

◆ changePreconditioner()

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

◆ getModulus()

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

◆ getResidue()

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

◆ result() [1/2]

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

◆ 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)
inline

Field Documentation

◆ MAXSKIP

template<class CRABase>
const int MAXSKIP = 1000

◆ MAXNONCOPRIME

template<class CRABase>
const int MAXNONCOPRIME = 1000

◆ Builder_

template<class CRABase>
CRABase Builder_
protected

◆ ngood_

template<class CRABase>
int ngood_ = 0
protected

◆ nbad_

template<class CRABase>
int nbad_ = 0
protected

◆ nskip_

template<class CRABase>
int nskip_ = 0
protected

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