Skip to content

Commit 85f3efb

Browse files
authored
Optionally skip InterlaceOp domain promote (#260)
* InterlaceOp domain promote skip optionally * version bump to v0.7.32
1 parent c14f5e0 commit 85f3efb

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunBase"
22
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
3-
version = "0.7.31"
3+
version = "0.7.32"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/Operators/functionals/Evaluation.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ convert(::Type{Operator{T}},B::DirichletWrapper) where {T} =
182182
DirichletWrapper(Operator{T}(B.op),B.order)::Operator{T}
183183

184184
# Default is to use diffbca
185-
default_Dirichlet(sp::Space,λ) = DirichletWrapper([ldiffbc(sp,λ);rdiffbc(sp,λ)],λ)
185+
default_Dirichlet(sp::Space,λ) =
186+
DirichletWrapper(InterlaceOperator((ldiffbc(sp,λ), rdiffbc(sp,λ)), false), λ)
186187
Dirichlet(sp::Space,λ) = default_Dirichlet(sp,λ)
187188
Dirichlet(sp::Space) = Dirichlet(sp,0)
188189
Dirichlet() = Dirichlet(UnsetSpace())

src/Operators/general/InterlaceOperator.jl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,19 @@ function InterlaceOperator(opsin::AbstractVector{<:Operator})
186186
ops = _convert_vector(promotedomainspace(opsin))
187187
InterlaceOperator(ops, domainspace(first(ops)), rangespace(ops))
188188
end
189-
function InterlaceOperator(opsin::Tuple{Operator, Vararg{Operator}})
190-
ops = promotedomainspace(opsin)
189+
@inline function _InterlaceOperator(opsin, promotedomain)
190+
ops = promotedomain ? promotedomainspace(opsin) : opsin
191191
InterlaceOperator(ops, domainspace(first(ops)), rangespace(ops))
192192
end
193+
@static if VERSION >= v"1.8"
194+
Base.@constprop :aggressive function InterlaceOperator(opsin::Tuple{Operator, Vararg{Operator}}, promotedomain = true)
195+
_InterlaceOperator(opsin, promotedomain)
196+
end
197+
else
198+
function InterlaceOperator(opsin::Tuple{Operator, Vararg{Operator}}, promotedomain = true)
199+
_InterlaceOperator(opsin, promotedomain)
200+
end
201+
end
193202

194203
InterlaceOperator(ops::AbstractArray) =
195204
InterlaceOperator(Array{Operator{mapreduce(eltype,promote_type,ops)}, ndims(ops)}(ops))

0 commit comments

Comments
 (0)