You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To support DynamicPolynomials.jl in RecurrenceRelationships.jl I had to be careful to use the type of a polynomial (which is different than a variable). A quick-and-dirty fix was this:
Though now I'm also support matrices and so this doesn't work.
I'm wondering if there's a canonical function for determining the type of a polynomial given the type of the coefficients and the type of the variable.
The text was updated successfully, but these errors were encountered:
Good question. I also need to do this frequently, and also for JuMP when you want to obtain the type JuMP.AffExpr from the type JuMP.VariableRef in a generic way, e.g., when preallocating the result of matrix multiplication.
This is one of the reason of the creation of MutableArithmetics.promote_operation.
You can even directly call MutableArithmetics.promote_sum_mul(V, T) where V is the variable type and T is the number type and you'll get the polynomial type if V is a polynomial variable or you'll get JuMP.AffExpr if V is a JuMP variable.
To support DynamicPolynomials.jl in RecurrenceRelationships.jl I had to be careful to use the type of a polynomial (which is different than a variable). A quick-and-dirty fix was this:
https://github.com/JuliaApproximation/RecurrenceRelationships.jl/blob/82125b04d75df222024abaf7a10670fa6a99e9bc/src/RecurrenceRelationships.jl#L5
Though now I'm also support matrices and so this doesn't work.
I'm wondering if there's a canonical function for determining the type of a polynomial given the type of the coefficients and the type of the variable.
The text was updated successfully, but these errors were encountered: