Mega-Flint is a reality!

86 views
Skip to first unread message

Fredrik Johansson

unread,
Feb 27, 2023, 4:11:43 PM2/27/23
to flint-devel
Hi all,

The merging of Arb, Calcium and generic-rings into Flint's main branch (https://github.com/flintlib/flint2/) is now complete. Huge thanks to Isuru Fernando who managed to correctly merge the commit histories of the projects!

The last unmerged version of Flint is currently available in the https://github.com/flintlib/flint2/tree/flint-2.10 branch. I will try to issue a 2.10 release candidate based on that branch soonish.

Then we'll probably work towards making a flint-3.0 release in the coming months for the new Mega-Flint.

Best,
Fredrik

fieker

unread,
Feb 28, 2023, 2:18:42 AM2/28/23
to flint...@googlegroups.com
Congrats!!!

> Best,
> Fredrik
>
> --
>
> ---
> 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/CAJdUXTJ_cgFaqgEh1RMoFs1KtA-vVjaPoZfeTL_7z6zgQJ1fEA%40mail.gmail.com.

Martin Maechler

unread,
Mar 11, 2023, 5:41:56 AM3/11/23
to flint-devel
Thank you (all involved)!
I'm not an expert .. but a still somewhat knowledgable "consumer" of libraries such as  Arb, Flint:
In the past I have created `Rmpfr` (https://cran.R-project.org/package=Rmpfr)  an R interface to MPFR and have used `Rmpfr` myself in order to improve accuracy in R (https://www.R-project.org/) itself (as I am an R core member).
Notably for getting highly accurate  regularized incomplete Beta  functionality  (the function is important in statistics & probability),   I had finally found  Arb  which provides the _2_1 hypergeometric and also directly provides a regularized incomplete Beta via  `acb_hypgeom_beta_lower()`.

This (and other nice features!)  made me think that  `Arb` may really be useful to be (partly) accessible from R and eventually create an   `arbR` R package to the R community.
Just today working a bit on that, I noted that I really need  the  `sprintf*()` versions [rather than printf*()] for "output" because R needs to talk to the console and not have underlying C code directly print to stdout (*).
 
As there has been a push recently {new versions of  clang compiler, e.g. on Apple platform}  to deprecate  `sprintf()`  and urge developers to move to `snprintf()` instead,  I was going to ask if the flint*.h headers (and the Arb ones too)
will also get snprintf() versions,  Flint (released version) e.g., only has  
flint.h:485: FLINT_DLL int flint_sprintf(char * s, const char * str, ...); /* flint version of sprintf */

Now I've stumbled over this Mega-Flint announcement I wonder if I should hold a bit and rather wait a couple of months, before even really starting my project.
OTOH you will keep the API back compatible with the arb library (2.32) API?

Lastly: It seems to me that the Arb library does not yet provide any  sprintf* printing but always print to a file (or directly to stdout as special case), so  I cannot nicely get to R strings containing formatted  Arb  balls.
      Would you want feature requests for Arb  now on the Arb side or here,
 i.e. I assume at  https://github.com/flintlib/flint2/issues    ??

--
*)  for "print"ing in my Rmpfr R package, everything is based on MPFR library's   mpfr_get_str()  utility which fills the formatted output into a char* string.
     An analog of this I would want for Arb, Arf, .. Flint  "number"s.
    Of course the  conversion from and to regular integer, double, .. are likewise crucially important for the interface package.

Thank you for pointers / recommendations / ..
Martin

--
Martin <Maec...@stat.math.ethz.ch>   http://stat.ethz.ch/~maechler
Seminar für Statistik, ETH Zürich  Switzerland

Fredrik Johansson

unread,
Mar 11, 2023, 5:56:30 AM3/11/23
to flint...@googlegroups.com
Hi Martin,

Thanks for your feedback!

On Sat, Mar 11, 2023 at 11:41 AM Martin Maechler <mmae...@gmail.com> wrote:
Thank you (all involved)!
I'm not an expert .. but a still somewhat knowledgable "consumer" of libraries such as  Arb, Flint:
In the past I have created `Rmpfr` (https://cran.R-project.org/package=Rmpfr)  an R interface to MPFR and have used `Rmpfr` myself in order to improve accuracy in R (https://www.R-project.org/) itself (as I am an R core member).
Notably for getting highly accurate  regularized incomplete Beta  functionality  (the function is important in statistics & probability),   I had finally found  Arb  which provides the _2_1 hypergeometric and also directly provides a regularized incomplete Beta via  `acb_hypgeom_beta_lower()`.

This (and other nice features!)  made me think that  `Arb` may really be useful to be (partly) accessible from R and eventually create an   `arbR` R package to the R community.
Just today working a bit on that, I noted that I really need  the  `sprintf*()` versions [rather than printf*()] for "output" because R needs to talk to the console and not have underlying C code directly print to stdout (*).
 
As there has been a push recently {new versions of  clang compiler, e.g. on Apple platform}  to deprecate  `sprintf()`  and urge developers to move to `snprintf()` instead,  I was going to ask if the flint*.h headers (and the Arb ones too)
will also get snprintf() versions,  Flint (released version) e.g., only has  
flint.h:485: FLINT_DLL int flint_sprintf(char * s, const char * str, ...); /* flint version of sprintf */

You can use arb_get_str().

Now I've stumbled over this Mega-Flint announcement I wonder if I should hold a bit and rather wait a couple of months, before even really starting my project.
OTOH you will keep the API back compatible with the arb library (2.32) API?

It shouldn't be a big hassle to base your project on the latest FLINT and Arb releases, migrating to the merged library once it has a public release. The APIs will remain backward compatible.

Lastly: It seems to me that the Arb library does not yet provide any  sprintf* printing but always print to a file (or directly to stdout as special case), so  I cannot nicely get to R strings containing formatted  Arb  balls.
      Would you want feature requests for Arb  now on the Arb side or here,
 i.e. I assume at  https://github.com/flintlib/flint2/issues    ??
 
Yes, the flint2 tracker would be better, but either one works for me.

--
*)  for "print"ing in my Rmpfr R package, everything is based on MPFR library's   mpfr_get_str()  utility which fills the formatted output into a char* string.
     An analog of this I would want for Arb, Arf, .. Flint  "number"s.
    Of course the  conversion from and to regular integer, double, .. are likewise crucially important for the interface package.

Don't hesitate to point out any missing conversion routines.

Note that arb_fpwrap.h provides ready-made machine float wrappers for many Arb transcendental functions, e.g. for the lower beta function you have arb_fpwrap_double_beta_lower / arb_fpwrap_cdouble_beta_lower.

Best,
Fredrik

Martin Maechler

unread,
Mar 13, 2023, 4:49:50 PM3/13/23
to flint-devel
Thanks a lot, Fredrik,
for now you've answered all my questions!

Martin
Reply all
Reply to author
Forward
0 new messages