Chinese Remaindering with full precision and no chance of failure.
More...
#include <cra-builder-single.h>
|
| CRABuilderFullSingle (const size_t bitbound) |
| Creates a new deterministic CRA object. More...
|
|
template<typename ModType , typename ResType > |
void | initialize (const ModType &D, const ResType &e) |
| Initialize the CRA with the first residue. More...
|
|
template<typename ModType , typename ResType > |
void | progress (const ModType &D, const ResType &e) |
| Update the residue and termination condition. More...
|
|
const Integer & | getResidue () const |
| Gets the result recovered so far.
|
|
Integer & | getResidue (Integer &r) const |
| Gets the result recovered so far.
|
|
Integer & | result (Integer &r) const |
| alias for getResidue
|
|
template<typename ModType , class Vect > |
void | initialize (const ModType &D, const Vect &e) |
| init
|
|
const std::vector< Integer > & | result (bool normalized=true) const |
| result
|
|
|
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 size_t | getShelf (double logmod) |
| Returns the index where the shelf (with specified natural log of modulus) belongs.
|
|
static const integer & | mod_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.
|
|
template<class Domain_Type>
struct LinBox::CRABuilderFullSingle< Domain_Type >
Chinese Remaindering with full precision and no chance of failure.
◆ CRABuilderFullSingle()
Creates a new deterministic CRA object.
- Parameters
-
bitbound | An upper bound on the number of bits in the result. |
failprob | An upper bound on the probability of failure. |
◆ initialize()
void initialize |
( |
const ModType & |
D, |
|
|
const ResType & |
e |
|
) |
| |
|
inline |
Initialize the CRA with the first residue.
The eventually-recovered number will be congruent to e modulo D. This function must be called just once. Subsequent calls should be made to the progress() function.
Either the types of D and e should both be Integer, or D is the domain type (e.g., Modular<double>) and e is the element type (e.g., double)
- Parameters
-
D | The modulus |
e | The residue |
◆ progress()
void progress |
( |
const ModType & |
D, |
|
|
const ResType & |
e |
|
) |
| |
|
inline |
Update the residue and termination condition.
The eventually-recovered number will be congruent to e modulo D.
The initialize function must be called at least once before calling this one.
Either the types of D and e should both be Integer, or D is the domain type (e.g., Modular<double>) and e is the element type (e.g., double)
- Parameters
-
D | The modulus of the new image |
e | The residue modulo D |
◆ mod_to_integer()
static const integer& mod_to_integer |
( |
const Integer & |
D | ) |
|
|
inlinestaticprotectedinherited |
Returns a reference to D.
This is needed to automatically handle whether D is a Domain or an actual integer.
◆ collapse()
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: