• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
krandomsequence.h
1/* This file is part of the KDE libraries
2 Copyright (c) 1999 Sean Harmer <sh@astro.keele.ac.uk>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18#ifndef K_RANDOM_SEQUENCE_H
19#define K_RANDOM_SEQUENCE_H
20
21#include "tdelibs_export.h"
22
23class KRandomSequencePrivate;
24class TQGList;
39class TDECORE_EXPORT KRandomSequence
40{
41public:
55 KRandomSequence( long lngSeed = 0 );
56
60 virtual ~KRandomSequence();
61
65 KRandomSequence(const KRandomSequence &a);
66
70 KRandomSequence &operator=(const KRandomSequence &a);
71
78 void setSeed( long lngSeed = 0 );
79
85 double getDouble();
86
93 unsigned long getLong(unsigned long max);
94
100 bool getBool();
101
107 void randomize(TQGList *list);
108
130 void modulate(int i);
131
132private:
133 void Draw(); // Generate the random number
134 long m_lngSeed1;
135 long m_lngSeed2;
136 long m_lngShufflePos;
137
138 static const int m_nShuffleTableSize;
139 long *m_ShuffleArray;
140
141 KRandomSequencePrivate *d;
142};
143
144#endif
145
KRandomSequence::operator=
KRandomSequence & operator=(const KRandomSequence &a)
Assignment.
Definition krandomsequence.cpp:55
KRandomSequence::KRandomSequence
KRandomSequence(long lngSeed=0)
Creates a pseudo-random sequence based on the seed lngSeed.
Definition krandomsequence.cpp:32
KRandomSequence::getLong
unsigned long getLong(unsigned long max)
Get the next number from the pseudo-random sequence.
Definition krandomsequence.cpp:205
KRandomSequence::getDouble
double getDouble()
Get the next number from the pseudo-random sequence.
Definition krandomsequence.cpp:185
KRandomSequence::modulate
void modulate(int i)
Modulate the random sequence.
Definition krandomsequence.cpp:168
KRandomSequence::randomize
void randomize(TQGList *list)
Put a list in random order.
Definition krandomsequence.cpp:229
KRandomSequence::setSeed
void setSeed(long lngSeed=0)
Restart the sequence based on lngSeed.
Definition krandomsequence.cpp:69
KRandomSequence::getBool
bool getBool()
Get a boolean from the pseudo-random sequence.
Definition krandomsequence.cpp:213

tdecore

Skip menu "tdecore"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.15.0
This website is maintained by Timothy Pearson.