%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%  overview.tex       LiDIA documentation
%%
%%  This file contains comments on the design of LiDIA
%%      
%%  Copyright   (c)   1996   by LiDIA-Group
%%
%%  Authors: Johannes Buchmann, Ingrid Biehl, Thomas Papanikolaou
%%      
    

\newcommand{\Pari}{{\bf Pari}}
\newcommand{\Kant}{{\bf Kant}}
\newcommand{\Simath}{{\bf Simath}}
\newcommand{\Maple}{{\bf Maple}}
\newcommand{\Mathematica}{{\bf Mathematica}}
\newcommand{\lc}{{\bf lc}}
\newcommand{\libi}{{\bf libI}}
\newcommand{\gmp}{{\bf GNU gmp}}
\newcommand{\lip}{{\bf lip}}
\newcommand{\bigint}{{\bf bigint}}


\chapter{Overview}
This chapter describes the overall organization of the \LiDIA\ 
system and the use of \LiDIA's library.

\section{Introduction}
\label{Pref}

In early 1994 our research group in computational number theory at
the Department of Computer Science at the Universit\"at des 
Saarlandes, Germany, was working on implementations of algorithms 
for factoring integers, determining discrete logarithms in finite 
fields, counting points on elliptic curves over finite fields, 
etc. In those implementations three different multiprecision integer 
packages were used. The code written for those implementations 
was hard to read and hardly documented as well. Therefore, many 
basic routines were written over and over again, often not very 
efficiently.

Because of this we decided to organize all the software in a
library which we called \Index{\LiDIA}. The organization of this
task, the development of the general concept of the library and
the implementation of the basic components like the \EM{kernel},
the \EM{interface} and the majority of the components for doing
arithmetic were designed and implemented by Thomas Papanikolaou.

Since we find that \EM{object oriented programming} is appropriate for 
implementing mathematical algorithms and since C and C++ belong to the
most accepted programming languages in scientific computing,
we decided to use C++ as the \EM{implementation language\/} for
\LiDIA. To guarantee easy \EM{portability\/} of \LiDIA\  we decided
to have a very small machine dependent kernel in \LiDIA. That kernel
currently contains the multiprecision integer arithmetic and a memory
manager. All \LiDIA\  objects are implemented in C++ and compiled with
many different compilers on various architectures. Currently we use the
compilers \TT{g++-2.7.2, cfront-3.01, HP CC, Watcom v.10} and 
\TT{MIPS CC} on \TT{sparc8, sparc-ultra, mips, intel} and \TT{hp}. 
Moreover, we support the \TT{emx -- Port of g++} on OS/2 -- systems.

Although not in the public domain, \LiDIA\  can be used freely for 
non commercial purposes (see copyright notice, page 
\pageref{CopyRight}).


\section{Design notes}

It is a serious problem to decide which multiprecision integer package
and which memory manager should be used in \LiDIA. There are
competing multiprecision integer packages, for example the
\gmp\ package  \cite{gnump}, the \libi\ package \cite{dentzer} and
the \lip\ package \cite{lenstra}. Some of those packages are more
efficient on one architecture and some on others. Also, new
architectures lead very fast to new multiprecision packages. We decided
to make \LiDIA\  independent of a particular kernel and to make it easy
to replace the \LiDIA\ kernel. To achieve this, we separate the kernel
from the application programs by an \EM{interface\/} in which the
declarations, operators, functions, and procedures dealing with
multiprecision integers and the memory management are standardized. All
\LiDIA\ classes use the kernel through that interface. They never use
the kernel functions directly. Whenever new kernel packages are used
only the interface has to be changed appropriately but none of the
\LiDIA\  classes has to be altered.  In the \LiDIAVersion\ package we
use the \libi\ package written by Ralf Dentzer \cite{dentzer} and its memory
manager as the default kernel.

We try to develop extremely efficient code for the algorithms
we offer in the \LiDIA\  system. Therefore, \LiDIA\  is designed in
such a way, that a user can decide in which level of abstraction one
implements the programs. Moreover  we try to keep the dependency of
parts of the library on each other to a minimum and to define
interfaces precisely in order to be able to replace modules by more
efficient modules in an efficient way.

\section{Structure of \LiDIA}

The \LiDIA\  library has 5 levels.

The lowest level contains the \Index{kernel}, which contains
a \Index{multiprecision} integer arithmetic and a \Index{memory
manager}. Both programs are currently written in \Index{C} to attain
maximum speed \footnote{However, it is possible to use any other
implementation language in the kernel, as long as this language can be
called from C++.}.

