Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion error #48

Open
saschatimme opened this issue Nov 11, 2018 · 1 comment
Open

Conversion error #48

saschatimme opened this issue Nov 11, 2018 · 1 comment

Comments

@saschatimme
Copy link
Contributor

julia> @polyvar x y

julia> [x^2+x+y y+x; 1 + x x*y+x]
ERROR: MethodError: no method matching Polynomial{Int64,T,V} where V<:AbstractArray{T,1} where T<:(Term{Int64,M} where M<:Monomial)(::Polynomial{Int64,Term{Int64,Monomial{(x, y),2}},Array{Term{Int64,Monomial{(x, y),2}},1}})
Stacktrace:
 [1] convert(::Type{Polynomial{Int64,T,V} where V<:AbstractArray{T,1} where T<:(Term{Int64,M} where M<:Monomial)}, ::Polynomial{Int64,Term{Int64,Monomial{(x, y),2}},Array{Term{Int64,Monomial{(x, y),2}},1}}) at /Users/sascha/.julia/dev/MultivariatePolynomials/src/conversion.jl:5
 [2] setindex!(::Array{Polynomial{Int64,T,V} where V<:AbstractArray{T,1} where T<:(Term{Int64,M} where M<:Monomial),1}, ::Polynomial{Int64,Term{Int64,Monomial{(x, y),2}},Array{Term{Int64,Monomial{(x, y),2}},1}}, ::Int64) at ./array.jl:769
 [3] getindex(::Tuple{Polynomial{Int64,Term{Int64,Monomial{(x, y),2}},Array{Term{Int64,Monomial{(x, y),2}},1}},Polynomial{Int64,Term{Int64,Monomial{(x, y),2}},Array{Term{Int64,Monomial{(x, y),2}},1}},Polynomial{Int64,Term{Int64,Monomial{(x,),1}},Array{Term{Int64,Monomial{(x,),1}},1}},Polynomial{Int64,Term{Int64,Monomial{(x, y),2}},Array{Term{Int64,Monomial{(x, y),2}},1}}}, ::UnitRange{Int64}) at ./range.jl:274
 [4] typed_hvcat(::Type{Polynomial{Int64,Term{Int64,Monomial{(x, y),2}},Array{Term{Int64,Monomial{(x, y),2}},1}}}, ::Tuple{Int64,Int64}, ::Polynomial{Int64,Term{Int64,Monomial{(x, y),2}},Array{Term{Int64,Monomial{(x, y),2}},1}}, ::Vararg{Any,N} where N) at ./abstractarray.jl:1653
 [5] hvcat(::Tuple{Int64,Int64}, ::Polynomial{Int64,Term{Int64,Monomial{(x, y),2}},Array{Term{Int64,Monomial{(x, y),2}},1}}, ::Vararg{Any,N} where N) at ./abstractarray.jl:1631
 [6] top-level scope at none:0
@fgerick
Copy link
Contributor

fgerick commented Aug 12, 2019

I think the problem here is the syntax, because the construction of the matrix is character dependent (sensitive to blanks, i don't know the right name for this). I think what you meant to write was

[x^2+x+y y+x; 1+x x*y+x]

(no blanks at 1+x). This works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants