Skip to content

Commit

Permalink
make 'rand' of Tetrahedron consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Jul 23, 2024
1 parent fd1b70e commit db7b38b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Sets/Tetrahedron/rand.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
function rand(::Type{Tetrahedron}; N::Type{<:Real}=Float64, rng::AbstractRNG=GLOBAL_RNG,
seed::Union{Int,Nothing}=nothing)
function rand(::Type{Tetrahedron}; N::Type{<:Real}=Float64, dim::Int=3,
rng::AbstractRNG=GLOBAL_RNG, seed::Union{Int,Nothing}=nothing)
@assert dim == 3 "cannot create a random Tetrahedron of dimension $dim"
require(@__MODULE__, :LazySets; fun_name="rand")

rng = reseed!(rng, seed)
P = rand(VPolytope; N=N, dim=3, rng=rng, seed=seed, num_vertices=4)
vertices = P.vertices
return Tetrahedron(vertices)
return Tetrahedron(P.vertices)
end

0 comments on commit db7b38b

Please sign in to comment.