Givaro
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Protected Attributes
Modular< Log16, Log16 > Class Template Reference

This class implement the standard arithmetic with Modulo Elements. More...

#include <modular-log16.h>

Public Types

enum  { size_rep = sizeof(Residu_t) }
 
typedef Modular< Log16 > Self_t
 
typedef uint16_t Residu_t
 
typedef int16_t Power_t
 
typedef Power_t Rep
 
typedef int16_t Element
 
typedef ElementElement_ptr
 
typedef const ElementConstElement_ptr
 
typedef Residu_tArray
 
typedef const Residu_tconstArray
 
typedef ModularRandIter< Self_tRandIter
 
typedef GeneralRingNonZeroRandIter< Self_tNonZeroRandIter
 

Public Member Functions

 Modular (Residu_t p=2)
 
 Modular (const Modular< Log16 > &F)
 
 ~Modular ()
 
bool operator== (const Modular< Log16 > &BC) const
 
bool operator!= (const Modular< Log16 > &BC) const
 
Modular< Log16 > & operator= (const Modular< Log16 > &F)
 
Residu_t residu () const
 
Residu_t size () const
 
Residu_t characteristic () const
 
Residu_t cardinality () const
 
template<class T >
T & characteristic (T &p) const
 
template<class T >
T & cardinality (T &p) const
 
int16_t & convert (int16_t &x, const Rep a) const
 
uint16_t & convert (uint16_t &x, const Rep a) const
 
uint32_t & convert (uint32_t &x, const Rep a) const
 
int32_t & convert (int32_t &x, const Rep a) const
 
uint64_t & convert (uint64_t &x, const Rep a) const
 
int64_t & convert (int64_t &x, const Rep a) const
 
double & convert (double &x, const Rep a) const
 
Integerconvert (Integer &i, const Rep a) const
 
Repinit (Rep &r) const
 
Repinit (Rep &r, const int64_t a) const
 
Repinit (Rep &a, const int32_t i) const
 
Repinit (Rep &r, const uint64_t a) const
 
Repinit (Rep &a, const uint32_t i) const
 
Repinit (Rep &a, const Integer &i) const
 
Repinit (Rep &a, const double i) const
 
Repinit (Rep &a, const float i) const
 
Repinit (Rep &a, const int16_t i) const
 
Repinit (Rep &r, const uint16_t a) const
 
Repassign (Rep &r, const Rep a) const
 
void assign (const size_t sz, Array r, constArray a) const
 
bool iszero (const Rep a) const
 
bool isone (const Rep a) const
 
bool ismone (const Rep a) const
 
bool isZero (const Rep a) const
 
bool isOne (const Rep a) const
 
bool isMOne (const Rep a) const
 
size_t length (const Rep a) const
 
bool areEqual (const Element &a, const Element &b) const
 
Repmul (Rep &r, const Rep a, const Rep b) const
 
Repdiv (Rep &r, const Rep a, const Rep b) const
 
Repadd (Rep &r, const Rep a, const Rep b) const
 
Repsub (Rep &r, const Rep a, const Rep b) const
 
Repneg (Rep &r, const Rep a) const
 
Repinv (Rep &r, const Rep a) const
 
Repmulin (Rep &r, const Rep a) const
 
Repdivin (Rep &r, const Rep a) const
 
Repaddin (Rep &r, const Rep a) const
 
Repsubin (Rep &r, const Rep a) const
 
Repnegin (Rep &r) const
 
Repinvin (Rep &r) const
 
void mul (const size_t sz, Array r, constArray a, constArray b) const
 
void mul (const size_t sz, Array r, constArray a, Rep b) const
 
void div (const size_t sz, Array r, constArray a, constArray b) const
 
void div (const size_t sz, Array r, constArray a, Rep b) const
 
void add (const size_t sz, Array r, constArray a, constArray b) const
 
void add (const size_t sz, Array r, constArray a, Rep b) const
 
void sub (const size_t sz, Array r, constArray a, constArray b) const
 
void sub (const size_t sz, Array r, constArray a, Rep b) const
 
void neg (const size_t sz, Array r, constArray a) const
 
void inv (const size_t sz, Array r, constArray a) const
 
Repaxpy (Rep &r, const Rep a, const Rep b, const Rep c) const
 
Repaxpyin (Rep &r, const Rep a, const Rep b) const
 
void axpy (const size_t sz, Array r, constArray a, constArray x, constArray c) const
 
void axpyin (const size_t sz, Array r, constArray a, constArray x) const
 
Repaxmy (Rep &r, const Rep a, const Rep b, const Rep c) const
 
void axmy (const size_t sz, Array r, constArray a, constArray x, constArray c) const
 
Repaxmyin (Rep &r, const Rep a, const Rep b) const
 
Repmaxpy (Rep &r, const Rep a, const Rep b, const Rep c) const
 
Repmaxpyin (Rep &r, const Rep a, const Rep b) const
 
void maxpyin (const size_t sz, Array r, constArray a, constArray x) const
 
Repreduceadd (Rep &r, const size_t sz, constArray a) const
 
