Contents

Quick and dirty

Quick and dirty

Introduction

This project is a Python C module implementation of Numerical Recipes quick and dirty random number generator. The module is called quickndirty and provides the class Rng that has the following interface:

  • seed(s) - sets the seed s to be used in random number generation process
  • random(n) - gives random U(0,1) numbers (if n>0 returns a n-tuple with random numbers)
  • getrandbits(k) - gives k length random bit strings
  • getstate - gives the current state of the random number generator
  • setstate(state) - sets the state of the random number generator
  • jumpahead(n) - changes the current state of the random number generator (it iterates the generator n steps forward)

The objective is to have a very simple interface that generates only random bit strings and U(0,1) numbers. I believe that the standard distributions and stochastic process are meant to be applications that use a random number generator and we can't create dependencies between random number generator and the specific purpose algorithms.

Homepage

The project is hosted at Google:

Download

Last modified November 19, 2008 1:16 am / Skin by Kevin Hughes
MediaWiki