Quantcast
Channel: Intel® Software - Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 3005

random number generators

$
0
0

Hi,
Why the first element of the vector is generated from the distribution with the mean value equal to 0.0. How should I correct this code:

void RNorm(int n ,float *x ,float mu=100.0f, float sigma=1.0f)
{
VSLStreamStatePtr stream;
vslNewStream( &stream, VSL_BRNG_MCG31, 777);
// vsRngGaussian( VSL_METHOD_SGAUSSIAN_BOXMULLER2, stream, 1, x, mu, sigma );  //if I use this line the result will be correct
vsRngGaussian( VSL_METHOD_SGAUSSIAN_BOXMULLER2, stream, n, x, mu, sigma );
vslDeleteStream( &stream );
}

Thanks,
Stan


Viewing all articles
Browse latest Browse all 3005

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>