ERROR: LoadError: BoundsError: attempt to access 3-element Array{Int64,1} at index [4]
Stacktrace:
[1] getindex(::Array{Int64,1}, ::Int64) at ./array.jl:554
[2] include_string(::String, ::String) at ./loading.jl:522
[3] include_string(::String, ::String, ::Int64) at /home/gluon/.julia/v0.6/CodeTools/src/eval.jl:30
[4] include_string(::Module, ::String, ::String, ::Int64, ::Vararg{Int64,N} where N) at /home/gluon/.julia/v0.6/CodeTools/src/eval.jl:34
[5] (::Atom.##92#97{String,Int64,String})() at /home/gluon/.julia/v0.6/Atom/src/eval.jl:52
[6] withpath(::Atom.##92#97{String,Int64,String}, ::String) at /home/gluon/.julia/v0.6/CodeTools/src/utils.jl:30
[7] withpath(::Function, ::String) at /home/gluon/.julia/v0.6/Atom/src/eval.jl:38
[8] hideprompt(::Atom.##91#96{String,Int64,String}) at /home/gluon/.julia/v0.6/Atom/src/repl.jl:67
[9] macro expansion at /home/gluon/.julia/v0.6/Atom/src/eval.jl:49 [inlined]
[10] (::Atom.##90#95{Dict{String,Any}})() at ./task.jl:80
while loading /media/DATA/PhD/code/ising/ising_julia_code/Lattice2.jl, in expression starting on line 24
And just in case, is it possible to use @inboudns and @view in a sum call, like e. g.:
Please note that accessing an out-of-bounds index with an @inbounds declaration is undefined behavior and may cause any arbitrary behavior, including launching nukes, throwing arbitrary non-sensical errors, returning garbage, crashing or calling your parents to complain that you’ve been bad.
Grant the compiler permission to skip bounds checks within the given expression by simply assuming that all indexing is in bounds. If the given index is not actually in bounds your program may crash or produce complete garbage. Elimination of bounds checks is not guaranteed by the @inbounds annotation, merely permitted.