-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2318 from JuliaReach/schillic/2310
Fix global-variable issues in tests
- Loading branch information
Showing
7 changed files
with
77 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
using Distributions: Uniform | ||
|
||
P1 = BallInf([0.6, 0.1, -1.3, -0.4, 0.2], 0.6) | ||
A = [1.0 0.0; | ||
0.0 1.0; | ||
-1.0 0.0; | ||
0.0 -1.0] | ||
b = [1.0, 2.0, 3.0, 4.0] | ||
P2 = HPolyhedron(A, b) | ||
P3 = HPolyhedron([0.0 0.1], [3.0]) | ||
P4 = Ball2([0.2, -0.3, -1.1, 0.6, -0.7], 0.4) | ||
for N in [Float64] | ||
P1 = BallInf([0.6, 0.1, -1.3, -0.4, 0.2], 0.6) | ||
A = [1.0 0.0; | ||
0.0 1.0; | ||
-1.0 0.0; | ||
0.0 -1.0] | ||
b = [1.0, 2.0, 3.0, 4.0] | ||
P2 = HPolyhedron(A, b) | ||
P3 = HPolyhedron([0.0 0.1], [3.0]) | ||
P4 = Ball2([0.2, -0.3, -1.1, 0.6, -0.7], 0.4) | ||
|
||
## Test rand samples are contained in the set | ||
p1 = LazySets.sample(P1) | ||
@test p1 ∈ P1 | ||
p1_samples = LazySets.sample(P1, 100) | ||
@test sum(p1_samples .∈ Ref(P1)) == length(p1_samples) | ||
## Test rand samples are contained in the set | ||
p1 = LazySets.sample(P1) | ||
@test p1 ∈ P1 | ||
p1_samples = LazySets.sample(P1, 100) | ||
@test sum(p1_samples .∈ Ref(P1)) == length(p1_samples) | ||
|
||
@test LazySets.RejectionSampler(P2).box_approx == [Uniform(-3.0,1.0), Uniform(-4.0,2.0)] | ||
@test LazySets.RejectionSampler(P2).box_approx == [Uniform(-3.0,1.0), Uniform(-4.0,2.0)] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters