Quote:Original post by Hyrcan
No, Rune Hunter is perfectly fine, row/column major is actually the right term.
Hyrcan, I believe you are incorrect. I can't be 100% sure without knowing more about the OP's situation, but I'm pretty sure.
You say that the OP's issue is related to matrix 'majorness', but I propose that it's related to notational convention.
First, note that nowhere in the OP's posted code are 1-d indices used. Instead, we see individual named elements (e.g. M11), and named rows and columns (e.g. Row1, Column1, etc.). Since these member fields identify specific elements, rows, and columns (irrespective of the underlying storage), majorness should not be an issue for the code as shown.
This statement is also telling:
Quote:Original post by Rune Hunter
Because Wolfram|Alpha uses column major matrices (like much of math)
First of all, I can't find anything online that indicates that Mathematica uses column-major matrices; all the references I found suggest that matrices are represented as 'lists of lists', and that they are entered in row-major form by default.
Second of all, it doesn't make much sense to say that 'much of math' uses column-major matrices (in a typical reference on linear algebra, the question of 'row-major vs. column-major' is unlikely to even come up, I would think). However, it
is true that much of math makes use of column
vectors, another indication that the OP may have been using the wrong term.
Furthermore, the OP himself states that he actually meant 'row/column vector':
Quote:Original post by Rune Hunter
Sorry about that. I do mean I am using row vectors while Wolfram|Alpha and the Wikipedia article are using column vectors.
Now, since there's clearly some confusion about the issue, I suppose the above statement might be incorrect as well, but the evidence doesn't seem to indicate that.
In any case, overall there seems to be more evidence for it being a notation issue (row vs. column vectors) than a matrix layout issue (row- vs. column-major). I don't think there's enough information in the thread to say for sure, but I'd say that my guess is at least as good as yours (and if I had to bet, I'd bet on it being a notational issue).