Friday, January 30, 2015

6. The art of computer programming, Vol2 Chapter 3, by Kunth, this chapter can be used as a referen


6. The art of computer programming, Vol2 Chapter 3, by Kunth, this chapter can be used as a reference quite.
In other words, the random number is subtracted from the former two chaotic results. All the random number generator, a beginning leem must determine the initial value of Rn in terms of the above, you must first decide how much R0 and R1. This is why at the beginning of the general call to rand, srand with the first reason.
Suppose I want to generate random number leem generator from 0 to 32767, the essays in C language, the code is roughly as follows static int seed1, seed2; const static int M = 32768; void set_seed (int n1, int n2) {seed1 = n1; seed2 = n2;} int fib_seed () {int result = (seed2 - seed1)% M; seed1 = seed2; seed2 = result; return result;}
int fib_seed () {int result = (seed2 - seed1)% M; if (result <0) result = - result; seed2 = seed1; seed1 = result; return result;}
1. Quality (Quality): This fib_gen began to repeat in a short period, failed. 2. Efficiently (efficiency): efficiency is very fast indeed, it only uses a simple assignment, adder, and very efficient. 3. Repeatability (reproducibility): Indeed, can also get other computers. 4. Portability (portable): the system for different results "may" produce out will be different, because the positive mod negative, out of the results are not the same, this part is to see the results of the machine. 5. Simplicity (ease of use): This should be the easiest I've seen a few chaotic leem generator.
You are not logged in, a visitor will leave a message. You can also top service account login message development Letters leem (2) does not make the idea of a real (4) Experience notes (2)
Latest article featured in April 2014 (1) 2014 1999 (1) February 2014 (2) January 2014 (1) September 2013 (2) May 2013 (1) January 2013 (3) December 2012 (10) November leem 2012 (6) October 2012 (4) 2012 August (1) July 2012 (13) June 2012 (17) May 2012 (2) 2012 1999 (15) 2012 1999 ( 9) January 2012 (4) 2011 December (7) November 2011 (33) October 2011 (8) 2011 1998 (8) 2011 August (11) July 2011 (3) 2011 June ( 7) May 2011 (12) 2011 1999 (13) 2011 1999 (5) February 2011 (1) January 2011 (31) 2010 December (34) November 2010 (22) June 2008 ( 1) May 2008 (1) March 2008 (11) November 2007 (1) November 2005 (2)
{{GuestName}} (Logout)


No comments:

Post a Comment