-
Notifications
You must be signed in to change notification settings - Fork 170
Closed
Description
It was difficult to find an MWE since Julia just kept crashing:
using Symbolics, SparseArrays
@variables x y[1:4]
z = Symbolics.Num[
0
-x*((1//3)*y[1] + (1//12)*y[2] + (1//6)*y[3] + (1//9)*y[4])*((y[1] + y[2] + y[3] + y[4])^-1)
]
sparse(z)
zsh: segmentation fault /Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
If you use convert
convert(SparseVector{Num, Int64},z)
ERROR: StackOverflowError:
Stacktrace:
[1] promote_type
@ ./promotion.jl:233 [inlined]
[2] promote_result(#unused#::Type, #unused#::Type, #unused#::Type{DynamicPolynomials.Term{true, Any}}, #unused#::Type{Any})
@ Base ./promotion.jl:247
--- the last 2 lines are repeated 79982 more times ---
[159967] promote_type
@ ./promotion.jl:233 [inlined]
Interestingly, if you remove the negative sign on x
it works just fine.
I'm using Symbolics v3.2.3.
Metadata
Metadata
Assignees
Labels
No labels