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

NO DOC. More...

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

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

Public Member Functions

template<template< class T > class Vect>
void initialize (const Integer &D, const Vect< Integer > &e)
 Init.
 
template<template< class T > class Vect>
void progress (const Integer &D, const Vect< Integer > &e)
 Progress.
 
template<class Vect >
void progress (const Domain &D, const Vect &e)
 
template<class OKDomain >
void progress (const Domain &D, const BlasVector< OKDomain > &e)
 
template<class Vect >
Vect & result (Vect &d)
 Result.
 
bool terminated ()
 terminate
 
template<typename ModType , typename ResType >
void initialize (const ModType &D, const ResType &e)
 Initialize the CRA with the first residue. More...
 
void initialize (const Integer &D, const Integer &e)
 Initialize the CRA with the first residue. More...
 
void initialize (const Domain &D, const DomainElement &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...
 
bool terminated () const
 Checks whether the CRA is (heuristically) finished. More...
 
decltype(Integer().bitsize()) modbits () const
 Returns a lower bound on the number of bits in the modulus.
 
template<typename ModType , class Vect >
void initialize (const ModType &D, const Vect &e)
 init
 
const std::vector< Integer > & result (bool normalized=true) const
 result
 

Protected Member Functions

template<class Vect1 , class Vect2 >
Integer & dot (Integer &z, const Integer &D, const Vect1 &v1, const Vect2 &v2)
 
template<class Vect1 , class Vect2 >
DomainElement & dot (DomainElement &z, const Domain &D, const Vect1 &v1, const Vect2 &v2)
 
bool progress_check (const Integer &D, const Integer &e)
 Update the residue and check whether it changed. More...
 
bool progress_check (const Domain &D, const DomainElement &e)
 Update the residue and check whether it changed. More...
 
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::CRABuilderEarlyMultip< Domain_Type >

NO DOC.

Member Function Documentation

◆ progress() [1/3]

void progress ( const Domain &  D,
const Vect &  e 
)
inline
Todo:
Could be much faster
  • do not compute twice the product of moduli
  • reconstruct one element of e until Early Termination, then only, try a random linear combination.

◆ progress() [2/3]

void progress ( const Domain &  D,
const BlasVector< OKDomain > &  e 
)
inline
Todo:
Could be much faster
  • do not compute twice the product of moduli
  • reconstruct one element of e until Early Termination, then only, try a random linear combination.

◆ dot() [1/2]

Integer& dot ( Integer &  z,
const Integer &  D,
const Vect1 &  v1,
const Vect2 &  v2 
)
inlineprotected
Bug:
why a dot product here ?

◆ dot() [2/2]

DomainElement& dot ( DomainElement &  z,
const Domain &  D,
const Vect1 &  v1,
const Vect2 &  v2 
)
inlineprotected
Bug:
why a dot product here ?

◆ initialize() [1/3]

void initialize ( const ModType &  D,
const ResType &  e 
)
inlineinherited

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
DThe modulus
eThe residue

◆ initialize() [2/3]

void initialize ( const Integer &  D,
const Integer &  e 
)
inlineinherited

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.

Parameters
DThe modulus
eThe residue

◆ initialize() [3/3]

void initialize ( const Domain &  D,
const DomainElement &  e 
)
inlineinherited

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.

Parameters
DThe modulus
eThe residue

◆ progress() [3/3]

void progress ( const ModType &  D,
const ResType &  e 
)
inlineinherited

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
DThe modulus of the new image
eThe residue modulo D

◆ terminated()

bool terminated ( ) const
inlineinherited

Checks whether the CRA is (heuristically) finished.

Returns
true iff the early termination condition has been reached.

◆ progress_check() [1/2]

bool progress_check ( const Integer &  D,
const Integer &  e 
)
inlineprotectedinherited

Update the residue and check whether it changed.

The eventually-recovered number will be congruent to e modulo D.

The initialize function should be called at least once before calling this one.

Parameters
DThe modulus of the new image
eThe residue modulo D
Returns
true iff the residue changed with this update

◆ progress_check() [2/2]

bool progress_check ( const Domain &  D,
const DomainElement &  e 
)
inlineprotectedinherited

Update the residue and check whether it changed.

The eventually-recovered number will be congruent to e modulo D.

The initialize function should be called at least once before calling this one.

Parameters
DThe modulus of the new image
eThe residue modulo D
Returns
true iff the residue changed with this update

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

void collapse ( ) const
inlineprotectedinherited

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: