Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
7234 Discussions

How can I just get a simple uniform random generator?

yangjio4849
Beginner
793 Views
I don't know many about the random generator, and I just want to get a uniform random generator within 0 to 1, just like the button 'Rnd' on some calculators. I haven't tested some subroutines provided by MKL, but unfortunately, it didn't work yet, mostly caused by the fact that I didn't know what's seed or stream. Could andbody help me? Just telling me the name of the subroutine and usage will be apprciated enough.
0 Kudos
1 Reply
Intel_C_Intel
Employee
793 Views
The MKL random number generators create vectors of random numbers. The idea behind them is that creating 1000 random numbers can be done more efficiently than creating 1 random number at a time 1000 times. There are a number of uniform random number generators with different characteristics in various data formats - bit, integer, single and double precision. The seed is simply a starting point. If you use the same seed you will get the same sequence of numbers. A stream is in fact a descriptor which can be used numerous times. Once a stream has been created you can create a vector of random numbers. There is a quite clear description how to do this in the VSLNotes. Essentially the process is to create a stream and then call the random number generator. Bruce
0 Kudos
Reply