public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/29785]  New: Fortran 2003: POINTER Rank Remapping
@ 2006-11-09 18:48 burnus at gcc dot gnu dot org
  2006-11-09 18:48 ` [Bug fortran/29785] " burnus at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-11-09 18:48 UTC (permalink / raw)
  To: gcc-bugs

POINTER Rank Remapping

(From http://www.fortran.bcs.org/forum2002/f2000dme.htm)
Motivation: ability to have pointers to diagonals of matrices.

  REAL,ALLOCATABLE,TARGET :: base_array(:)
  REAL,POINTER :: matrix(:,:)
  REAL,POINTER :: diagonal(:)
  ...
  ALLOCATE(base_array(n*n))
  matrix(1:n,1:n) => base_array ! rank remapping
  diagonal => base_array(::n+1)

Notes:

* The base array must be rank one, to ensure that the remapping is a simple
linear transformation.
* Both lower bound and upper bound must be specified for each dimension.

Fortran 2003 standard, see "7.4.2.1 Data pointer assignment":
"R735 pointer-assignment-stmt
   is data-pointer-object [ (bounds-spec-list) ] => data-target
   or data-pointer-object (bounds-remapping-list ) => data-target
   or proc-pointer-object => proc-target

C718 (R735) If bounds-spec-list is specified, the number of bounds-specs shall 
            equal the rank of data pointer-object.
C719 (R735) If bounds-remapping-list is specified, the number of 
            bounds-remappings shall equal the rank of data-pointer-object.
C720 (R735) If bounds-remapping-list is specified, data-target shall have rank 
            one; otherwise, the ranks of data-pointer-object and data-target
            shall be the same."

and "7.4.2.1 Data pointer assignment":
"If bounds-remapping-list is specified, data-target shall not be a
disassociated or undefined pointer, and the size of data-target shall not be
less than the size of data-pointer-object. The elements of the target of
data-pointer-object, in array element order (6.2.2.2), are the first
SIZE(data-pointer-object) elements of data-target."


-- 
           Summary: Fortran 2003: POINTER Rank Remapping
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org
OtherBugsDependingO 20585
             nThis:


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29785


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-08-19 16:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-09 18:48 [Bug fortran/29785] New: Fortran 2003: POINTER Rank Remapping burnus at gcc dot gnu dot org
2006-11-09 18:48 ` [Bug fortran/29785] " burnus at gcc dot gnu dot org
2007-04-12  8:19 ` burnus at gcc dot gnu dot org
2008-07-03 16:10 ` burnus at gcc dot gnu dot org
2009-08-07  7:35 ` jv244 at cam dot ac dot uk
2010-07-21  9:03 ` burnus at gcc dot gnu dot org
2010-07-21  9:06 ` domob at gcc dot gnu dot org
2010-07-21 10:14 ` burnus at gcc dot gnu dot org
2010-08-17 17:38 ` domob at gcc dot gnu dot org
2010-08-17 18:21 ` mikael at gcc dot gnu dot org
2010-08-18 19:34 ` domob at gcc dot gnu dot org
2010-08-19 16:03 ` domob at gcc dot gnu dot org
2010-08-19 16:06 ` domob at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).