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
- Question about VDRNGUNIFORM

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

li_r_

Beginner

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

05-11-2015
03:25 PM

48 Views

Question about VDRNGUNIFORM

Hi, there,

I am trying to generate 100 3-dimensional quasi-random vectors in the (2,3)^3 space by following the instruction on page 32 of "Intel Math Kernel Library Vector Statistical Library Notes." The illustrative example it provides looks like the following:

include <stdio.h>

include “mkl.h”

float mat[100][3]; /* buffer for quasi-random numbers */

VSLStreamStatePtr stream;

/* Initializing */

vslNewStream( &stream, VSL_BRNG_SOBOL, 3 );

/* Generating */

vsRngUniform( VSL_METHOD_SUNIFORM_STD, stream, 100*3, (float*)mat, 2.0f, 3.0f );

/* Deleting the streams */

vslDeleteStream( &stream );

My question is: To my knowledge, the random number generator generates a series of numbers in sequential and puts them into the matrix in **column-major order**. Then, why we generate the 100 3-dimensional vectors by specifying it as mat[100][3] not the other way around like mat[3][100].

Thanks,

R.

Link Copied

1 Reply

Andrey_N_Intel

Employee

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

05-12-2015
02:59 AM

48 Views

Hello,

The present version of Intel MKL Sobol Quasi-Random Number Generator returns the numbers in the order you describe above: the first 3-dim vector comes first, then the second 3-dim vector comes etc. This order is defined, in particular, by performance aspects of the generator.

Do I correctly understand that you prefer to have a different way of packing the random numbers, that is the first coordinate of the 3 dim vector comes first (for all 100 vectors), the second coordinate comes second, etc? If my understanding is correct, can you please help me better understand reasons for which you need this order?

Thanks,

Andrey

- 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.