Skip to content

Commit 92b727c

Browse files
authored
Parameterize PiecewiseSegment (#149)
* Parameterize PiecewiseSegment * bump version to v0.5.16 * Restore some unary operators * reinstate ==
1 parent bd54541 commit 92b727c

File tree

6 files changed

+31
-36
lines changed

6 files changed

+31
-36
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.5.15"
3+
version = "0.5.16"
44

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

2121
[compat]
22-
ApproxFunBase = "0.7"
22+
ApproxFunBase = "0.7.34"
2323
ApproxFunBaseTest = "0.1"
2424
Aqua = "0.5"
2525
BandedMatrices = "0.16, 0.17"

src/ApproxFunOrthogonalPolynomials.jl

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,35 +48,32 @@ import DomainSets: Domain, indomain, UnionDomain, FullSpace, Point,
4848

4949
import BandedMatrices: bandshift, bandwidth, colstop, bandwidths, BandedMatrix
5050

51-
import Base: convert, getindex, *, +, -, ==, <, <=, >, |, !, !=, eltype,
52-
>=, /, ^, \, , transpose, size, copyto!, copy,
53-
map, vcat, hcat, show, stride, sum, cumsum, conj, inv,
54-
complex, reverse, exp, sqrt, abs, sign, issubset, values,
51+
import Base: convert, getindex, eltype, <, <=, +, -, *, /, ^, ==,
52+
show, stride, sum, cumsum, conj, inv,
53+
complex, exp, sqrt, abs, sign, issubset,
5554
first, last, rand, intersect, setdiff,
56-
isless, union, angle, isnan, isapprox, isempty, sort, merge,
57-
minimum, maximum, extrema, argmax, argmin,
58-
zeros, zero, one, promote_rule, length, resize!, isinf,
59-
getproperty, cld, div, real, imag,
60-
max, min, log, acosh, tanh, atanh,
61-
atan, sinh, asinh,
62-
tan, tanh, asin, sec, acos,
63-
sin, cos, sinh, cosh,
64-
asinh, acosh, atanh,
65-
Array, Vector, Matrix, view, ones, split
66-
67-
import LinearAlgebra: norm, mul!, det, eigvals, qr, Tridiagonal, transpose
68-
69-
import FastTransforms: plan_chebyshevtransform, plan_chebyshevtransform!,
55+
isless, union, angle, isnan, isapprox, isempty,
56+
minimum, maximum, extrema, zeros, one, promote_rule,
57+
getproperty, real, imag, max, min, log, acos,
58+
sin, cos, asinh, acosh, atanh, ones
59+
# atan, tan, tanh, asin, sec, sinh, cosh,
60+
# split
61+
62+
using FastTransforms: plan_chebyshevtransform, plan_chebyshevtransform!,
7063
plan_ichebyshevtransform, plan_ichebyshevtransform!,
71-
pochhammer, lgamma, chebyshevtransform!, ichebyshevtransform!
64+
pochhammer, lgamma
7265

73-
import BlockBandedMatrices: blockbandwidths, subblockbandwidths
66+
import BlockBandedMatrices: blockbandwidths
7467

7568
# we need to import all special functions to use Calculus.symbolic_derivatives_1arg
76-
import SpecialFunctions: erfcx, dawson, erf,
69+
import SpecialFunctions: erfcx, dawson,
7770
hankelh1, hankelh2, besselj, bessely, besseli, besselk,
78-
besselkx, hankelh1x, hankelh2x,
79-
expm1, eta, gamma, erfc
71+
besselkx, hankelh1x, hankelh2x
72+
# The following are not extended here.
73+
# Some of these are extended in ApproxFunBase
74+
# erf, erfinv, erfc, erfcinv, erfi, gamma, lgamma, digamma, invdigamma,
75+
# trigamma, airyai, airybi, airyaiprime, airybiprime, besselj0,
76+
# besselj1, bessely0, bessely1
8077

8178
using StaticArrays: SVector
8279

src/Spaces/Ultraspherical/ContinuousSpace.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
export ContinuousSpace
22

3-
struct ContinuousSpace{T,R} <: Space{PiecewiseSegment{T},R}
4-
domain::PiecewiseSegment{T}
3+
struct ContinuousSpace{T,R,P<:PiecewiseSegment{T}} <: Space{P,R}
4+
domain::P
55
end
66

77
ContinuousSpace(d::PiecewiseSegment{T}) where {T} =
8-
ContinuousSpace{T,real(eltype(T))}(d)
8+
ContinuousSpace{T,real(eltype(T)),typeof(d)}(d)
99

1010

1111
Space(d::PiecewiseSegment) = ContinuousSpace(d)

src/Spaces/Ultraspherical/DirichletSpace.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,10 @@ setdomain(S::ChebyshevDirichlet{l,r},d::Domain) where {l,r} = ChebyshevDirichlet
3737
Base.isless(a::Chebyshev,b::ChebyshevDirichlet) = false
3838
<(a::Chebyshev,b::ChebyshevDirichlet) = false
3939
<=(a::Chebyshev,b::ChebyshevDirichlet) = false
40-
>(a::Chebyshev,b::ChebyshevDirichlet) = true
41-
>=(a::Chebyshev,b::ChebyshevDirichlet) = true
4240

4341
Base.isless(a::ChebyshevDirichlet,b::Chebyshev) = true
4442
<(a::ChebyshevDirichlet,b::Chebyshev) = true
4543
<=(a::ChebyshevDirichlet,b::Chebyshev) = true
46-
>(a::ChebyshevDirichlet,b::Chebyshev) = false
47-
>=(a::ChebyshevDirichlet,b::Chebyshev) = false
4844

4945
## coefficients
5046

src/specialfunctions.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,10 @@ for (op,ODE,RHS,growth) in ((:(hankelh1),"f^2*f'*D^2+(f*f'^2-f^2*f'')*D+(f^2-ν^
7575
opfxmin,opfxmax = $op(ν,f(xmin)),$op(ν,f(xmax))
7676
opmax = maximum(abs,(opfxmin,opfxmax))
7777
end
78-
D=Derivative(space(f))
79-
B=[Evaluation(space(f),xmin),Evaluation(space(f),xmax)]
80-
u=\([B;eval($L)],[opfxmin;opfxmax;eval($R)];tolerance=eps(T)*opmax)
78+
Sf = space(f)
79+
D=Derivative(Sf)
80+
B=[Evaluation(Sf,xmin), Evaluation(Sf,xmax)]
81+
u=\([B;$L],[opfxmin;opfxmax;$R];tolerance=eps(T)*opmax)
8182

8283
setdomain(u,domain(fin))
8384
end

test/SpacesTest.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ using ApproxFunBaseTest: testspace, testbandedoperator, testraggedbelowoperator,
6161

6262
s=Fun(sin,-2..2)|>abs
6363
c=Fun(cos,-2..2)|>abs
64-
sc=Fun(x -> abs(sin(x))+abs(cos(x)), ContinuousSpace(PiecewiseSegment([-2,(-π/2),0/2,2])))
64+
csp = @inferred ContinuousSpace(PiecewiseSegment([-2,(-π/2),0/2,2]))
65+
sc=Fun(x -> abs(sin(x))+abs(cos(x)), csp)
6566
@test norm(sc-(c+s))<100eps()
6667

6768
@test sc * sc == sc^2

0 commit comments

Comments
 (0)