10MultiArrays-handout

10MultiArrays-handout - More on Multidimensional Arrays...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
More on Multidimensional Arrays Amir Hossein Rabbani Winter 2009
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Review 0 2 0 0 1 0 1 1 0 0 0 2 0 0 2 3 1 0 2 0 1 1 0 1 2 2 3 3 3 3 2 2 2 3 3 2 2 2 2 3 3 3 2 2 2 3 3 2 Occupancy Capacity 1 2 3 4 5 6 Column Indices 1 2 3 4 Row Indices 1 2 3 4 5 6 1 2 INTEGER :: Hotel_Elephant (2,4,6) Hotel_Elephant ( table , floor , room ) Hotel_Elephant (1,2,5) Hotel_Elephant (2,2,5) QuickTimeª and a decompressor are needed to see this picture. Declaration: Access:
Background image of page 2
Processing Tables O O O O O O O O O O O O O O O O 2 methods for processing tables: ROW-MAJOR Cells can accessed row by row O O O O O O O O O O O O O O O O COLUMN-MAJOR Cells can accessed column by column
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Array Input, ROW-MAJOR PROGRAM rowMajor IMPLICIT NONE INTEGER :: X(2,4) INTEGER :: I,J DO I = 1, 2 DO J = 1, 4 READ(*,*) X(I,J) END DO END DO END PROGRAM rowMajor O O O O O O O O input 4 8 3 9 7 5 2 6 ? ? ? ? ? ? ? ?
Background image of page 4
PROGRAM rowMajor IMPLICIT NONE INTEGER :: X(2,4) INTEGER :: I,J DO I = 1, 2 DO J = 1, 4 READ(*,*) X(I,J) END DO END DO END PROGRAM rowMajor O O O O O O O O input 4 8 3 9 7 5 2 6 4 8 3 9 7 5 2 6 Array Input, ROW-MAJOR
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Array Input, COLUMN-MAJOR PROGRAM colMajor IMPLICIT NONE INTEGER :: X(2,4) INTEGER :: I,J DO J = 1, 4 DO I = 1, 2 READ(*,*) X(I,J) END DO END DO END PROGRAM colMajor O O O O O O O O input 4 8 3 9 7 5 2 6 ? ? ? ? ? ? ? ?
Background image of page 6
Array Input, COLUMN-MAJOR PROGRAM colMajor IMPLICIT NONE INTEGER :: X(2,4) INTEGER :: I,J DO J = 1, 4 DO I = 1, 2 READ(*,*) X(I,J) END DO END DO END PROGRAM colMajor O O O O O O O O input 4 8 3 9 7 5 2 6 4 3 7 2 8 9 5 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Compare input 4 8 3 9 7 5 2 6 4 3 7 2 8 9 5 6 4 8 3 9 7 5 2 6 ROW-MAJOR COLUMN-MAJOR
Background image of page 8
QuickTimeª and a
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 27

10MultiArrays-handout - More on Multidimensional Arrays...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online