simplerandom

Simple random number generators
Download

simplerandom Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Publisher Name:
  • Craig McQueen

simplerandom Tags


simplerandom Description

Simple random number generators simplerandom library is a simple pseudo-random number generators, from George Marsaglia.IntroThe simplerandom package is provided, which contains modules containing classes for various simple pseudo-random number generators.The algorithms were obtained from a newsgroup post by George Marsaglia . The algorithms were specified in C in the newsgroup post. For the purpose of prototyping software in a high-level language such as Python, before writing it in faster C, it is useful to have identical algorithms implemented in both Python and C.One module provides Python iterators, which generate simple unsigned 32-bit integers identical to their C counterparts.Another module provides random classes that are sub-classed from the class Random in the random module of the standard Python library.UsageIterators >>> import simplerandom.iterators as sri >>> rng = sri.RandomKISSIterator(123958, 34987243, 3495825239, 2398172431) >>> next(rng) 21111917L >>> next(rng) 1327965872L >>> next(rng) 2128842716LRandom class API >>> import simplerandom.random as srr >>> rng = srr.RandomKISS(258725234) >>> rng.random() 0.30631872435766117 >>> rng.random() 0.43903576112750442 >>> rng.random() 0.69756297733927486 Requirements: · Python


simplerandom Related Software