Matlab中随机函数所采用的算法

Version 4.0 and earlier uses "minimum standard" LCG(线性同余法linear congruential) for rand() and a modified Box-Muller for randn()

 

Versions 5.0 and later uses 32 seed generator based on the lagged Fibonacci sequence for the rand() and the ziggurat method for randn()

 

(摘自PPT:《Random Random Number Generators》,Steve C. Thompson,[email protected]

 

标准C库函数rand()同样采用线性同余法,有些是16位,有些是31位。

你可能感兴趣的:(c,算法,matlab,Random,generator)