Incorrect Bound Error Exception

Hello,
I’m doing a enumeration of solutions in a simulation framework.
As an example, I’m consulting if the k-th component in the t-th period was already visited:
sum(wx[k,1:t])==0

The weird thing is that is throwing the following exception in execution time:

BoundsError: attempt to access 117×5 Array{Float64,2} at index [177, 1:4]
throw_boundserror(::Array{Float64,2}, ::Tuple{Int64,UnitRange{Int64}}) at abstractarray.jl:433
checkbounds at abstractarray.jl:362 [inlined]
macro expansion at multidimensional.jl:441 [inlined]
_getindex at multidimensional.jl:438 [inlined]
getindex at abstractarray.jl:882 [inlined]
SolveADP(::Float64, ::Array{Float64,1}, ::Int64, ::Int64, ::Int64, ::Int64, ::Float64, ::Array{Float64,2}, ::Int64, ::Array{Array{Int32,1},1}, ::Array{Int32,1}, ::Array{Float64,2}, ::UnitRange{Int64}, ::Array{Any,1}) at adp.jl:258
macro expansion at adp.jl:495 [inlined]
anonymous at :?
include_string(::String, ::String) at loading.jl:515
include_string(::String, ::String, ::Int64) at eval.jl:30
include_string(::Module, ::String, ::String, ::Int64, ::Vararg{Int64,N} where N) at eval.jl:34
(::Atom.##49#53{String,Int64,String})() at eval.jl:50
withpath(::Atom.##49#53{String,Int64,String}, ::String) at utils.jl:30
withpath(::Function, ::String) at eval.jl:38
macro expansion at eval.jl:49 [inlined]
(::Atom.##48#52{Dict{String,Any}})() at task.jl:80

I think there is no bound error, any idea of the source of the error?
Thanks!

k seems to be 177 while size(wx, 1) is only 117BoundsError.

1 Like