Number Theoretic Library (NTL) by Shoup, now accessible from Lisp
Subject: Number Theoretic Library (NTL) by Shoup, now accessible from Lisp
From: Richard Fateman
Date: Sat, 21 May 2005 15:30:14 -0700
I've gotten this to work well enough so that I can time
polynomial arithmetic, but NTL does a lot more.
(For large univariate polynomials, it is quite fast.)
Additions, comments, corrections, are welcome.
..................
This README file is located in
http://www.cs.berkeley.edu/~fateman/papers/lisp2ntl/README.
This directory contains material to allow Victor Shoup's NTL 5.4 to be
used with Allegro Common Lisp (and probably many other systems with a
similar interface). NTL includes very fast routines for Number
Theoretic calculations, and includes, for example, fast polynomial
arithmetic, including factoring (one variable, over finite field or
integers).
In addition to this README file, the parent file directory contains
two source files and one dll.
thedll.dll is the compiled and linked version of the NTL 5.4
system as well as the lisp interface code.
loadntl.cl
A file (which can be compiled if you like, to loadntl.fasl)
must be read in to Allegro Common Lisp 7.0. It provides the
Lisp side of the interface. There are lots of comments in this
file. You also need to read in the dll, e.g. (load "thedll.dll")
for it to work.
I have also provided the C++ file that I wrote, in case
you want to re-make the dll, or have different needs for
using the NTL system. You may, for example, want to expose
additional entry points to the NTL code.
LispWins3.cpp
is a file that sets up the linkages between Victor Shoup's NTL
(version 5.4) and can be compiled in Windows visual C++ 6.0. To make
this work, this file is added to the src code in the NTL project, and
then the project is re-built.
Instructions for compiling thedll.dll from this are almost the same as
given by Shoup's instructions, except that, following the Wizard for a
new project, choose to make a windows DLL that exports symbols. It
doesn't need MFC. I found it necessary to change the "pre-compiled
headers" directive to "automatic", also.) I am not an expert on this
stuff and can't give you advice. I think that compiling under Linux
or various versions of unix should be easy, but I haven't tried it.
Distribution etc.
Shoup's NTL is covered by the GNU public license. If mine is
considered a modification of NTL, then it too is GPL. If it is not
covered by GPL, I would like to assert (1) I wrote it and own it. (2)
You have my permission to use it for whatever you wish to do with it,
now or anytime in the future. (3) I am not responsible for any
problems you might have in using it.
Richard Fateman 5/21/05