aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/matrix.spad.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra/matrix.spad.pamphlet')
-rw-r--r--src/algebra/matrix.spad.pamphlet16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/algebra/matrix.spad.pamphlet b/src/algebra/matrix.spad.pamphlet
index 3704e00e..a5c173dc 100644
--- a/src/algebra/matrix.spad.pamphlet
+++ b/src/algebra/matrix.spad.pamphlet
@@ -205,7 +205,7 @@ Matrix(R): Exports == Implementation where
-- -- error check: this is a top level function
-- cols := # v.mini(v)
-- for k in (mini(v) + 1)..maxi(v) repeat
--- cols ^= # v.k => error "matrix: rows of different lengths"
+-- cols ~= # v.k => error "matrix: rows of different lengths"
-- ans := new(rows,cols,0)
-- for i in minr(ans)..maxr(ans) for k in mini(v)..maxi(v) repeat
-- vv := v.k
@@ -303,9 +303,9 @@ RectangularMatrix(m,n,R): Exports == Implementation where
matrix(l: List List R) ==
-- error check: this is a top level function
- #l ^= m => error "matrix: wrong number of rows"
+ #l ~= m => error "matrix: wrong number of rows"
for ll in l repeat
- #ll ^= n => error "matrix: wrong number of columns"
+ #ll ~= n => error "matrix: wrong number of columns"
ans : Matrix R := new(m,n,0)
for i in minr(ans)..maxr(ans) for ll in l repeat
for j in minc(ans)..maxc(ans) for r in ll repeat
@@ -318,7 +318,7 @@ RectangularMatrix(m,n,R): Exports == Implementation where
coerce(x:$):Matrix(R) == copy(x pretend Matrix(R))
rectangularMatrix x ==
- (nrows(x) ^= m) or (ncols(x) ^= n) =>
+ (nrows(x) ~= m) or (ncols(x) ~= n) =>
error "rectangularMatrix: matrix of bad dimensions"
copy(x) pretend $
@@ -410,9 +410,9 @@ SquareMatrix(ndim,R): Exports == Implementation where
matrix(l: List List R) ==
-- error check: this is a top level function
- #l ^= ndim => error "matrix: wrong number of rows"
+ #l ~= ndim => error "matrix: wrong number of rows"
for ll in l repeat
- #ll ^= ndim => error "matrix: wrong number of columns"
+ #ll ~= ndim => error "matrix: wrong number of columns"
ans : Matrix R := new(ndim,ndim,0)
for i in minr(ans)..maxr(ans) for ll in l repeat
for j in minc(ans)..maxc(ans) for r in ll repeat
@@ -426,14 +426,14 @@ SquareMatrix(ndim,R): Exports == Implementation where
scalarMatrix r == scalarMatrix(ndim,r)$Matrix(R) pretend $
diagonalMatrix l ==
- #l ^= ndim =>
+ #l ~= ndim =>
error "diagonalMatrix: wrong number of entries in list"
diagonalMatrix(l)$Matrix(R) pretend $
coerce(x:$):Matrix(R) == copy(x pretend Matrix(R))
squareMatrix x ==
- (nrows(x) ^= ndim) or (ncols(x) ^= ndim) =>
+ (nrows(x) ~= ndim) or (ncols(x) ~= ndim) =>
error "squareMatrix: matrix of bad dimensions"
copy(x) pretend $