(j3.2006) reverse section contiguous?
Dick Hendrickson
dick.hendrickson
Thu Jan 5 16:52:05 EST 2012
On Thu, Jan 5, 2012 at 12:56 PM, Bill Long <longb at cray.com> wrote:
> The question arose as to, given
>
> ? ?real x(10)
>
> whether
>
> ? ?x(10:1:-1)
>
> is CONTIGUOUS.
>
> The relevant part of the "is contiguous" ?rules is
>
> "An object is contiguous if it is ...
>
> ? (6) a nonzero-sized array section (6.5.3) provided that ...
>
> ? ? ?(c) the elements of the section, in array element order, are a subset
> of
> ? ? ?the base object elements that are consecutive in array element order,"
>
> The elements of the section are ?{A(10), A(9), A(8), ..., A(1)} ?which, as a
> set of elements, is a subset of {A(1), A(2), ..., A(10)}. (Perhaps "subset"
> is a flawed word here.)
>
> The test for NOT contiguous includes:
>
> "the elements of the object in array element order are not consecutive in
> the
> elements of the base object"
>
> which does appear to be satisfied, since "consecutive" implies both an
> ordering and adjacent.
>
> Did we intent for X(10:1:-1) to be CONTIGUOUS? ? In other words, is "packed
> in memory with no gaps" good enough here, or do we also require "memory
> locations in the same order as the memory locations of an explicit-shape
> whole array"?
Since I don't go to the meetings, I'll vote early. I think the second
choice is the one we meant. I think we added contiguous to
A) allow optimizers to do fast addressing without having to worry
about the stride part of the dope vector and
B) to allow contiguous arrays to be easily passed to other languages
which don't naturally have strided arrays.
Dick Hendrickson
>
> Cheers,
> Bill
>
> --
> Bill Long ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? longb at cray.com
> Fortran Technical Support ? ?& ? ? ? ? ? ? ? ? voice: 651-605-9024
> Bioinformatics Software Development ? ? ? ? ? ?fax: ? 651-605-9142
> Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101
>
>
> _______________________________________________
> J3 mailing list
> J3 at j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3
More information about the J3
mailing list