Skip to content

Commit 6019e9c

Browse files
committed
Fix building Matrix of poly and matpoly of same eltype
1 parent bc47935 commit 6019e9c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/poly.jl

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ Base.convert{C}(::Type{PolyType{C}}, p::TermContainer{C}) = p
155155

156156
# needed to build [p Q; Q p] where p is a polynomial and Q is a matpolynomial in Julia v0.5
157157
Base.convert{C}(::Type{TermType{C}}, p::TermContainer{C}) = p
158+
Base.convert{C, T}(::Type{TermType{C, T}}, p::TermContainer{C, T}) = p
158159

159160
function Base.convert{S}(::Type{S}, p::TermContainer)
160161
s = zero(S)

test/poly.jl

+2
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@
135135
@test typeof(MultivariatePolynomials.TermContainer{true, Int}(p)) == Polynomial{true, Int}
136136
p = x + y
137137
Q = MatPolynomial([true false; false true], [x, y])
138+
P = MatPolynomial([1 2; 2 1], [x, y])
138139
@test isa([p, Q], Vector{Polynomial{true, Int}})
139140
@test isa([p Q; Q p], Matrix{Polynomial{true, Int}})
141+
@test isa([p P; P 0], Matrix{Polynomial{true, Int}})
140142
end
141143
@testset "Non-commutative MatPolynomial" begin
142144
@ncpolyvar x y

0 commit comments

Comments
 (0)