Re: Passing Selected Contiguous Elements of Arrays ??
- From: Ron Shepard <ron-shepard@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 17 Nov 2009 15:10:05 -0600
In article <hdqpiq$li6$1@xxxxxxxxxxxxxxxx>,
glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx> wrote:
Well, one way is to use assumed shape which can process non-contiguous
arrays fairly easily. (Though possibly slower due to cache effects.)
The Fortran 77 way is to pass both the actual dimension for all
except the rightmost, in addition to the subarray dimensions.
(Which still works in later versions as assumed size or explicit
size.)
The above "cache effect" comment applies equally to both situations.
That is, it is due to the effect of noncontiguous addressing on the
hardware rather than to the differences in the two features of the
language.
Also, on some compilers the assumed shape approach is more flexible.
For example, a TRANSPOSE() expression in an actual argument might be
done simply with dope vector manipulation rather than creating a copy,
while the f77 approach would always require an explicit copy. You can
verify this with the (nonstandard) loc() function; it surprised me the
first time I saw a compiler do this.
$.02 -Ron Shepard
.
- References:
- Passing Selected Contiguous Elements of Arrays ??
- From: monir
- Re: Passing Selected Contiguous Elements of Arrays ??
- From: glen herrmannsfeldt
- Passing Selected Contiguous Elements of Arrays ??
- Prev by Date: Re: Random number generators
- Next by Date: Re: Random number generators
- Previous by thread: Re: Passing Selected Contiguous Elements of Arrays ??
- Next by thread: ♬+♬+♬ 2009 Prada shoes Cheap *** at website www.fjrjtrade.com <***>
- Index(es):