Re: large numerical arrays
Re: large numerical arrays
- Subject: Re: large numerical arrays
- From: Jason Harris <email@hidden>
- Date: Mon, 24 Jun 2002 21:29:49 -0700
Hi Charles,
I'd definitely suggest sticking with malloc (or new/free). For storing
numerical values, you don't need the overhead of any of the container
classes. And I'd imagine that since you're doing numerical computations,
you're accustomed to the Fortran nastiness of static-sized arrays (yick).
And since most numerical computation is of the form "fetch, operate, store",
you _really_ don't need the overhead...
If you _do_ decide to use a smarter array or vector type, I suggest using
the STL instead of the Cocoa containers. That way, you still don't have the
overhead of the cocoa stuff, and you can write specializations for your
specific numerical types to speed things up.
Hope this helps!
Jason Harris
Charles C. Agosta Tried to Tell Me:
>
Although I have been programming for many years (30?), I am new
>
to object oriented programming. Most of the work I do involves
>
scientific programming that has lots of calculation and very simple
>
user interfaces. I realize that much of my old code will stay the
>
same as I migrate to Cocoa (certainly I am not going to rewrite my
>
trusty Numerical Recipes , despite the fact that it drives me crazy
>
that all of their arrays start with index 1 instead of 0), but what
>
about memory allocation?
>
I often declare a few one or two dimensional arrays of doubles
>
that contain 1 - 5 million members. I used to use malloc, and
>
switched to NewPtr when I started Mac programming about fifteen years
>
ago. NSarray does not seen to apply to simple numerical types. Is
>
there anything that I should consider from the Cocoa class library?
>
Thanks for the help.
>
>
-Chuck
_______________________________________________
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.