# Incorrect Bound Error Exception

**URL:** <https://discourse.julialang.org/t/incorrect-bound-error-exception/7525>\
**Category:** Numerics\
**Created:** [December 5, 2017, 11:54am UTC](https://discourse.julialang.org/t/incorrect-bound-error-exception/7525 "2017-12-05T11:54:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlagos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlagos/32/4490_2.png) [@tlagos](https://discourse.julialang.org/u/tlagos)\
**Post date:** [December 5, 2017, 11:54am UTC](https://discourse.julialang.org/t/incorrect-bound-error-exception/7525/1 "2017-12-05T11:54:33Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [December 5, 2017, 12:11pm UTC](https://discourse.julialang.org/t/incorrect-bound-error-exception/7525/2 "2017-12-05T12:11:24Z")

</div>

> [@tlagos](#):
>
> BoundsError: attempt to access 117×5 Array{Float64,2} at index [177, 1:4]

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