altavir
07/08/2022, 8:29 AMfunctions
module (it is intended to be lightweight). Could you create a separate module like kmath-rational
and move all but basic polynomials there?altavir
07/08/2022, 10:09 AMtypealias MultivariatePolynomial = Map<Symbol, Plynomial>
? It would completely solve all structure problems. And then mulitvariate polynomial is easily constructed on top of regular polynomial algebra.Gleb Minaev
07/08/2022, 12:10 PMInt
instead of Symbol
is used to identify variables). More precily, let there be polynomial 3 + 5 y - 7 x^2 z
. Obviously, we should represent it as a map from variables powers sets of its monomials to coefficients of corresponding monomials (like {() -> 3, (y) -> 5, (x^2 z) -> -7}
). So now the question is how we should represent such variables powers set of each monomial (let's call it "signature" of the monomial). If you have representation of variable as `Symbol`s then signatures can be represented as a `Map<Symbol, UInt>`: now 3 + 5 y - 7 x^2 z
is {{} -> 3, {y -> 1u} -> 5, {x -> 2u, z -> 1u} -> -7}
. That's how "labeled polynomials" work. But if you have representation of variablese as `Int`s (if you numbered your variables) then signatures can be represented as lists of powers where value on each index i
is power of `i`th varible: if x
, y
, and z
are numbered as 0
, 1
, and 2
then 3 + 5 y - 7 x^2 z
can be represented as {[] -> 3, [0u, 1u] ->5, [2u, 0u, 1u] -> -7}
.
2. Sorry, I don't understand how you suggest to represent multivariate polynomial as a map from variables to univariate polynomials (for example, still the same 3 + 5 y - 7 x^2 z
).altavir
07/08/2022, 12:49 PMSymbolIndexer
altavir
07/08/2022, 12:50 PMGleb Minaev
07/08/2022, 8:31 PMGleb Minaev
07/08/2022, 8:44 PMaltavir
07/09/2022, 6:59 AMaltavir
07/09/2022, 7:00 AMGleb Minaev
07/11/2022, 2:59 PMkmath-polynomialX
. Although, it seems there are some issues after the move. Now I am trying to resolve them as much as I can and move rest parts to the new module.altavir
07/11/2022, 3:00 PMpolinomils
will be fine. We do not have other modules with polinomialsGleb Minaev
07/12/2022, 5:17 PM