IT++ Logo
Classes | Public Member Functions | Static Public Attributes | List of all members
itpp::random_details::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, FIX1_V, FIX2_V, PCV1_V, PCV2_V > Class Template Reference

C++ implementation of dSFMT random number generator. More...

#include <itpp/base/random_dsfmt.h>

Classes

struct  Context
 DSFMT context structure. More...
 

Public Member Functions

 DSFMT (Context &c)
 Constructor using a certain context.
 
void init_gen_rand (unsigned int seed)
 Initialise the generator with a new seed.
 
uint32_t genrand_uint32 ()
 Generate uniform [0, UINT_MAX) integer pseudorandom number.
 
double genrand_close1_open2 ()
 Generate uniform [1, 2) double pseudorandom number.
 
double genrand_open_open ()
 Generate uniform (0, 1) double pseudorandom number.
 

Static Public Attributes

static const int N = (MEXP - 128) / 104 + 1
 
static const uint64_t FIX1 = FIX1_V
 
static const uint64_t FIX2 = FIX2_V
 
static const uint64_t PCV1 = PCV1_V
 
static const uint64_t PCV2 = PCV2_V
 

Detailed Description

template<int MEXP, int POS1, int SL1, uint64_t MSK1, uint64_t MSK2, uint64_t FIX1_V, uint64_t FIX2_V, uint64_t PCV1_V, uint64_t PCV2_V>
class itpp::random_details::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, FIX1_V, FIX2_V, PCV1_V, PCV2_V >

C++ implementation of dSFMT random number generator.

The DSFMT class implements parts of the Double precision SIMD-oriented Fast Mersenne Twister (dSFM) random number generator. DSFMT directly generates double precision floating point random numbers, which have the IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985) format. DSFMT does not support integer outputs.

Visit http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/index.html for more details on the original dSFMT implementation.

Here is a copy of the LICENSE.txt file from the dSFMT-src-2.0.tar.gz package, on which C++ DSFMT implementation is based:

* Copyright (c) 2007, 2008 Mutsuo Saito, Makoto Matsumoto and Hiroshima
* University.  All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
*     * Redistributions of source code must retain the above copyright
*       notice, this list of conditions and the following disclaimer.
*     * Redistributions in binary form must reproduce the above
*       copyright notice, this list of conditions and the following
*       disclaimer in the documentation and/or other materials provided
*       with the distribution.
*     * Neither the name of the Hiroshima University nor the names of
*       its contributors may be used to endorse or promote products
*       derived from this software without specific prior written
*       permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* 

Definition at line 98 of file random_dsfmt.h.

Member Function Documentation

template<int MEXP, int POS1, int SL1, uint64_t MSK1, uint64_t MSK2, uint64_t FIX1_V, uint64_t FIX2_V, uint64_t PCV1_V, uint64_t PCV2_V>
void itpp::random_details::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, FIX1_V, FIX2_V, PCV1_V, PCV2_V >::init_gen_rand ( unsigned int  seed)
inline

Initialise the generator with a new seed.

This function initializes the internal state array with a 32-bit integer seed.

Parameters
seeda 32-bit integer used as the seed.

Definition at line 154 of file random_dsfmt.h.

Referenced by itpp::RNG_randomize(), and itpp::RNG_reset().

template<int MEXP, int POS1, int SL1, uint64_t MSK1, uint64_t MSK2, uint64_t FIX1_V, uint64_t FIX2_V, uint64_t PCV1_V, uint64_t PCV2_V>
double itpp::random_details::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, FIX1_V, FIX2_V, PCV1_V, PCV2_V >::genrand_close1_open2 ( )
inline

Generate uniform [1, 2) double pseudorandom number.

This function generates and returns double precision pseudorandom number which distributes uniformly in the range [1, 2). This is the primitive and faster than generating numbers in other ranges. init_gen_rand() must be called before this function.

Returns
double precision floating point pseudorandom number

Definition at line 186 of file random_dsfmt.h.

template<int MEXP, int POS1, int SL1, uint64_t MSK1, uint64_t MSK2, uint64_t FIX1_V, uint64_t FIX2_V, uint64_t PCV1_V, uint64_t PCV2_V>
double itpp::random_details::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, FIX1_V, FIX2_V, PCV1_V, PCV2_V >::genrand_open_open ( )
inline

Generate uniform (0, 1) double pseudorandom number.

This function generates and returns double precision pseudorandom number which distributes uniformly in the range (0, 1). init_gen_rand() must be called before this function.

Returns
double precision floating point pseudorandom number

Definition at line 203 of file random_dsfmt.h.


The documentation for this class was generated from the following files:
SourceForge Logo

Generated on Sat Jul 6 2013 10:54:35 for IT++ by Doxygen 1.8.2