Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

/magnus/back_end/Elt/include/NormalRandomWord.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: NormalRandomWord.h,v 1.2 1996/08/20 23:02:46 alex Exp $
00003  */
00004 
00005 // Copyright (C) 1995 The New York Group Theory Cooperative
00006 // See magnus/doc/COPYRIGHT for the full notice.
00007 
00008 // Contents: Definition of class NormalRandomWord for generating
00009 //           random words with normally distributed lengths and
00010 //           uniformly distributed generators.
00011 //
00012 // Principal Author: Roger Needham
00013 //
00014 // Status: Useable.
00015 //
00016 // Revision History:
00017 // * 07/96 Alexey M. implemented IPC tools.
00018 
00019 
00020 #ifndef _NORMALRANDOMWORD_H_
00021 #define _NORMALRANDOMWORD_H_
00022 
00023 
00024 #include "Word.h"
00025 #include "RandomNumbers.h"
00026 
00027 
00028 class NormalRandomWord {
00029 
00030 public:
00031 
00032   NormalRandomWord(int numberOfGenerators, int meanLength, int lengthStddev,
00033                                                  int lengthSeed, int generatorSeed)
00034   : numGens(numberOfGenerators), mean(meanLength), stddev(lengthStddev),
00035          G(generatorSeed), L(lengthSeed)
00036   { }
00037 
00038   Word word( );
00039 
00040   /////////////////////////////////////////////////////////////////////////
00041   //                                                                     //
00042   // IPC tools:                                                          //
00043   //                                                                     //
00044   /////////////////////////////////////////////////////////////////////////
00045 
00046   friend ostream& operator < ( ostream& ostr, const NormalRandomWord& nRW )
00047   {
00048     ostr < nRW.numGens < nRW.mean < nRW.stddev < nRW.G < nRW.L;
00049     return ostr;
00050   }
00051   
00052   friend istream& operator > ( istream& istr, NormalRandomWord& nRW )
00053   {
00054     istr > nRW.numGens > nRW.mean > nRW.stddev > nRW.G > nRW.L;
00055     return istr;
00056   }
00057 
00058 private:
00059 
00060   int numGens, mean, stddev;
00061 
00062   UniformRandom G;
00063   // For choosing letters in the word.
00064 
00065   NormalRandom L;
00066   // For choosing the length of the word.
00067 
00068 
00069 };
00070 
00071 #endif

Generated at Tue Jun 19 09:49:34 2001 for Magnus Classes by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001