Skip to content

Commit

Permalink
remove redundant to_N
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed May 15, 2019
1 parent 05ae54d commit b1420d1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/unit_box_approximation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,31 @@ for N in [Float64, Rational{Int}, Float32]
# Testing box_approximation_symmetric (= symmetric interval hull)
# ===================================================================
# Box approximation of a 2D square
b = BallInf(N[1, 1], to_N(N, 0.1))
b = BallInf(N[1, 1], N(0.1))
h = box_approximation_symmetric(b)
hexp = Hyperrectangle(N[0, 0], to_N(N, [1.1, 1.1]))
hexp = Hyperrectangle(N[0, 0], N[1.1, 1.1])
@test h.center hexp.center
@test h.radius hexp.radius

# Box approximation of a 2D unit ball in the 1-norm
b = Ball1(N[1, -2], to_N(N, 0.2))
b = Ball1(N[1, -2], N(0.2))
h = box_approximation_symmetric(b)
hexp = Hyperrectangle(N[0, 0], to_N(N, [1.2, 2.2]))
hexp = Hyperrectangle(N[0, 0], N[1.2, 2.2])
@test h.center hexp.center
@test h.radius hexp.radius

# Box approximation of a 3D unit ball in the 1-norm
b = Ball1(N[1, 2, 0], to_N(N, 0.1))
b = Ball1(N[1, 2, 0], N(0.1))
h = box_approximation_symmetric(b)
hexp = Hyperrectangle(N[0, 0, 0], to_N(N, [1.1, 2.1, 0.1]))
hexp = Hyperrectangle(N[0, 0, 0], N[1.1, 2.1, 0.1])
@test h.center hexp.center
@test h.radius hexp.radius

# Box approximation of a 4D hyperrectangle
b = Hyperrectangle(to_N(N, [-1.5, -2.5, 2.4, -0.4]),
to_N(N, [0.1, 0.2, 0.3, 0.4]))
b = Hyperrectangle(N[-1.5, -2.5, 2.4, -0.4],
N[0.1, 0.2, 0.3, 0.4])
h = box_approximation_symmetric(b)
hexp = Hyperrectangle(zeros(N, 4), to_N(N, [1.6, 2.7, 2.7, 0.8]))
hexp = Hyperrectangle(zeros(N, 4), N[1.6, 2.7, 2.7, 0.8])
@test h.center hexp.center
@test h.radius hexp.radius

Expand Down

0 comments on commit b1420d1

Please sign in to comment.