Skip to content

Commit a4729cc

Browse files
authored
defaultcoeff for int coeffs (#170)
1 parent c281e83 commit a4729cc

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/Space.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ _ldiv_coefficients!!(inplace::Val{false}) = ldiv_coefficients
310310
_Fun(v::AbstractVector, sp) = Fun(sp, v)
311311
_Fun(v, sp) = Fun(v, sp)
312312
_maybeconvert(inplace::Val{true}, f, v) = v
313-
_maybeconvert(inplace::Val{false}, f::AbstractVector, v) = strictconvert(Vector{eltype(f)}, v)
313+
_maybeconvert(inplace::Val{false}, f::AbstractVector, v) = strictconvert(Vector{float(eltype(f))}, v)
314314
function defaultcoefficients(f,a,b,inplace = Val(false))
315315
ct=conversion_type(a,b) # gives a space that has a banded conversion to both a and b
316316

test/SpacesTest.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,18 @@ using StaticArrays
239239
v = @inferred coefficients(Float64[0,0,1], Chebyshev(), Ultraspherical(1))
240240
@test v [-0.5, 0, 0.5]
241241

242+
@testset "int coeffs" begin
243+
f = Fun(Chebyshev(), [0,1])
244+
@test f(0.4) 0.4
245+
f = Fun(NormalizedChebyshev(), [0,1])
246+
@test f(0.4) 0.4 * (2/pi)
247+
248+
f = Fun(Chebyshev(), [1])
249+
@test f(0.4) 1
250+
f = Fun(NormalizedChebyshev(), [1])
251+
@test f(0.4) (1/pi)
252+
end
253+
242254
@testset "inplace transform" begin
243255
@testset for sp_c in Any[Legendre(), Chebyshev(), Jacobi(1,2), Jacobi(0.3, 2.3),
244256
Ultraspherical(1), Ultraspherical(2)]

0 commit comments

Comments
 (0)