%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%  matrix_GL2Z.tex        LiDIA documentation
%%  
%%  This file contains the documentation of the class gl2z
%%  
%%  Copyright (c) 1995 by the LiDIA Group
%%  
%%  Authors:  Thomas Papanikolaou
%%  

\begin{lidia_man}
\markright{\BF{matrix\_GL2Z}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NAME
	\BF{matrix\_GL2Z} \DOTFILL multi-precision \MATH{GL(2, \Z )} arithmetic

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ABSTRACT
	\BF{matrix\_GL2Z} is a class  for doing multi-precision arithmetic
	with matrices of \MATH{GL(2, \Z )}. It was especially designed for
	the algorithms which deal with the unimodular transformations of
	variables of binary quadratic forms.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\DESCRIPTION    
	A \BF{matrix\_GL2Z} consists of a quadruple of bigints
	\begin{verbatim}
 [s u]
 [t v]
	\end{verbatim}
	with \MATH{s v - t u = \PM 1}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\CONS

\fcode{ct }{matrix\_GL2Z}{}{
	initializes with the identity matrix.}

\fcode{ct }{matrix\_GL2Z}{const bigint \& a\k const bigint \& c\k const bigint \&b\k const bigint \& d}{
	initializes with the matrix [a c] [b d].  If the determinant is
	\MATH{\NEQ \PM 1}, the \BF{error\_handler} will be invoked.}

\fcode{ct }{matrix\_GL2Z}{const matrix\_GL2Z \& U}{
	constructs a copy of the matrix U.}

\fcode{dt }{\SIM matrix\_GL2Z}{}{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ASGN

	The operator \TT{=} is overloaded.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ACCS

	Let \MATH{U} be of type \BF{matrix\_GL2Z}.

\cfcode{int }{U.det}{}{
	returns the value of the determinant of \MATH{U}.}
\cfcode{bigint }{U.get\_s}{}{
	returns the value of \MATH{s}.}
\cfcode{bigint }{U.get\_t}{}{
	returns the value of \MATH{t}.}
\cfcode{bigint }{U.get\_u}{}{
	returns the value of \MATH{u}.}
\cfcode{bigint }{U.get\_v}{}{
	returns the value of \MATH{v}.}
\cfcode{bigint }{U.operator()}{int i\k int j}{
	returns \MATH{U(i,j)} if \MATH{i,j~\IN~\{0, 1 \}} (element
	of the \MATH{i}-th row and \MATH{j}-th column). If \MATH{i}
	or \MATH{j} are not in \MATH{\{0, 1\}}, the \BF{error\_handler}
	will be invoked.}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ARTH

	The operators \TT{*} and \TT{/} are overloaded. For more
	efficient computation use:

\fcode{void }{multiply}{matrix\_GL2Z \& S\k const matrix\_GL2Z \& U\k const matrix\_GL2Z \& V}{
	\MATH{S = U \CDOT V}.}

\fcode{void }{divide}{matrix\_GL2Z \& S\k const matrix\_GL2Z \& U\k const matrix\_GL2Z \& V}{
	\MATH{S = U \CDOT V^{-1}}.}

\fcode{void }{U.invert}{}{
	\MATH{U = U^{-1}}.}

\fcode{matrix\_GL2Z }{inverse}{const matrix\_GL2Z U}{
	returns the \MATH{U^{-1}}.}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\COMP

	The operator \TT{==} is overloaded.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\IO

	The operators \TT{<<} and \TT{>>} are  overloaded. Input and
	output of a \BF{matrix\_GL2Z} have the following ASCII--format,
	where \MATH{s}, \MATH{t}, \MATH{u} and \MATH{v} are \BF{bigints}:

	\begin{center}
	\begin{verbatim}
 [s u]
 [t v]
	\end{verbatim} 
	\end{center}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\SEEALSO
	\BF{quadratic\_form}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\EXAMPLES

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\AUTHOR
	Thomas Papanikolaou

\end{lidia_man}
