There is this: https://github.com/SimonDanisch/FixedSizeArrays.jl

Best,
Simon


Am Dienstag, 2. Februar 2016 01:07:11 UTC+1 schrieb Nathan Baum:
>
> In some code I'm writing I have inner loops which, amongst other things, 
> translate spherical coordinates into Cartesian.
>
> I notice that the inner loop is a *lot* faster if I change the code to 
> use tuples. This makes sense, but when I use tuples I can't use the maths 
> operators and functions that I can with vectors.
>
> Is there some package which provides these functions for tuples or, 
> alternatively, which offers alternative implementations of efficient 
> fixed-length vectors?
>
> The code is
>
> rll2xyz(r, θ, ϕ) = let cosθ = cos(θ)
>   [r * cosθ * cos(ϕ), r * cosθ * sin(ϕ), r * sin(θ)] # slower version
> end
>
>
> vs
>
> rll2xyz(r, θ, ϕ) = let cosθ = cos(θ)
>   (r * cosθ * cos(ϕ), r * cosθ * sin(ϕ), r * sin(θ)) # faster version
> end
>
>
>

Reply via email to