Skip to content

Commit

Permalink
Merge pull request #30 from mkborregaard/fix_adapted_grid
Browse files Browse the repository at this point in the history
reinstate seeded rng
  • Loading branch information
mkborregaard authored Sep 14, 2017
2 parents 053ff02 + d24f3f8 commit fb84045
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/adapted_grid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ function adapted_grid(f, minmax::Tuple{Real, Real}; max_recursions = 7)
xs[end-1] = xs[end] - (xs[end] - xs[end-1]) * 0.25

# Wiggle interior points a bit to prevent aliasing and other degenerate cases
#rng = MersenneTwister(1337)
rng = MersenneTwister(1337)
rand_factor = 0.05
for i in 2:length(xs)-1
xs[i] += rand_factor * 2 * (rand() - 0.5) * (xs[i+1] - xs[i-1]) #set rand(rng) for debugging
xs[i] += rand_factor * 2 * (rand(rng) - 0.5) * (xs[i+1] - xs[i-1])
end

n_tot_refinements = zeros(Int, n_intervals)
Expand Down

0 comments on commit fb84045

Please sign in to comment.