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

#include <zring.h>

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

Public Types

enum  
 
using Element = Element
 
using Rep = Element
 
using Residu_t = Element
 
using Element_ptr = Element *
 
using ConstElement_ptr = const Element *
 
typedef DomainRandIter< Self_t >::RandIter RandIter
 
typedef GeneralRingNonZeroRandIter< Self_tNonZeroRandIter
 
typedef const Element ConstElement
 

Public Member Functions

Residu_t residu () const
 
Residu_t size () const
 
Residu_t cardinality () const
 
T & cardinality (T &c) const
 
Residu_t characteristic () const
 
T & characteristic (T &c) const
 
bool operator== (const Self_t &F) const
 
bool operator!= (const Self_t &F) const
 
bool isZero (const Element &a) const
 
bool isOne (const Element &a) const
 
bool isMOne (const Element &a) const
 
bool isUnit (const Element &a) const
 
Elementabs (Element &x, const Element &a) const
 
Element abs (const Element &a) const
 
long compare (const Element &a, const Element &b) const
 
Elementinit (Element &x) const
 
Elementinit (Element &x, const T &s) const
 
Elementassign (Element &x, const Element &y) const
 
T & convert (T &x, const Element &y) const
 
Elementreduce (Element &x, const Element &y) const
 
Elementreduce (Element &x) const
 
Element minElement () const
 
Element maxElement () const
 
Elementrandom (const Random &g, Element &r) const
 
Elementnonzerorandom (const Random &g, Element &a) const
 
std::ostream & write (std::ostream &os) const
 Print field. More...
 
std::ostream & write (std::ostream &os, const Element &a) const
 Print field element. More...
 
std::istream & read (std::istream &is, Element &a) const
 Read field element. More...
 
Input/Output Operations
std::ostream & write (std::ostream &os, std::string F) const
 Read field. More...
 
std::istream & read (std::istream &is) const
 Read field. 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...
 

Static Public Member Functions

static Residu_t maxCardinality ()
 
static Residu_t minCardinality ()
 
static const std::string type_string ()
 

Data Fields

const Element one
 
const Element zero
 
const Element mOne
 

Member Typedef Documentation

◆ Element

using Element = Element
inherited

◆ Rep

using Rep = Element
inherited

◆ Residu_t

using Residu_t = Element
inherited

◆ Element_ptr

using Element_ptr = Element*
inherited

◆ ConstElement_ptr

using ConstElement_ptr = const Element*
inherited

◆ RandIter

typedef DomainRandIter<Self_t>::RandIter RandIter
inherited

◆ NonZeroRandIter

◆ ConstElement

typedef const Element ConstElement
inherited

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

Member Function Documentation

◆ residu()

Residu_t residu ( ) const
inlineinherited

◆ size()

Residu_t size ( ) const
inlineinherited

◆ cardinality() [1/2]

Residu_t cardinality ( ) const
inlineinherited

◆ cardinality() [2/2]

T& cardinality ( T &  c) const
inlineinherited

◆ characteristic() [1/2]

Residu_t characteristic ( ) const
inlineinherited

◆ characteristic() [2/2]

T& characteristic ( T &  c) const
inlineinherited

◆ maxCardinality()

static Residu_t maxCardinality ( )
inlinestaticinherited

◆ minCardinality()

static Residu_t minCardinality ( )
inlinestaticinherited

◆ operator==()

bool operator== ( const Self_t F) const
inlineinherited

◆ operator!=()

bool operator!= ( const Self_t F) const
inlineinherited

◆ isZero()

bool isZero ( const Element a) const
inlinevirtualinherited

◆ isOne()

bool isOne ( const Element a) const
inlinevirtualinherited

◆ isMOne()

bool isMOne ( const Element a) const
inlinevirtualinherited

◆ isUnit()

bool isUnit ( const Element a) const
inlinevirtualinherited

◆ abs() [1/2]

Element& abs ( Element x,
const Element a 
) const
inlineinherited

◆ abs() [2/2]

Element abs ( const Element a) const
inlineinherited

◆ compare()

long compare ( const Element a,
const Element b 
) const
inlineinherited

◆ init() [1/2]

Element& init ( Element x) const
inlinevirtualinherited

◆ init() [2/2]

Element& init ( Element x,
const T &  s 
) const
inlineinherited

◆ assign()

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

◆ convert()

T& convert ( T &  x,
const Element y 
) const
inlineinherited

◆ reduce() [1/2]

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

◆ reduce() [2/2]

Element& reduce ( Element x) const
inlineinherited

◆ minElement()

Element minElement ( ) const
inlineinherited

◆ maxElement()

Element maxElement ( ) const
inlineinherited

◆ random()

Element& random ( const Random &  g,
Element r 
) const
inlineinherited

◆ nonzerorandom()

Element& nonzerorandom ( const Random &  g,
Element a 
) const
inlineinherited

◆ type_string()

static const std::string type_string ( )
inlinestaticinherited

◆ write() [1/3]

std::ostream& write ( std::ostream &  os) const
inlinevirtualinherited

Print field.

Returns
output stream to which field is written.
Parameters
osoutput stream to which field is written.

Reimplemented from UnparametricOperations< _Element >.

◆ write() [2/3]

std::ostream& write ( std::ostream &  os,
const Element a 
) const
inlinevirtualinherited

Print field element.

Returns
output stream to which field element is written.
Parameters
osoutput stream to which field element is written.
xfield element.

Reimplemented from UnparametricOperations< _Element >.

◆ write() [3/3]

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

Read field.

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

◆ read() [1/2]

std::istream& read ( std::istream &  is,
Element a 
) const
inlinevirtualinherited

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 >.

◆ read() [2/2]

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.

◆ areEqual()

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

x == y

Implements RingInterface< _Element >.

◆ add()

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

x := y + z

Implements RingInterface< _Element >.

◆ sub()

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

x := y - z

Implements RingInterface< _Element >.

◆ mul()

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

x := y*z

Implements RingInterface< _Element >.

◆ div()

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

x := y/z

◆ mod()

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

x := y mod z

◆ neg()

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

x := -y

Implements RingInterface< _Element >.

◆ inv()

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

x := 1/y

◆ axpy()

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

z := a*x + y

Implements RingInterface< _Element >.

◆ axpyin()

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

z := a*x + z

Implements RingInterface< _Element >.

◆ axmy()

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

z := a*x - y

Implements RingInterface< _Element >.

◆ axmyin()

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

z := a*x - z

Implements RingInterface< _Element >.

◆ maxpy()

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

z := y - a*x

Implements RingInterface< _Element >.

◆ maxpyin()

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

z := z - a*x

Implements RingInterface< _Element >.

◆ addin()

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

x := x + y

Implements RingInterface< _Element >.

◆ subin()

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

x := x - y

Implements RingInterface< _Element >.

◆ mulin()

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

x := x*y

Implements RingInterface< _Element >.

◆ divin()

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

x := x/y

◆ modin()

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

x := x mod y

◆ negin()

Element& negin ( Element x) const
inlinevirtualinherited

x := -x

Implements RingInterface< _Element >.

◆ invin()

Element& invin ( Element x) const
inlineinherited

x := 1/x

Field Documentation

◆ one

const Element one
inherited

◆ zero

const Element zero
inherited

◆ mOne

const Element mOne
inherited

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