PolynomialRoots.jl
PolynomialRoots.jl copied to clipboard
JET: MethodError for zero polynomial
Complaint from JET.jl:
┌ roots(poly::Vector{Int64}) @ PolynomialRoots /src/PolynomialRoots.jl:610 │┌ roots(poly::Vector{Int64}; epsilon::Float64, polish::Bool) @ PolynomialRoots /src/PolynomialRoots.jl:617 ││ no matching method found `(::Colon)(::Int64, ::Nothing)` (1/2 union split): (1 PolynomialRoots.:(:) last_nz::Union{Nothing, Int64}) │└────────────────────
So Line 617 errors with a MethodError
for ::Colon
if the input vector has no nonzero element.
MWE:
using PolynomialRoots
roots([0,0,0])