Re: A Matrix collection class
Re: A Matrix collection class
- Subject: Re: A Matrix collection class
- From: Chris Purcell <email@hidden>
- Date: Wed, 8 May 2002 07:44:35 +0100
The problem with that approach is that it gets very memory and time
inefficient if you have several dimensions - need to set up an awful lot
of NSArrays. I was hoping for something a little less ugly.
Kritter out
Chris Purcell wrote:
|Does anyone know of a good implementation of a matrix collection
class -
|a multi-dimensional array class without the overheads of NSDictionary?
Would an array of arrays (technically, an NSArray containing NSArrays)
work? (I don't think I'd even consider NSDictionary to implement a
matrix, unless maybe you want a sparse matrix.) You could wrap it in
its own class to hide the ugliness. For example:
- (id) objectAtRow: (int) r column: (int) c
{
return [[iMatrix objectAtIndex: r] objectAtIndex: c];
}
Glen Fisher
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.