|
Boost : |
From: John Maddock (John_Maddock_at_[hidden])
Date: 1999-11-07 07:25:36
Jeet -
This is fairly trivial criticism but some of the out of line declarations
could have been declared class-inline to avoid the problems that some
compilers have with static template members:
template<typename Generator>
class uniform_deviate{
public:
enum{
rand_max = 0xffffffff,
uint_div = rand_max,
sint_div = rand_max/2
};
// etc....
};
or:
template<typename Generator>
class uniform_deviate{
public:
static const randnum_t rand_max = 0xffffffff;
static const uinteger_t uint_div = rand_max;
static const uinteger_t sint_div = rand_max/2;
// etc....
};
rather than:
template <typename Generator>
const uniform_deviate<Generator>::randnum_t
uniform_deviate<Generator>::rand_max = 0xffffffff;
template <typename Generator>
const uniform_deviate<Generator>::uinteger_t
uniform_deviate<Generator>::uint_div = rand_max;
template <typename Generator>
const uniform_deviate<Generator>::uinteger_t
uniform_deviate<Generator>::sint_div = rand_max/2;
Also, if you want to investigate the theory in this area further... by
coincidence I was reading an article on random numbers in New Scientist
this morning, and that led to: http://www.cwi.nl/~paulv/ which has a wide
selection of papers on Kolmogorov complexity and its application to both
random number theory and the "average case" analysis of algorithms.
Anyway, I hope this helps rather than hinders...
- John.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk