<?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 Re: random number generator vsrnggaussian used in subroutine in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-number-generator-vsrnggaussian-used-in-subroutine/m-p/874329#M8776</link>
    <description>&lt;BR /&gt;&lt;SPAN style="font-size: small;"&gt;Your program creates and initializes random stream with the same basic random generator and seed 10 times in subroutine test_sub1. So, output of the Gaussian generator is not changed. Can you create/initialize random stream once in your main program andpass the stream in the subroutine test_sub1? Please, do not forget to remove initialization of the stream in the sub-routine.Also, please free resources allocated for random stream in the main programwhengeneration of random numbers is completed.Routine vsldeletestream can be used for this purpose. Thanks, Andrey&lt;/SPAN&gt;</description>
    <pubDate>Wed, 25 Mar 2009 06:49:09 GMT</pubDate>
    <dc:creator>Andrey_N_Intel</dc:creator>
    <dc:date>2009-03-25T06:49:09Z</dc:date>
    <item>
      <title>random number generator vsrnggaussian used in subroutine</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-number-generator-vsrnggaussian-used-in-subroutine/m-p/874328#M8775</link>
      <description>Hi, guys:&lt;BR /&gt; I want to create a random number with Gaussian distribution probability by function vsrnggaussian.&lt;BR /&gt;&lt;BR /&gt;The subroutine is:&lt;BR /&gt;INCLUDE '/home/fengy/mkl/10.0.3.020/include/mkl_vsl.fi'&lt;BR /&gt;INCLUDE '/home/fengy/mkl/10.0.3.020/examples/vslf/source/errcheck.inc'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SUBROUTINE  test_sub1&lt;BR /&gt; USE MKL_VSL_TYPE&lt;BR /&gt; USE MKL_VSL&lt;BR /&gt;&lt;BR /&gt; IMPLICIT NONE&lt;BR /&gt; &lt;BR /&gt; REAL, DIMENSION(1) :: r&lt;BR /&gt;&lt;BR /&gt; INTEGER(KIND=4) i, nn&lt;BR /&gt; INTEGER n&lt;BR /&gt; INTEGER(KIND=4) errcode&lt;BR /&gt;&lt;BR /&gt; INTEGER brng, method, seed&lt;BR /&gt;&lt;BR /&gt; TYPE(VSL_STREAM_STATE) :: stream&lt;BR /&gt; REAL  a, sigma&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; n=1&lt;BR /&gt; brng = VSL_BRNG_MCG31&lt;BR /&gt; method = 0&lt;BR /&gt; seed = 777&lt;BR /&gt; a = 0.0&lt;BR /&gt; sigma = 1.0&lt;BR /&gt; &lt;BR /&gt; errcode = vslnewstream(stream, brng, seed)&lt;BR /&gt; CALL CheckVslError(errcode)&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; errcode = vsrnggaussian(method, stream, n, r, a, sigma)&lt;BR /&gt; CALL CheckVslError(errcode)&lt;BR /&gt;&lt;BR /&gt; WRITE(*,*) 'now r is: ', r(1)&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;END SUBROUTINE test_sub1&lt;BR /&gt;&lt;BR /&gt; The main program is:&lt;BR /&gt;PROGRAM  test_g_r&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; IMPLICIT NONE&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; INTEGER n&lt;BR /&gt;&lt;BR /&gt; REAL, DIMENSION(1) :: r&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; DO n=1, 10&lt;BR /&gt; CALL test_sub1&lt;BR /&gt; ENDDO&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;END PROGRAM test_g_r&lt;BR /&gt;&lt;BR /&gt;However, the output of r(1) does not change. It is a intrinsic problem for function vsrnggaussian? What can I do so that each time test_sub1 is called, it will give a random number which has Gaussian distribution density?&lt;BR /&gt;&lt;BR /&gt; Thanks!&lt;BR /&gt; Arthur&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Mar 2009 17:34:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-number-generator-vsrnggaussian-used-in-subroutine/m-p/874328#M8775</guid>
      <dc:creator>fymaterials</dc:creator>
      <dc:date>2009-03-24T17:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: random number generator vsrnggaussian used in subroutine</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-number-generator-vsrnggaussian-used-in-subroutine/m-p/874329#M8776</link>
      <description>&lt;BR /&gt;&lt;SPAN style="font-size: small;"&gt;Your program creates and initializes random stream with the same basic random generator and seed 10 times in subroutine test_sub1. So, output of the Gaussian generator is not changed. Can you create/initialize random stream once in your main program andpass the stream in the subroutine test_sub1? Please, do not forget to remove initialization of the stream in the sub-routine.Also, please free resources allocated for random stream in the main programwhengeneration of random numbers is completed.Routine vsldeletestream can be used for this purpose. Thanks, Andrey&lt;/SPAN&gt;</description>
      <pubDate>Wed, 25 Mar 2009 06:49:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-number-generator-vsrnggaussian-used-in-subroutine/m-p/874329#M8776</guid>
      <dc:creator>Andrey_N_Intel</dc:creator>
      <dc:date>2009-03-25T06:49:09Z</dc:date>
    </item>
  </channel>
</rss>

