aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/array2.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2013-05-13 13:36:34 +0000
committerdos-reis <gdr@axiomatics.org>2013-05-13 13:36:34 +0000
commitf13c7c6ff91ff3256bb4b24fb64beabfef2ccd2a (patch)
tree3cafc2a733bebdb79e26063102dacb9e11aae88f /src/algebra/array2.spad.pamphlet
parentee6014ad79a7499469b3a144e3af839678db1b9e (diff)
downloadopen-axiom-f13c7c6ff91ff3256bb4b24fb64beabfef2ccd2a.tar.gz
* algebra/array2.spad.pamphlet (InnerTwoDimensionalArray): Inherit
empty? and empty from base domain. (TwoDimensionalArray): Attribute shallowlyMutable is already specified by TwoDimensionalArrayCategory. * algebra/matcat.spad.pamphlet (MatricCategory): Attributes shallowlyMutable and finiteAggregate are already specified by TwoDimensionalArrayCategory.
Diffstat (limited to 'src/algebra/array2.spad.pamphlet')
-rw-r--r--src/algebra/array2.spad.pamphlet23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/algebra/array2.spad.pamphlet b/src/algebra/array2.spad.pamphlet
index 0c9ff532..7b3aaf9d 100644
--- a/src/algebra/array2.spad.pamphlet
+++ b/src/algebra/array2.spad.pamphlet
@@ -272,20 +272,10 @@ InnerTwoDimensionalArray(R,Row,Col):_
Exports == TwoDimensionalArrayCategory(R,Row,Col)
Implementation == PrimitiveArray PrimitiveArray R add
-
---% Predicates
-
- empty? m == empty? rep m
-
--% Primitive array creation
-
- empty() == per empty()$Rep
-
new(rows,cols,a) ==
rows = 0 =>
error "new: arrays with zero rows are not supported"
--- cols = 0 =>
--- error "new: arrays with zero columns are not supported"
arr : Rep := new(rows,empty())
for i in 0..rows-1 repeat
arr.i := new(cols,a)
@@ -300,7 +290,7 @@ InnerTwoDimensionalArray(R,Row,Col):_
nrows m == # rep m
ncols m ==
empty? m => 0
- # rep(m)(minIndex rep m)
+ # rep(m).0
--% Part selection/assignment
@@ -346,18 +336,17 @@ TwoDimensionalArray(R):Exports == Implementation where
++ A TwoDimensionalArray is a two dimensional array with
++ 1-based indexing for both rows and columns.
R : Type
- macro Row == OneDimensionalArray R
- macro Col == OneDimensionalArray R
- Exports == TwoDimensionalArrayCategory(R,Row,Col) with
- shallowlyMutable
- ++ One may destructively alter TwoDimensionalArray's.
- Implementation == InnerTwoDimensionalArray(R,Row,Col)
+ macro V == OneDimensionalArray R
+ Exports == TwoDimensionalArrayCategory(R,V,V)
+ Implementation == InnerTwoDimensionalArray(R,V,V)
@
\section{License}
<<license>>=
--Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
--All rights reserved.
+--Copyright (C) 2007-2013, Gabriel Dos Reis.
+--All rights reversed.
--
--Redistribution and use in source and binary forms, with or without
--modification, are permitted provided that the following conditions are