On 10/2/22 13:18, Qian Yun wrote:
For bigger inputs, I think current implementation is bad both ways:
a) For sparse cases, simply chain the MxN terms together, sort and
dedupe is O(N^2*log(N)) better than current O(N^3).
This way the time complexity is O(N^2*log(N^2)) -> O(2*N^2*log(N)),
t
Now some comparison with Maxima and Reduce:
IIUC, Maxima implementation is "ptimes" at
https://github.com/calyau/maxima/blob/master/src/rat3a.lisp#L850
And Reduce implementation is "poly!-multf" at
https://github.com/reduce-algebra/reduce-algebra/blob/master/packages/poly/polrep.red#L199
The Max