[問題] 東吳考古-化簡程式
Assuming the 2-dimensional matrix is stored in memory using row-major order.
To improve the performance of the matrix multiplication, what can you do to
the following algorithm to make it run faster ?
Assuming c=a*b
for(i = 0 ; i < n ; i ++ )
for(j = 0 ; j < n ; j ++)
for(k = 0 ; k < n ; k ++)
c[i][j] += a[i][k] * b[k][j]
小弟只知道拆成2個 2個的for迴圈 (還是有別的解法?)
但不知道要怎樣下手....
麻煩各為大大了m(__ __)m
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.223.194.17
→
06/06 02:20, , 1F
06/06 02:20, 1F
推
06/06 07:05, , 2F
06/06 07:05, 2F
※ 編輯: XrGodz 來自: 61.229.21.41 (06/06 10:03)
推
06/06 12:44, , 3F
06/06 12:44, 3F