Child pages
  • Question 16 - Row-major order versus column-major order in matrices
Skip to end of metadata
Go to start of metadata

In C language, the entries of a matrix are allocated in rows. For example:

The matrix

a
d
g

b
e
h

c
f
i

is stored as [ a b c d e f g h i ]

In FORTRAN, the entries of a matrix are allocated in column. For example:

The matrix

a
d
g

b
e
h

c
f
i

is stored as [ a d g b e h c f i ]

  • No labels