On Mon, Jan 26, 2009 at 2:06 AM, Alexander Dreyer
<jan.alexander.dre...@googlemail.com> wrote:
>
> Hello everybody,
> I'm about to implement a C++-class for polynomials in the style of
> PolyBoRi, but with integer-valued coefficients. In fact, the Integers
> may be quite large, let's say up to 2^512.
> Since this data type might be interesting for the SAGE community
> somewhen, I would like to ask you for your opinion: What would you
> suggest as data type for those coefficients?
>
> Best regards,
>  Alexander Dreyer

I'm not sure it matters to Sage... no matter what data structure you
use, whoever writes the Sage interface can write code to translate
back and forth to the normal Sage data types.

I'm not sure I understand what these polynomials are.  Are the
coefficients really just integers mod 2^512 (so that multiplication is
integer multiplication, followed by discarding the high-order words)?
Do you need to do any operations on them besides addition,
subtraction, and multiplication?  How much effort are you willing to
spend on micro-optimizations?

I would recommend using GMP, and using either the mpz or mpn layers,
depending on the answers to the above questions.  If you only need
addition, subtraction, and multiplication, then using mpn is faster
and probably easier (since you control the memory being used, and you
don't have to worry about mpz_init() and mpz_clear()).  If you need
more integer operations, then it would probably be better to use the
mpz layer.

Carl

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to