Public Member Functions | Protected Member Functions | Static Protected Member Functions
CRABuilderFullMultipFixed< Domain_Type > Struct Template Reference

Chinese Remaindering Algorithm for multiple residues. More...

#include <cra-builder-full-multip-fixed.h>

+ Inheritance diagram for CRABuilderFullMultipFixed< Domain_Type >:
+ Collaboration diagram for CRABuilderFullMultipFixed< Domain_Type >:

Public Member Functions

 CRABuilderFullMultipFixed (const std::pair< size_t, double > &p)
 Constructor. More...
template<class Iterator >
void initialize (const Domain &D, Iterator &e)
 Intialize to the first residue/prime. More...
template<class Iterator >
void progress (const Domain &D, Iterator &e)
 Add a new residue (ie take into account a new prime). More...
template<class Iterator >
void result (Iterator &d) const
 Compute the result. More...
template<typename ModType , class Vect >
void initialize (const ModType &D, const Vect &e)
const std::vector< Integer > & result (bool normalized=true) const

Protected Member Functions

void collapse () const
 Collapses all shelves by combining residues. More...
void normalize () const
 Collapses (if necessary) the top shelf and normalizes the result into the symmetric modulus range.

Static Protected Member Functions

static size_t getShelf (double logmod)
 Returns the index where the shelf (with specified natural log of modulus) belongs.
static const integermod_to_integer (const Integer &D)
 Returns a reference to D. More...
template<class Domain >
static integer mod_to_integer (const Domain &D)
 Returns the characteristic of D.
static void combineShelves (Shelf &dest, const Shelf &src)
 Incorporates the residue in src into dest and updates the modulus.
static void ensureShelf (size_t index, std::vector< Shelf > &shelves, size_t dim)
 Expands the shelves as necessary so that the given index exists in the array.

Detailed Description

template<class Domain_Type>
struct LinBox::CRABuilderFullMultipFixed< Domain_Type >

Chinese Remaindering Algorithm for multiple residues.

An upper bound is given on the size of the data to reconstruct.

Constructor & Destructor Documentation

◆ CRABuilderFullMultipFixed()

CRABuilderFullMultipFixed ( const std::pair< size_t, double > &  p)


pis a pair such that
  • p.first is the size of a residue (ie. it would be 1 for "FullSingle")
  • p.second is the theoretical upperbound (log2) on the size of the integers to reconstruct.

Member Function Documentation

◆ initialize()

void initialize ( const Domain &  D,
Iterator &  e 

Intialize to the first residue/prime.

eiterator on the first residue
any CRA should first call initialize before progress

◆ progress()

void progress ( const Domain &  D,
Iterator &  e 

Add a new residue (ie take into account a new prime).

eiterator for the new residue, for instance, a std::vector<T>::iterator.

◆ result()

void result ( Iterator &  d) const

Compute the result.

moves low occupied shelves up.

[out]dan iterator for the result.

◆ mod_to_integer()

static const integer& mod_to_integer ( const Integer &  D)

Returns a reference to D.

This is needed to automatically handle whether D is a Domain or an actual integer.

◆ collapse()

void collapse ( ) const

Collapses all shelves by combining residues.

After this, there will be a single (top) shelf containing the current full residue.

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