00001 // Copyright 2009-2015 Sandia Corporation. Under the terms 00002 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. 00003 // Government retains certain rights in this software. 00004 // 00005 // Copyright (c) 2009-2015, Sandia Corporation 00006 // All rights reserved. 00007 // 00008 // This file is part of the SST software package. For license 00009 // information, see the LICENSE file in the top level directory of the 00010 // distribution. 00011 00012 #ifndef SST_CORE_RNG_SSTRNG_H 00013 #define SST_CORE_RNG_SSTRNG_H 00014 00015 #include <stdint.h> 00016 00017 namespace SST { 00018 namespace RNG { 00019 00020 /** 00021 \class SSTRandom sstrng.h "sst/core/rng/sstrng.h" 00022 00023 Implements the base class for random number generators for the SST core. This does not 00024 implement an actual RNG itself only the base class which describes the methods each 00025 class will implement. 00026 */ 00027 class SSTRandom { 00028 00029 public: 00030 /** 00031 Generates the next random number in the range 0 to 1. 00032 */ 00033 virtual double nextUniform() = 0; 00034 00035 /** 00036 Generates the next random number as an unsigned 32-bit integer. 00037 */ 00038 virtual uint32_t generateNextUInt32() = 0; 00039 00040 /** 00041 Generates the next random number as an unsigned 64-bit integer. 00042 */ 00043 virtual uint64_t generateNextUInt64() = 0; 00044 00045 /** 00046 Generates the next random number as a signed 64-bit integer. 00047 */ 00048 virtual int64_t generateNextInt64() = 0; 00049 00050 /** 00051 Generates the next random number as a signed 32-bit integer 00052 */ 00053 virtual int32_t generateNextInt32() = 0; 00054 00055 /** 00056 Destroys the random number generator 00057 */ 00058 virtual ~SSTRandom() { } 00059 00060 }; 00061 00062 } //namespace RNG 00063 } //namespace SST 00064 00065 #endif //SST_CORE_RNG_SSTRNG_H