Closed nsajko closed 11 months ago
We have https://juliaalgebra.github.io/MultivariatePolynomials.jl/dev/types/#MultivariatePolynomials.similar_variable to programatically create a new variable
But to use similar_variable
I first need a polynomial value, and I thought I need a variable to construct a polynomial value? Seems like a chicken and egg problem?
Note sure what your use case is. Can't you use mod.@polyvar a
and then use a
and not care about the returned type ?
Ah, you're right about that, I don't have to care about which type @polyvar
returns, given that it also defines a variable with the same name.
TypedPolynomials.@polyvar x
returns a single value, butDynamicPolynomials.@polyvar x
returns a length-one tuple:To get around this inconsistency, I currently do
@polyvar x dummy
, which is awkward.Is there a better way?