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 Rep * Array
 Representation of vector of the Element.
typedef const Rep * constArray
 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.
Rep & init (Rep &a) const
 Init a representation.
void init (const size_t, Array a, constArray b) const
 Init a representation.
Rep & init (Rep &r, const long int a) const
 Init a representation.
Rep & init (Rep &r, const unsigned long int a) const
 Init a representation.
Rep & init (Rep &a, const int i) const
 Init a representation.
Rep & init (Rep &a, const unsigned int i) const
 Init a representation.
Rep & init (Rep &a, const IntType &i) const
 Init a representation.
Rep & init (Rep &a, const double i) const
 Init a representation.
Rep & init (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.
size_t length (const Rep &a) const
 Misc methods.
Rep & mul (Rep &r, const Rep &a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
Rep & div (Rep &r, const Rep &a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
Rep & add (Rep &r, const Rep &a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
Rep & sub (Rep &r, const Rep &a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
Rep & neg (Rep &r, const Rep &a) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
Rep & inv (Rep &r, const Rep &a) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
Rep & mulin (Rep &r, const Rep &a) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
Rep & divin (Rep &r, const Rep &a) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
Rep & addin (Rep &r, const Rep &a) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
Rep & subin (Rep &r, const Rep &a) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
Rep & negin (Rep &r) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
Rep & invin (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.
Rep & axpy (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.
Rep & axpyin (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.
Rep & axmy (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.
Rep & axmyin (Rep &r, const Rep &a, const Rep &b) const
 Operations with reduction: r <- a op b mod p, r <- op a mod p.
Rep & maxpy (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.
Rep & maxpyin (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.
Rep & assign (Rep &r, const Rep &a) const
 Misc: r <- a mod p.
Rep & assign (Rep &r, const long a) const
 Misc: r <- a mod p.
Rep & assign (Rep &r, const unsigned long a) const
 Misc: r <- a mod p.
Rep & assign (Rep &r, const short a) const
 Misc: r <- a mod p.
Rep & assign (Rep &r, const unsigned short a) const
 Misc: r <- a mod p.
Rep & reduceadd (Rep &r, const size_t sz, constArray a) const
 Misc.
Rep & reducemul (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.
const Rep one
 1
const Rep mOne
 -1

Protected Attributes

Residu_t _p
 data representation of the domain:
typedef GIV_randIter< ZpzDom
< IntType >, Rep > 
randIter
 Random.
template<class RandIter >
Rep & random (RandIter &, Rep &r) const
 Random.
template<class RandIter >
Rep & random (RandIter &, Rep &r, long s) const
 Random.
template<class RandIter >
Rep & random (RandIter &, Rep &r, const Rep &b) const
 Random.
template<class RandIter >
Rep & nonzerorandom (RandIter &, Rep &r) const
 Random.
template<class RandIter >
Rep & nonzerorandom (RandIter &, Rep &r, long s) const
 Random.
template<class RandIter >
Rep & nonzerorandom (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: