1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/input matrix22.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
-- this file shows nesting of matrices
m:SQMATRIX(2,INT) := squareMatrix matrix [[0,1],[-1,0]]
-- this determinant can be computed
determinant m
n:SQMATRIX(2,SQMATRIX(2,INT)) :=
squareMatrix matrix [[m,m**2],[m**3,m**4]]
-- this determinant cannot be computed by Scratchpad II
-- because there is no function that computes the determinant of a
-- matrix whose entries belong to a noncommutative ring
)set mes test off
determinant n
)set mes test on
-- another level of matrix
o:SQMATRIX(2,SQMATRIX(2,SQMATRIX(2,INT))) :=
squareMatrix matrix [[n,n**2],[n**3,n**4]]
o ** 2
-- add 2 to this matrix
% + 2
-- what is 2 as a matrix?
o := 2
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}
|