Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
高级会员
注册日期: 2019-11-21
帖子: 3,006
声望力: 66 ![]() |
![]() I wrote this algorithm that resolves matrix-vector product two ways: 1) inner-product: Y11 = A11*X11 + A12*X21 + .... + A1n*n1 and so on 2) lineal combination: Y = Colum1mn*X1 + Column2*X2 and so on I did this because i wanted to compare who is the fastest way to multiply Matrix-Vector i tried with n=[10000,9000,8000,7000,6000,5000,4000,3000,2000,1500,1000,800,500,300,100] run the algorith 3 times and took the average value with every value of n and got this graph, and i was right, inner-product is the fastest because of how is saved matrix in memory thats ok but i ran algorithm 3 times to graph the points and got that Time of N=7000 > time of N=8000 > time of N=9000. And i want to know why is this? i thought that it could be something like the computer will start calculating slowly but if i run the algorithm more times it will calculate faster. But i ran the algorithm 7 times after the first 3 (10 in total) and got about the same result (this time n=7000 time was about 130 sec not 150 but still is time 7000 > time 8000 > time 9000) This is the code i wrote
More... |
![]() |
![]() |