This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problem with large arrays


Quoting Peter Teuben <teuben@astro.umd.edu>:

> On Thu, 7 Jul 2005 apaz@purdue.edu wrote:
> 
> > 
> > Well, I need to work with large arrays that must be share by several
> classes. I
> > new into C/Objective-C. I'm a Fortran programmer. THere, I used to work
> with
> > dynamic allocation of memory. What's the best way to work whith large
> arrays in
> > Objective-C ?
> 
> i would probably write a function to allocate dynamic arrays, that way you'd
> have something like (e.g.)
> 	double ****a = array4d(10,20,4,50);
> which i once did using a "recursive" (array4d would call array3d etc.)
> technique. You can find that in the NEMO package under the the name
> mdarray:
> 	http://bima.astro.umd.edu/nemo/man_html/mdarray.3.html
>  Or, more elegantly, use classes for this.
> 
> peter
> 


I have being trying this, but the program is taking too much memory (more than 3
G) when building an array of the following dimensions (197, 9, 15, 150), which I
don't consider too large. My code needs several of this arrays and I'm able to
run it without any problem in the same machine using Fortran.

Any help will be great!!

Thank you,

Alex


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]