[理工] 请问资结一题Row/Column major的问题

楼主: iloveconic (乐陶陶)   2014-10-26 20:47:34
Assume in a byte machine. A is an array declared as
A[-1:m, 2:n] and each element occupied 3 bytes. The
address of A[3,5] ia at 180 and A[5,3] is at 138. Find
the address of the element A[-1,2]
我用Row major和Column major算出来的结果不一样
想在此请问一下是怎么判定是用Column major的@@
是因为A(3,5)=180
V V 这样判定的吗?
A(5,3)=138
A(3,5)=138
↑ 那这样就是Row major吗?
A(5,3)=180
麻烦各位了!!
作者: HiltonCool (野兽疯)   2014-10-26 23:50:00
没错!
楼主: iloveconic (乐陶陶)   2014-10-27 07:48:00
感谢!

Links booklink

Contact Us: admin [ a t ] ucptt.com