ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/rng.h
(Generate patch)

Comparing deliantra/server/include/rng.h (file contents):
Revision 1.8 by root, Sat Apr 30 11:02:25 2011 UTC vs.
Revision 1.11 by root, Mon Oct 1 01:43:39 2012 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2010,2011 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * 5 *
6 * Deliantra is free software: you can redistribute it and/or modify it under 6 * Deliantra is free software: you can redistribute it and/or modify it under
7 * the terms of the Affero GNU General Public License as published by the 7 * the terms of the Affero GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your 8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version. 9 * option) any later version.
77 x = x * A + B; 77 x = x * A + B;
78 return x; 78 return x;
79 } 79 }
80}; 80};
81 81
82typedef lc_rng<3039177861U, 0U> borosh_niederreiter_rng; 82typedef lc_rng<3039177861U, 0U> borosh_niederreiter_rng;
83typedef lc_rng<2147001325U, 715136305U> bcpl_rng; 83typedef lc_rng<2147001325U, 715136305U> bcpl_rng;
84typedef lc_rng< 1664525U, 1U> lavaux_janssens_rng; 84typedef lc_rng< 1664525U, 1U> lavaux_janssens_rng;
85typedef lc_rng< 1664525U, 1013904223U> numerical_recipes_rng;
85 86
86template<typename T, int N, int k> 87template<typename T, int N, int k>
87struct gfsr_rng 88struct gfsr_rng
88{ 89{
89 int i; 90 int i;
137// and likely of higher quality. 138// and likely of higher quality.
138typedef gfsr_rng<uint32_t, 250, 103> r250_rng; 139typedef gfsr_rng<uint32_t, 250, 103> r250_rng;
139typedef gfsr_rng<uint32_t, 521, 168> r521_rng; 140typedef gfsr_rng<uint32_t, 521, 168> r521_rng;
140 141
141// freeciv uses this one, so it's good enough for us :) 142// freeciv uses this one, so it's good enough for us :)
142// (also known as mitchell moore generator 143// (also known as mitchell moore generator)
143typedef gfsr_rng<uint32_t, 55, 24> freeciv_rng; 144typedef gfsr_rng<uint32_t, 55, 24> freeciv_rng;
144 145
145// this one should be high quality, but is slightly slower than tausworthe 146// this one should be high quality, but is slightly slower than tausworthe
146struct r250521_rng 147struct r250521_rng
147{ 148{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines