BioStructures.jl
BioStructures.jl copied to clipboard
3-vector for coordinates?
Most of the structs in this package are now quite efficient, but I see one more potential opportunity: Atom's coords field is a Vector{Float64}. Assuming this will always be a 3-vector, one option would be to create a Coordinates type. MIToS does this already, although their array type is immutable. Is this kind of change something worth considering? Would it need to be mutable? I'm thinking of methods like applytransform!.
Yes we should think about doing something like this. Coordinates will always be a 3-vector.
We would want to be able to change the coordinates of an atom but could make Atom itself mutable and keep the coordinates immutable, assigning new coordinates via coords!/x!/y!/z!. In that case SVector{3, Float64} might be sufficient. If making Atom mutable gives slowdowns we could try MVector too.