diff --git a/src/system.jl b/src/system.jl index eacb7a1..ae3f71d 100644 --- a/src/system.jl +++ b/src/system.jl @@ -14,11 +14,19 @@ end function System(polys::Vector{<:MP.AbstractPolynomialLike}, variables=_variables(polys)) System([Polynomial(p, variables) for p in polys]) end -_variables(polys) = sort!(union(Iterators.flatten(MP.variables.(ps))), rev=true) +_variables(polys) = sort!(union(Iterators.flatten(MP.variables.(polys))), rev=true) Base.length(F::System) = length(F.polys) Base.getindex(F::System, i) = getindex(F.polys, i) + +""" + nvariables(F::System) + +Returns the number of variables of `F`. +""" +nvariables(F::System) = size(exponents(F[1]), 1) + """ JacobianConfig(F::Vector{Polynomial{T}}, [x::AbstractVector{S}])