Skip to content

Commit 7bed5a1

Browse files
authored
Move Fun(::Interval) constructor from AFOP (#318)
* move Fun interval constructor from AFOP * move integral
1 parent 2b30404 commit 7bed5a1

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/Operators/banded/CalculusOperator.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,13 @@ for TYP in (:Derivative,:Integral,:Laplacian)
248248
end
249249
end
250250

251+
# the default domain space is higher to avoid negative ultraspherical spaces
252+
function Integral(d::IntervalOrSegment,n::Integer)
253+
ds = Space(d)
254+
rs = rangespace(Derivative(ds))
255+
Integral(rs, n)
256+
end
257+
251258
==(A::Derivative, B::Derivative) = A.order == B.order && domainspace(A) == domainspace(B)
252259

253260

src/constructors.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ function Fun(::typeof(identity), d::Domain)
183183
end
184184
end
185185

186+
Fun(::typeof(identity), d::IntervalOrSegment{<:Number}) =
187+
Fun(Space(d), [mean(d), complexlength(d)/2])
188+
186189
Fun(::typeof(identity), S::Space) = Fun(identity,domain(S))
187190

188191

0 commit comments

Comments
 (0)