Skip to content

Commit

Permalink
dictionary conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
daanhb committed May 27, 2020
1 parent ac46f85 commit 483df67
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/bases/fourier/fourier.jl
Expand Up @@ -25,7 +25,6 @@ name(b::Fourier) = "Fourier series"
# The default numeric type is Float64
Fourier(n::Int) = Fourier{Float64}(n)

convert(::Type{Fourier{T}}, d::Fourier{T}) where {T} = d
convert(::Type{Fourier{T}}, d::Fourier) where {T} = Fourier{T}(d.n)

@deprecate Fourier(n, a::Number, b::Number) Fourier(n)a..b
Expand Down
2 changes: 2 additions & 0 deletions src/bases/poly/chebyshev/ChebyshevT.jl
Expand Up @@ -14,6 +14,8 @@ ChebyshevT(n::Int) = ChebyshevT{Float64}(n)

similar(b::ChebyshevT, ::Type{T}, n::Int) where {T} = ChebyshevT{T}(n)

convert(::Type{ChebyshevT{T}}, d::ChebyshevT) where {T} = ChebyshevT{T}(d.n)

"Mapped Chebyshev polynomials."
struct MappedChebyshev{T} <: MappedDict{T,T}
superdict :: ChebyshevT{T}
Expand Down
1 change: 1 addition & 0 deletions test/test_chebyshev.jl
Expand Up @@ -8,6 +8,7 @@ function test_chebyshev_expansions(T)
g = BasisFunctions.secondgrid(b)
BasisFunctions.Test.test_generic_dict_transform(b, g)
BasisFunctions.Test.test_generic_dict_transform(complex(b), g)
@test convert(ChebyshevT{BigFloat}, ChebyshevT{T}(10)) isa ChebyshevT{BigFloat}
end

@test support(b) == ChebyshevInterval{T}()
Expand Down
2 changes: 2 additions & 0 deletions test/test_fourier.jl
Expand Up @@ -17,6 +17,8 @@ function test_fourier_series(T)

@test support(fb0) == UnitInterval{T}()

@test convert(Fourier{BigFloat}, Fourier{Float64}(10)) isa Fourier{BigFloat}

## Even length
n = 12
a = -T(1.2)
Expand Down

0 comments on commit 483df67

Please sign in to comment.