In \LiDIA's kernel it is possible to use various multiprecision
integer packages since the functions of the kernel are never called
directly by any application program of \LiDIA\  but only through the
interface on the second level. Therefore, any package supporting the
whole functionality of the interface can be used in the kernel.
Currently, we support the multiprecision integer packages
\libi\ \cite{dentzer}, Arjen Lenstra's \Index{lip} package \cite{lenstra}
(available by anonymous ftp via \TT{flash.bellcore.com:/pub/lenstra}) and GNU's
\IndexSUBTT{GNU}{gmp} arithmetic \cite{gnump} (available by anonymous
ftp via \TT{prep.ai.mit.edu}).

The second \LiDIA\  level is the \BF{interface} through which {\CPP}
applications on higher levels have access to the kernel. By that
interface declarations, operators, functions and procedures dealing
with multiprecision integers and memory management are standardized.
\LiDIA\  applications always use those standards. They never call the 
underlying kernel directly.  The interface for the multiprecision
integer arithmetic is realized by the class \BF{bigint} and the
interface for the general memory manager is implemented in the class
\BF{gmm}.

The third level of \LiDIA\  contains all non parameterized 
\LiDIA\  applications, the so-called \Index{simple classes}. For 
example, on the third level there is a class \BF{bigrational} 
which implements the arithmetic of rational numbers.

On the fourth \LiDIA\  level there are the \Index{parameterized classes}
(also called \Index{container classes}). These classes are designed to
solve computational problems which are very similar in many concrete
applications. In the current version this level includes generic 
implementations of hash tables, vectors, matrices, power series, 
and univariate polynomials.

The highest level of \LiDIA\  includes the user interface which
consists of an online documentation tool and the \BF{interpreter}
{\lc} \index{\lc} which makes the \LiDIA\  functions available for
interactive use. 

\label{LidFig}
\begin{center}
\postscript{PS/lidia_model}{\LiDIA's structure model}
\end{center}
\begin{center} Fig.: The levels of \LiDIA \end{center}


\section{Future developments}

In the future we will expand the set of classes and algorithms.
Methods which are available in {\LiDIAVersion} will also be available
in future releases, so as to ensure compatibility of user implemented
algorithms with new versions of \LiDIA. If you develop algorithms of
general interest using \LiDIA, we would appreciate it if you let us
include them in the \LiDIA\  package or send information about your
implementation to other \LiDIA\  users.

%\subsection{In \MATH{\beta}-testing}
%\begin{itemize}
%\item Generic multivariate rational function arithmetic
%\item Gr\"obner bases
%\end{itemize}

\subsection{In work}

\begin{itemize}
\item Porting of John Cremona's elliptic curve package
\item Discrete logarithms using COS
%\item Symbolic computation
\item Invariants of number fields
\item Counting points on elliptic curves over \MATH{\F_p}, \MATH{p>3}
\end{itemize}


\section{\LiDIA\ Group}

\subsection{Current members}

At the moment the \LiDIA\ Group consists of the following people:

\begin{center}
Werner Backes,
Franz-Dieter Berger,
Ingrid Biehl,
Johannes Buchmann,
John Cremona,
Sascha Demetrio,
Thomas Denny,
Friedrich Eisenbrand,
Kurt Huwig,
Michael Jacobson,
Thorsten Lauer,
Markus Maurer,
Volker M\"uller,
Stefan Neis,
Thomas Papanikolaou,
Sachar Paulus,
Thomas Pfahler,
Nigel Smart,
Thomas Sosnowski,
Patrick Theobald,
Damian Weber,
Susanne Wetzel
\end{center}

\subsection{Former members}
\begin{center}
Oliver Braun,
Carmen Hiber,
Patrick Kirsch,
Christiane Lenhardt,
Frank Lehmann,
Andreas Monstadt,
Oliver Morsch,
Andreas M\"uller.
\end{center}

\section{Acknowledgements}

We would like to thank Ralf Dentzer for allowing us to use the
multiprecision integer arithmetic {\libi}, Arjen Lenstra for writing
{\lip} and Paul Leyland for providing the free version
\TT{freelip-1.0}, Torbj\"orn Grandlund for {\gmp} and the GNU project
for their wonderful software.

Special thanks to our colleagues John Cremona, Bernd Meyer, Nigel P.
Smart and Christoph Thiel for a lot of helpful comments and discussions.




