Here's something I wrote up on implementing FMPFR. Enjoy!
This documents some of the design choices for, and lessons from, the implementation of MPFR, reflecting both strenghs and weaknesses of
Fortran and the other tools that are used.
On Sun, 31 Jul 2022 14:48:34 +0000, Thomas Koenig wrote:
Here's something I wrote up on implementing FMPFR. Enjoy!
This documents some of the design choices for, and lessons from, the
implementation of MPFR, reflecting both strenghs and weaknesses of
Fortran and the other tools that are used.
Thomas, This looks really interesting. I'll have to give it
a workout on the weekend.
I'm subscribed to the MPFR mailing
list and saw an email you sent there. Are you planning to integrate/contribute this to MPFR? If gfortran (or other
modern compiler is available), it would be nice to have a
Fortran module is built when building MPFR?
I read this with interest, but I do not quite understand the
issue with the generics with two integers. Could you explain this
further via the C interface? (I did not find that documentation
immediately so gave up after 60 seconds ;)).
Also, with respect
to array intrinsics, you could simply start with one-dimensional
versions, as I imagine that will be the most common use case.
and I was a little bit stuck in my head because I thought that
mpfr_rnd_t had to be an integer (it is a C enum), so I chose an 8-bit
int for it.
However, a better solution is actually rather simple: Make a
derived type and declare parameters with the values of the enum.
Duh. I think I will implement that next.
On 8/3/2022 1:06 PM, Thomas Koenig wrote:
and I was a little bit stuck in my head because I thought that
mpfr_rnd_t had to be an integer (it is a C enum), so I chose an 8-bit
int for it.
However, a better solution is actually rather simple: Make a
derived type and declare parameters with the values of the enum.
Duh. I think I will implement that next.
In Fortran 2023, you will be able to declare "real enums" that are typed
for this. See https://j3-fortran.org/doc/year/21/21-110r1.txt
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 159 |
Nodes: | 16 (0 / 16) |
Uptime: | 99:49:08 |
Calls: | 3,209 |
Files: | 10,563 |
Messages: | 3,009,979 |