Performance of struct

This looks good, except that since ComplexF64 is a concrete type little is gained by parameterising like this. That is, the only type T that satisfies T <: ComplexF64 is T == ComplexF64.

Did you mean:

struct El{T<:Complex}
  H::Array{T,2}
  N::Int64
  name::String
end

instead? This works just as well as long as T is a concrete type, (which it will be since the only types that satisfy T <: Complex are types like Complex{Float64} which is a concrete type).

Edited: I forgot how Complex works.

3 Likes