If column-major order is used, how is the following matrix stored in memory? a b c d e f g h i

If column-major order is used, how is the following matrix stored in memory?
a b c
d e f
g h i
A. ihgfedcba
B. abcdefghi
C. cfibehadg
D. adgbehcfi
 
Answer: D
Explanation: It starts with the first element and continues in the same column until the end of column is reached and then proceeds with the next column. Fortran follows column-major order.
 

Tìm kiếm

Back
Top