Givaro
Public Types | Public Member Functions | Protected Attributes
ZpzDom< IntType > Class Template Reference

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

#include <givzpzGen.h>

Public Types

typedef IntType Residu_t
 type to store residue
 
typedef IntType Rep
 Representation of Element of the domain ZpzDom.
 
typedef RepArray
 Representation of vector of the Element.
 
typedef const RepconstArray
 Representation of vector of the Element.
 

Public Member Functions

ZpzDom< IntType > & operator= (const ZpzDom< IntType > &F)
 Copy.
 
 ZpzDom ()
 Constructor.
 
 ZpzDom (Residu_t p)
 Constructor.
 
 ZpzDom (const ZpzDom< IntType > &F)
 Constructor.
 
int operator== (const ZpzDom< IntType > &BC) const
 (in)Equality
 
int operator!= (const ZpzDom< IntType > &BC) const
 (in)Equality
 
int areEqual (const Rep &a, const Rep &b) const
 (in)Equality
 
Residu_t residu () const
 Access to the modulus.
 
Residu_t size () const
 Access to the modulus.
 
Rep access (const Rep &a) const
 Access to the modulus.
 
Residu_t characteristic () const
 Access to the modulus.
 
Residu_t characteristic (Residu_t p) const
 Access to the modulus.
 
Residu_t cardinality () const
 Access to the modulus.
 
Repinit (Rep &a) const
 Init a representation.
 
void init (const size_t, Array a, constArray b) const
 Init a representation.
 
Repinit (Rep &r, const long int a) const
 Init a representation.
 
Repinit (Rep &r, const unsigned long int a) const
 Init a representation.
 
Repinit (Rep &a, const int i) const
 Init a representation.
 
Repinit (Rep &a, const unsigned int i) const
 Init a representation.
 
Repinit (Rep &a, const IntType &i) const
 Init a representation.
 
Repinit (Rep &a, const double i) const
 Init a representation.
 
Repinit (Rep &a, const float i) const
 Init a representation.
 
float & convert (float &r, const Rep &a) const
 Conversion.
 
double & convert (double &r, const Rep &a) const
 Conversion.
 
long int & convert (long int &r, const Rep &a) const
 Conversion.
 
unsigned long int & convert (unsigned long int &r, const Rep &a) const
 Conversion.
 
IntType & convert (IntType &i, const Rep &a) const
 Conversion.
 
int isZero (const Rep &a) const
 Misc methods.
 
int isOne (const Rep &a) const
 Misc methods.
 
int isMOne (const Rep &a) const
 Misc methods.
 
size_t length (const Rep &a) const
 Misc methods.
 
Repmul (Rep &r, const Rep &a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repdiv (Rep &r, const Rep &a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repadd (Rep &r, const Rep &a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repsub (Rep &r, const Rep &a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repneg (Rep &r, const Rep &a) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repinv (Rep &r, const Rep &a) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repmulin (Rep &r, const Rep &a) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repdivin (Rep &r, const Rep &a) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repaddin (Rep &r, const Rep &a) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repsubin (Rep &r, const Rep &a) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repnegin (Rep &r) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repinvin (Rep &r) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
void mul (const size_t sz, Array r, constArray a, constArray b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
void mul (const size_t sz, Array r, constArray a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
void div (const size_t sz, Array r, constArray a, constArray b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
void div (const size_t sz, Array r, constArray a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
void add (const size_t sz, Array r, constArray a, constArray b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
void add (const size_t sz, Array r, constArray a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
void sub (const size_t sz, Array r, constArray a, constArray b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
void sub (const size_t sz, Array r, constArray a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
void neg (const size_t sz, Array r, constArray a) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
void inv (const size_t sz, Array r, constArray a) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repaxpy (Rep &r, const Rep &a, const Rep &b, const Rep &c) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
void axpy (const size_t sz, Array r, constArray a, constArray x, constArray c) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repaxpyin (Rep &r, const Rep &a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
void axpyin (const size_t sz, Array r, constArray a, constArray x) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repaxmy (Rep &r, const Rep &a, const Rep &b, const Rep &c) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
void axmy (const size_t sz, Array r, constArray a, constArray x, constArray c) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repaxmyin (Rep &r, const Rep &a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repmaxpy (Rep &r, const Rep &a, const Rep &b, const Rep &c) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
Repmaxpyin (Rep &r, const Rep &a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
void maxpyin (const size_t sz, Array r, constArray a, constArray x) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
 
void assign (const size_t sz, Array r, constArray a) const
 Misc: r <- a mod p.
 
Repassign (Rep &r, const Rep &a) const
 Misc: r <- a mod p.
 
Repassign (Rep &r, const long a) const
 Misc: r <- a mod p.
 
Repassign (Rep &r, const unsigned long a) const
 Misc: r <- a mod p.
 
Repassign (Rep &r, const short a) const
 Misc: r <- a mod p.
 
Repassign (Rep &r, const unsigned short a) const
 Misc: r <- a mod p.
 
Repreduceadd (Rep &r, const size_t sz, constArray a) const
 Misc.
 
Repreducemul (Rep &r, const size_t sz, constArray a) const
 Misc.
 
void i2d (const size_t sz, double *r, constArray a) const
 Misc.
 
void d2i (const size_t sz, Array r, const double *a) const
 Misc.
 
std::istream & read (std::istream &s)
 IO methods.
 
std::ostream & write (std::ostream &s) const
 IO methods.
 
std::istream & read (std::istream &s, Rep &a) const
 IO methods.
 
std::ostream & write (std::ostream &s, const Rep &a) const
 IO methods.
 

Data Fields

const Rep zero
 Constantes. More...
 
const Rep one
 1
 
const Rep mOne
 -1
 

Protected Attributes

Residu_t _p
 data representation of the domain:
 
typedef GIV_randIter< ZpzDom< IntType >, ReprandIter
 Random.
 
template<class RandIter >
Reprandom (RandIter &, Rep &r) const
 Random.
 
template<class RandIter >
Reprandom (RandIter &, Rep &r, long s) const
 Random.
 
template<class RandIter >
Reprandom (RandIter &, Rep &r, const Rep &b) const
 Random.
 
template<class RandIter >
Repnonzerorandom (RandIter &, Rep &r) const
 Random.
 
template<class RandIter >
Repnonzerorandom (RandIter &, Rep &r, long s) const
 Random.
 
template<class RandIter >
Repnonzerorandom (RandIter &, Rep &r, const Rep &b) const
 Random.
 

Detailed Description

template<typename IntType>
class Givaro::ZpzDom< IntType >

This class implement the standard arithmetic with Modulo Elements.

Field Documentation

const Rep zero

Constantes.

0


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