From f13c7c6ff91ff3256bb4b24fb64beabfef2ccd2a Mon Sep 17 00:00:00 2001 From: dos-reis Date: Mon, 13 May 2013 13:36:34 +0000 Subject: * 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. --- src/algebra/array2.spad.pamphlet | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'src/algebra/array2.spad.pamphlet') 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} <>= --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 -- cgit v1.2.3