Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

math::random::tt800(3pm) [debian man page]

TT800(3pm)						User Contributed Perl Documentation						TT800(3pm)

NAME
Math::Random::TT800 - Matsumoto's TT800 Pseudorandom number generator DESCRIPTION
This perl extension module implements M. Matsumoto's twisted generalized shift register generator called TT800 as described in his article published in ACM Transactions on Modelling and Computer Simulation, Vol. 4, No. 3, 1994, pages 254-266. SYNOPSIS
use Math::Random::TT800; my $tt = new Math::Random::TT800; $value = $tt->next(); $ivalue = $tt->next_int(); FUNCTIONS
new my $tt = new Math::Random::TT800; my $tt = new Math::Random::TT800 @seeds; Create a new TT800 object. Providing seeds is optional. A TT800 takes 25 integers as seed which must not be all zero. If less than 25 integers are supplied, the rest are taken from the default seed. next $value = $tt->next(); next returns the next pseudorandom number from the TT800 object as a floating point value in the range [0,1). next_int $ivalue = $tt->next_int(); next_int returns a integer value filled with 32 random bits. COPYRIGHT
This implementation is based on the C code by M. Matsumoto <matumoto@math.keio.ac.jp> available from ftp://random.mat.sbg.ac.at/pub/data/tt800.c. Converted to a perl extension module and enhancements to support multiple streams of pseudorandom numbers by Otmar Lendl <lendl@cosy.sbg.ac.at>. Copyright (c) 1997 by Otmar Lendl (Perl and XS code). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2002-10-23 TT800(3pm)

Check Out this Related Man Page

MT(3pm) 						User Contributed Perl Documentation						   MT(3pm)

NAME
Math::Random::MT - The Mersenne Twister PRNG SYNOPSIS
## Object-oriented interface: use Math::Random::MT; $gen = Math::Random::MT->new() # or... $gen = Math::Random::MT->new($seed); # or... $gen = Math::Random::MT->new(@seeds); $seed = $gen->get_seed(); # seed used to generate the random numbers $rand = $gen->rand(42); # random number in the interval [0, 42) $dice = int($gen->rand(6)+1); # random integer between 1 and 6 $coin = $gen->rand() < 0.5 ? # flip a coin "heads" : "tails" $int = $gen->irand(); # random integer in [0, 2^32-1] ## Function-oriented interface: use Math::Random::MT qw(srand rand irand); # now use srand() and rand() as you usually do in Perl DESCRIPTION
The Mersenne Twister is a pseudorandom number generator developed by Makoto Matsumoto and Takuji Nishimura. It is described in their paper at <URL:http://www.math.keio.ac.jp/~nisimura/random/doc/mt.ps>. This algorithm has a very uniform distribution and is good for modelling purposes but do not use it for cryptography. This module implements two interfaces: Object-oriented interface new() Creates a new generator that is automatically seeded based on gettimeofday. new($seed) Creates a new generator seeded with an unsigned 32-bit integer. new(@seeds) Creates a new generator seeded with an array of (up to 624) unsigned 32-bit integers. set_seed() Seeds the generator. It takes the same arguments as new(). get_seed() Retrieves the value of the seed used. rand($num) Behaves exactly like Perl's builtin rand(), returning a number uniformly distributed in [0, $num) ($num defaults to 1). irand() Returns a 32-bit integer, i.e. an integer uniformly distributed in [0, 2^32-1]. Function-oriented interface srand($seed) Behaves just like Perl's builtin srand(). As in Perl >= 5.14, the seed is returned. If you use this interface, it is strongly recommended that you call srand() explicitly, rather than relying on rand() to call it the first time it is used. rand($num) Behaves exactly like Perl's builtin rand(), returning a number uniformly distributed in [0, $num) ($num defaults to 1). irand() Returns a 32-bit integer, i.e. an integer uniformly distributed in [0, 2^32-1]. SEE ALSO
<URL:http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html> Data::Entropy ACKNOWLEDGEMENTS
Sean M. Burke For giving me the idea to write this module. Philip Newton For several useful patches. Florent Angly For implementing seed generation and retrieval. AUTHOR
Abhijit Menon-Sen <ams@toroid.org> Copyright 2001 Abhijit Menon-Sen. All rights reserved. Based on the C implementation of MT19937 Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura This software is distributed under a (three-clause) BSD-style license. See the LICENSE file in the distribution for details. perl v5.14.2 2012-08-07 MT(3pm)
Man Page