Repreducemul (Rep &r, const size_t sz, constArray a) const
 
Repdotprod (Rep &r, const size_t sz, constArray a, constArray b) const
 
Repdotprod (Rep &r, const int32_t bound, const size_t sz, constArray a, constArray b) const
 
void i2d (const size_t sz, double *r, constArray a) const
 
void d2i (const size_t sz, Array r, const double *a) const
 
template<class Random >
Elementrandom (const Random &g, Element &r) const
 
template<class Random >
Elementnonzerorandom (const Random &g, Element &a) const
 
std::istream & read (std::istream &s)
 
std::ostream & write (std::ostream &s) const
 
std::istream & read (std::istream &s, Rep &a) const
 
std::ostream & write (std::ostream &s, const Rep a) const
 

Static Public Member Functions

static Residu_t maxCardinality ()
 
static Residu_t minCardinality ()
 

Data Fields

const Element zero
 
const Element one
 
const Element mOne
 

Protected Attributes

Residu_t _p
 
Residu_t _pmone
 
Power_t_tab_value2rep
 
Residu_t_tab_rep2value
 
Power_t_tab_mul
 
Power_t_tab_div
 
Power_t_tab_neg
 
Power_t_tab_addone
 
Power_t_tab_subone
 
Power_t_tab_mone
 
Power_t_tab_pone
 
int * numRefs
 

Detailed Description

template<>
class Givaro::Modular< Log16, Log16 >

This class implement the standard arithmetic with Modulo Elements.

Member Typedef Documentation

typedef Modular<Log16> Self_t
typedef uint16_t Residu_t
typedef int16_t Power_t
typedef Power_t Rep
typedef int16_t Element
typedef Element* Element_ptr
typedef const Element* ConstElement_ptr
typedef Residu_t* Array
typedef const Residu_t* constArray

Member Enumeration Documentation

anonymous enum
Enumerator
size_rep 

Constructor & Destructor Documentation

Modular ( Residu_t  p = 2)
inline
Modular ( const Modular< Log16 > &  F)
inline
~Modular ( )
inline

Member Function Documentation

