I would encode the Julia function with an array bound error:
function wrong()
alphas = [ 0.5, 1, 1.25, 2.0 ] ;
theta = 0:0.02:1 * pi ;
U = zeros( length(theta), 4 ) ;
i = 1 ;
j = 1 ;
for a = alphas
kd = pi * a ;
for t = theta
v = (cos( kd * cos( t ) ) - cos( kd ))/sin( t ) ;
U[i, j] = v ;
i = i + 1 ;
end
j = j + 1 ;
end
end
Here i = 1 should be in the loop. I get:
julia> wrong()
ERROR: BoundsError()
in setindex! at array.jl:308 (repeats 2 times)
Is there a way to get the julia translator to provide more detailed information about the exceptions when they hit, or ways to debug in the error statement and see what happens? For example, knowing what index values that were caused by a boundary error when this happened would be useful for debugging this.
source
share