Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- how to generate random numbers over [0.0, 1.0) with MKL VSL

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

woshiwuxin

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-22-2013
07:13 AM

79 Views

how to generate random numbers over [0.0, 1.0) with MKL VSL

Hi, everyone!

The basic random number generators in MKL VSL can distribute the numbers within [0.0, 1.0], but how to generate random numbers over [0.0, 1.0)?

Thanks in advance!

Link Copied

3 Replies

Andrey_N_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-22-2013
11:27 PM

79 Views

Hi,

Basic RNGs in Intel(R) MKL VSL return numbers uniformly distributed on the interval [0,1), that is "1" is not included in the interval. Please, let me know if this answers your question.

Andrey

woshiwuxin

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-23-2013
12:10 AM

79 Views

Hi, Andrey

Andrey Nikolaev (Intel) wrote:

Hi,

Basic RNGs in Intel(R) MKL VSL return numbers uniformly distributed on the interval [0,1), that is "1" is not included in the interval. Please, let me know if this answers your question.

Andrey

According to Intel Math Kernel Library Reference Manual (Document Number: 630813-055US), 'vsrnguniform' and 'vdrnguniform' can produce "random numbers uniformly distributed over the intervel [a, b]" (Page 2664). So, I don't think I can get random numbers within [0, 1) by using these functions. However, I just found 'virnguniform' can generate integer "random numbers uniformly distributed over the interval [a, b)" (Page 2698). I could use 'virnguniform' to find an integer first, and then divide it by 'b' for a random floating point number in [0, 1).

Andrey_N_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-25-2013
01:43 AM

79 Views

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.