Skip to content

Commit

Permalink
Add IntervalBox(x, n) as well as with Val{n}
Browse files Browse the repository at this point in the history
  • Loading branch information
dpsanders committed Aug 2, 2017
1 parent 151d80e commit f130c1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/multidim/intervalbox.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ import Base.×
×(a::IntervalBox, b::IntervalBox) = IntervalBox(a..., b...)

IntervalBox{n}(x::Interval, ::Type{Val{n}}) = IntervalBox(SVector(ntuple(i->x, Val{n})))

IntervalBox(x::Interval, n::Int) = IntervalBox(x, Val{n})
2 changes: 2 additions & 0 deletions test/multidim_tests/multidim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,6 @@ end
@test IntervalBox(1..2, Val{2}) == (1..2) × (1..2)
@test IntervalBox(1..2, Val{5}) == (1..2) × (1..2) × (1..2) × (1..2) × (1..2)

@test IntervalBox(1..2, 3) == IntervalBox(1..2, Val{3})

end

0 comments on commit f130c1f

Please sign in to comment.