faithtools/faith/randomsequence.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (c) 1999 Sean Harmer <sh@astro.keele.ac.uk>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00016    Boston, MA 02111-1307, USA.
00017 */
00018 #ifndef KDE__RANDOMSEQUENCE_H
00019 #define KDE__RANDOMSEQUENCE_H
00020 
00021 #include <faith/tools.h>
00022 namespace Faith
00023 {
00024 
00039 class FAITH_TOOLS_EXPORT RandomSequence
00040 {
00041 public:
00055   RandomSequence( long lngSeed = 0 );
00056 
00060   virtual ~RandomSequence();
00061 
00065   RandomSequence(const RandomSequence &a);
00066 
00070   RandomSequence &operator=(const RandomSequence &a);
00071 
00078   void setSeed( long lngSeed = 1 );
00079 
00085   double getDouble();
00086 
00093   unsigned long getLong(unsigned long max);
00094 
00100   bool getBool();
00101 
00102 #if 0
00103 
00108   void randomize(QGList *list);
00109 #endif
00110 
00132   void modulate(int i);
00133 
00134   static int random();
00135 
00136 private:
00137   void draw(); // Generate the random number
00138   long m_lngSeed1;
00139   long m_lngSeed2;
00140   long m_lngShufflePos;
00141 
00142   static const int m_nShuffleTableSize;
00143   long *m_ShuffleArray;
00144 
00145   struct Private;
00146   Private *d;
00147 };
00148 
00149 }
00150 
00151 #endif
00152 

Generated on Fri Sep 1 00:23:07 2006 for Faith by  doxygen 1.4.7