2

I know there is a word that represents the most rapidly changed index which starts with "M...", but I can not recall the word even after searching through the internet. So I come here to ask for your help: would you please tell me what the word is.

In computer science, if we have a two-dimensional array (indexed by X and Y), we store the elements of that array in X first order, so the order of the 3X2 array is: [X1,Y1] [X2,Y1], [X3,Y1], and then [X1,Y2],[X2,Y2],[X3,Y2], X is the M... axis; it represents the most rapidly changed indices.

Would you please tell me what the word is? It starts with an M.

  • 1
    I think this is too domain-specific for this forum - perhaps you could ask on a computer science or maths forum? – Max Williams Apr 7 '16 at 9:38
  • Even coming as I do from a computing background, I'm not sure what word you're after here. In 2D arrays we usually just call both indices...well, "indices". You could maybe call the first one the primary index, but I can't think of anything that begins with M. – John Clifford Apr 7 '16 at 9:39
  • 1
    The only thing I can think of beginning with M that even comes close to being related is matrix. – John Clifford Apr 7 '16 at 9:40
  • 3
    I'm voting to close this question as off-topic because it belongs on another site in the SE network. – Edwin Ashworth Apr 7 '16 at 10:12
  • 1
    Thank you all! I really appricate all your help. I think the answer is "minor axis" and "major axis". – J.Doe Apr 7 '16 at 13:55
5

You may be after major.

In Fortran the first index is the most rapidly varying index when moving through the elements of a two dimensional array as it is stored in memory. If you adopt the matrix convention for indexing, then this means the matrix is stored one column at a time (since the first index moves to the next row as it changes). Thus Fortran is considered a Column-major language. C has just the opposite convention. In C, the last index changes most rapidly as one moves through the array as stored in memory. Thus C is a Row-major language. The matrix is stored by rows. Note that in both cases it presumes that the matrix convention for indexing is being used, i.e., for both Fortran and C, the first index is the row. Note this convention implies that the indexing convention is invariant and that the data order changes to keep that so.

Numpy arrays from Scipy.org (my emphases)

  • Good answer, I did consider major but that seemed too simple to be what the OP was looking for. On reflection that's probably it, though. – John Clifford Apr 7 '16 at 9:51
  • I got it,thank you so much for your help. I think this is right answer. – J.Doe Apr 7 '16 at 13:56
3

If by rapid you mean the one changed most often as you traverse the 2D array in order then you mean major

A 2D matrix contains items indexed by two numbers (row and column), but it is stored internally as a 1D contiguous block of memory, accessible with a single number. There is more than one way of storing matrix items in a 1D block of memory: we can put the elements of the first row first, the second row then, and so on, or the elements of the first column first, the second column then, and so on. The first method is called row-major order, whereas the latter is called column-major order. Choosing between the two methods is only a matter of internal convention: NumPy uses the row-major order, like C, but unlike FORTRAN.

ipython-books.github.io

2

A common labelling is major axis (or primary axis) and minor axis (or secondary axis).

See pandas for an example.

Not the answer you're looking for? Browse other questions tagged or ask your own question.