Skip to content

Commit

Permalink
Merge pull request #65 from skygering/master
Browse files Browse the repository at this point in the history
Add RNG to push function
  • Loading branch information
sjkelly committed Apr 6, 2023
2 parents 02a2eb7 + ebf4c26 commit 4009f86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/VoronoiDelaunay.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import GeometricalPredicates: geta, getb, getc

import Base: push!, iterate, copy, sizehint!
import Colors: RGB, RGBA
using Random: shuffle!
using Random: shuffle!, MersenneTwister

const min_coord = GeometricalPredicates.min_coord + eps(Float64)
const max_coord = GeometricalPredicates.max_coord - eps(Float64)
Expand Down Expand Up @@ -703,8 +703,8 @@ function _pushunsorted!(tess::DelaunayTessellation2D{T}, a::Vector{T}) where {T<
end

# push an array but sort it first for better performance
function push!(tess::DelaunayTessellation2D{T}, a::Vector{T}) where {T<:AbstractPoint2D}
shuffle!(a)
function push!(tess::DelaunayTessellation2D{T}, a::Vector{T}, rng = MersenneTwister()) where {T<:AbstractPoint2D}
shuffle!(rng, a)
mssort!(a)
_pushunsorted!(tess, a)
end
Expand Down

0 comments on commit 4009f86

Please sign in to comment.