JuliaAlgebra / StaticPolynomials.jl

Fast evaluation of multivariate polynomials
https://juliaalgebra.github.io/StaticPolynomials.jl/latest/
Other
16 stars 4 forks source link

Type Stability for other `StaticVector`s while evaluating `PolynomialSystem`. #46

Open manuelbb-upb opened 3 years ago

manuelbb-upb commented 3 years ago

Hi, thanks for the great package!

I noticed, that evaluating a PolynomialSystem at a SVector returns an SVector, but the same does not hold true for SizedVector or MVector.

I currently define

for V in [:SizedVector, :MVector ]
    @eval Base.@propagate_inbounds StaticPolynomials.evaluate( F :: PolynomialSystem, x :: $V ) = $V( StaticPolynomials._evaluate( F, x ) )
    @eval Base.@propagate_inbounds StaticPolynomials.evaluate( F :: PolynomialSystem, x :: $V , p) = $V( StaticPolynomials._evaluate( F, x , p) )
end

in my package, but I think, it would be great to have these definitions in polynomial_system.jl

I guess the other subtypes (FieldVector and SUnitRange) can be neglected.

Should I open a pull request?