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
Currently, monomials are represented as unboxed vectors of Ints. This seems rather inefficient: an unboxed vector stores an offset, a length, and the data is stored byte-per-byte instead of word-per-word.
I'm also wondering if a Map is the best data-structure to use to represent polynomials, but I suppose that's best left to a separate ticket.
Yes, repr. of polynomial deserves another issue - indeed, the desirable representation depends on the purpose. Groebner basis algorithms performs well with ordered structures - hence we are using Maps here by default. I once tried heaps as an alternative repr, but it didn't buy me a good speed up at that time . OTOH, multivariate factorisation works well with recursive, nested representation.
Anyway, as we have classes abstracting over polynomials, so we can have multiple representation for specific use cases. And Map-based repr performs relatively well at average for the time being.
or, avoiding all indirections entirely:
I think Unboxed approach won't scale as it needs extra data insts and makes it hard to implement folding (e.g. for monomial ordering and sugars) generically. IMHO, its performance gain doesn't deserve the effort to rewrite codes entirely (could be wrong though).
Array seems good, but then we could use even more efficient primitive (unboxed)
array: PrimArray. I think we can use my subcategories package to reduce the amonunt of code modification.
As I'm a busy recently, so a pull request (including runtime and heap benchmarks) is really welcome!
Currently, monomials are represented as unboxed vectors of
Int
s. This seems rather inefficient: an unboxed vector stores an offset, a length, and the data is stored byte-per-byte instead of word-per-word.Two ideas come to mind instead:
or, avoiding all indirections entirely:
I'm also wondering if a
Map
is the best data-structure to use to represent polynomials, but I suppose that's best left to a separate ticket.The text was updated successfully, but these errors were encountered: