Skip to content

Commit

Permalink
Merge b980614 into 13b1b1b
Browse files Browse the repository at this point in the history
  • Loading branch information
mlubin committed Jul 28, 2018
2 parents 13b1b1b + b980614 commit 3fbf8d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/JuMPArray.jl
Expand Up @@ -62,14 +62,14 @@ function _to_cartesian(d,NT,idx...)
push!(indexing, quote
rng = d.indexsets[$i]
I = idx[$i]
I - (start(rng) - 1)
I - (first(rng) - 1)
end)
else
push!(indexing, quote
rng = d.indexsets[$i]
I = idx[$i]
first(rng) <= I <= last(rng) || error("Failed attempt to index JuMPArray along dimension $($i): $I$(d.indexsets[$i])")
I - (start(rng) - 1)
I - (first(rng) - 1)
end)
end
elseif S == StepRange{Int}
Expand All @@ -80,7 +80,7 @@ function _to_cartesian(d,NT,idx...)
rng = $(d.indexsets[i])
I = idx[$i]
first(rng) <= I <= last(rng) || error("Failed attempt to index JuMPArray along dimension $($i): $I$(d.indexsets[$i])")
dv, rv = divrem(I - start(rng), step(rng))
dv, rv = divrem(I - first(rng), step(rng))
rv == 0 || error("Failed attempt to index JuMPArray along dimension $($i): $I$(d.indexsets[$i])")
dv + 1
end)
Expand Down

0 comments on commit 3fbf8d9

Please sign in to comment.