Hi Volker, On 2014-12-28, Volker Braun <vbraun.n...@gmail.com> wrote: > When starting from scratch I would go with the first option. Cleaner code, > easier to write and debug, and if the coefficient is already a Python > object then the overhead is already bounded by a factor of 2.
In fact, a year or two ago, I had experimental code where I did follow the aproach to use Python objects (of course cythoned). It tought me much (about theory), but it wasn't really competitive. > I would use > std::map<exponent, coefficient> (that is, a binary tree) instead of > std::list<std::pair<exponent, coefficient>> as underlying data structure > though. Even if you don't want/need associative containers, why linked > lists? Because this is about computing Gröbner bases. So, there is a monomial ordering by which the terms of a polynomial are linearly ordered. That's at #17435. In the yet unpublished branch implementing Gröbner basis computations, I am using the geobucket data structure, which is a bit more complicated than just a linear list, but is better for the typical operations occurring when computing Gröbner bases. > Do you ever insert in the middle? Yes, as follows: > Presumably polynomials are immutable => arrays or std::vector Polynomials get reduced by generators of ideals, so, they aren't immutable, as the lead term will be replaced by other terms, that are inserted in the middle. > Though given that your implementation already exists and (presumably) works > and is well-debugged I wouldn't change it now. Finish it, and if you run > into any performance bottleneck you can explore other options. Yep, that was my plan. First, I had the above-mentioned experimental code, based on the experiments I came up with a paper describing the theory, and now I try to get a competitive implementation. Best regards, Simon -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.