5.538.232.7[20,20]
5.533.327.8[15,15]
Table 2 shows the time required to access a matrix element when the indices are local variables, for
example, matrix[m1,m2]. The data shows that it takes slightly longer to access an element with
variable indices, but the overhead for indirect access is about the same, at a mean of 5.8 mS.
Table 2
Matrix element access time, variable indices
6.040.234.2[20,20]
5.835.329.5[15,15]
6.030.224.2[10,10]
5.725.219.5[5,5]
5.821.315.5[1,1]20 rows, 20 columns
5.626.220.6[10,10]
5.823.717.9[5,5]
5.721.215.5[1,1]10 rows, 10 columns
Reference method
overhead
Tar - Tav
Access time Tar,
reference method
(mS)
Access time Tav,
value method
(mS)
Element
accessedMatrix dimensions
Table 3 shows the mean time required to access each element of matrices of various sizes. Element
indices are local variables, and the elements were accessed by value, for example, matrix[m1,m2].
Table 3
Mean matrix element access time, direct access
27.458524.94010
35.4108022.63010
26.057520.32010
32.9107018.21010
25.056532.41555
30.3106031.31455
23.655530.11355
27.7105028.91255
21.954527.91155
34.0204027.01055
25.2104025.9955
21.253525.0855
30.0203023.6755
23.8103022.5655
19.152521.4555
29.3302020.9455
25.5202019.7355
21.5102018.9255
Mean access time,
single element (mS)
Matrix
columns
Matrix
rows
Mean access time,
single element (mS)
Matrix
columns
Matrix
rows
7 - 50