big_integer cln and gmp

Feature Request: Can support for alternate numerics packages be specified in the type declaration for big_integer rather then with a macro? I'd like to be able to have multiple implementations declared in the same program. Joel

----- Original Message ----- From: "Joel Young" <jdy@cs.brown.edu>
Feature Request:
Can support for alternate numerics packages be specified in the type declaration for big_integer rather then with a macro? I'd like to be able to have multiple implementations declared in the same program.
Joel
This can be done, but what is the reason to do use different types (besides easier testing)? My idea was to make one portable integer type, which could make use of the fastest library installed. That's why it uses macros to select its implementation. If you create a program which explicitly uses gmp or cln, then it's a nonportable program. Interaction between integers based on alternate numerics packages would be the most difficult. An obvious approach would be to use convert_integer_to_little_endian and convert_little_endian_to_integer, but it's not that efficient... If it's for testing only, where no interaction is needed, then it's quite easy. Macros would still be needed to really enable a library, because otherwise the code does not compile on a platform that hasn't got the library installed, but it is not too difficult to make the integer types parameterized on an enum telling which implementation to pick. Richard

-------- From: "Richard Peters" <r.a.peters@student.tue.nl>
From: "Joel Young" <jdy@cs.brown.edu>
Feature Request:
Can support for alternate numerics packages be specified in the type declaration for big_integer rather then with a macro? I'd like to be able to have multiple implementations declared in the same program.
Joel
This can be done, but what is the reason to do use different types (besides easier testing)? My idea was to make one portable integer type, which could make use of the fastest library installed. That's why it uses macros to select its implementation. If you create a program which explicitly uses gmp or cln, then it's a nonportable program.
Many numerics packages use build time parameters to specify the number type. For large systems I find this frustrating as sooner or later you might want to do one part of the app using the float version and another with the double version. In particular tho, this time it is mostly for testing purposes. Communication between types could be done explicitly with conversion to string or BCD (binary coded decimal) or whatever. This is low priority tho. Speed and correctness are much much more important. Joel
participants (2)
-
Joel Young
-
Richard Peters