linbox
|
Domain for integer operations. More...
#include <PID-integer.h>
Inherits UnparametricField< K >.
Public Types | |
Common Object Interface for a LinBox Field. | |
These methods and member types are required of all LinBox fields. See FieldArchetype for detailed specifications. | |
typedef UnparametricRandIter< K > | RandIter |
Type of random field element generators. | |
Public Member Functions | |
Element & | axpyin (integer &r, const integer &a, const integer &x) const |
axpyin | |
Element & | axmyin (integer &r, const integer &a, const integer &x) const |
axmyin | |
Element & | maxpyin (integer &r, const integer &a, const integer &x) const |
maxpyin | |
Element & | axpy (integer &r, const integer &a, const integer &x, const integer &y) const |
axpy | |
bool | isUnit (const Element &x) const |
isUnit | |
Element & | abs (Element &x, const Element &a) const |
abs | |
Element | abs (const Element &a) const |
abs | |
long | compare (const Element &a, const Element &b) const |
compare two elements, a and b. | |
Element & | gcd (Element &g, const Element &a, const Element &b) const |
gcd (g, a, b) return g = gcd (a, b) | |
Element & | gcdin (Element &g, const Element &b) const |
gcdin(g, b) return g = gcd (g, b) | |
Element & | xgcd (Element &g, Element &s, Element &t, const Element &a, const Element &b) const |
xgcd (g, s, t, a, b) g = gcd(a, b) = a*s + b*t. | |
Element & | lcm (Element &c, const Element &a, const Element &b) const |
lcm (c, a, b) c = lcm (a, b) | |
Element & | lcmin (Element &l, const Element &b) const |
lcmin (l, b) l = lcm (l, b) | |
Element & | quo (Element &q, const Element &a, const Element &b) const |
quo (q, x, y) q = floor (x/y); | |
Element & | rem (Element &r, const Element &a, const Element &b) const |
rem (r, a, b) r = remindar of a / b | |
Element & | quoin (Element &a, const Element &b) const |
quoin (a, b) a = quotient (a, b) | |
Element & | remin (Element &a, const Element &b) const |
quoin (a, b) a = quotient (a, b) | |
void | quoRem (Element &q, Element &r, const Element &a, const Element &b) const |
quoRem (q, r, a, b) q = [a/b], r = a - b*q |r| < |b|, and if r != 0, sign(r) = sign(b) | |
bool | isDivisor (const Element &a, const Element &b) const |
isDivisor (a, b) Test if b | a. | |
Element & | sqrt (Element &x, const Element &y) const |
sqrt(x,y) x=floor(sqrt(y)) | |
template<> | |
NTL::zz_p & | inv (NTL::zz_p &x, const NTL::zz_p &y) const |
template<> | |
NTL::zz_p & | invin (NTL::zz_p &x) const |
template<> | |
bool | isZero (const NTL::zz_p &x) const |
template<> | |
bool | isOne (const NTL::zz_p &x) const |
template<> | |
integer & | characteristic (integer &c) const |
template<> | |
integer & | cardinality (integer &c) const |
Field Object Basics. | |
Element & | inv (Element &x, const Element &y) const |
c := characteristic of this field (zero or prime). | |
Element & | invin (Element &x) const |
c := characteristic of this field (zero or prime). | |
std::ostream & | write (std::ostream &os, const Element &p) const |
c := characteristic of this field (zero or prime). | |
bool | isZero (const Element &x) const |
c := characteristic of this field (zero or prime). | |
bool | isOne (const Element &x) const |
c := characteristic of this field (zero or prime). | |
long unsigned int | characteristic (long unsigned int &p) const |
c := characteristic of this field (zero or prime). | |
long unsigned int | characteristic () const |
c := characteristic of this field (zero or prime). | |
integer & | characteristic (integer &c) const |
c := characteristic of this field (zero or prime). | |
long unsigned int | cardinality () const |
c := characteristic of this field (zero or prime). | |
integer & | cardinality (integer &c) const |
c := cardinality of this field (-1 if infinite). | |
template<typename Src > | |
Element & | init (Element &x, const Src &s) const |
c := characteristic of this field (zero or prime). | |
std::istream & | read (std::istream &is, Element &x) const |
c := characteristic of this field (zero or prime). | |
std::istream & | read (std::istream &is) const |
c := characteristic of this field (zero or prime). | |
template<typename T > | |
T & | convert (T &x, const Element &y) const |
c := characteristic of this field (zero or prime). | |
class RR. | |
Rational number field. This field is provided as a convenience in a few places. Use with caution because expression swell. This specialization allows the UnparametricField template class to be used to wrap NTL's RR class as a LinBox field. | |
template<> | |
NTL::RR & | inv (NTL::RR &x, const NTL::RR &y) const |
template<> | |
NTL::RR & | invin (NTL::RR &x) const |
template<> | |
bool | isZero (const NTL::RR &x) const |
template<> | |
bool | isOne (const NTL::RR &x) const |
template<> | |
NTL::ZZ_p & | inv (NTL::ZZ_p &x, const NTL::ZZ_p &y) const |
template<> | |
NTL::ZZ_p & | invin (NTL::ZZ_p &x) const |
template<> | |
bool | isZero (const NTL::ZZ_p &x) const |
template<> | |
bool | isOne (const NTL::ZZ_p &x) const |
template<> | |
integer & | characteristic (integer &c) const |
template<> | |
integer & | cardinality (integer &c) const |
Implementation-Specific Methods. | |
These methods are not required of all LinBox fields and are included only for the implementation of this field template. | |
const K & | operator() (void) const |
Constant access operator. | |
K & | operator() (void) |
Access operator. | |
Protected Member Functions | |
void | RationalReconstruction (Element &a, Element &b, const Element &f, const Element &m, const Element &k, bool reduce, bool recursive) const |
Rational number reconstruction. |
Domain for integer operations.
long compare | ( | const Element & | a, |
const Element & | b | ||
) | const [inline] |
compare two elements, a and b.
return 1, if a > b return 0, if a = b; return -1. if a < b
Element& xgcd | ( | Element & | g, |
Element & | s, | ||
Element & | t, | ||
const Element & | a, | ||
const Element & | b | ||
) | const [inline] |
xgcd (g, s, t, a, b) g = gcd(a, b) = a*s + b*t.
The coefficients s and t are defined according to the standard Euclidean algorithm applied to |a| and |b|, with the signs then adjusted according to the signs of a and b.
void RationalReconstruction | ( | Element & | a, |
Element & | b, | ||
const Element & | f, | ||
const Element & | m, | ||
const Element & | k, | ||
bool | reduce, | ||
bool | recursive | ||
) | const [inline, protected] |
Rational number reconstruction.
, with
and
.
- von zur Gathen & Gerhard, Modern Computer Algebra, 5.10, Cambridge Univ. Press 1999
NTL::zz_p & inv | ( | NTL::zz_p & | x, |
const NTL::zz_p & | y | ||
) | const [inherited] |
x = 1 / y This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
y | field element. |
NTL::RR & inv | ( | NTL::RR & | x, |
const NTL::RR & | y | ||
) | const [inherited] |
x = 1 / y This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
y | field element. |
NTL::ZZ_p & inv | ( | NTL::ZZ_p & | x, |
const NTL::ZZ_p & | y | ||
) | const [inherited] |
x = 1 / y This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
y | field element. |
NTL::zz_p & invin | ( | NTL::zz_p & | x | ) | const [inherited] |
x = 1 / x This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
NTL::RR & invin | ( | NTL::RR & | x | ) | const [inherited] |
x = 1 / x This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
NTL::ZZ_p & invin | ( | NTL::ZZ_p & | x | ) | const [inherited] |
x = 1 / x This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
bool isZero | ( | const NTL::zz_p & | x | ) | const [inherited] |
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.
x | field element. |
bool isZero | ( | const NTL::RR & | x | ) | const [inherited] |
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.
x | field element. |
bool isZero | ( | const NTL::ZZ_p & | x | ) | const [inherited] |
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.
x | field element. |
bool isOne | ( | const NTL::zz_p & | x | ) | const [inherited] |
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.
x | field element. |
bool isOne | ( | const NTL::RR & | x | ) | const [inherited] |
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.
x | field element. |
bool isOne | ( | const NTL::ZZ_p & | x | ) | const [inherited] |
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.
x | field element. |
Return integer representing characteristic of the field. Returns the modulus of the field, which should be prime.
Return integer representing characteristic of the field. Returns the modulus of the field, which should be prime.
Return integer representing cardinality of the field. Returns the modulus of the field, which should be prime.
Return integer representing cardinality of the field. Returns the modulus of the field, which should be prime.
const K& operator() | ( | void | ) | const [inline, inherited] |
Constant access operator.
K& operator() | ( | void | ) | [inline, inherited] |
Access operator.