summaryrefslogtreecommitdiff
path: root/module/linalg.m
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2006-12-22 20:52:35 +0000
committerCharles.Forsyth <devnull@localhost>2006-12-22 20:52:35 +0000
commit46439007cf417cbd9ac8049bb4122c890097a0fa (patch)
tree6fdb25e5f3a2b6d5657eb23b35774b631d4d97e4 /module/linalg.m
parent37da2899f40661e3e9631e497da8dc59b971cbd0 (diff)
20060303-partial
Diffstat (limited to 'module/linalg.m')
-rw-r--r--module/linalg.m24
1 files changed, 24 insertions, 0 deletions
diff --git a/module/linalg.m b/module/linalg.m
new file mode 100644
index 00000000..ccc3288d
--- /dev/null
+++ b/module/linalg.m
@@ -0,0 +1,24 @@
+# The convention used here for storing matrices is the same commonly
+# used for scientific programming in C, namely linearizing in Fortran order.
+# Let A be an m by n matrix. We represent this by
+# a: array of real;
+# m, n, lda: int;
+# where the variable lda ("leading dimension of a") is used so that a
+# succession of matrix problems of varying sizes can be created without
+# wholesale copying of data. The element of A in the i-th row and j-th column
+# is stored in a[i+lda*j], where 0<=i<m and 0<=j<n. This 0-origin indexing
+# is used everywhere, and in particular in permutation vectors.
+
+LinAlg: module{
+ PATH: con "/dis/math/linalg.dis";
+
+ Vector: type array of real;
+ Matrix: adt{
+ m, L, n: int; # rows, column stride, columns
+ a: Vector; # data, stored A[i,j] = a[i+L*j]
+ };
+
+ dgefa: fn(a:array of real, lda, n:int, ipvt:array of int): int;
+ dgesl: fn(a:array of real, lda, n:int, ipvt:array of int, b:array of real, job:int);
+ printmat: fn(label:string, a:array of real, lda, m, n:int);
+};