linbox
Data Structures | Public Member Functions | Protected Member Functions
ChineseRemainderSequential< CRABase > Struct Template Reference

No doc. More...

#include <cra-domain-sequential.h>

Inherited by ChineseRemainderOMP< CRABase >.

Data Structures

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

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. More...
 
template<class ResultType , class Function , class PrimeIterator >
ResultType & operator() (ResultType &res, Function &Iteration, PrimeIterator &primeiter)
 The Chinese Remaindering Algorithm loop. More...
 
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. More...
 

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.
 

Detailed Description

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

No doc.

Member Function Documentation

◆ iterCount()

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]

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]

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.

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