From: Maarten Kronenburg (M.Kronenburg_at_[hidden])
Date: 2006-05-29 17:21:56
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.
"Gerhard Wesp" <gwesp_at_[hidden]> wrote in message
> 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
> 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:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk