* Re: Column Major
[not found] <B7E5FF992B2A6442AFCE58D2D5112F2F0F9E82A1@sbdmail17.us.bosch.com>
@ 2009-09-18 16:59 ` Z F
0 siblings, 0 replies; only message in thread
From: Z F @ 2009-09-18 16:59 UTC (permalink / raw)
To: Hickey Rob (ED/ETS4-Wm), gsl-discuss
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
>
>
>
>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-09-18 16:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <B7E5FF992B2A6442AFCE58D2D5112F2F0F9E82A1@sbdmail17.us.bosch.com>
2009-09-18 16:59 ` Column Major Z F
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).