bool operator== ( const Modular< Log16 > &  BC) const
inline
bool operator!= ( const Modular< Log16 > &  BC) const
inline
Modular< Log16, Log16 > & operator= ( const Modular< Log16 > &  F)
inline
Modular< Log16, Log16 >::Residu_t residu ( ) const
inline
Residu_t size ( ) const
inline
Residu_t characteristic ( ) const
inline
Residu_t cardinality ( ) const
inline
T& characteristic ( T &  p) const
inline
T& cardinality ( T &  p) const
inline
int16_t& convert ( int16_t &  x,
const Rep  a 
) const
inline
uint16_t& convert ( uint16_t &  x,
const Rep  a 
) const
inline
uint32_t& convert ( uint32_t &  x,
const Rep  a 
) const
inline
int32_t& convert ( int32_t &  x,
const Rep  a 
) const
inline
uint64_t& convert ( uint64_t &  x,
const Rep  a 
) const
inline
int64_t& convert ( int64_t &  x,
const Rep  a 
) const
inline
double& convert ( double &  x,
const Rep  a 
) const
inline
Integer& convert ( Integer i,
const Rep  a 
) const
inline
Modular< Log16, Log16 >::Rep & init ( Rep r) const
inline
Modular< Log16, Log16 >::Rep & init ( Rep r,
const int64_t  a 
) const
inline
Modular< Log16, Log16 >::Rep & init ( Rep a,
const int32_t  i 
) const
inline
Modular< Log16, Log16 >::Rep & init ( Rep r,
const uint64_t  a 
) const
inline
Modular< Log16, Log16 >::Rep & init ( Rep a,
const uint32_t  i 
) const
inline
Modular< Log16, Log16 >::Rep & init ( Rep a,
const Integer i 
) const
inline
Modular< Log16, Log16 >::Rep & init ( Rep a,
const double  i 
) const
inline
Modular< Log16, Log16 >::Rep & init ( Rep a,
const float  i 
) const
inline
Modular< Log16, Log16 >::Rep & init ( Rep a,
const int16_t  i 
) const
inline
Modular< Log16, Log16 >::Rep & init ( Rep r,
const uint16_t  a 
) const
inline
Modular< Log16, Log16 >::Rep & assign ( Rep r,
const Rep  a 
) const
inline
void assign ( const size_t  sz,
Array  r,
constArray  a 
) const
inline
bool iszero ( const Rep  a) const
inline
bool isone ( const Rep  a) const
inline
bool ismone ( const Rep  a) const
inline
bool isZero ( const Rep  a) const
inline
bool isOne ( const Rep  a) const
inline
bool isMOne ( const Rep  a) const
inline
size_t length ( const Rep  a) const
inline
bool areEqual ( const Element a,
const Element b 
) const
inline
Modular< Log16, Log16 >::Rep & mul ( Rep r,
const Rep  a,
const Rep  b 
) const
inline
Modular< Log16, Log16 >::Rep & div ( Rep r,
const Rep  a,
const Rep  b 
) const
inline
Modular< Log16, Log16 >::Rep & add ( Rep r,
const Rep  a,
const Rep  b 
) const
inline
Modular< Log16, Log16 >::Rep & sub ( Rep r,
const Rep  a,
const Rep  b 
) const
inline
Modular< Log16, Log16 >::Rep & neg ( Rep r,
const Rep  a 
) const
inline
Modular< Log16, Log16 >::Rep & inv ( Rep r,
const Rep  a 
) const
inline
Modular< Log16, Log16 >::Rep & mulin ( Rep r,
const Rep  a 
) const
inline
Modular< Log16, Log16 >::Rep & divin ( Rep r,
const Rep  a 
) const
inline
Modular< Log16, Log16 >::Rep & addin ( Rep r,
const Rep  a 
) const
inline
Modular< Log16, Log16 >::Rep & subin ( Rep r,
const Rep  a 
) const
inline
Modular< Log16, Log16 >::Rep & negin ( Rep r) const
inline
Modular< Log16, Log16 >::Rep & invin ( Rep r) const
inline
void mul ( const size_t  sz,
Array  r,
constArray  a,
constArray  b 
) const
inline
void mul ( const size_t  sz,
Array  r,
constArray  a,
Rep  b 
) const
inline
void div ( const size_t  sz,
Array  r,
constArray  a,
constArray  b 
) const
inline
void div ( const size_t  sz,
Array  r,
constArray  a,
Rep  b 
) const
inline
void add ( const size_t  sz,
Array  r,
constArray  a,
constArray  b 
) const
inline
void add ( const size_t  sz,
Array  r,
constArray  a,
Rep  b 
) const
inline
void sub ( const size_t  sz,
Array  r,
constArray  a,
constArray  b 
) const
inline
void sub ( const size_t  sz,
Array  r,
constArray  a,
Rep  b 
) const
inline
void neg ( const size_t  sz,
Array  r,
constArray  a 
) const
inline
void inv ( const size_t  sz,
Array  r,
constArray  a 
) const
Modular< Log16, Log16 >::Rep & axpy ( Rep r,
const Rep  a,
const Rep  b,
const Rep  c 
) const
inline
Modular< Log16, Log16 >::Rep & axpyin ( Rep r,
const Rep  a,
const Rep  b 
) const
inline
void axpy ( const size_t  sz,
Array  r,
constArray  a,
constArray  x,
constArray  c 
) const
inline
void axpyin ( const size_t  sz,
Array  r,
constArray  a,
constArray  x 
) const
inline
Modular< Log16, Log16 >::Rep & axmy ( Rep r,
const Rep  a,
const Rep  b,
const Rep  c 
) const
inline
void axmy ( const size_t  sz,
Array  r,
constArray  a,
constArray  x,
constArray  c 
) const
inline
Modular< Log16, Log16 >::Rep & axmyin ( Rep r,
const Rep  a,
const Rep  b 
) const
inline
Modular< Log16, Log16 >::Rep & maxpy ( Rep r,
const Rep  a,
const Rep  b,
const Rep  c 
) const
inline
Modular< Log16, Log16 >::Rep & maxpyin ( Rep r,
const Rep  a,
const Rep  b 
) const
inline
void maxpyin ( const size_t  sz,
Array  r,
constArray  a,
constArray  x 
) const
inline
Rep& reduceadd ( Rep r,
const size_t  sz,
constArray  a 
) const
Rep& reducemul ( Rep r,
const size_t  sz,
constArray  a 
) const
Modular< Log16, Log16 >::Rep & dotprod ( Rep r,
const size_t  sz,
constArray  a,
constArray  b 
) const
inline
Modular< Log16, Log16 >::Rep & dotprod ( Rep r,
const int32_t  bound,
const size_t  sz,
constArray  a,
constArray  b 
) const
inline
void i2d ( const size_t  sz,
double *  r,
constArray  a 
) const
inline
void d2i ( const size_t  sz,
Array  r,
const double *  a 
) const
inline
Element& random ( const Random &  g,
Element r 
) const
inline
Element& nonzerorandom ( const Random &  g,
Element a 
) const
inline
std::istream & read ( std::istream &  s)
inline
std::ostream & write ( std::ostream &  s) const
inline
std::istream & read ( std::istream &  s,
Rep a 
) const
inline
std::ostream & write ( std::ostream &  s,
const Rep  a 
) const
inline
static Residu_t maxCardinality ( )
inlinestatic
static Residu_t minCardinality ( )
inlinestatic

Field Documentation

Residu_t _p
protected
Residu_t _pmone
protected
Power_t* _tab_value2rep
protected
Residu_t* _tab_rep2value
protected
Power_t* _tab_mul
protected
Power_t* _tab_div
protected
Power_t* _tab_neg
protected
Power_t* _tab_addone
protected
Power_t* _tab_subone
protected
Power_t* _tab_mone
protected
Power_t* _tab_pone
protected
int* numRefs
protected
const Element zero
const Element one
const Element mOne

The documentation for this class was generated from the following files: