Givaro 4.2.1
UnparametricZRing< _Element > Class Template Reference

Generic Class ZRing. More...

#include <zring.h>

+ Inheritance diagram for UnparametricZRing< _Element >:

Public Types

enum  { size_rep = sizeof(Element) }
 
using Element = _Element
 
using Rep = _Element
 
using Self_t = UnparametricZRing<Element>
 
using Parent_t = UnparametricOperations<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

 UnparametricZRing ()
 
 UnparametricZRing (const UnparametricZRing &F)
 
template<class T>
 UnparametricZRing (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
 
UnparametricZRing< Element > & operator= (const UnparametricZRing< Element > &)
 
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
 
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
 
Element minElement () const
 
Element maxElement () const
 
template<class Random>
Elementrandom (const Random &g, Element &r) const
 
template<class Random>
Elementnonzerorandom (Random &g, Element &a) const
 
std::ostream & write (std::ostream &os) const
 Print field.
 
std::ostream & write (std::ostream &os, const Element &a) const
 Print field element.
 
std::istream & read (std::istream &is, Element &a) const
 Read field element.
 
Comparison Predicates
bool areEqual (const Element &x, const Element &y) const
 x == y
 
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
 
Elementsub (Element &x, const Element &y, const Element &z) const
 x := y - z
 
Elementmul (Element &x, const Element &y, const Element &z) const
 x := y*z
 
Elementdiv (Element &x, const Element &y, const Element &z) const
 x := y/z
 
Elementmod (Element &x, const Element &y, const Element &z) const
 x := y mod z
 
Elementneg (Element &x, const Element &y) const
 x := -y
 
Elementinv (Element &x, const Element &y) const
 x := 1/y
 
Elementaxpy (Element &z, const Element &a, const Element &x, const Element &y) const
 z := a*x + y
 
Elementaxpyin (Element &z, const Element &a, const Element &x) const
 z := a*x + z
 
Elementaxmy (Element &z, const Element &a, const Element &x, const Element &y) const
 z := a*x - y
 
Elementaxmyin (Element &z, const Element &a, const Element &x) const
 z := a*x - z
 
Elementmaxpy (Element &z, const Element &a, const Element &x, const Element &y) const
 z := y - a*x
 
Elementmaxpyin (Element &z, const Element &a, const Element &x) const
 z := z - a*x
 
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
 
Elementsubin (Element &x, const Element &y) const
 x := x - y
 
Elementmulin (Element &x, const Element &y) const
 x := x*y
 
Elementdivin (Element &x, const Element &y) const
 x := x/y
 
Elementmodin (Element &x, const Element &y) const
 x := x mod y
 
Elementnegin (Element &x) const
 x := -x
 
Elementinvin (Element &x) const
 x := 1/x
 
Input/Output Operations
std::ostream & write (std::ostream &os, std::string F) const
 Read field.
 
std::istream & read (std::istream &is) const
 Read field.
 

Static Public Member Functions

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

Data Fields

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

Detailed Description

template<class _Element>
class Givaro::UnparametricZRing< _Element >

Generic Class ZRing.

Ring of integers, using the unparametric _Element base type. Provide unparametric with domain features ZRing<Element> is a sugar name for UnparametricZRing<Element> Also, there is a specialization, below, for ZRing<Integer>

Member Typedef Documentation

◆ Element

template<class _Element>
using Element = _Element

◆ Rep

template<class _Element>
using Rep = _Element

◆ Self_t

template<class _Element>
using Self_t = UnparametricZRing<Element>

◆ Parent_t

template<class _Element>
using Parent_t = UnparametricOperations<Element>

◆ Residu_t

template<class _Element>
using Residu_t = _Element

◆ Element_ptr

template<class _Element>
using Element_ptr = Element*

◆ ConstElement_ptr

template<class _Element>
using ConstElement_ptr = const Element*

◆ RandIter

template<class _Element>
typedef DomainRandIter<Self_t>::RandIter RandIter

◆ NonZeroRandIter

template<class _Element>
typedef GeneralRingNonZeroRandIter<Self_t> NonZeroRandIter

◆ ConstElement

template<class _Element>
typedef const Element ConstElement
inherited

Member Enumeration Documentation

◆ anonymous enum

template<class _Element>
anonymous enum
Enumerator
size_rep 

Constructor & Destructor Documentation

◆ UnparametricZRing() [1/3]

template<class _Element>
UnparametricZRing ( )
inline

◆ UnparametricZRing() [2/3]

template<class _Element>
UnparametricZRing ( const UnparametricZRing< _Element > & F)
inline

◆ UnparametricZRing() [3/3]

template<class _Element>
template<class T>
UnparametricZRing ( const T & )
inline

Member Function Documentation

◆ residu()

template<class _Element>
Residu_t residu ( ) const
inline

◆ size()

template<class _Element>
Residu_t size ( ) const
inline

◆ cardinality() [1/2]

template<class _Element>
Residu_t cardinality ( ) const
inline

◆ characteristic() [1/2]

template<class _Element>
Residu_t characteristic ( ) const
inline

◆ cardinality() [2/2]

template<class _Element>
template<typename T>
T & cardinality ( T & c) const
inline

◆ characteristic() [2/2]

template<class _Element>
template<typename T>
T & characteristic ( T & c) const
inline

◆ maxCardinality()

template<class _Element>
static Residu_t maxCardinality ( )
inlinestatic

◆ minCardinality()

template<class _Element>
static Residu_t minCardinality ( )
inlinestatic

◆ operator==()

template<class _Element>
bool operator== ( const Self_t & F) const
inline

◆ operator!=()

template<class _Element>
bool operator!= ( const Self_t & F) const
inline

◆ operator=()

template<class _Element>
UnparametricZRing< Element > & operator= ( const UnparametricZRing< Element > & )
inline

◆ isZero()

template<class _Element>
bool isZero ( const Element & a) const
inlinevirtual

◆ isOne()

template<class _Element>
bool isOne ( const Element & a) const
inlinevirtual

◆ isMOne()

template<class _Element>
bool isMOne ( const Element & a) const
inlinevirtual

◆ isUnit()

template<class _Element>
bool isUnit ( const Element & a) const
inlinevirtual

◆ abs() [1/2]

template<class _Element>
Element & abs ( Element & x,
const Element & a ) const
inline

◆ abs() [2/2]

template<class _Element>
Element abs ( const Element & a) const
inline

◆ compare()

template<class _Element>
long compare ( const Element & a,
const Element & b ) const
inline

◆ init() [1/2]

template<class _Element>
Element & init ( Element & x) const
inlinevirtual

◆ init() [2/2]

template<class _Element>
template<typename T>
Element & init ( Element & x,
const T & s ) const
inline

◆ assign()

template<class _Element>
Element & assign ( Element & x,
const Element & y ) const
inlinevirtual

◆ convert()

template<class _Element>
template<typename T>
T & convert ( T & x,
const Element & y ) const
inline

◆ reduce() [1/2]

template<class _Element>
Element & reduce ( Element & x,
const Element & y ) const
inline

◆ reduce() [2/2]

template<class _Element>
Element & reduce ( Element & x) const
inline

◆ minElement()

template<class _Element>
Element minElement ( ) const
inline

◆ maxElement()

template<class _Element>
Element maxElement ( ) const
inline

◆ random()

template<class _Element>
template<class Random>
Element & random ( const Random & g,
Element & r ) const
inline

◆ nonzerorandom()

template<class _Element>
template<class Random>
Element & nonzerorandom ( Random & g,
Element & a ) const
inline

◆ type_string()

template<class _Element>
static const std::string type_string ( )
inlinestatic

◆ write() [1/3]

template<class _Element>
std::ostream & write ( std::ostream & os) const
inlinevirtual

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]

