Skip to content

Commit 51b9aa0

Browse files
authored
coefficient conversion bugfix (#146)
1 parent 6cf64e7 commit 51b9aa0

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunBase"
22
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
3-
version = "0.6.3"
3+
version = "0.6.4"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/Space.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ coefficients(f::AbstractVector,sp1::Space,::Type{T2}) where {T2<:Space} = coeffi
304304
## coefficients defaults to calling Conversion, otherwise it tries to pipe through Chebyshev
305305

306306

307+
_Fun(v::AbstractVector, sp) = Fun(sp, v)
308+
_Fun(v, sp) = Fun(v, sp)
307309
function defaultcoefficients(f,a,b)
308310
ct=conversion_type(a,b) # gives a space that has a banded conversion to both a and b
309311

@@ -321,7 +323,7 @@ function defaultcoefficients(f,a,b)
321323
end
322324
if spacescompatible(a,csp) || spacescompatible(b,csp)
323325
# b is csp too, so we are stuck, try Fun constructor
324-
coefficients(default_Fun(Fun(a,f),b))
326+
coefficients(default_Fun(_Fun(f,a),b))
325327
else
326328
coefficients(f,a,csp,b)
327329
end

test/SpacesTest.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,9 @@ using ApproxFunOrthogonalPolynomials
173173
v = rand(4)
174174
v2 = transform(NormalizedChebyshev(), v)
175175
@test itransform(NormalizedChebyshev(), v2) v
176+
177+
f = Fun(x->x^2, Chebyshev())
178+
v = coefficients(f, Chebyshev(), Legendre())
179+
@test v coefficients(Fun(x->x^2, Legendre()))
176180
end
177181
end

0 commit comments

Comments
 (0)