Created by Scott Robert Ladd at Coyote Gulch Productions.
00001 //--------------------------------------------------------------------- 00002 // Algorithmic Conjurings @ http://www.coyotegulch.com 00003 // 00004 // kissrng.cpp (libcoyotl) 00005 // 00006 // The popular "Keep It Simple Stupid" psuedorandom number generator. 00007 // 00008 //--------------------------------------------------------------------- 00009 // 00010 // Copyright 1990-2005 Scott Robert Ladd 00011 // 00012 // This program is free software; you can redistribute it and/or modify 00013 // it under the terms of the GNU General Public License as published by 00014 // the Free Software Foundation; either version 2 of the License, or 00015 // (at your option) any later version. 00016 // 00017 // This program is distributed in the hope that it will be useful, 00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 // GNU General Public License for more details. 00021 // 00022 // You should have received a copy of the GNU General Public License 00023 // along with this program; if not, write to the 00024 // Free Software Foundation, Inc. 00025 // 59 Temple Place - Suite 330 00026 // Boston, MA 02111-1307, USA. 00027 // 00028 //----------------------------------------------------------------------- 00029 // 00030 // For more information on this software package, please visit 00031 // Scott's web site, Coyote Gulch Productions, at: 00032 // 00033 // http://www.coyotegulch.com 00034 // 00035 //----------------------------------------------------------------------- 00036 00037 #if !defined(LIBCOYOTL_KISSRNG_H) 00038 #define LIBCOYOTL_KISSRNG_H 00039 00040 #include "prng.h" 00041 00042 namespace libcoyotl 00043 { 00045 00050 class kissrng : public prng 00051 { 00052 private: 00053 uint32_t m_x; 00054 uint32_t m_y; 00055 uint32_t m_z; 00056 uint32_t m_c; 00057 00058 public: 00060 00064 kissrng(); 00065 00067 00071 kissrng(uint32_t seed); 00072 00074 00078 virtual void init(uint32_t seed); 00079 00080 private: 00082 00086 void init_helper(); 00087 00088 public: 00090 00094 virtual uint32_t get_rand(); 00095 }; 00096 00097 } // end namespace libcoyotl 00098 00099 #endif
© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.