Approximation domains

DomainSets has its roots in the JuliaApproximation community. It is used for example in the packages ApproxFun and BasisFunctions.

Approximation intervals

There are a number of stateless intervals (i.e. singleton types without data) to represent standard intervals used in approximation theory. The endpoints of these intervals are fixed and hence, at least in principle, known to the compiler.

DomainSets.HalfLineType
HalfLine()
HalfLine{T=Float64,C=:closed}()

The positive halfline [0,∞) when C is :closed or (0,∞) when C is :open. The interval is always open at infinity.

DomainSets.NegativeHalfLineType
NegativeHalfLine()
NegativeHalfLine{T=Float64,C=:closed}()

The negative halfline (-∞,0] when C is :closed or (-∞,0) when C is :open. The interval is always open at minus infinity.

The types are simple enough that some common set arithmetic operations retain their special structure:

julia> HalfLine() ∩ ChebyshevInterval()
0.0 .. 1.0 (Unit)

julia> NegativeHalfLine() \ UnitInterval()
-Inf .. 0.0 (open) (NegativeHalfLine)

The unit cube and other cubes

The product domain associated with any of the fixed intervals remains stateless if the dimension is fixed as well:

julia> UnitInterval()^2
UnitSquare()

julia> ChebyshevInterval()^3
(-1.0 .. 1.0 (Chebyshev)) × (-1.0 .. 1.0 (Chebyshev)) × (-1.0 .. 1.0 (Chebyshev))

Some special cases are named.

DomainSets.UnitCubeType
UnitCube()
UnitCube(::Val{N=3})
UnitCube(dim::Int)

The d-dimensional domain $[0,1]^d$.