diff options
Diffstat (limited to 'src/input/algaggr.input.pamphlet')
-rw-r--r-- | src/input/algaggr.input.pamphlet | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/input/algaggr.input.pamphlet b/src/input/algaggr.input.pamphlet new file mode 100644 index 00000000..e860c43b --- /dev/null +++ b/src/input/algaggr.input.pamphlet @@ -0,0 +1,72 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/input algaggr.input} +\author{The Axiom Team} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +\section{License} +<<license>>= +--Copyright The Numerical Algorithms Group Limited 1991. +@ +<<*>>= +<<license>> + +)clear all +-- lists are constructed explicitly by using square brackets +l := [1,4,2,-6,0,3,5,4,2,3] +-- "listify" an element by using the "list" function +m := list 555555 +-- use "concat" to add an item to the front of a list +concat(5,l) +-- "concat" concatenates 2 lists +concat(m,l) +-- to remove all duplicates, issue +removeDuplicates l +-- use "first" to get the first element, and "rest" to get the +-- list of remaining elements +first l +rest l +-- "last" extracts the last element +last l +-- to find the number of elements, use "#" +#l +-- "first" and "rest" extract or remove leading or trailing +-- parts of the list +l +first(l,3) +rest(l,3) +-- individual elements may be extracted as follows +-- notice that list indexing goes from 1 to the size of the list +l.1 +l.2 +l.(#l) +-- individual elements may be set (destructively) in a similar manner +l.1 := 1000000000 +l +-- "insert" is used to add an element to a specific position in the list +insert(10,l,4) +insert(2,l,1) +-- "position" determines the first index of an element in a list +-- if the element is not in the list, 0 is returned. +position(-6,l) +-- to reverse a list +reverse l +-- the following functions demonstrate some functions on sets +l +m := [4,2,3,6,5,7,-9,1,2,3,2] +sl:SET(INT) := brace l +sm:SET(INT) := brace m +difference(sl, sm) +intersect(sl,sm) +union(sl,sm) +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} |