All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  */
8 #ifndef __SIM_RandomTwister_h__
9 #define __SIM_RandomTwister_h__
11 #include "SIM_API.h"
12 #include <UT/UT_MTwister.h>
13 #include "SIM_Random.h"
15 /// This class defines a bunch of useful tools for random number
16 /// generation. It is designed to be attached as subdata to objects
17 /// or solvers that need a stream of random numbers.
19 {
20 protected:
21  explicit SIM_RandomTwister(const SIM_DataFactory *factory);
22  virtual ~SIM_RandomTwister();
24  virtual void initializeSubclass();
25  virtual void makeEqualSubclass(const SIM_Data *source);
26  virtual void saveSubclass(std::ostream &os) const;
27  virtual bool loadSubclass(UT_IStream &is);
29  virtual uint urandomSubclass();
30  virtual void setSeedSubclass(uint seed);
32 private:
35  SIM_Random,
36  "Random Stream",
39  UT_MersenneTwister myTwister;
40 };
42 #endif
virtual void makeEqualSubclass(const SIM_Data *source)
Definition: SIM_DataUtils.h:45
virtual bool loadSubclass(UT_IStream &is)
virtual uint urandomSubclass()=0
Override this function to implement a new random number generator.
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:58
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:802
virtual void saveSubclass(std::ostream &os) const
unsigned int uint
Definition: SYS_Types.h:33
#define SIM_API
Definition: SIM_API.h:10
virtual void setSeedSubclass(uint seed)=0
Override this function to initialize the random number generator.
static const SIM_DopDescription * getEmptyDopDescription()
A DOP description that says not to create an automatic DOP.
virtual void initializeSubclass()