Givaro
|
This class implement the standard arithmetic with Modulo Elements. More...
#include <givzpz32uns.h>
Public Types | |
enum | { size_rep = sizeof(Residu_t) } |
typedef Unsigned32::type | Residu_t |
typedef Unsigned32::type | Rep |
typedef Unsigned32::type | Element |
typedef Rep * | Array |
typedef const Rep * | constArray |
typedef GIV_randIter< ZpzDom < Unsigned32 >, Rep > | randIter |
Public Member Functions | |
ZpzDom () | |
ZpzDom (Residu_t p) | |
ZpzDom (const ZpzDom< Unsigned32 > &F) | |
int | operator== (const ZpzDom< Unsigned32 > &BC) const |
int | operator!= (const ZpzDom< Unsigned32 > &BC) const |
ZpzDom< Unsigned32 > & | operator= (const ZpzDom< Unsigned32 > &F) |
Residu_t | residu () const |
Residu_t | size () const |
Rep | access (const Rep a) const |
Residu_t | characteristic () const |
Integer & | characteristic (Integer &p) const |
Residu_t | cardinality () const |
Rep & | init (Rep &a) const |
void | init (const size_t, Array a, constArray b) const |
Rep & | init (Rep &r, const long a) const |
Rep & | init (Rep &r, const unsigned long a) const |
Rep & | init (Rep &a, const int i) const |
Rep & | init (Rep &a, const unsigned int i) const |
Rep & | init (Rep &a, const Integer &i) const |
Rep & | init (Rep &a, const double i) const |
Rep & | init (Rep &a, const float i) const |
float & | convert (float &r, const Rep a) const |
double & | convert (double &r, const Rep a) const |
long int & | convert (long int &r, const Rep a) const |
unsigned long int & | convert (unsigned long int &r, const Rep a) const |
int32_t & | convert (int32_t &r, const Rep a) const |
uint32_t & | convert (uint32_t &r, const Rep a) const |
Integer & | convert (Integer &i, const Rep a) const |
int | isZero (const Rep a) const |
int | isOne (const Rep a) const |
size_t | length (const Rep a) const |
int | areEqual (const Rep &a, const Rep &b) const |
Rep & | mul (Rep &r, const Rep a, const Rep b) const |
Rep & | div (Rep &r, const Rep a, const Rep b) const |
Rep & | add (Rep &r, const Rep a, const Rep b) const |
Rep & | sub (Rep &r, const Rep a, const Rep b) const |
Rep & | neg (Rep &r, const Rep a) const |
Rep & | inv (Rep &r, const Rep a) const |
Rep & | mulin (Rep &r, const Rep a) const |
Rep & | divin (Rep &r, const Rep a) const |
Rep & | addin (Rep &r, const Rep a) const |
Rep & | subin (Rep &r, const Rep a) const |
Rep & | negin (Rep &r) const |
Rep & | invin (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 |
Rep & | axpy (Rep &r, const Rep a, const Rep b, const Rep c) const |
void | axpy (const size_t sz, Array r, constArray a, constArray x, constArray c) const |
Rep & | axpyin (Rep &r, const Rep a, const Rep b) const |
void | axpyin (const size_t sz, Array r, constArray a, constArray x) const |
Rep & | axmy (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 |
Rep & | axmyin (Rep &r, const Rep a, const Rep b) const |
Rep & | maxpy (Rep &r, const Rep a, const Rep b, const Rep c) const |
Rep & | maxpyin (Rep &r, const Rep a, const Rep b) const |
void | maxpyin (const size_t sz, Array r, constArray a, constArray x) const |
void | assign (const size_t sz, Array r, constArray a) const |
Rep & | assign (Rep &r, const Rep a) const |
Rep & | assign (Rep &r, const long a) const |
Rep & | assign (Rep &r, const unsigned long a) const |
Rep & | assign (Rep &r, const short a) const |
Rep & | assign (Rep &r, const unsigned short a) const |
template<class RandIter > | |
Rep & | random (RandIter &, Rep &r) const |
template<class RandIter > | |
Rep & | random (RandIter &, Rep &r, long s) const |
template<class RandIter > | |
Rep & | random (RandIter &, Rep &r, const Rep &b) const |
template<class RandIter > | |
Rep & | nonzerorandom (RandIter &, Rep &r) const |
template<class RandIter > | |
Rep & | nonzerorandom (RandIter &, Rep &r, long s) const |
template<class RandIter > | |
Rep & | nonzerorandom (RandIter &, Rep &r, const Rep &b) const |
Rep & | reduceadd (Rep &r, const size_t sz, constArray a) const |
Rep & | reducemul (Rep &r, const size_t sz, constArray a) const |
Rep & | dotprod (Rep &r, const size_t sz, constArray a, constArray b) const |
Rep & | dotprod (Rep &r, const int 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 |
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 |
Data Fields | |
const Rep | zero |
const Rep | one |
Protected Member Functions | |
int32_t & | gcdext (int32_t &d, int32_t &u, int32_t &v, const int32_t a, const int32_t b) const |
uint32_t & | invext (uint32_t &u, const uint32_t a, const uint32_t b) const |
Static Protected Member Functions | |
static void | Init () |
static void | End () |
Protected Attributes | |
Residu_t | _p |
double | _dp |
This class implement the standard arithmetic with Modulo Elements.
typedef Unsigned32::type Residu_t |
typedef Unsigned32::type Rep |
typedef Unsigned32::type Element |
typedef const Rep* constArray |
typedef GIV_randIter< ZpzDom<Unsigned32> , Rep > randIter |
ZpzDom | ( | ) | [inline] |
ZpzDom | ( | Residu_t | p | ) | [inline] |
ZpzDom | ( | const ZpzDom< Unsigned32 > & | F | ) | [inline] |
int operator== | ( | const ZpzDom< Unsigned32 > & | BC | ) | const [inline] |
int operator!= | ( | const ZpzDom< Unsigned32 > & | BC | ) | const [inline] |
ZpzDom<Unsigned32>& operator= | ( | const ZpzDom< Unsigned32 > & | F | ) | [inline] |
ZpzDom< Unsigned32 >::Residu_t residu | ( | ) | const [inline] |
Residu_t size | ( | ) | const [inline] |
Residu_t characteristic | ( | ) | const [inline] |
Residu_t cardinality | ( | ) | const [inline] |
ZpzDom< Unsigned32 >::Rep & init | ( | Rep & | a | ) | const [inline] |
void init | ( | const size_t | sz, |
Array | a, | ||
constArray | b | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & init | ( | Rep & | r, |
const long | a | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & init | ( | Rep & | r, |
const unsigned long | a | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & init | ( | Rep & | a, |
const int | i | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & init | ( | Rep & | a, |
const unsigned int | i | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & init | ( | Rep & | a, |
const Integer & | i | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & init | ( | Rep & | a, |
const double | i | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & init | ( | Rep & | a, |
const float | i | ||
) | const [inline] |
float& convert | ( | float & | r, |
const Rep | a | ||
) | const [inline] |
double& convert | ( | double & | r, |
const Rep | a | ||
) | const [inline] |
long int& convert | ( | long int & | r, |
const Rep | a | ||
) | const [inline] |
unsigned long int& convert | ( | unsigned long int & | r, |
const Rep | a | ||
) | const [inline] |
int isZero | ( | const Rep | a | ) | const [inline] |
int isOne | ( | const Rep | a | ) | const [inline] |
size_t length | ( | const Rep | a | ) | const [inline] |
ZpzDom< Unsigned32 >::Rep & mul | ( | Rep & | r, |
const Rep | a, | ||
const Rep | b | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & div | ( | Rep & | r, |
const Rep | a, | ||
const Rep | b | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & add | ( | Rep & | r, |
const Rep | a, | ||
const Rep | b | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & sub | ( | Rep & | r, |
const Rep | a, | ||
const Rep | b | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & neg | ( | Rep & | r, |
const Rep | a | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & inv | ( | Rep & | r, |
const Rep | a | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & mulin | ( | Rep & | r, |
const Rep | a | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & divin | ( | Rep & | r, |
const Rep | a | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & addin | ( | Rep & | r, |
const Rep | a | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & subin | ( | Rep & | r, |
const Rep | a | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & negin | ( | Rep & | r | ) | const [inline] |
ZpzDom< Unsigned32 >::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 |
void axpy | ( | const size_t | sz, |
Array | r, | ||
constArray | a, | ||
constArray | x, | ||
constArray | c | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & axpyin | ( | Rep & | r, |
const Rep | a, | ||
const Rep | b | ||
) | const [inline] |
void axpyin | ( | const size_t | sz, |
Array | r, | ||
constArray | a, | ||
constArray | x | ||
) | const [inline] |
void axmy | ( | const size_t | sz, |
Array | r, | ||
constArray | a, | ||
constArray | x, | ||
constArray | c | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & axmyin | ( | Rep & | r, |
const Rep | a, | ||
const Rep | b | ||
) | const [inline] |
ZpzDom< Unsigned32 >::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] |
void assign | ( | const size_t | sz, |
Array | r, | ||
constArray | a | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & assign | ( | Rep & | r, |
const Rep | a | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & assign | ( | Rep & | r, |
const long | a | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & assign | ( | Rep & | r, |
const unsigned long | a | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & assign | ( | Rep & | r, |
const short | a | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & assign | ( | Rep & | r, |
const unsigned short | a | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & random | ( | RandIter & | g, |
Rep & | r | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & random | ( | RandIter & | g, |
Rep & | r, | ||
long | s | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & random | ( | RandIter & | g, |
Rep & | r, | ||
const Rep & | b | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & nonzerorandom | ( | RandIter & | g, |
Rep & | r | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & nonzerorandom | ( | RandIter & | g, |
Rep & | r, | ||
long | s | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & nonzerorandom | ( | RandIter & | g, |
Rep & | r, | ||
const Rep & | b | ||
) | const [inline] |
Rep& reduceadd | ( | Rep & | r, |
const size_t | sz, | ||
constArray | a | ||
) | const |
Rep& reducemul | ( | Rep & | r, |
const size_t | sz, | ||
constArray | a | ||
) | const |
ZpzDom< Unsigned32 >::Rep & dotprod | ( | Rep & | r, |
const size_t | sz, | ||
constArray | a, | ||
constArray | b | ||
) | const [inline] |
ZpzDom< Unsigned32 >::Rep & dotprod | ( | Rep & | r, |
const int | 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] |
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] |
int32_t & gcdext | ( | int32_t & | d, |
int32_t & | u, | ||
int32_t & | v, | ||
const int32_t | a, | ||
const int32_t | b | ||
) | const [protected] |
void Init | ( | ) | [static, protected] |
void End | ( | ) | [static, protected] |
double _dp [protected] |