comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Generate Same Sequence of Random Numbers in IDL and C
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Generate Same Sequence of Random Numbers in IDL and C [message #89071 is a reply to message #89063] Tue, 22 July 2014 09:21 Go to previous messageGo to previous message
sweiss1993 is currently offline  sweiss1993
Messages: 4
Registered: July 2014
Junior Member
Hi Mike,

Thanks for the reply! I seeded the way you described, and there is still a difference in the random number output for each program. To be specific, I seeded both with a constant integer of 4357 (default seed for GSL's RNG). I also made sure the seed was not reinitialized with every loop iteration. Both programs now have a constant output every time the program runs. However, the outputs from the programs do not match each other. On closer inspection, I noticed that the first random numbers match, but after the next iteration, they are not the same.

Since both programs use the same number generator and start with the same seed, I am guessing there must be a difference in how GDL changes the seed with each call. So, do you or anyone happen to know how exactly IDL/GDL changes the seed for a constant seed input? I have read the documentation, and attempted to read the GDL C++ source code, but neither have been much help in this regard.

- Sam
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: rebin vs congrid
Next Topic: IDL and C inter-language communication / call_external()

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:09:43 PDT 2025

Total time taken to generate the page: 0.00392 seconds