Boost logo

Boost :

From: Csaba Szepesvari (szepes_at_[hidden])
Date: 2000-06-08 09:23:49


> At 11:35 PM 6/7/00 +0200, Jens Maurer wrote:
>
> >Csaba Szepesvari wrote:
> >> 3) checking conformance
> >>
> >> When an rng is passed along, the client might want to have a means
> for
> >> checking if it received an appropriate one (appropriate
> distribution).
> >
> >Ok. The plan is to have an enum
> >enum random_distribution { random_uniform_int, [...] random_normal }
> >and an appropriate "static const" member within each distribution.
> >
> >Or do we want a traits class (more extensible than a member) like
> >this (similar to std::iterator_traits<>)?
> >
> >template<class T>
> >class random_traits {
> > static const random_distribution = ...
> >};
>
> My general sense is that the random number library is already quite
> feature rich, particularly from the standpoint of a casual user. If
> you try to solve all problems you will end up with something only
> experts will use. A problem presented as "the client might want..."
> doesn't sound serious enough to warrant more than a very simple
> change, if any change at all.

I think, anyone (like me) who develops a general piece of software that uses
random random generators needs this feature. Not having this feature means
that you cannot safely use these random number generators in a library that
gets them as template arguments, breaking the encapsulation view.

By the way, re the parameter passing/copying issue if you forbid the copy
constructor then how should I write a function that uses a random number
generator (with a specific distribution)? E.g. imagine I want to write a
library supporting Monte-Carlo integration: I need to check the distribution
(first issue), but I would like to use a user supplied rng because of
independence and because users might have preferences for certain rngs.

Cheers,

  Csaba


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk