Skip to content

Upgrade to ApproxFunBase v0.8 #200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ApproxFunOrthogonalPolynomials"
uuid = "b70543e2-c0d9-56b8-a290-0d4d6d4de211"
version = "0.6.13"
version = "0.6.14"

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

[compat]
ApproxFunBase = "0.7.71"
ApproxFunBase = "0.8"
ApproxFunBaseTest = "0.1"
Aqua = "0.5"
BandedMatrices = "0.16, 0.17"
Expand Down
6 changes: 3 additions & 3 deletions src/Spaces/Jacobi/JacobiOperators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Derivative(J::Jacobi) = ConcreteDerivative(J,1)
else
d = domain(J)
v = [ConcreteDerivative(Jacobi(J.b+i-1, J.a+i-1, d)) for i in k:-1:1]
DerivativeWrapper(TimesOperator(v), J, k)
DerivativeWrapper(TimesOperator(v), k, J)
end
end
@static if VERSION >= v"1.8"
Expand Down Expand Up @@ -49,14 +49,14 @@ function Integral(J::Jacobi,k::Number)
@assert k > 0 "order of integral must be > 0"
if k > 1
Q=Integral(J,1)
IntegralWrapper(TimesOperator(Integral(rangespace(Q),k-1),Q),J,k)
IntegralWrapper(TimesOperator(Integral(rangespace(Q),k-1),Q),k,J)
elseif J.a > 0 && J.b > 0 # we have a simple definition
ConcreteIntegral(J,1)
else # convert and then integrate
sp=Jacobi(J.b+1,J.a+1,domain(J))
C=Conversion(J,sp)
Q=Integral(sp,1)
IntegralWrapper(TimesOperator(Q,C),J,1)
IntegralWrapper(TimesOperator(Q,C),1,J)
end
end

Expand Down
12 changes: 9 additions & 3 deletions src/Spaces/PolynomialSpace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,8 @@ hasconversion(a::NormalizedPolynomialSpace,b::PolynomialSpace) = hasconversion(a
hasconversion(a::NormalizedPolynomialSpace,b::NormalizedPolynomialSpace) = hasconversion(a.space,b)

function isdiag(D::DerivativeWrapper{<:Operator, <:NormalizedPolynomialSpace})
sp = D.space
csp = _stripnorm(sp)
sp = domainspace(D)
csp = canonicalspace(sp)
isdiag(Derivative(csp, D.order))
end

Expand Down Expand Up @@ -577,5 +577,11 @@ function Derivative(sp::NormalizedPolynomialSpace, k::Number)
csp=canonicalspace(sp)
D = Derivative(csp,k)
C = ConcreteConversion(sp,csp)
DerivativeWrapper(TimesOperator(D, C), sp, k)
DerivativeWrapper(TimesOperator(D, C), k, sp, rangespace(D))
end

ApproxFunBase.hasconcreteconversion_canonical(
@nospecialize(::NormalizedPolynomialSpace), @nospecialize(_)) = true

rangespace(M::MultiplicationWrapper{<:PolynomialSpace,
<:NormalizedPolynomialSpace}) = domainspace(M)
4 changes: 2 additions & 2 deletions src/Spaces/Ultraspherical/UltrasphericalOperators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function Conversion(A::Chebyshev, B::Ultraspherical)
CAU = ConcreteConversion(A, U)
v2 = Union{eltype(v), typeof(CAU)}[v; CAU]
bwsum = (0, (isapproxinteger(mB) ? 2length(v2) : ℵ₀))
return ConversionWrapper(TimesOperator(v2, bwsum, (ℵ₀,ℵ₀), bwsum))
return ConversionWrapper(TimesOperator(v2, bwsum, (ℵ₀,ℵ₀), bwsum), A, B)
end
throw(ArgumentError("please implement $A → $B"))
end
Expand Down Expand Up @@ -175,7 +175,7 @@ function Conversion(A::Ultraspherical,B::Ultraspherical)
v = [v; vlast]
end
bwsum = (0, (isapproxinteger(b-a) ? 2length(v) : ℵ₀))
return ConversionWrapper(TimesOperator(v, bwsum, (ℵ₀,ℵ₀), bwsum))
return ConversionWrapper(TimesOperator(v, bwsum, (ℵ₀,ℵ₀), bwsum), A, B)
end
end
throw(ArgumentError("please implement $A → $B"))
Expand Down
4 changes: 4 additions & 0 deletions test/JacobiTest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ using Static

@test (@inferred (n -> domainspace(Derivative(Jacobi(n,n), 2)))(1)) == Jacobi(1,1)
@test (@inferred (n -> rangespace(Derivative(Jacobi(n,n), 2)))(1)) == Jacobi(3,3)

D = Derivative(NormalizedLegendre(), 2)
@test (@inferred rangespace(D)) == Jacobi(2,2)
end

@testset "identity Fun for interval domains" begin
Expand Down Expand Up @@ -306,6 +309,7 @@ using Static
end

M1 = @inferred Multiplication(Fun(Legendre()), NormalizedLegendre())
@test (@inferred rangespace(M1)) == NormalizedLegendre()
@test M1 * Fun(x->x^4, NormalizedLegendre()) ≈ Fun(x->x^5, NormalizedLegendre())
M2 = @inferred Multiplication(Fun(NormalizedLegendre()), Legendre())
@test M2 * Fun(x->x^4, Legendre()) ≈ Fun(x->x^5, Legendre())
Expand Down