Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!mailrus!ncar!tank!oddjob!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.fortran Subject: Re: Fortran versus C for numerical analysis Message-ID: <13567@mimsy.UUCP> Date: 15 Sep 88 01:16:51 GMT References: <1457@valhalla.ee.rochester.edu> <3570@lanl.gov> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 51 >In article <1457@valhalla.ee.rochester.edu> davis@galaxy.ee.rochester.edu >(Al Davis) writes: >>Well, what is wrong with an array of pointers? Having worked with both, I >>believe the array of pointers is the superior method. It eliminates the > ^^^^^^^^^^^^^^^ >>conformant array fudge. It is usually faster. It is more general. It > ^^^^^^^^^^^^^^^^^^^^ >>works for strangely shaped sparse matrices. Etc. In article <3570@lanl.gov> jlg@lanl.gov (Jim Giles) writes: >I agree with everything above except the marked portions. Good so far. >If I want an array of pointers to pointers to ..., I should do something >different from just declaring a two dimensional array - arrays of pointers >aren't the same! You have just described C declarations. >For one thing, they are almost always slower - they can _never_ ^^^^^^^^^^^^^^^^^^^^ >be faster because a conformant array _can_ be implemented that way if >necessary. An array of pointer to pointer to ... _can't_ be treated >as a conformant array though - some of the pointers might be aliased! It is true that they can never be faster. Saying that they are `almost always slower', however, shows just as much bias as Al Davis's claim. >The fact that they usually aren't doesn't help, the optimizer must assume >that it's possible. Someone claimed that interprocedural alias detection >will soon be simple - I haven't seen it yet. Of course not. When I said `soon' I meant `on the order of 10 years'. (This is certainly not `soon enough' for those doing this sort of work now.) >... Indeed, >it's possible to extend Fortran to include pointers (the Fortran I use >has them), it's very difficult to get conformant arrays in C - even >when that's what you really want! Indeed, it is possible to extend C to include conformant arrays (the C I use has them%); it is very difficult to get pointers in Fortran---even when that is what you really want! ----- % Well, actually, I do not use it. It is GCC, available for free from prep.ai.mit.edu and other places on the Internet. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris