Xref: utzoo comp.lang.fortran:4157 comp.lang.c:34272 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!lanl!ttw From: ttw@lanl.gov (Tony Warnock) Newsgroups: comp.lang.fortran,comp.lang.c Subject: Re: Fortran vs. C for numerical work (SUMMARY) Message-ID: <7097@lanl.gov> Date: 27 Nov 90 23:38:17 GMT References: <1990Nov21.220816.15220@rice.edu> <2173@tuvie> <9458:Nov2721:51:5590@kramden.acf.nyu.edu> Organization: Los Alamos Natl Lab, Los Alamos, N.M. Lines: 25 Re: >> 2. C has no conformant arrays, i.e. you can't do the equivalent of: > [ ... ] >> In C you either have to do your own indexing *(a + j*m +i) or have >> pointers to pointers *(*(a + i) + j). Dan Bernstein writes: >I agree that this is a problem. However, the double-pointer solution >usually allows faster access than the standard method of storing arrays, >doesn't waste much memory, allows more flexibility, gets around the >memory management problems of some small architectures, and lets you use >a[i][j] for *(*(a + i) + j), all within current C. It is extremely >difficult to do this efficiently in Fortran, and it will continue to be. What is it that Dan thinks is difficult? He uses only "this" so it is not clear what he has in mind. Fortran has allowed one to write a(i,j,k,l,m,n,p) for years. If done inside a loop where one of the supscripts is varying, there is only a single addition (if that) to do indexing. If the subscripts are chosed at random, how does having a pointer help: the necessary offset must still be gotten somehow.