<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Random Number Generator in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Random-Number-Generator/m-p/1172041#M28648</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to generate a vector of random numbers using the following code. However, every time I execute the code, the output vector is the same as previous run! Can you please help? Thank you in advance. - Afshin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;    int N = 30;
    double r&lt;N&gt;;
    VSLStreamStatePtr stream;
    int errcode;
    double a=0,sigma=0.5;
   
    /***** Initialize *****/
    errcode = vslNewStream( &amp;amp;stream, VSL_BRNG_MT2203, 10000 );
    printf("err = %i\n",errcode);
    /***** Call RNG *****/
    errcode = vdRngGaussian( VSL_RNG_METHOD_GAUSSIAN_BOXMULLER, stream, N, r, a, sigma );
    printf("err = %i\n",errcode);
    vslDeleteStream(&amp;amp;stream);
 
    for (i=0; i&amp;lt;N; i++){
        printf("r = %f\n",r&lt;I&gt;);
    }&lt;/I&gt;&lt;/N&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Dec 2018 21:11:42 GMT</pubDate>
    <dc:creator>Ahmadi__Afshin</dc:creator>
    <dc:date>2018-12-06T21:11:42Z</dc:date>
    <item>
      <title>Random Number Generator</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Random-Number-Generator/m-p/1172041#M28648</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to generate a vector of random numbers using the following code. However, every time I execute the code, the output vector is the same as previous run! Can you please help? Thank you in advance. - Afshin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;    int N = 30;
    double r&lt;N&gt;;
    VSLStreamStatePtr stream;
    int errcode;
    double a=0,sigma=0.5;
   
    /***** Initialize *****/
    errcode = vslNewStream( &amp;amp;stream, VSL_BRNG_MT2203, 10000 );
    printf("err = %i\n",errcode);
    /***** Call RNG *****/
    errcode = vdRngGaussian( VSL_RNG_METHOD_GAUSSIAN_BOXMULLER, stream, N, r, a, sigma );
    printf("err = %i\n",errcode);
    vslDeleteStream(&amp;amp;stream);
 
    for (i=0; i&amp;lt;N; i++){
        printf("r = %f\n",r&lt;I&gt;);
    }&lt;/I&gt;&lt;/N&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 21:11:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Random-Number-Generator/m-p/1172041#M28648</guid>
      <dc:creator>Ahmadi__Afshin</dc:creator>
      <dc:date>2018-12-06T21:11:42Z</dc:date>
    </item>
    <item>
      <title>Hi Afshin,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Random-Number-Generator/m-p/1172042#M28649</link>
      <description>&lt;P&gt;Hi Afshin,&lt;/P&gt;&lt;P&gt;This result is expected to be the same from run to run.&lt;/P&gt;&lt;P&gt;If you want the result to be different every time, you will need to change the seed value for each run.&amp;nbsp; You can use the time function to do that.&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Khang&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 00:49:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Random-Number-Generator/m-p/1172042#M28649</guid>
      <dc:creator>Khang_N_Intel</dc:creator>
      <dc:date>2018-12-07T00:49:37Z</dc:date>
    </item>
    <item>
      <title>Thank you, Khang! You always</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Random-Number-Generator/m-p/1172043#M28650</link>
      <description>&lt;P&gt;Thank you, Khang! You always provide best answers.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 00:55:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Random-Number-Generator/m-p/1172043#M28650</guid>
      <dc:creator>Ahmadi__Afshin</dc:creator>
      <dc:date>2018-12-07T00:55:10Z</dc:date>
    </item>
    <item>
      <title>Hi Afshin,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Random-Number-Generator/m-p/1172044#M28651</link>
      <description>&lt;P&gt;Hi Afshin,&lt;/P&gt;&lt;P&gt;We are here to help users make the best out of Intel(r) MKL.&lt;/P&gt;&lt;P&gt;Please do not hesitate to contact us should you have any questions about Intel(R) MKL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Khang&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 01:03:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Random-Number-Generator/m-p/1172044#M28651</guid>
      <dc:creator>Khang_N_Intel</dc:creator>
      <dc:date>2018-12-07T01:03:53Z</dc:date>
    </item>
  </channel>
</rss>

