aboutsummaryrefslogtreecommitdiff
path: root/src/input/matrix.input.pamphlet
blob: d2038a8b1eb0244fef8b37132651bd8f33b15b77 (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/input matrix.input}
\author{The Axiom Team}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{License}
<<license>>=
--Copyright The Numerical Algorithms Group Limited 1991.
@
<<*>>=
<<license>>

)cl all
 
-- A number of matrix computations over the integers and over the
-- rationals using various algortihms and indexing schemes.
 
-- Hilbert matrix
 
mat : MATRIX FRAC INT := matrix [[1/(i + j) for i in 1..5] for j in 1..5]
matinv := inverse mat
mat * matinv
 
-- Vandermonde determinant
 
mat2 : MATRIX INT := matrix [[j**i for i in 0..4] for j in 1..5]
rowEchelon  mat2
determinant mat2
minordet    mat2
 
-- same computation, work over the rationals
 
mat4 : MATRIX FRAC INT := matrix [[j**i for i in 0..4] for j in 1..5]
rowEchelon  mat4
determinant mat4
minordet    mat4
 
-- same computation, different indexing
 
mat6 : MATRIX INT := matrix [[1,2,3],[4,5,6],[7,8,9]]
rowEchelon mat6
rank       mat6
nullity    mat6
nullSpace  mat6
 
mat8 : MATRIX INT := _
 matrix [[1,-2,13,0,5,-47],[-4,15,0,16,-2,1],[-7,0,8,-11,9,0]]
rowEchelon mat8
rank       mat8
nullity    mat8
nullSpace  mat8
 
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}