Skip to content

Commit 637bbb0

Browse files
authored
Upgrade to ApproxFunBase v0.8 (#200)
* upgrade AFB to v0.8 * Update Ultraspherical * rangespace for normalized polynomial space multiplication * reintroduce derivative for NormalizedPolynomialSpace
1 parent 133b0a9 commit 637bbb0

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunOrthogonalPolynomials"
22
uuid = "b70543e2-c0d9-56b8-a290-0d4d6d4de211"
3-
version = "0.6.13"
3+
version = "0.6.14"
44

55
[deps]
66
ApproxFunBase = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
@@ -20,7 +20,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2020
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
2121

2222
[compat]
23-
ApproxFunBase = "0.7.71"
23+
ApproxFunBase = "0.8"
2424
ApproxFunBaseTest = "0.1"
2525
Aqua = "0.5"
2626
BandedMatrices = "0.16, 0.17"

src/Spaces/Jacobi/JacobiOperators.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Derivative(J::Jacobi) = ConcreteDerivative(J,1)
99
else
1010
d = domain(J)
1111
v = [ConcreteDerivative(Jacobi(J.b+i-1, J.a+i-1, d)) for i in k:-1:1]
12-
DerivativeWrapper(TimesOperator(v), J, k)
12+
DerivativeWrapper(TimesOperator(v), k, J)
1313
end
1414
end
1515
@static if VERSION >= v"1.8"
@@ -49,14 +49,14 @@ function Integral(J::Jacobi,k::Number)
4949
@assert k > 0 "order of integral must be > 0"
5050
if k > 1
5151
Q=Integral(J,1)
52-
IntegralWrapper(TimesOperator(Integral(rangespace(Q),k-1),Q),J,k)
52+
IntegralWrapper(TimesOperator(Integral(rangespace(Q),k-1),Q),k,J)
5353
elseif J.a > 0 && J.b > 0 # we have a simple definition
5454
ConcreteIntegral(J,1)
5555
else # convert and then integrate
5656
sp=Jacobi(J.b+1,J.a+1,domain(J))
5757
C=Conversion(J,sp)
5858
Q=Integral(sp,1)
59-
IntegralWrapper(TimesOperator(Q,C),J,1)
59+
IntegralWrapper(TimesOperator(Q,C),1,J)
6060
end
6161
end
6262

src/Spaces/PolynomialSpace.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,8 @@ hasconversion(a::NormalizedPolynomialSpace,b::PolynomialSpace) = hasconversion(a
531531
hasconversion(a::NormalizedPolynomialSpace,b::NormalizedPolynomialSpace) = hasconversion(a.space,b)
532532

533533
function isdiag(D::DerivativeWrapper{<:Operator, <:NormalizedPolynomialSpace})
534-
sp = D.space
535-
csp = _stripnorm(sp)
534+
sp = domainspace(D)
535+
csp = canonicalspace(sp)
536536
isdiag(Derivative(csp, D.order))
537537
end
538538

@@ -577,5 +577,11 @@ function Derivative(sp::NormalizedPolynomialSpace, k::Number)
577577
csp=canonicalspace(sp)
578578
D = Derivative(csp,k)
579579
C = ConcreteConversion(sp,csp)
580-
DerivativeWrapper(TimesOperator(D, C), sp, k)
580+
DerivativeWrapper(TimesOperator(D, C), k, sp, rangespace(D))
581581
end
582+
583+
ApproxFunBase.hasconcreteconversion_canonical(
584+
@nospecialize(::NormalizedPolynomialSpace), @nospecialize(_)) = true
585+
586+
rangespace(M::MultiplicationWrapper{<:PolynomialSpace,
587+
<:NormalizedPolynomialSpace}) = domainspace(M)

src/Spaces/Ultraspherical/UltrasphericalOperators.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function Conversion(A::Chebyshev, B::Ultraspherical)
141141
CAU = ConcreteConversion(A, U)
142142
v2 = Union{eltype(v), typeof(CAU)}[v; CAU]
143143
bwsum = (0, (isapproxinteger(mB) ? 2length(v2) : ℵ₀))
144-
return ConversionWrapper(TimesOperator(v2, bwsum, (ℵ₀,ℵ₀), bwsum))
144+
return ConversionWrapper(TimesOperator(v2, bwsum, (ℵ₀,ℵ₀), bwsum), A, B)
145145
end
146146
throw(ArgumentError("please implement $A$B"))
147147
end
@@ -175,7 +175,7 @@ function Conversion(A::Ultraspherical,B::Ultraspherical)
175175
v = [v; vlast]
176176
end
177177
bwsum = (0, (isapproxinteger(b-a) ? 2length(v) : ℵ₀))
178-
return ConversionWrapper(TimesOperator(v, bwsum, (ℵ₀,ℵ₀), bwsum))
178+
return ConversionWrapper(TimesOperator(v, bwsum, (ℵ₀,ℵ₀), bwsum), A, B)
179179
end
180180
end
181181
throw(ArgumentError("please implement $A$B"))

test/JacobiTest.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ using Static
258258

259259
@test (@inferred (n -> domainspace(Derivative(Jacobi(n,n), 2)))(1)) == Jacobi(1,1)
260260
@test (@inferred (n -> rangespace(Derivative(Jacobi(n,n), 2)))(1)) == Jacobi(3,3)
261+
262+
D = Derivative(NormalizedLegendre(), 2)
263+
@test (@inferred rangespace(D)) == Jacobi(2,2)
261264
end
262265

263266
@testset "identity Fun for interval domains" begin
@@ -306,6 +309,7 @@ using Static
306309
end
307310

308311
M1 = @inferred Multiplication(Fun(Legendre()), NormalizedLegendre())
312+
@test (@inferred rangespace(M1)) == NormalizedLegendre()
309313
@test M1 * Fun(x->x^4, NormalizedLegendre()) Fun(x->x^5, NormalizedLegendre())
310314
M2 = @inferred Multiplication(Fun(NormalizedLegendre()), Legendre())
311315
@test M2 * Fun(x->x^4, Legendre()) Fun(x->x^5, Legendre())

0 commit comments

Comments
 (0)