diff --git a/Project.toml b/Project.toml index 07cc086..da525fa 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ApproxFunOrthogonalPolynomials" uuid = "b70543e2-c0d9-56b8-a290-0d4d6d4de211" -version = "0.5.17" +version = "0.5.18" [deps] ApproxFunBase = "fbd15aa5-315a-5a7d-a8a4-24992e37be05" diff --git a/src/Spaces/Chebyshev/ChebyshevOperators.jl b/src/Spaces/Chebyshev/ChebyshevOperators.jl index f53a7c3..ff103f2 100644 --- a/src/Spaces/Chebyshev/ChebyshevOperators.jl +++ b/src/Spaces/Chebyshev/ChebyshevOperators.jl @@ -214,8 +214,10 @@ end ## Derivative -Derivative(sp::Chebyshev{DD},order::Integer) where {DD<:IntervalOrSegment} = +function Derivative(sp::Chebyshev{DD},order::Number) where {DD<:IntervalOrSegment} + @assert Integer(order) == order "order must be an integer" ConcreteDerivative(sp,order) +end rangespace(D::ConcreteDerivative{Chebyshev{DD,RR}}) where {DD<:IntervalOrSegment,RR} = diff --git a/src/Spaces/Hermite/Hermite.jl b/src/Spaces/Hermite/Hermite.jl index 29f5adc..3fd43e1 100644 --- a/src/Spaces/Hermite/Hermite.jl +++ b/src/Spaces/Hermite/Hermite.jl @@ -87,8 +87,9 @@ Fun(::typeof(identity), sp::GaussWeight) = Fun(identity, sp.space) spacescompatible(a::GaussWeight,b::GaussWeight)=spacescompatible(a.space,b.space)&&isapprox(a.L,b.L) -function Derivative(sp::GaussWeight,k::Integer) - if k == 1 +function Derivative(sp::GaussWeight,k::Number) + @assert Integer(k) == k "order must be an integer" + if k == 1 x = Multiplication(Fun(identity,sp.space),sp.space) D = Derivative(sp.space) D2 = D - (2sp.L)x diff --git a/src/Spaces/Jacobi/JacobiOperators.jl b/src/Spaces/Jacobi/JacobiOperators.jl index 5d52164..0bbc9c4 100644 --- a/src/Spaces/Jacobi/JacobiOperators.jl +++ b/src/Spaces/Jacobi/JacobiOperators.jl @@ -1,6 +1,7 @@ ## Derivative -function Derivative(J::Jacobi,k::Integer) +function Derivative(J::Jacobi,k::Number) + @assert Integer(k) == k "order must be an integer" k==1 ? ConcreteDerivative(J,1) : DerivativeWrapper( TimesOperator( @@ -33,7 +34,8 @@ Evaluation(S::NormalizedPolynomialSpace{<:Jacobi},x::Number,o::Integer) = Concre ## Integral -function Integral(J::Jacobi,k::Integer) +function Integral(J::Jacobi,k::Number) + @assert Integer(k) == k "order must be an integer" if k > 1 Q=Integral(J,1) IntegralWrapper(TimesOperator(Integral(rangespace(Q),k-1),Q),J,k) diff --git a/src/Spaces/Ultraspherical/UltrasphericalOperators.jl b/src/Spaces/Ultraspherical/UltrasphericalOperators.jl index c9769d9..39a0652 100644 --- a/src/Spaces/Ultraspherical/UltrasphericalOperators.jl +++ b/src/Spaces/Ultraspherical/UltrasphericalOperators.jl @@ -54,9 +54,12 @@ end #Derivative(d::IntervalOrSegment)=Derivative(1,d) -Derivative(sp::Ultraspherical{LT,DD},m::Integer) where {LT,DD<:IntervalOrSegment} = +function Derivative(sp::Ultraspherical{LT,DD}, m::Number) where {LT,DD<:IntervalOrSegment} + @assert Integer(m) == m "order must be an integer" ConcreteDerivative(sp,m) -function Integral(sp::Ultraspherical{LT,DD},m::Integer) where {LT,DD<:IntervalOrSegment} +end +function Integral(sp::Ultraspherical{LT,DD}, m::Number) where {LT,DD<:IntervalOrSegment} + @assert Integer(m) == m "order must be an integer" λ = order(sp) if m ≤ λ ConcreteIntegral(sp,m)