Do I lose performance by (ab)using multivariate polynomials over only one variable?

15 views
Skip to first unread message

Mao Zeng

unread,
Mar 25, 2023, 12:50:48 PM3/25/23
to nemo-devel
I'm writing some code which uses Nemo for polynomial arithmetic with any number of variables. For convenience, I haven't distinguished the multivariate and univariate case. So when there is only one variable, the code is essentially
`R, (x,) = PolynomialRing(QQ, ["x"])`

Do I lose performance by not using
`R, x = PolynomialRing(QQ, "x")`
instead?

It seems that the former code uses `fmpq_mpoly` from FLINT, which may not be optimal for the univariate case?

tho...@gmail.com

unread,
Mar 25, 2023, 1:05:52 PM3/25/23
to nemo-devel
Yes, the difference will be noticeable. Depending on how you structured your code, it might be possible to just use the univariate instead?

Mao Zeng

unread,
Mar 25, 2023, 6:18:35 PM3/25/23
to nemo-devel
OK, I'll just to treat the univariate case as a special case in my code. Thanks for confirming that this is worth doing.
Reply all
Reply to author
Forward
0 new messages