This is the mail archive of the gsl-discuss@sourceware.org mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Column Major


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
> 
> 
>  
> 





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]