Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdfish committed Mar 3, 2022
1 parent db26dfb commit fac247a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 56 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 itsdfish <[email protected]> and contributors
Copyright (c) 2022 itsdfish

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ParameterSpacePartitions"
uuid = "64931d76-8770-46b0-8423-0a5d3a7d2d72"
authors = ["itsdfish"]
version = "0.3.9"
version = "0.3.10"

[deps]
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
Expand All @@ -12,7 +12,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
QHull = "a8468747-bd6f-53ef-9e5c-744dbc5c59e7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"
Expand All @@ -25,7 +24,6 @@ DataFrames = "1.3.0"
Distributions = "0.23.0,0.24.0,v0.25.37"
QHull = "0.2"
Requires = "1.3.0"
Revise = "v3.3.1"
SafeTestsets = "0.0.1"
SpecialFunctions = "2"
StatsPlots = "0.14.0"
Expand Down
80 changes: 28 additions & 52 deletions test/volume_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,20 @@
Random.seed!(633)
n = 2
μ = fill(0.0, n)

x = randn(n, n)
cov_mat = x' * x
fun = sample_ellipsoid_surface
x = map(_ -> fun(μ, n, cov_mat), 1:10_000)
points = reduce(vcat, transpose.(x))

v1 = volume_ellipsoid(n, cov_mat)

hull = chull(points)
v2 = hull.volume

@test v1 v2 rtol = .03

x = randn(n, n)
cov_mat = x' * x
fun = sample_ellipsoid_surface
x = map(_ -> fun(μ, n, cov_mat), 1:10_000)
points = reduce(vcat, transpose.(x))

v1 = volume_ellipsoid(n, cov_mat)

hull = chull(points)
v2 = hull.volume

@test v1 v2 rtol = .03
for _ in 1:5
x = randn(n, n)
cov_mat = x' * x
fun = sample_ellipsoid_surface
x = map(_ -> fun(μ, n, cov_mat), 1:10_000)
points = reduce(vcat, transpose.(x))

v1 = volume_ellipsoid(n, cov_mat)

hull = chull(points)
v2 = hull.volume

@test v1 v2 rtol = .03
end
end

@safetestset "3D Ellipsoid Volume" begin
Expand All @@ -38,32 +26,20 @@ end
Random.seed!(584)
n = 3
μ = fill(0.0, n)

x = randn(n, n)
cov_mat = x' * x
fun = sample_ellipsoid_surface
x = map(_ -> fun(μ, n, cov_mat), 1:10_000)
points = reduce(vcat, transpose.(x))

v1 = volume_ellipsoid(n, cov_mat)

hull = chull(points)
v2 = hull.volume

@test v1 v2 rtol = .03

x = randn(n, n)
cov_mat = x' * x
fun = sample_ellipsoid_surface
x = map(_ -> fun(μ, n, cov_mat), 1:10_000)
points = reduce(vcat, transpose.(x))

v1 = volume_ellipsoid(n, cov_mat)

hull = chull(points)
v2 = hull.volume

@test v1 v2 rtol = .03
for _ in 1:5
x = randn(n, n)
cov_mat = x' * x
fun = sample_ellipsoid_surface
x = map(_ -> fun(μ, n, cov_mat), 1:10_000)
points = reduce(vcat, transpose.(x))

v1 = volume_ellipsoid(n, cov_mat)

hull = chull(points)
v2 = hull.volume

@test v1 v2 rtol = .03
end
end

@safetestset "4D Ellipsoid Volume" begin
Expand Down

0 comments on commit fac247a

Please sign in to comment.