Skip to content

Commit 9644f21

Browse files
committed
Add setdiff for point
1 parent 55f0453 commit 9644f21

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ToeplitzMatrices = "c751599d-da0a-543b-9d20-d0a503d91d24"
3131
[compat]
3232
AbstractFFTs = "≥ 0.3.1"
3333
BandedMatrices = "0.9.0"
34-
BlockArrays = "0.8.0"
34+
BlockArrays = "0.8, 0.9"
3535
BlockBandedMatrices = "0.4.0"
3636
Calculus = "≥ 0.1.15"
3737
DSP = "≥ 0.5.1"

src/Domains/Domains.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ affine_setdiff(d::Domain, ptsin::UnionDomain) =
4646
affine_setdiff(d::Domain, ptsin::WrappedDomain{<:AbstractVector}) =
4747
_affine_setdiff(d, ptsin.domain)
4848

49+
function _affine_setdiff(d::Domain, p::Number)
50+
isempty(d) && return d
51+
p d && return d
52+
a,b = endpoints(d)
53+
if leftendpoint(d) > rightendpoint(d)
54+
a,b = b,a
55+
end
56+
UnionDomain(a..p, p..b) # TODO: Clopen interval
57+
end
58+
4959
function _affine_setdiff(d::Domain, pts)
5060
isempty(pts) && return d
5161
tol=sqrt(eps(arclength(d)))

0 commit comments

Comments
 (0)