Matrix, Array2D and SequenceableCollection

Richard A. O'Keefe ok at cs.otago.ac.nz
Wed Dec 11 00:10:15 UTC 2002


Brent Pinkney <brent_pinkney at yahoo.co.uk> wrote:
	After sleeping on it, I must agree that it is bollocks
	- a Matrix DOES have an external ordering (row major)
	matching the description in ArrayedCollection.
	
One of the aspects of my Matrix class that I posted here
was that I very much wanted to HIDE the external ordering.

If you iterate over the elements of some collection,
you have no right to expect it to have the same order next
time UNLESS it is a sequenceable collection.

In the same way, if you iterate over a Matrix (my version)
you will see the elements in _some_ order, but you have no
right to expect row major order.  There could (for interfacing
with Fortran, perhaps) be a subclass of Matrix that uses
column major order.  There could be another subclass that
stores band or triangular matrices in some fancy way.




More information about the Squeak-dev mailing list