-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Approxfun support #11
Conversation
• prevent infinite-loop in +(::Domain, ::Any)
• support closed/open intervals in setdiff and union
Codecov Report
@@ Coverage Diff @@
## master #11 +/- ##
==========================================
- Coverage 97.57% 94.91% -2.66%
==========================================
Files 23 23
Lines 535 649 +114
==========================================
+ Hits 522 616 +94
- Misses 13 33 +20
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, setdiff
is fixed in 0.7, but Set(::Set)
is a no-op, so the fix is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Semantic changes to in
are fine: it returns false now in some cases, rather than throwing an error, which is convenient. We may need some more checks for open and closed domains (in setdiff for intervals, for example), but for the time being we are not using that functionality.
I think 1+im in interval(0,1) throws an error as intervals can't be promoted to In the case of intervals, we would want something like an # represent D embedded in `FullSpace{T}()`.
struct EmbeddedDomain{D,T} <: Domain{T}
domain::D
end
# default is to embed, probably need to check the types makes sense
convert(::Type{Domain{T}}, d::Domain) where T = EmbeddedDomain{typeof(d),T}(d)
# TODO: can we avoid a try block?
function indomain(x::T, d::EmbeddedDomain{D,T}) where {T,D}
try
xT = convert(eltype(D), x)
catch InexactError
return false
end
in(xT, d.domain)
end |
This is related to JuliaApproximation/ApproxFun.jl#267 which came up with integrating delta functions. |
Apparently That doesn't fix |
ApproxFun now passes all tests using Domains.jl, though there is still some work to be done.
This makes the following changes:
convert(Domain{T}, d::Domain)
for each of the current domains. We use this to supportin
with different types.UnionDomain(::AbstractVector)
. This may be removed if UseSet
inUnionDomain
to avoid redundancy and ordering #9 goes ahead.==
andhash
forUnionDomain
, using aSet
to resolve the issue of ordering+
meaning union #7: Remove+
and other synonyms for unionUnionDomain
convert(Domain, Float64)
, which now returns aFullSpace{Float64}()
setdiff
for intervals andUnionDomain
Point
for aDomain
? #6:Point
is now a domainsetdiff
andunion
(TODO:intersect
)minimum
,maximum
,supremum
andinfimum
. (TODO:maximum(norm, ::Domain)
, etc., for higher dimensions.) forUnionDomain
and intervals.