Skip to content

Commit 17cce1f

Browse files
authored
Namespace in Calculus operator macro (#267)
* Namespace in Calculus operator macro * bump version to v0.7.34 * more namespaces in macros
1 parent 53b072b commit 17cce1f

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
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.33"
3+
version = "0.7.34"
44

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

src/Operators/Operator.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ hasconstblocks(A::Operator) = hasconstblocks(domainspace(A)) && hasconstblocks(r
7575
macro functional(FF)
7676
quote
7777
Base.size(A::$FF,k::Integer) = k==1 ? 1 : dimension(domainspace(A))
78-
ApproxFunBase.rangespace(F::$FF) = ConstantSpace(eltype(F))
78+
ApproxFunBase.rangespace(F::$FF) = ApproxFunBase.ConstantSpace(eltype(F))
7979
ApproxFunBase.isafunctional(::$FF) = true
8080
ApproxFunBase.blockbandwidths(A::$FF) = 0,hastrivialblocks(domainspace(A)) ? bandwidth(A,2) : ℵ₀
8181
function ApproxFunBase.defaultgetindex(f::$FF,k::Integer,j::Integer)
@@ -494,7 +494,7 @@ haswrapperstructure(_) = false
494494
# Ex: c*op or real(op)
495495
macro wrapperstructure(Wrap)
496496
ret = quote
497-
haswrapperstructure(::$Wrap) = true
497+
ApproxFunBase.haswrapperstructure(::$Wrap) = true
498498
end
499499

500500
for func in (:(ApproxFunBase.bandwidths),:(LinearAlgebra.stride),

src/Operators/banded/CalculusOperator.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ macro calculus_operator(Op)
1212
DefaultOp = Symbol(:Default, Op)
1313
return esc(quote
1414
# The SSS, TTT are to work around #9312
15-
abstract type $Op{SSS,OT,TTT} <: CalculusOperator{SSS,OT,TTT} end
15+
abstract type $Op{SSS,OT,TTT} <: ApproxFunBase.CalculusOperator{SSS,OT,TTT} end
1616

1717
struct $ConcOp{S<:Space,OT,T} <: $Op{S,OT,T}
1818
space::S # the domain space
@@ -23,22 +23,22 @@ macro calculus_operator(Op)
2323
order::OT
2424
end
2525

26-
@wrapper $WrappOp
26+
ApproxFunBase.@wrapper $WrappOp
2727

2828

2929
## Constructors
30-
$ConcOp(sp::Space,k) = $ConcOp{typeof(sp),typeof(k),prectype(sp)}(sp,k)
30+
$ConcOp(sp::Space,k) = $ConcOp{typeof(sp),typeof(k),ApproxFunBase.prectype(sp)}(sp,k)
3131

32-
$Op(sp::UnsetSpace,k) = $ConcOp(sp,k)
33-
$Op(sp::UnsetSpace,k::Real) = $ConcOp(sp,k)
34-
$Op(sp::UnsetSpace,k::Integer) = $ConcOp(sp,k)
32+
$Op(sp::ApproxFunBase.UnsetSpace,k) = $ConcOp(sp,k)
33+
$Op(sp::ApproxFunBase.UnsetSpace,k::Real) = $ConcOp(sp,k)
34+
$Op(sp::ApproxFunBase.UnsetSpace,k::Integer) = $ConcOp(sp,k)
3535

3636
function $DefaultOp(sp::Space,k)
37-
csp=canonicalspace(sp)
38-
if conversion_type(csp,sp)==csp # Conversion(sp,csp) is not banded, or sp==csp
37+
csp=ApproxFunBase.canonicalspace(sp)
38+
if ApproxFunBase.conversion_type(csp,sp)==csp # Conversion(sp,csp) is not banded, or sp==csp
3939
error("Implement $(string($Op))($(string(sp)),$k)")
4040
end
41-
$WrappOp(TimesOperator([$Op(csp,k),Conversion(sp,csp)]),k)
41+
$WrappOp(ApproxFunBase.TimesOperator([$Op(csp,k),Conversion(sp,csp)]),k)
4242
end
4343

4444
$DefaultOp(d,k) = $Op(Space(d),k)

src/Operators/functionals/CalculusFunctional.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ macro calculus_functional(Op)
1010
ConcOp = Symbol(:Concrete, Op)
1111
WrappOp = Symbol(Op, :Wrapper)
1212
return esc(quote
13-
abstract type $Op{SSS,TTT} <: CalculusFunctional{SSS,TTT} end
13+
abstract type $Op{SSS,TTT} <: ApproxFunBase.CalculusFunctional{SSS,TTT} end
1414
struct $ConcOp{S,T} <: $Op{S,T}
1515
domainspace::S
1616
end
1717
struct $WrappOp{BT<:Operator,S<:Space,T} <: $Op{S,T}
1818
op::BT
1919
end
2020

21-
@wrapper $WrappOp
21+
ApproxFunBase.@wrapper $WrappOp
2222

2323

2424
# We expect the operator to be real/complex if the basis is real/complex
25-
$ConcOp(dsp::Space) = $ConcOp{typeof(dsp),prectype(dsp)}(dsp)
25+
$ConcOp(dsp::Space) = $ConcOp{typeof(dsp),ApproxFunBase.prectype(dsp)}(dsp)
2626

2727
$Op() = $Op(UnsetSpace())
2828
$Op(dsp) = $ConcOp(dsp)
@@ -37,7 +37,7 @@ macro calculus_functional(Op)
3737
ApproxFunBase.domain::$ConcOp) = domain.domainspace)
3838
ApproxFunBase.domainspace::$ConcOp) = Σ.domainspace
3939

40-
Base.getindex(::$ConcOp{UnsetSpace},kr::AbstractRange) =
40+
Base.getindex(::$ConcOp{ApproxFunBase.UnsetSpace},kr::AbstractRange) =
4141
error("Spaces cannot be inferred for operator")
4242

4343
$WrappOp(op::Operator) =

0 commit comments

Comments
 (0)