You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The set of natural numbers can not be promoted to have Float64 type, that is why you're getting an error.
The VcatDomain is a concrete subtype of ProductDomain. The more generic function productdomain decides, based on the arguments, which concrete subtype of ProductDomain is most suited to return. However, that will also fail here, because by default it chooses VcatDomain for domains with scalar eltypes.
The type you're probably after is TupleProductDomain, which represents its elements as a Tuple rather than a Vector and which doesn't promote them:
julia> d =TupleProductDomain(ℝ, ℕ)
RealNumbers() ×NaturalNumbers()
julia>eltype(d)
Tuple{Float64, Int64}
julia> (2.3,5) ∈ d
true
Alternatively, you could type ProductDomain{Tuple{Float64,Int}}(ℝ, ℕ).
I may be misunderstanding the intended use of VcatDomain, but I assumed it represents a Cartesian Product based on this code:
DomainSets.jl/src/domains/numbers.jl
Lines 64 to 71 in 3b914a2
So, I tried to represent$\mathbb{R} \times \mathbb{N} $ , but was met with an error:
The text was updated successfully, but these errors were encountered: