This shows you the differences between two versions of the page.
ruby_cookbook [2012/07/19 14:39] mantis created |
ruby_cookbook [2012/07/19 14:40] (current) mantis |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <<TableOfContents(3)>> | ||
+ | |||
+ | ====== GSL ====== | ||
+ | |||
+ | Documentation for the rb-gsl module can be found at http://rb-gsl.rubyforge.org/ | ||
+ | |||
+ | Documentation for the GSL is at http://www.gnu.org/software/gsl/manual/ | ||
+ | |||
+ | ===== Create Random Numbers with Given Distribution ===== | ||
+ | <code>#!highlight ruby | ||
+ | rng = GSL::Rng.alloc # create a random number generator with default method and seed 0 | ||
+ | GSL::Ran.gaussian(rng, 2.5) # draws random number from gaussian with mu = 0 and sigma = 2.5 | ||
+ | </code> | ||