next up previous contents index
Next: Data structures Up: User's Guide Previous: Basic algebraic categories   Contents   Index

Arithmetic

For efficiency reasons, $\Sigma{}^{{\rm it}}$ defines Integer to be SALLI's GMPInteger. This means that programs using $\Sigma{}^{{\rm it}}$ must be linked with GMP 3.0 or 3.1, and that you cannot run $\Sigma{}^{{\rm it}}$ in the compiler interactive loop. On the other hand, several of GMP's low-level functions are exported by Integer and the other ones can be called safely on elements of Integer. Similarly, $\Sigma{}^{{\rm it}}$ defines Float to be SALLI's GMPFloat. Of course, the machine types MachineInteger, SingleFloat and DoubleFloat remain available in $\Sigma{}^{{\rm it}}$, and it is in fact recommended to use MachineInteger wherever appropriate, in particular for loop or data structure indices. Conversions between MachineInteger and Integer are provided by coerce and machine.

$\Sigma{}^{{\rm it}}$ provides two different implementations of the finite field ${\mathbbm Z}/ p{\mathbbm Z}$ when $p$ is a machine prime: SmallPrimeField provides a standard implementation, while ZechPrimeField provides a significantly faster implementation based on a logarithmic representation of its elements. However, ZechPrimeField precomputes a table of size ${\cal O}(p)$ so it should only be used for reasonably small values of $p$ and when a significant amount of calculations in ${\mathbbm Z}/ p{\mathbbm Z}$ are made following the creation of the type (we have found the precomputation time to be under one second for $p$ around $10^6$ on recent workstations).

The type Fraction$(R)$ implements the fraction field of the GcdDomain $R$. Typical arguments are Integer (to get the rational numbers) or polynomial types. Note that fractions are automatically normalized after each arithmetic operation.


next up previous contents index
Next: Data structures Up: User's Guide Previous: Basic algebraic categories   Contents   Index
Manuel Bronstein 2000-12-13