
The foundation of LINK is a group of {\em basic} templated C++ objects.
These objects are easily accessible from the Scheme interface, as we
will see below.

\clearpage

\subsection{\Collections}
\label{sec:collection}

{\em All of the following methods are generated automatically for each
type of collectionn.  The instantiation of new types requires recompiling, so
the process will eventually be described in the programmer's manual. 
However, most users should be satisfied with the types currently 
available, which are the same types as those enumerate for typed
lists (Page~\pageref{sec:list})}.

\begin{flushleft}

\input{basic/UserCollection.crt.tex}

\input{basic/UserCollection.tbl.tex}

\end{flushleft}

The \Collection\ hierarchy, documented in the Programmer's Manual, 
provides LINK with a flexible core of set and sequence classes that 
interact with each other easily, facilitating the representation of
a rich variety of graphs.  

\begin{figure}[tbh]
\input{examples/collection/Usermset1}
\caption{Definition of sets and multisets}
\label{fig:mset1}
\end{figure}

\begin{figure}[tbh]
\input{examples/collection/Userseq1}
\caption{Definition of sequences}
\label{fig:seq1}
\end{figure}

\begin{figure}[tbh]
\input{examples/collection/Userconversion}
\caption{Conversions between collections and Scheme lists}
\label{fig:conversion}
\end{figure}

\begin{figure}[tbh]
\input{examples/collection/Usermember}
\caption{Membership testing in collections}
\label{fig:member}
\end{figure}

\begin{figure}[tbh]
\input{examples/collection/Usernull}
\caption{Example of overloaded method: null?}
\label{fig:null}
\end{figure}

\begin{figure}[tbh]
\input{examples/collection/Usergeneric}
\caption{Defining generic functions which take collections as arguments}
\label{fig:generic}
\end{figure}

\begin{figure}[tbh]
\input{examples/collection/Usercompare}
\caption{Comparing collections}
\label{fig:compare}
\end{figure}

\begin{figure}[tbh]
\input{examples/collection/Userset-prim}
\caption{The set primitive operations}
\label{fig:set-prim}
\end{figure}

\begin{figure}[tbh]
\input{examples/collection/Userset-set}
\caption{$k$-sets and power sets of a set}
\label{fig:set-set}
\end{figure}

\subsection{Typed Vectors}
\label{sec:vector}

{\em All of the following methods are generated automatically for each
type of vector.  The instantiation of new types requires recompiling, so
the process will eventually be described in the programmer's manual. 
However, most users should be satisfied with the types currently 
available: \verb+int, char, Vertex, Graph, Edge, Attribute+.}

\begin{flushleft}

\input{basic/UserVector.crt.tex}

\input{basic/UserVector.tbl.tex}

\end{flushleft}

\begin{figure}[tbh]
\input{examples/vector/Uservect1}
\caption{Creating and manipulating vectors}
\label{fig:vect1}
\end{figure}

\begin{figure}[tbh]
\input{examples/vector/Uservect2}
\caption{Typed vs. untyped vectors}
\label{fig:vect2}
\end{figure}

\begin{figure}[tbh]
\input{examples/vector/Uservect3}
\caption{Conversion of typed vector to Scheme list}
\label{fig:vect3}
\end{figure}

\begin{figure}[tbh]
\input{examples/vector/Uservect4}
\caption{Copying of typed vectors}
\label{fig:vect4}
\end{figure}

\begin{figure}[tbh]
\input{examples/vector/Uservect5}
\caption{Comparison of typed vectors}
\label{fig:vect5}
\end{figure}

\clearpage

\subsection{Typed Lists}
\label{sec:list}

Generally, algorithms which return collections of data will use objects
from the \Collection\ hierarchy.  However, it is possible for algorithms
to return \List$<$type$>$ objects, and the latter can be manipulated in 
a limited way in Scheme.  The only necessary manipulations are simply 
translations to and from standard Scheme lists.  
\begin{flushleft}

\input{basic/UserList.crt.tex}

\input{basic/UserList.tbl.tex}

\end{flushleft}

\clearpage



\clearpage
