Skip to content

Commit

Permalink
bugfix in vectorfun arithmetic (#166)
Browse files Browse the repository at this point in the history
* bugfix in vectorfun arithmetic

* version bump to v0.6.13

* check for approx instead of exact

* Add tests
  • Loading branch information
jishnub authored Aug 18, 2022
1 parent bb55ab7 commit cdc4782
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 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.12"
version = "0.6.13"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
4 changes: 2 additions & 2 deletions src/Multivariate/VectorFun.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ for OP in (:*,:+,:-)
$OP(f::ArrayFun, A::AbstractArray{<:Fun}) = Fun($OP(Array(f),A))
$OP(A::UniformScaling, f::ArrayFun) = Fun($OP(A,Array(f)))
$OP(f::ArrayFun, A::UniformScaling) = Fun($OP(Array(f),A))
$OP(A::Number, f::ArrayFun) = Fun($OP(A,Array(f)))
$OP(f::ArrayFun, A::Number) = Fun($OP(Array(f),A))
$OP(A::Number, f::ArrayFun) = Fun($OP(A*I,Array(f)))
$OP(f::ArrayFun, A::Number) = Fun($OP(Array(f),A*I))

$OP(f::ScalarFun, A::AbstractArray) = Fun(broadcast($OP,f,A))
$OP(A::AbstractArray, f::ScalarFun) = Fun(broadcast($OP,A,f))
Expand Down
10 changes: 10 additions & 0 deletions test/SpacesTest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -287,5 +287,15 @@ using ApproxFunOrthogonalPolynomials
@test newvals(f2) values(f3)
@test values(f2) values(f3)
end

@testset "Multivariate" begin
@testset for S in Any[Chebyshev(), Legendre()]
f = Fun(x->ones(2,2), S)
@test (f+1) * f (1+f) * f f^2 + f
@test (f-1) * f f^2 - f
@test (1-f) * f f - f^2
@test f + f 2f f*2
end
end
end
end

2 comments on commit cdc4782

@jishnub
Copy link
Member Author

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/66475

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.13 -m "<description of version>" cdc4782fe40e2c06afa0a25980de6f5c7f2adf55
git push origin v0.6.13

Please sign in to comment.