linbox
Public Member Functions | Protected Member Functions
PID_integer Class Reference

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))
 
Field Object Basics.
std::istream & read (std::istream &is)
 Builds this field to have characteristic q and cardinality qe.
 
std::istream & read (std::istream &s, Element &a) const
 Builds this field to have characteristic q and cardinality qe.
 
template<typename Src >
Element & init (Element &x, const Src &s) const
 Builds this field to have characteristic q and cardinality qe.
 
Element & init (Element &x) const
 Builds this field to have characteristic q and cardinality qe.
 
template<typename T >
T & convert (T &x, const Element &y) const
 Builds this field to have characteristic q and cardinality qe.
 
integercardinality (integer &c) const
 Builds this field to have characteristic q and cardinality qe.
 
integercharacteristic (integer &c) const
 Builds this field to have characteristic q and cardinality qe.
 
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.
 

Detailed Description

Domain for integer operations.

Examples:
examples/charpoly.C, examples/det.C, examples/doubledet.C, examples/graph-charpoly.C, examples/minpoly.C, examples/smith.C, examples/smithvalence.C, examples/smithvalence.h, examples/solve.C, examples/sparseelimdet.C, and examples/valence.C.

Member Function Documentation

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
inlineprotected

Rational number reconstruction.

$\frac{n}{d} \equiv f \mod m$, with $\vert n \vert <k$ and $0 < \vert d \vert \leq \frac{f}{k}$.

Bibliography:
  • von zur Gathen & Gerhard, Modern Computer Algebra, 5.10, Cambridge Univ. Press 1999
std::istream& read ( std::istream &  is)
inlineinherited

Builds this field to have characteristic q and cardinality qe.

This constructor must be defined in a specialization.

std::istream& read ( std::istream &  s,
Element &  a 
) const
inlineinherited

Builds this field to have characteristic q and cardinality qe.

This constructor must be defined in a specialization.

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

Builds this field to have characteristic q and cardinality qe.

This constructor must be defined in a specialization.

Element& init ( Element &  x) const
inlineinherited

Builds this field to have characteristic q and cardinality qe.

This constructor must be defined in a specialization.

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

Builds this field to have characteristic q and cardinality qe.

This constructor must be defined in a specialization.

integer& cardinality ( integer c) const
inlineinherited

Builds this field to have characteristic q and cardinality qe.

This constructor must be defined in a specialization.

integer& characteristic ( integer c) const
inlineinherited

Builds this field to have characteristic q and cardinality qe.

This constructor must be defined in a specialization.

const K& operator() ( void  ) const
inlineinherited

Constant access operator.

Returns
constant reference to field object
K& operator() ( void  )
inlineinherited

Access operator.

Returns
reference to field object

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