Skip to content

Commit

Permalink
use left/rightendpoint instead of infimum and supremum
Browse files Browse the repository at this point in the history
  • Loading branch information
daanhb committed Aug 14, 2021
1 parent 4e40045 commit 6716483
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/domains/cube.jl
Original file line number Diff line number Diff line change
Expand Up @@ -299,26 +299,26 @@ Rectangle(a::NTuple{N,T}, b::NTuple{N,T}) where {N,T} =
Rectangle(domains::Tuple) = Rectangle(domains...)
Rectangle(domains::ClosedInterval...) = Rectangle(promote_domains(domains)...)
Rectangle(domains::ClosedInterval{T}...) where {T} =
Rectangle(map(infimum, domains), map(supremum, domains))
Rectangle(map(leftendpoint, domains), map(rightendpoint, domains))
Rectangle(domains::AbstractVector{<:ClosedInterval}) =
Rectangle(map(infimum, domains), map(supremum, domains))
Rectangle(map(leftendpoint, domains), map(rightendpoint, domains))
Rectangle(domains::Domain...) =
error("The Rectangle constructor expects two points or a list of intervals (closed).")

Rectangle{T}(domains::Tuple) where {T} = Rectangle{T}(domains...)
Rectangle{T}(domains::ClosedInterval...) where {T} =
Rectangle{T}(map(infimum, domains), map(supremum, domains))
Rectangle{T}(map(leftendpoint, domains), map(rightendpoint, domains))
Rectangle{T}(domains::AbstractVector{<:ClosedInterval}) where {T} =
Rectangle{T}(map(infimum, domains), map(supremum, domains))
Rectangle{T}(map(leftendpoint, domains), map(rightendpoint, domains))
Rectangle{T}(domains::Domain...) where {T} =
error("The Rectangle constructor expects two points or a list of intervals (closed).")

ProductDomain(domains::ClosedInterval...) = Rectangle(domains...)
ProductDomain(domains::AbstractVector{<:ClosedInterval}) =
Rectangle(map(infimum, domains), map(supremum, domains))
Rectangle(map(leftendpoint, domains), map(rightendpoint, domains))
ProductDomain{T}(domains::ClosedInterval...) where {T} = Rectangle{T}(domains...)
ProductDomain{T}(domains::AbstractVector{<:ClosedInterval}) where {T} =
Rectangle{T}(map(infimum, domains), map(supremum, domains))
Rectangle{T}(map(leftendpoint, domains), map(rightendpoint, domains))



Expand Down

0 comments on commit 6716483

Please sign in to comment.