template<class _Element>
std::ostream & write ( std::ostream & os,
const Element & x ) const
inlinevirtual

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

◆ read() [1/2]

template<class _Element>
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 >.

◆ areEqual()

template<class _Element>
bool areEqual ( const Element & x,
const Element & y ) const
inlinevirtualinherited

x == y

Implements RingInterface< _Element >.

◆ add()

template<class _Element>
Element & add ( Element & x,
const Element & y,
const Element & z ) const
inlinevirtualinherited

x := y + z

Implements RingInterface< _Element >.

◆ sub()

template<class _Element>
Element & sub ( Element & x,
const Element & y,
const Element & z ) const
inlinevirtualinherited

x := y - z

Implements RingInterface< _Element >.

◆ mul()

template<class _Element>
Element & mul ( Element & x,
const Element & y,
const Element & z ) const
inlinevirtualinherited

x := y*z

Implements RingInterface< _Element >.

◆ div()

template<class _Element>
Element & div ( Element & x,
const Element & y,
const Element & z ) const
inlineinherited

x := y/z

◆ mod()

template<class _Element>
Element & mod ( Element & x,
const Element & y,
const Element & z ) const
inlineinherited

x := y mod z

◆ neg()

template<class _Element>
Element & neg ( Element & x,
const Element & y ) const
inlinevirtualinherited

