Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexander Samoilov alsam

View GitHub Profile
@alsam
alsam / FArray.jl
Last active Apr 13, 2016
Julia implementation Fortran-like array with arbitrary starting indices, negative or zero. Incurs a reasonable overhead vs. Base.Array, expected performance degradation should be strictly less than 2x.
View FArray.jl
# Fortran-like array with arbitrary starting indices
#
# usage:
#
# julia> include("FArray.jl")
# size (generic function with 51 methods)
#
# julia> y = FArray(Float64, -1:1, -7:7, -128:512, -5:5, -1:1, -3:3, -2:2, -1:1);
#
# julia> y[-1,-7,-128,-5,-1,-3,-2,-1] = 14