Hi,
With Julia 0.5 I'm little bit confused what is the best approach for high 
speed array access. I'm writing a simulation where particles move in the 
field interpolated from an irregular mesh of tetrahedrons in 3D.
So i basically have a *points* array of MyPoint (= 3xFloat64, stands for 
x,y,z) and *elements *array of MyElement(= 4xUInt32,  stands for indexes to 
points forming a tetrahedron) and some lookup arrays.
I often access the points by direct indexing  - defining own 
getindex(::MyPoint, ::Integer) for the custom types, such as this example: 

points[elements[tetrahedron_id][vertex_id]][axis_ix] 

or in loops where i prefer treating the arrays as types such as 

for el in elements
  point1 = el[1]
  point2 = el[2]
  r = (point1[1]+point2[1])/2 + (point1[2]+point2[2])/2
end


or even calling specialized functions on MyElement type

for el in elements
  myfunc(el)
end

I'm considering StaticArrays.jl and FixedSizeArrays to use for the 
definition of MyPoint and MyElement, but I'm little bit confused what is 
the actual difference between the two implementation. Could please someone 
explain to me, what is the difference between this two packages? Is one of 
them superseding the other one on 0.5+? What is the difference in memory 
layout and performance consequences?

Thank you very much.
Cheers 
Petr

 

Reply via email to