Timing matrix-vector multiplication¶
Let’s repeat the experiment of the previous figure for more, and larger, values of n.
Plotting the time as a function of n on log-log scales is equivalent to plotting the logs of the variables, but is formatted more neatly.
You can see that while the full story is complicated, the graph is trending to a straight line of positive slope. For comparison, we can plot a line that represents O(n2) growth exactly. (All such lines have slope equal to 2.)