I know that @inbounds
can be applied before a statement like
x[i] = y
and it will elide the bounds check for the setindex!
call on x
. I’m a little confused about where else @inbounds
can be applied, though. If I write
@inbounds for i = 1:n
x[i] = i^2
y[i] = exp(x[i])
z[i] = 1/y[i]
end
does this elide all of the bounds checks in the loop?