- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to compare MT2203 PRNG(C code) results with Intel VSL MT2203.
I use DCMT library(version 4.0) to calculate parameter for MT2203.
Below is how i use VSL functions:
#########################
#include
#include
#include "mkl_vsl.h"
#include "mkl_vsl_functions.h"
#define BasicRNG (VSL_BRNG_MT2203)
#define samples 50
#define nstreams 2
int main()
{
unsigned int init[4]={0x123, 0x234, 0x345, 0x456};
int n=4,i=0;
float r[samples]; /* buffer for random numbers */
VSLStreamStatePtr stream[nstreams];
/* Initializing */
for(int k =0;k< nstreams;k++)
vslNewStreamEx( &stream
/* Generating */
for(int k =0;k< nstreams;k++)
vsRngUniform( VSL_METHOD_SUNIFORM_STD,stream
printf(" Numbers are \n");
for (i=0; i
if (i%5==4) printf("\n");
}
/* Deleting the streams */
for(int k =0;k< nstreams;k++)
vslDeleteStream( &stream
return 0;
}
###############
I have attached dcmt.h file which contains the parameters for 1024 MT2203 generators.
The file includes the data as {matrixa,masb,maskc,seed } for all 1024 generators.
My C code results doen't match with VSL results.
Can any one let me know whether i am using VSL functions properly?
OR is there any thing wrong in generating MT2203 parameters?
Thanks in advance.
Regards,
Jyothi
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Jyothi,
You correctly use VSL library.
The difference between your C code for MT2203 and VSLversion should be in different sets of the parameters.We made choice of the parameters using DCMT library. Additionally, among the generated parameter sets we selected those that provided the gap between realized k-distribution and theoretical upper bound as small as possible. Please, let me know if this answers your question.
Thanks,
Andrey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Jyothi,
You correctly use VSL library.
The difference between your C code for MT2203 and VSLversion should be in different sets of the parameters.We made choice of the parameters using DCMT library. Additionally, among the generated parameter sets we selected those that provided the gap between realized k-distribution and theoretical upper bound as small as possible. Please, let me know if this answers your question.
Thanks,
Andrey
Thanks a lot for your reply.
Pleaselet me know how can i proceed further to verify my results.
If you can give some pointers will be very much useful.
Thanks,
Jyothi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Jyothi,
It makes sense to use open source code for Mersenne Twister RNG with your parameters to test output of the implementation. Do you have chance to verify your implementation using the codes of DCMT library available on the Mersenne Twsiter site? You also could do statistical testing of your generator using one of suites like DieHard.
Can I know the reasons for which you can not use VSL version of MT2203 in your application?
Best,
Andrey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page