On 01 Jan 09, at 10:56, Adam Foltzer wrote:
Off to do some refactoring of my Swarm class; at the risk of spawning a tangent, am I just completely missing a Cocoa data structure that's suited to matrices of scalar values? I had a working implementation using nested NSMutableArrays, but the code wound up looking disgusting (my fault, not the API's ;-), so I rewrote it with good ol' C arrays, malloc, and free. It has no leaks now, and is really, really fast, but I feel like I shouldn't have
to reinvent the wheel in order to do matrix operations.

The Cocoa collection classes are primarily oriented towards dealing with ObjC objects. If all you're working with is homogeneous arrays of scalar values (or structures consisting of scalar values), you probably are best off using C arrays.

That's not to say that Apple has nothing to offer. If you're performing SIMD-esque operations on large matrices or vectors, the Accelerate framework might have some tools you'd be interested in. It's listed under Carbon for some reason, but it's just as applicable to Cocoa applications.

If that doesn't do it, but you're fine with targeting Intel machines only, dropping down to the SSE primitives may also be an option to consider.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to