Skip to content

Commit ce21781

Browse files
authored
Fix method signature in BandedMatrix for Ultraspherical derivative (#335)
1 parent bada1ee commit ce21781

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/fastops.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function BandedMatrix(S::SubOperator{T,<:ConcreteDerivative{<:Chebyshev,<:Any,T}
9898
end
9999

100100

101-
function BandedMatrix(S::SubOperator{T,<:ConcreteDerivative{<:Ultraspherical,T},
101+
function BandedMatrix(S::SubOperator{T,<:ConcreteDerivative{<:Ultraspherical,<:Any,T},
102102
NTuple{2,UnitRange{Int}}}) where {T}
103103
n,m = size(S)
104104
ret = BandedMatrix{eltype(S)}(undef, (n,m), bandwidths(S))

test/ChebyshevTest.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ include("testutils.jl")
304304
@test s1 == s2
305305

306306
D1 = @inferred Derivative(s1)
307-
D2 = Derivative(s2)
307+
D2 = @inferred Derivative(s2)
308308

309309
@test D1 isa ApproxFunBase.ConcreteDerivative
310310
@test D2 isa ApproxFunBase.ConcreteDerivative

test/UltrasphericalTest.jl

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -442,20 +442,19 @@ include("testutils.jl")
442442
@test M * f f2
443443
end
444444

445+
@testset "Derivative" begin
446+
f = Fun(x -> 3x^3 + 4x + 5, Ultraspherical(2))
447+
@test Derivative() * f Fun(x -> 9x^2 + 4, Ultraspherical(2))
448+
end
449+
445450
@testset "Derivative in a normalized space" begin
446451
s1 = NormalizedUltraspherical(1,-1..1)
447452
s2 = NormalizedUltraspherical(1)
448453
@test s1 == s2
449-
D1 = if VERSION >= v"1.8"
450-
@inferred Derivative(s1)
451-
else
452-
Derivative(s1)
453-
end
454-
D2 = if VERSION >= v"1.8"
455-
@inferred Derivative(s2)
456-
else
457-
Derivative(s2)
458-
end
454+
455+
D1 = @inferred Derivative(s1)
456+
D2 = @inferred Derivative(s2)
457+
459458
@test D1 isa ApproxFunBase.ConcreteDerivative
460459
@test D2 isa ApproxFunBase.ConcreteDerivative
461460
@test !isdiag(D1)

0 commit comments

Comments
 (0)