Boost logo

Boost Users :

From: Giulio Veronesi (giulio_veronesi_at_[hidden])
Date: 2006-01-09 12:45:15


Hi all,

I've a problem with random number generator. Let us
consider the following code fragment:

long int s = 123456;
mt19937 rnd_gen(s);

When I try to compile it I get the following error
message:

/home/mpalesi/WORK/TOOLS/BGL/current/boost/random/mersenne_twister.hpp:
In
   member function `void
boost::random::mersenne_twister<UIntType, w, n, m, r,
   a, u, s, b, t, c, l, val>::seed(Generator&) [with
Generator = long int,
   UIntType = uint32_t, int w = 32, int n = 624, int m
= 397, int r = 31,
   UIntType a = 09908b0df, int u = 11, int s = 7,
UIntType b = 09d2c5680, int t
   = 15, UIntType c = 0efc60000, int l = 18, UIntType
val = 0c77666de]':
/home/mpalesi/WORK/TOOLS/BGL/current/boost/random/mersenne_twister.hpp:67:
  instantiated from
`boost::random::mersenne_twister<UIntType, w, n, m, r,
a, u, s, b, t, c, l,
val>::mersenne_twister(Generator&) [with Generator =
long int, UIntType = uint32_t, int w = 32, int n =
624, int m = 397, int r = 31, UIntType a = 09908b0df,
int u = 11, int s = 7, UIntType b = 09d2c5680, int t =
15, UIntType c = 0efc60000, int l = 18, UIntType val =
0c77666de]'
src/apsra_mesh.cpp:253: instantiated from here
/home/mpalesi/WORK/TOOLS/BGL/current/boost/random/mersenne_twister.hpp:103:
error: `
   gen' cannot be used as a function
make: *** [obj/apsra_mesh.o] Error 1

The src/apsra_mesh.cpp:253 is the row "mt19937
rnd_gen(s);"

I've no problem if I try to compile:
mt19937 rnd_gen(123456);

Please, could you help me to resolve this problem?

Best regards,
Giulio

Chiacchiera con i tuoi amici in tempo reale!
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net