Talk:Multi-dimensional array: Difference between revisions

m
Line 54:
<br/>
::''not explaining that matrices are normally considered as "row major" in mathematics'' But they are not! There is no such thing as '''storage''' in mathematics. When you write a matrix by hand, elements are written in a square. There is no mathematical reason prefer rows to columns: rows for equations? But then columns for basis vectors. And if you actually believe that has the slightest impact on Matmul, then I fear you don't understand at all the difference between storage and the mathematical definition of a matrix product. The latter is perfectly defined and universally accepted (it's also a matter of convention, but it's well established). This may come from an abuse of row-major languages: maybe this leads you to think it's natural and everything else is not. This is plain wrong.
::Regarding puzzled users: anyone doing numerical analysis should be aware that array storage depends on language and/or mathematical library. Even when programming in C for numerical linear algebra, it's likely you will make use of a vendor optimized LAPACK library. Fortran is not the only one to use column-major order. Matlab, VBA and R do, for instance. Of course it comes from Fortran roots, but nevertheless, they do. It's the right place in RC to tell the difference, not to express your personal opinion that you don't understand why it's so. After all, one could also ask, why otherlater languages did not follow the Fortran convention?
::As to actual reasons to prefer column-major or row-major? I don't know the original reason. There may be actually none, in fact. Since it's mostly equivalent (regarding implementation of numerical algorithms), it's perfectly acceptable to choose one or the other. And to see why it's equivalent, I suggest having a look at ''Matrix Computations'' (Golub & Val Loan). They give a good discussion on row-wise and column-wise algorithms.
::[[User:Arbautjc|Arbautjc]] ([[User talk:Arbautjc|talk]]) 11:11, 25 October 2016 (UTC)
Anonymous user