Skip to content

Commit f581987

Browse files
authored
Map to canonical in weighted space display (#83)
* Map to canonical in weighted space display * Bump version to v0.3.15
1 parent ed5f0c8 commit f581987

File tree

4 files changed

+32
-20
lines changed

4 files changed

+32
-20
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunSingularities"
22
uuid = "f8fcb915-6b99-5be2-b79a-d6dbef8e6e7e"
3-
version = "0.3.14"
3+
version = "0.3.15"
44

55
[deps]
66
ApproxFunBase = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
@@ -21,7 +21,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2121
ApproxFunSingularitiesStaticArraysExt = "StaticArrays"
2222

2323
[compat]
24-
ApproxFunBase = "0.8.36, 0.9"
24+
ApproxFunBase = "0.8.56, 0.9.12"
2525
ApproxFunBaseTest = "0.1"
2626
ApproxFunOrthogonalPolynomials = "0.2.3, 0.3, 0.4, 0.5, 0.6"
2727
Aqua = "0.6"

src/JacobiWeight.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -509,16 +509,16 @@ end
509509
function show(io::IO,s::JacobiWeight)
510510
d=domain(s)
511511
#TODO: Get shift and weights right
512+
sym = domain(s) == canonicaldomain(s) ? "x" : "𝑪($(domain(s)), x)"
512513
if s.α==s.β
513-
print(io,"(1-x^2)^", s.α, "[")
514+
print(io,"(1-$sym^2)^", s.α)
514515
elseif s.β==0
515-
print(io,"(1-x)^", s.α, "[")
516+
print(io,"(1-$sym)^", s.α)
516517
elseif s.α==0
517-
print(io,"(1+x)^", s.β, "[")
518+
print(io,"(1+$sym)^", s.β)
518519
else
519-
print(io,"(1+x)^", s.β, "(1-x)^", s.α, "[")
520+
print(io,"(1+$sym)^", s.β, " * (1-$sym)^", s.α)
520521
end
521-
522-
show(io,s.space)
523-
print(io,"]")
522+
print(io, " * ")
523+
show(io, s.space)
524524
end

src/LogWeight.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,11 @@ end
9999
function show(io::IO,s::LogWeight)
100100
d=domain(s)
101101
#TODO: Get shift and weights right
102+
sym = domain(s) == canonicaldomain(s) ? "x" : "𝑪($(domain(s)), x)"
102103
if s.α==s.β
103-
print(io,"log((1-x^2)^", s.α, ")[")
104+
print(io,"log((1-$sym^2)^", s.α, ")")
104105
else
105-
print(io,"log((1+x)^", s.β, "(1-x)^", s.α, ")[")
106+
print(io,"log((1+$sym)^", s.β, " * (1-$sym)^", s.α, ")")
106107
end
107-
108-
show(io,s.space)
109-
print(io,"]")
108+
print(io, " * ", s.space)
110109
end

test/runtests.jl

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -853,37 +853,50 @@ end
853853
w = LogWeight(1.0, 0.0, Chebyshev())
854854
s = repr(w)
855855
@test startswith(s, "log")
856-
@test contains(s, "Chebyshev")
856+
@test contains(s, "Chebyshev()")
857857
@test contains(s, "(1+x)^1")
858858
@test contains(s, "(1-x)^0")
859859

860860
w = LogWeight(1.0, 1.0, Chebyshev())
861861
s = repr(w)
862862
@test startswith(s, "log")
863-
@test contains(s, "Chebyshev")
863+
@test contains(s, "Chebyshev()")
864864
@test contains(s, "(1-x^2)^1")
865+
866+
w = LogWeight(1, 2, Chebyshev(0..1))
867+
s = repr(w)
868+
@test startswith(s, "log")
869+
@test contains(s, "Chebyshev($(0..1))")
870+
@test contains(s, "(1+𝑪($(0..1), x))^1")
871+
@test contains(s, "(1-𝑪($(0..1), x))^2")
865872
end
866873
@testset "JacobiWeight" begin
867874
w = JacobiWeight(1.0, 0.0, Chebyshev())
868875
s = repr(w)
869-
@test contains(s, "Chebyshev")
876+
@test contains(s, "Chebyshev()")
870877
@test contains(s, "(1+x)^1")
871878

872879
w = JacobiWeight(0.0, 1.0, Chebyshev())
873880
s = repr(w)
874-
@test contains(s, "Chebyshev")
881+
@test contains(s, "Chebyshev()")
875882
@test contains(s, "(1-x)^1")
876883

877884
w = JacobiWeight(1.0, 1.0, Chebyshev())
878885
s = repr(w)
879-
@test contains(s, "Chebyshev")
886+
@test contains(s, "Chebyshev()")
880887
@test contains(s, "(1-x^2)^1")
881888

882889
w = JacobiWeight(1.0, 2.0, Chebyshev())
883890
s = repr(w)
884-
@test contains(s, "Chebyshev")
891+
@test contains(s, "Chebyshev()")
885892
@test contains(s, "(1+x)^1")
886893
@test contains(s, "(1-x)^2")
894+
895+
w = JacobiWeight(1,2,Chebyshev(0..1))
896+
s = repr(w)
897+
@test contains(s, "Chebyshev($(0..1))")
898+
@test contains(s, "(1+𝑪($(0..1), x))^1")
899+
@test contains(s, "(1-𝑪($(0..1), x))^2")
887900
end
888901
end
889902

0 commit comments

Comments
 (0)