9.2.1 sage.libs.ntl -

The module sage.libs.ntl defines the following classes:

class mat_ZZ
The mat_ZZ class implements arithmetic with matrices over $ \mathbf{Z}$ .

class mat_ZZ_class
The mat_ZZ class implements arithmetic with matrices over $ \mathbf{Z}$ .

class ZZ_class
The ZZ class is used to represent signed, arbitrary length integers.

Routines are provided for all of the basic arithmetic operations, as well as for some more advanced operations such as primality testing. Space is automatically managed by the constructors and destructors.

This module also provides routines for generating small primes, and fast routines for performing modular arithmetic on single-precision numbers.

Note: SAGE wrapping of this class is currently not complete.

class ZZX_class
The class ZZX implements polynomials in $ \mathbf{Z}[X]$ , i.e., univariate polynomials with integer coefficients.

Polynomial multiplication is very fast, and is implemented using one of 4 different algorithms:

  1. Classical
  2. Karatsuba
  3. Schoenhage and Strassen -- performs an FFT by working modulo a "Fermat number" of appropriate size... good for polynomials with huge coefficients and moderate degree
  4. CRT/FFT -- performs an FFT by working modulo several small primes. This is good for polynomials with moderate coefficients and huge degree.

The choice of algorithm is somewhat heuristic, and may not always be perfect.

Many thanks to Juergen Gerhard <jngerhar@plato.uni-paderborn.de> for pointing out the deficiency in the NTL-1.0 ZZX arithmetic, and for contributing the Schoenhage/Strassen code.

Extensive use is made of modular algorithms to enhance performance (e.g., the GCD algorithm and many others).



Subsections
See About this document... for information on suggesting changes.