Hi there, when I am generating two matrices of random numbers, these are always equal for a single run of the program. They change values at different runnings (because I am using the time(NULL) for the seed), but they are still equal.

In other words, at time t1 A=B but at time t2 (another run) still A=B but the entries are different. I guess this has to do with the fact that every time an object matrix is created, and filled with random numbers, they are both the same as they are invoqued at the same time. Is there a way to construct two different random matrices at once? Cheers

In other words, at time t1 A=B but at time t2 (another run) still A=B but the entries are different. I guess this has to do with the fact that every time an object matrix is created, and filled with random numbers, they are both the same as they are invoqued at the same time. Is there a way to construct two different random matrices at once? Cheers

> I am using the time(NULL) for the seed

> every time an object matrix is created, and filled with random numbers,

> they are both the same as they are invoqued at the same time.

Use the same random number engine for both the matrices; and seed it (with the current time) only once.

> every time an object matrix is created, and filled with random numbers,

> they are both the same as they are invoqued at the same time.

Use the same random number engine for both the matrices; and seed it (with the current time) only once.

Topic archived. No new replies allowed.