Givaro
Public Types | Public Member Functions | Static Public Member Functions | Data Fields
ZRing< _Element > Class Template Reference

Class ZRing. More...

#include <zring.h>

+ Inheritance diagram for ZRing< _Element >:
+ Collaboration diagram for ZRing< _Element >:

Public Types

enum  { size_rep = sizeof(Residu_t) }
 
using Element = _Element
 
using Rep = _Element
 
using Self_t = ZRing< Element >
 
using Residu_t = Element
 
using Element_ptr = Element *
 
using ConstElement_ptr = const Element *
 
typedef GeneralRingRandIter< Self_tRandIter
 
typedef GeneralRingNonZeroRandIter< Self_tNonZeroRandIter
 
typedef const Element ConstElement
 

Public Member Functions

 ZRing ()
 
 ZRing (const ZRing &F)
 
template<class T >
 ZRing (const T &)
 
Residu_t residu () const
 
Residu_t size () const
 
Residu_t cardinality () const
 
Residu_t characteristic () const
 
template<typename T >
T & cardinality (T &c) const
 
template<typename T >
T & characteristic (T &c) const
 
bool operator== (const Self_t &F) const
 
bool operator!= (const Self_t &F) const
 
ZRing< Element > & operator= (const ZRing< Element > &)
 
bool isZero (const Element &a) const
 
bool isOne (const Element &a) const
 
bool isMOne (const Element &a) const
 
Elementinit (Element &x) const
 
template<typename T >
Elementinit (Element &x, const T &s) const
 
Elementassign (Element &x, const Element &y) const
 
template<typename T >
T & convert (T &x, const Element &y) const
 
Elementreduce (Element &x, const Element &y) const
 
Elementreduce (Element &x) const
 
size_t minElement () const
 
size_t maxElement () const
 
template<class Random >
Elementrandom (const Random &g, Element &r) const
 
template<class Random >
Elementnonzerorandom (const Random &g, Element &a) const
 
std::ostream & write (std::ostream &os) const
 
std::ostream & write (std::ostream &os, const Element &a) const
 
std::istream & read (std::istream &is, Element &a) const
 Read field element. More...
 
Comparison Predicates
bool areEqual (const Element &x, const Element &y) const
 x == y More...
 
Arithmetic Operations

The first argument is set and is also the return value.

Elementadd (Element &x, const Element &y, const Element &z) const
 x := y + z More...
 
Elementsub (Element &x, const Element &y, const Element &z) const
 x := y - z More...
 
Elementmul (Element &x, const Element &y, const Element &z) const
 x := y*z More...
 
Elementdiv (Element &x, const Element &y, const Element &z) const
 x := y/z More...
 
Elementmod (Element &x, const Element &y, const Element &z) const
 x := y mod z More...
 
Elementneg (Element &x, const Element &y) const
 x := -y More...
 
Elementinv (Element &x, const Element &y) const
 x := 1/y More...
 
Elementaxpy (Element &z, const Element &a, const Element &x, const Element &y) const
 z := a*x + y More...
 
Elementaxpyin (Element &z, const Element &a, const Element &x) const
 z := a*x + z More...
 
Elementaxmy (Element &z, const Element &a, const Element &x, const Element &y) const
 z := a*x - y More...
 
Elementaxmyin (Element &z, const Element &a, const Element &x) const
 z := a*x - z More...
 
Elementmaxpy (Element &z, const Element &a, const Element &x, const Element &y) const
 z := y - a*x More...
 
Elementmaxpyin (Element &z, const Element &a, const Element &x) const
 z := z - a*x More...
 
Inplace Arithmetic Operations

The first argument is modified and the result is the return value.

Elementaddin (Element &x, const Element &y) const
 x := x + y More...
 
Elementsubin (Element &x, const Element &y) const
 x := x - y More...
 
Elementmulin (Element &x, const Element &y) const
 x := x*y More...
 
Elementdivin (Element &x, const Element &y) const
 x := x/y More...
 
Elementmodin (Element &x, const Element &y) const
 x := x mod y More...
 
Elementnegin (Element &x) const
 x := -x More...
 
Elementinvin (Element &x) const
 x := 1/x More...
 
Input/Output Operations
std::ostream & write (std::ostream &os, std::string F) const
 Print field. More...
 
std::istream & read (std::istream &is) const
 Read field. More...
 

Static Public Member Functions

static Residu_t maxCardinality ()
 
static Residu_t minCardinality ()
 

Data Fields

const Element one = 1
 
const Element zero = 0
 
const Element mOne = -1
 

Detailed Description

template<class _Element>
class Givaro::ZRing< _Element >

Class ZRing.

Ring of integers, using the _Element base type.

Member Typedef Documentation

using Element = _Element
using Rep = _Element
using Self_t = ZRing<Element>
using Residu_t = Element
using Element_ptr = Element*
using ConstElement_ptr = const Element*
typedef const Element ConstElement
inherited

Member Enumeration Documentation

anonymous enum
Enumerator
size_rep 

