[理工] [資結]-一些矩陣的計算問題

看板Grad-ProbAsk作者 (NULL)時間14年前 (2009/12/16 21:40), 編輯推噓2(202)
留言4則, 3人參與, 最新討論串1/2 (看更多)
一、What is the address for a[5][3] for an array declared as a[7][8]? Assume a row major ordering, 10 units of memory per element, and staring address is 1000. 二、Given A as an N by N array(N>=2) with A[i,j]=0 if |i-j|>2. Then, determine the maximal number of nonzero elements in A. 三、另外想請問一下row/column-major 到底怎麼判斷會比較準? ex1: A(0,5)=36 A(1,4)=56 A(2,7)=92 是row-major嗎? ex2: B(2,3)=18 B(3,2)=28 A(1,1)=2 是row-major嗎? 以上請賜教,感謝。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.57.105.22

12/16 23:34, , 1F
我也想知道= ="
12/16 23:34, 1F

12/16 23:47, , 2F
判斷哪個MAJOR把矩陣畫出來就很明顯了
12/16 23:47, 2F

12/17 20:46, , 3F
所謂major就是對位址變化的影響比較major
12/17 20:46, 3F

12/17 20:48, , 4F
ex1前兩個比,row變大、column變小,位址增加,就row-major
12/17 20:48, 4F
文章代碼(AID): #1BAEDGKO (Grad-ProbAsk)
文章代碼(AID): #1BAEDGKO (Grad-ProbAsk)