Skip to content

Commit

Permalink
Numbers as derivative orders (#39)
Browse files Browse the repository at this point in the history
* Numbers as derivative orders

* Add order test
  • Loading branch information
jishnub authored Dec 2, 2022
1 parent f4ed7c9 commit 5ef1dbd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ApproxFunSingularities"
uuid = "f8fcb915-6b99-5be2-b79a-d6dbef8e6e7e"
version = "0.3.3"
version = "0.3.4"

[deps]
ApproxFunBase = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
Expand Down
2 changes: 1 addition & 1 deletion src/JacobiWeight.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ WeightedJacobi(β,α) = JacobiWeight(β,α,Jacobi(β,α))
Fun(::typeof(identity), S::JacobiWeight) =
isapproxinteger(S.β) && isapproxinteger(S.α) ? Fun(x->x,S) : Fun(identity,domain(S))

order(S::JacobiWeight{Ultraspherical{Int,D,R},D,R}) where {D,R} = order(S.space)
order(S::JacobiWeight{<:Ultraspherical{<:Any,D,R},D,R}) where {D,R} = order(S.space)


spacescompatible(A::JacobiWeight,B::JacobiWeight) =
Expand Down
3 changes: 2 additions & 1 deletion src/JacobiWeightOperators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ end

Derivative(S::JacobiWeight{SS,DDD}) where {SS,DDD<:IntervalOrSegment} = jacobiweightDerivative(S)

function Derivative(S::JacobiWeight{SS,DD}, k::Integer) where {SS,DD<:IntervalOrSegment}
function Derivative(S::JacobiWeight{SS,DD}, k::Number) where {SS,DD<:IntervalOrSegment}
@assert Integer(k) == k "order must be an integer"
if k==1
Derivative(S)
else
Expand Down
7 changes: 7 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ using ApproxFunBase: HeavisideSpace, PointSpace, ArraySpace, DiracSpace, Piecewi
using ApproxFunBaseTest: testbandedoperator, testtransforms, testfunctional,
testbandedblockbandedoperator
using ApproxFunOrthogonalPolynomials
using ApproxFunOrthogonalPolynomials: order
using ApproxFunSingularities
using LinearAlgebra
using IntervalSets
Expand Down Expand Up @@ -167,6 +168,12 @@ end
@test norm(Fun(cos,Chebyshev)-Fun(cos,JacobiWeight(0,0,Jacobi(-0.5,-0.5))))<100eps()
@test norm(Fun(cos,Jacobi(-0.5,-0.5))-Fun(cos,JacobiWeight(0,0,Jacobi(-0.5,-0.5))))<100eps()
end

@testset "Ultraspherical order" begin
us = Ultraspherical(0.5)
s = JacobiWeight(1, 1, us)
@test order(s) == order(us)
end
end

@testset "Ray and Line" begin
Expand Down

2 comments on commit 5ef1dbd

@jishnub
Copy link
Member Author

@jishnub jishnub commented on 5ef1dbd Dec 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/73336

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.4 -m "<description of version>" 5ef1dbd67deb73d01eb0fd7e0a24338b01732368
git push origin v0.3.4

Please sign in to comment.