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

Chinese remaindering of a vector of elements without early termination. More...

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

+ Inheritance diagram for CRABuilderFullMultip< Domain_Type >:

Public Member Functions

 CRABuilderFullMultip (const double bnd=0.0, size_t dim=0)
 Creates a new vector CRA object. 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::CRABuilderFullMultip< Domain_Type >

Chinese remaindering of a vector of elements without early termination.

  • Jean-Guillaume Dumas, Thierry Gautier et Jean-Louis Roch. Generic design of Chinese remaindering schemes PASCO 2010, pp 26-34, 21-23 juillet, Grenoble, France.

The idea is that each "shelf" contains a vector of residues with some modulus. We want to combine shelves that have roughly the same size of modulus, for efficiency. The method is that any submitted residue is assigned to a unique shelf according to log2(log(modulus)), as computed by the getShelf() helper. When two residues belong on the same shelf, they are combined and re-assigned to another shelf, recursively.

Constructor & Destructor Documentation

◆ CRABuilderFullMultip()

CRABuilderFullMultip ( const double  bnd = 0.0,
size_t  dim = 0 

Creates a new vector CRA object.

bndupper bound on the natural logarithm of the result
dimdimension of the vector to be reconstructed

Member Function Documentation

◆ 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: