Generic rings in C

26 views
Skip to first unread message

Fredrik Johansson

unread,
Apr 9, 2022, 10:30:53 AM4/9/22
to flint-devel
Hi all,

I'm currently working on a new generics module in plain C.



This will eventually provide a unified interface to all Flint/Arb/Antic/Calcium types (and others). It is also fully recursive, so one can construct, say, matrices of polynomials over polynomials with Arb coefficients directly in C (and then easily switch to Calcium coefficients when the arithmetic needs to be done exactly). It's designed from the ground up to deal rigorously with things like inexact (e.g. interval) rings, semi-decidable rings, non-integral domains, etc.

Long term it could also potentially allow us to get rid of some code duplication in these libraries (replacing duplicated algorithms with calls to the generic implementations, where performance is the same), and it could be used to add things like power series, sparse matrices and multivariate polynomials for more types, plus more memory-efficient variants for small finite fields etc.

Still very much a work in progress. I will try to do a longer writeup in the near future; for now, feel free to look around.

Fredrik

Bill Hart

unread,
Apr 9, 2022, 11:20:01 AM4/9/22
to flint-devel
It's amazing how far you already got with this!

I notice you mention in the goals that you want to do some packing
down to the byte. Could you say more about what you have in mind here?

Bill.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "flint-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to flint-devel...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/flint-devel/CAJdUXT%2BbUgwGBFtH2V7DzUsxuM6iORDtH098CQ5tdF9acopzkg%40mail.gmail.com.

Fredrik Johansson

unread,
Apr 9, 2022, 11:50:45 AM4/9/22
to flint-devel
We can easily specialize Z/nZ for moduli that fit in 8, 16, 32, 64 or 128 bits, say. Likewise for Zech logarithms for finite fields with less than 2^8, 2^16 or 2^32 elements. This kind of specialization is also possible for floating-point types.

Not sure how bad the overhead will be. I haven't really done any benchmarking yet.

Fredrik

Reply all
Reply to author
Forward
0 new messages