x := -y

Implements RingInterface< _Element >.

◆ inv()

template<class _Element>
Element & inv ( Element & x,
const Element & y ) const
inlineinherited

x := 1/y

◆ axpy()

template<class _Element>
Element & axpy ( Element & z,
const Element & a,
const Element & x,
const Element & y ) const
inlinevirtualinherited

z := a*x + y

Implements RingInterface< _Element >.

◆ axpyin()

template<class _Element>
Element & axpyin ( Element & z,
const Element & a,
const Element & x ) const
inlinevirtualinherited

z := a*x + z

Implements RingInterface< _Element >.

◆ axmy()

template<class _Element>
Element & axmy ( Element & z,
const Element & a,
const Element & x,
const Element & y ) const
inlinevirtualinherited

z := a*x - y

Implements RingInterface< _Element >.

◆ axmyin()

template<class _Element>
Element & axmyin ( Element & z,
const Element & a,
const Element & x ) const
inlinevirtualinherited

z := a*x - z

Implements RingInterface< _Element >.

◆ maxpy()

template<class _Element>
Element & maxpy ( Element & z,
const Element & a,
const Element & x,
const Element & y ) const
inlinevirtualinherited

z := y - a*x

Implements RingInterface< _Element >.

◆ maxpyin()

template<class _Element>
Element & maxpyin ( Element & z,
const Element & a,
const Element & x ) const
inlinevirtualinherited

z := z - a*x

Implements RingInterface< _Element >.

◆ addin()

template<class _Element>
Element & addin ( Element & x,
const Element & y ) const
inlinevirtualinherited

x := x + y

Implements RingInterface< _Element >.

◆ subin()

template<class _Element>
Element & subin ( Element & x,
const Element & y ) const
inlinevirtualinherited

x := x - y

Implements RingInterface< _Element >.

◆ mulin()

template<class _Element>
Element & mulin ( Element & x,
const Element & y ) const
inlinevirtualinherited

x := x*y

Implements RingInterface< _Element >.

◆ divin()

template<class _Element>
Element & divin ( Element & x,
const Element & y ) const
inlineinherited

x := x/y

◆ modin()

template<class _Element>
Element & modin ( Element & x,
const Element & y ) const
inlineinherited

x := x mod y

◆ negin()

template<class _Element>
Element & negin ( Element & x) const
inlinevirtualinherited

x := -x

Implements RingInterface< _Element >.

◆ invin()

template<class _Element>
Element & invin ( Element & x) const
inlineinherited

x := 1/x

◆ write() [3/3]

template<class _Element>
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() [2/2]

template<class _Element>
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

◆ one

template<class _Element>
const Element one = 1

◆ zero

template<class _Element>
const Element zero = 0

◆ mOne

template<class _Element>
const Element mOne = -1

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