Skip to content

Commit

Permalink
coefficient conversion bugfix (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub authored Aug 7, 2022
1 parent 6cf64e7 commit 51b9aa0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ApproxFunBase"
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
version = "0.6.3"
version = "0.6.4"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
4 changes: 3 additions & 1 deletion src/Space.jl
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ coefficients(f::AbstractVector,sp1::Space,::Type{T2}) where {T2<:Space} = coeffi
## coefficients defaults to calling Conversion, otherwise it tries to pipe through Chebyshev


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

Expand All @@ -321,7 +323,7 @@ function defaultcoefficients(f,a,b)
end
if spacescompatible(a,csp) || spacescompatible(b,csp)
# b is csp too, so we are stuck, try Fun constructor
coefficients(default_Fun(Fun(a,f),b))
coefficients(default_Fun(_Fun(f,a),b))
else
coefficients(f,a,csp,b)
end
Expand Down
4 changes: 4 additions & 0 deletions test/SpacesTest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,9 @@ using ApproxFunOrthogonalPolynomials
v = rand(4)
v2 = transform(NormalizedChebyshev(), v)
@test itransform(NormalizedChebyshev(), v2) v

f = Fun(x->x^2, Chebyshev())
v = coefficients(f, Chebyshev(), Legendre())
@test v coefficients(Fun(x->x^2, Legendre()))
end
end

2 comments on commit 51b9aa0

@jishnub
Copy link
Member Author

@jishnub jishnub commented on 51b9aa0 Aug 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/65836

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.4 -m "<description of version>" 51b9aa0620409cbb0e6984eddbdf334f9825e167
git push origin v0.6.4

Please sign in to comment.