Optimized matrix multiplication in C

后端 未结 13 2427
一整个雨季
一整个雨季 2020-11-30 01:44

I\'m trying to compare different methods for matrix multiplication. The first one is normal method:

do
{
    for (j = 0; j < i; j++)
    {
        for (k          


        
13条回答
  •  Happy的楠姐
    2020-11-30 02:24

    If the matrix is not large enough or you don't repeat the operations a high number of times you won't see appreciable differences.

    If the matrix is, say, 1,000x1,000 you will begin to see improvements, but I would say that if it is below 100x100 you should not worry about it.

    Also, any 'improvement' may be of the order of milliseconds, unless yoy are either working with extremely large matrices or repeating the operation thousands of times.

    Finally, if you change the computer you are using for a faster one the differences will be even narrower!

提交回复
热议问题