DynamicPolynomials.jl icon indicating copy to clipboard operation
DynamicPolynomials.jl copied to clipboard

StackOverflowError for Vector{AbstractMonomialLike}

Open kbarros opened this issue 2 years ago • 0 comments

using DynamicPolynomials

@polyvar x
a = x^2
b = x

 # This runs without error
randn(2, 2) * [a, b]

# This throws StackOverflowError
randn(2, 2) * [p for p in (a, b)]

# The importance difference seems to be these types
@assert typeof([a, b]) == Vector{Monomial{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}}}
@assert typeof([p for p in (a, b)]) == Vector{AbstractMonomialLike}

kbarros avatar Jan 07 '24 19:01 kbarros