
The user should set the modulus of the unsigned_integer once in the beginning. But for a mathematical modulo class, the user can make a template with an unsigned_integer data member, and a non-type template parameter that holds the modulus. Upon instantiation of that template, the unsigned_integer static set_modulus function must be called with that modulus. Or simply a static initialize() method in that template which does that, or a static variable of an init class, see The C++ Programming Language, 3rd ed., 10.4.9. The point is that then a template type is associated with the modulus. Regards, Maarten. "Gerhard Wesp" <gwesp@google.com> wrote in message news:20060529153226.GG29026@google.com...
On Mon, May 29, 2006 at 05:15:59PM +0200, Carlo Wood wrote:
One for the infinite group of integers, and a templated one (so basically, infinite number of types) for the finite groups.
This has limited usefulness. The more common applications of finite groups (crypto...) require moduli - well beyond of what's possible as a numeric template parameter and - determined at runtime.
and 'unsigned_integer' for the finite group (with a static method to set the modulo). The only thing I disagree with
Aaah, so I got this wrong all the time. I thought Maarten's unsigned_integer should be, well, an unsigned integer, without a modulus involved. So it should represent Z_p? Maarten, can you clarify?
Regards -Gerhard -- Gerhard Wesp ZRH office voice: +41 (0)44 668 1878 ZRH office fax: +41 (0)44 200 1818 For the rest I claim that raw pointers must be abolished. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost