From: Z F <mail4me9999@yahoo.com>
To: "Hickey Rob \(ED/ETS4-Wm\)" <Rob.Hickey@us.bosch.com>,
gsl-discuss@sourceware.org
Subject: Re: Column Major
Date: Fri, 18 Sep 2009 16:59:00 -0000 [thread overview]
Message-ID: <153502.68203.qm@web110506.mail.gq1.yahoo.com> (raw)
In-Reply-To: <B7E5FF992B2A6442AFCE58D2D5112F2F0F9E82A1@sbdmail17.us.bosch.com>
Yes, that is exactly my point. No difference at all.
It is all in correct addressing of the memory locations
(i.e. the index "L" in your example).
--- On Fri, 9/18/09, Hickey Rob (ED/ETS4-Wm) <Rob.Hickey@us.bosch.com> wrote:
> From: Hickey Rob (ED/ETS4-Wm) <Rob.Hickey@us.bosch.com>
> Subject: Column Major
> To: mail4me9999@yahoo.com
> Date: Friday, September 18, 2009, 12:07 PM
>
>
>
>
>
> Column Major
>
>
>
>
> CALL COLUMN_MAJOR_TEST()
>
>
> END
>
>
> !
> **********************************************************************
>
>
> SUBROUTINE COLUMN_MAJOR_TEST()
>
>
> !
> **********************************************************************
>
>
>
> !
> DEMONSTRATE COLUMN MAJOR
>
>
> !
> ----------------------------------------------------------------------
>
>
> IMPLICIT NONE
>
>
> INTEGER I, J, K, L
>
>
> INTEGER, PARAMETER :: NI = 2, NJ = 3, NK =
> 4
>
>
> INTEGER, DIMENSION(NI,NJ,NK) :: MAT
>
>
> INTEGER, DIMENSION(NI*NJ*NK) :: VEC
>
>
>
>
>
> DO I = 1,NI
>
>
> DO J =
> 1,NJ
>
>
>
> DO K =
> 1,NK
>
>
> MAT(I,J,K) =
> 100*I + 10*J +
> K
>
>
>
>
> ENDDO
>
>
> ENDDO
>
>
> ENDDO
>
>
>
>
>
> VEC(:) = RESHAPE (MAT, (/NI*NJ*NK/))
>
>
>
>
>
> DO I = 1,NI
>
>
> DO J =
> 1,NJ
>
>
>
> DO K =
> 1,NK
>
>
> L = I
> + NI*((J-1) + NJ*((K-1) + NK*(0))) !
> ...etc
>
>
>
> WRITE(*,'(8(1X,I4))') I,J,K,L, MAT(I,J,K),
> VEC(L)
>
>
>
> ENDDO
>
>
> ENDDO
>
>
> ENDDO
>
>
>
>
>
> END SUBROUTINE COLUMN_MAJOR_TEST
>
>
>
>
parent reply other threads:[~2009-09-18 16:59 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <B7E5FF992B2A6442AFCE58D2D5112F2F0F9E82A1@sbdmail17.us.bosch.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=153502.68203.qm@web110506.mail.gq1.yahoo.com \
--to=mail4me9999@yahoo.com \
--cc=Rob.Hickey@us.bosch.com \
--cc=gsl-discuss@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).