Closed daanhb closed 7 months ago
As a random example, this is current behaviour in DomainSets:
julia> using IntervalSets, DomainSets
julia> using DomainSets: ×
julia> d = (0..1.0) × ComplexUnitCircle()
(0.0 + 0.0im..1.0 + 0.0im) × ComplexUnitCircle()
julia> eltype(d)
SVector{2, ComplexF64} (alias for StaticArraysCore.SArray{Tuple{2}, Complex{Float64}, 1, 2})
julia> numtype(d)
ComplexF64 (alias for Complex{Float64})
julia> prectype(d)
Float64
A type promotion happens when taking the cartesian product. Next, the T
in this example is a static vector and conveys information about the numeric type (the elements of the vector, here ComplexF64
) and the precision type (Float64
).
One comment: we can still support eltype
even if it is just an interface (that is, each domain would overload eltype
)
Related issue on moving the definition of a Domain
into a new and very lightweight package: https://github.com/JuliaMath/IntervalSets.jl/issues/136
The discussion came up again whether or not to see domains as inheriting from
Domain{T}
, or whether it can be an interface instead: https://github.com/JuliaMath/IntervalSets.jl/issues/117 and https://github.com/JuliaMath/IntervalSets.jl/issues/115Related to that is the question of what is the role of
T
inDomain{T}
.