linbox
Public Member Functions
NTL_zz_p Struct Reference

long ints modulo a positive integer. More...

#include <ntl-lzz_p.h>

+ Inheritance diagram for NTL_zz_p:

Public Member Functions

integercardinality (integer &c) const
 Cardinality. More...
 
integercharacteristic (integer &c) const
 Characteristic. More...
 
Element & inv (Element &x, const Element &y) const
 Multiplicative Inverse. More...
 
bool isZero (const Element &x) const
 Zero equality. More...
 
bool isOne (const Element &x) const
 One equality. More...
 
bool isUnit (const Element &x) const
 Unit test. More...
 
bool isMOne (const Element &x) const
 MOne equality. More...
 
Element & invin (Element &x) const
 Inplace Multiplicative Inverse. More...
 
std::ostream & write (std::ostream &os) const
 Print field. More...
 

Detailed Description

long ints modulo a positive integer.

While NTL allows any int to serve as the modulus, only prime moduli yield fields. The primality of the modulus will not be checked, so it is the programmer's responsibility to supply a prime modulus if a field is wanted. These specializations allow the Givaro::ZRing template class to be used to wrap NTL's zz_p class as a LinBox field. Uses nice trick for mod p via floating point.

Member Function Documentation

◆ cardinality()

integer& cardinality ( integer c) const
inline

Cardinality.

Return integer representing cardinality of the field. Returns the modulus of the field, which should be prime.

Returns
integer representing cardinality of the field

◆ characteristic()

integer& characteristic ( integer c) const
inline

Characteristic.

Return integer representing characteristic of the field. Returns the modulus of the field, which should be prime.

Returns
integer representing characteristic of the field.

◆ inv()

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

Multiplicative Inverse.

x = 1 / y This function assumes both field elements have already been constructed and initialized.

Returns
reference to x.
Parameters
xfield element (reference returned).
yfield element.

◆ isZero()

bool isZero ( const Element &  x) const
inline

Zero equality.

Test if field element is equal to zero. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsZero function is called.

Returns
boolean true if equals zero, false if not.
Parameters
xfield element.

◆ isOne()

bool isOne ( const Element &  x) const
inline

One equality.

Test if field element is equal to one. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsOne function is called.

Returns
boolean true if equals one, false if not.
Parameters
xfield element.

◆ isUnit()

bool isUnit ( const Element &  x) const
inline

Unit test.

Test if field element is invertible. This function assumes the field element has already been constructed and initialized.

Returns
boolean true if invertible, false if not.
Parameters
xfield element.

◆ isMOne()

bool isMOne ( const Element &  x) const
inline

MOne equality.

Test if field element is equal to one. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsMOne function is called.

Returns
boolean true if equals one, false if not.
Parameters
xfield element.

◆ invin()

Element& invin ( Element &  x) const
inline

Inplace Multiplicative Inverse.

x = 1 / x This function assumes both field elements have already been constructed and initialized.

Returns
reference to x.
Parameters
xfield element (reference returned).

◆ write()

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

Print field.

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

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