C# Mersenne Twister random integer generator implementation (SFMT) monte carlo simulation

后端 未结 5 1578
梦毁少年i
梦毁少年i 2021-02-01 10:37

So far I\'ve been using the C# Mersenne Twister found here to generate random numbers:

http://www.centerspace.net/resources.php

I just discovered SFMT

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-01 11:17

    Is there a reason you can't compile the C implementation into a DLL and call this from your C# code?

    EDIT:

    I'm sorry, but I have only a very limited knowledge of C (and indeed C#), but the "How to create a C dll" may be answered here: http://www.kapilik.com/2007/09/17/how-to-create-a-simple-win32-dll-using-visual-c-2005/ and the how fast can be checked by profiling the code.

提交回复
热议问题