- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Is there a way to call the random number generator with a STL's vector instead of a pointer to an array?
It seems kind of wasteful to copy every time from an array into the vector.
Cheers,
Elad
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Elad,
I wonder if this approach (with caution) would work for you
vector v(1000);
...
vdRngGaussian( VSL_RNG_METHOD_GAUSSIAN_ICDF, stream, v.size(), (double*)&v[0], 0.0, 1.0 );
Thanks,
Andrey
I wonder if this approach (with caution) would work for you
vector
...
vdRngGaussian( VSL_RNG_METHOD_GAUSSIAN_ICDF, stream, v.size(), (double*)&v[0], 0.0, 1.0 );
Thanks,
Andrey
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Elad,
I wonder if this approach (with caution) would work for you
vector v(1000);
...
vdRngGaussian( VSL_RNG_METHOD_GAUSSIAN_ICDF, stream, v.size(), (double*)&v[0], 0.0, 1.0 );
Thanks,
Andrey
I wonder if this approach (with caution) would work for you
vector
...
vdRngGaussian( VSL_RNG_METHOD_GAUSSIAN_ICDF, stream, v.size(), (double*)&v[0], 0.0, 1.0 );
Thanks,
Andrey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Worked great!! Thank you!!

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