Constructor & Destructor Documentation

ZRing ( )
inline
ZRing ( const ZRing< _Element > &  F)
inline
ZRing ( const T &  )
inline

Member Function Documentation

Residu_t residu ( ) const
inline
Residu_t size ( ) const
inline
Residu_t cardinality ( ) const
inline
Residu_t characteristic ( ) const
inline
T& cardinality ( T &  c) const
inline
T& characteristic ( T &  c) const
inline
static Residu_t maxCardinality ( )
inlinestatic
static Residu_t minCardinality ( )
inlinestatic
bool operator== ( const Self_t F) const
inline
bool operator!= ( const Self_t F) const
inline
ZRing<Element>& operator= ( const ZRing< Element > &  )
inline
bool isZero ( const Element a) const
inlinevirtual
bool isOne ( const Element a) const
inlinevirtual
bool isMOne ( const Element a) const
inlinevirtual
Element& init ( Element x) const
inline
Element& init ( Element x,
const T &  s 
) const
inline
Element& assign ( Element x,
const Element y 
) const
inline
T& convert ( T &  x,
const Element y 
) const
inline
Element& reduce ( Element x,
const Element y 
) const
inline
Element& reduce ( Element x) const
inline
size_t minElement ( ) const
inline
size_t maxElement ( ) const
inline
Element& random ( const Random &  g,
Element r 
) const
inline
Element& nonzerorandom ( const Random &  g,
Element a 
) const
inline
std::ostream& write ( std::ostream &  os) const
inline
std::ostream& write ( std::ostream &  os,
const Element a 
) const
inline
std::istream& read ( std::istream &  is,
Element x 
) const
inlinevirtual

Read field element.

Returns
input stream from which field element is read.
Parameters
isinput stream from which field element is read.
xfield element.

Reimplemented from UnparametricOperations< _Element >.

bool areEqual ( const Element x,
const Element y 
) const
inlinevirtualinherited

x == y

Implements RingInterface< _Element >.

Element& add ( Element x,
const Element y,
const Element z 
) const
inlinevirtualinherited

x := y + z

Implements RingInterface< _Element >.

Element& sub ( Element x,
const Element y,
const Element z 
) const
inlinevirtualinherited

x := y - z

Implements RingInterface< _Element >.

Element& mul ( Element x,
const Element y,
const Element z 
) const
inlinevirtualinherited

x := y*z

Implements RingInterface< _Element >.

Element& div ( Element x,
const Element y,
const Element z 
) const
inlineinherited

x := y/z

Element& mod ( Element x,
const Element y,
const Element z 
) const
inlineinherited

x := y mod z

Element& neg ( Element x,
const Element y 
) const
inlinevirtualinherited

x := -y

Implements RingInterface< _Element >.

Element& inv ( Element x,
const Element y 
) const
inlineinherited

x := 1/y

Element& axpy ( Element z,
const Element a,
const Element x,
const Element y 
) const
inlinevirtualinherited

z := a*x + y

Implements RingInterface< _Element >.

Element& axpyin ( Element z,
const Element a,
const Element x 
) const
inlinevirtualinherited

z := a*x + z

Implements RingInterface< _Element >.

Element& axmy ( Element z,
const Element a,
const Element x,
const Element y 
) const
inlinevirtualinherited

z := a*x - y

Implements RingInterface< _Element >.

Element& axmyin ( Element z,
const Element a,
const Element x 
) const
inlinevirtualinherited

z := a*x - z

Implements RingInterface< _Element >.

Element& maxpy ( Element z,
const Element a,
const Element x,
const Element y 
) const
inlinevirtualinherited

z := y - a*x

Implements RingInterface< _Element >.

Element& maxpyin ( Element z,
const Element a,
const Element x 
) const
inlinevirtualinherited

z := z - a*x

Implements RingInterface< _Element >.

Element& addin ( Element x,
const Element y 
) const
inlinevirtualinherited

x := x + y

Implements RingInterface< _Element >.

Element& subin ( Element x,
const Element y 
) const
inlinevirtualinherited

x := x - y

Implements RingInterface< _Element >.

Element& mulin ( Element x,
const Element y 
) const
inlinevirtualinherited

x := x*y

Implements RingInterface< _Element >.

Element& divin ( Element x,
const Element y 
) const
inlineinherited

x := x/y

Element& modin ( Element x,
const Element y 
) const
inlineinherited

x := x mod y

Element& negin ( Element x) const
inlinevirtualinherited

x := -x

Implements RingInterface< _Element >.

Element& invin ( Element x) const
inlineinherited

x := 1/x

std::ostream& write ( std::ostream &  os,
std::string  F 
) const
inlineinherited

Print field.

Returns
output stream to which field is written.
Parameters
osoutput stream to which field is written.
std::istream& read ( std::istream &  is) const
inlineinherited

Read field.

Returns
input stream from which field is read.
Parameters
isinput stream from which field is read.

Field Documentation

const Element one = 1
const Element zero = 0
const Element mOne = -1

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