One interesting design decision with rational polynomials is whether to use a common denominator or individual denominators for each coefficient. The second choice is generally slower, but the first can cause explosion in coefficient size in some examples (eg x + x^2/2 + x^3/3 + x^4/4 + ... + x^10000 / 10000).
I'd say the best option is to have two types of rational polynomials (defaulting to the single denominator implementation). Also take a look at sage.rings.polynomial.polynomial_integer_dense_flint.pyx for another, simpler example of wrapping FLINT. And if you want a bigger project, you could rewrite number field elements to use FLINT instead of NTL too. It's very similar code to rational polynomials. :-) David On Mon, Jun 29, 2009 at 5:29 PM, Martin Albrecht < m...@informatik.uni-bremen.de> wrote: > > > You don't need to worry about the get_cparent() magic defined in the > > zmod_poly wrapper, since you won't need to keep track of a modulus for > > your polynomial objects. > > One more thing: IIRC FLINT doesn't have a QQ['x'] type so I guess one would > define a struct > > struct my_qqx { > > fmpz_poly_t poly; > fmpz_t denominator; > > } > > and use that as the celement type? > > Cheers, > Martin > > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---