Skip to content

Commit b56935b

Browse files
authored
Kron for Fun and UniformScaling (#499)
* define types in \otimes, and kron for Fun and I * version bump to v0.8.40 * don't restrict \otimes * Add tests * Add test for I ⊗ x
1 parent 511a8a1 commit b56935b

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-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.8.39"
3+
version = "0.8.40"
44

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

src/Multivariate/Multivariate.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,5 @@ function Base.kron(f::Fun,g::Fun)
110110
end
111111
Base.kron(f::Fun,g::Number) = kron(f,Fun(g))
112112
Base.kron(f::Number,g::Fun) = kron(Fun(f),g)
113+
Base.kron(f::Fun,g::UniformScaling) = kron(f,Operator(g))
114+
Base.kron(f::UniformScaling,g::Fun) = kron(Operator(f),g)

test/PolynomialSpacesTests.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Base.:(==)(a::UniqueInterval, b::UniqueInterval) = (@assert a.parentinterval ==
203203
@test f(0.5)*g(0.5) (f*g)(0.5)
204204
end
205205

206-
@testset "Multivariate" begin
206+
@testset "ArraySpace" begin
207207
@testset for S in Any[Chebyshev(), Legendre()]
208208
f = Fun(x->ones(2,2), S)
209209
@test (f+1) * f (1+f) * f f^2 + f
@@ -213,6 +213,16 @@ Base.:(==)(a::UniqueInterval, b::UniqueInterval) = (@assert a.parentinterval ==
213213
end
214214
end
215215

216+
@testset "Multivariate" begin
217+
@testset "kron" begin
218+
x = Fun()
219+
O = x I
220+
@test O * Fun((x,y)->x^2 * y^2, Chebyshev()^2) Fun((x,y)->x^3 * y^2, Chebyshev()^2)
221+
O = I x
222+
@test O * Fun((x,y)->x^2 * y^2, Chebyshev()^2) Fun((x,y)->x^2 * y^3, Chebyshev()^2)
223+
end
224+
end
225+
216226
@testset "static coeffs" begin
217227
f = Fun(Chebyshev(), SA[1,2,3])
218228
g = Fun(Chebyshev(), [1,2,3])

0 commit comments

Comments
 (0)