Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

Row-major orderとColumn-major order

参考: Wikipedia: Row-major_order

行列を配列に格納するときにどのような順番に格納するかとしてRow-major orderとColumn-major orderの2種類があります。


Column-major orderとRow-major orderではそれぞれ以下のように配列に格納されます。

Address Column-major order Row-major order
0 a11 a11
1 a21 a12
2 a12 a13
3 a22 a21
4 a13 a22
5 a23 a23

Row-major order は C/C++/Objective-C (for C-style arrays), Mathematica, PL/I, Pascal, Speakeasy, SAS, and C#/CLI/.Net などで使われています。
Column-major order は Fortran, OpenGL and OpenGL ES, MATLAB, GNU Octave, S-Plus, R, Julia, Rasdaman, Scilab などで使われています。


Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
Help us understand the problem. What are the problem?