itpp::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, MSK32_1, MSK32_2, MSK32_3, MSK32_4, FIX1, FIX2, PCV1, PCV2 > Class Template Reference
[Random Number Generation]

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. More...

#include <random_dsfmt.h>

List of all members.

Classes

union  W128_T
 128-bit data structure

Public Member Functions

 DSFMT ()
 Default constructor.
 DSFMT (unsigned int seed)
 Constructor using a certain seed.
void randomize ()
 Set the seed to a semi-random value (based on hashed time and clock).
void reset ()
 Reset the generator with the same seed as used last time.
void reset (unsigned int seed)
 Initialise the generator with a new seed (.
double random_01 ()
 Return a uniformly distributed (0,1) value.
double random_01_lclosed ()
 Return a uniformly distributed [0,1) value.
double random_01_rclosed ()
 Return a uniformly distributed (0,1] value.
uint32_t random_int ()
 Return a uniformly distributed [0, UINT_MAX) value.
ivec get_state () const
 Return current state of generator in the form of ivec.
void set_state (const ivec &state)
 Resume the state of the generator from a previously saved ivec.
void init_gen_rand (unsigned int seed)
 Initialise the generator with a new seed.

Static Public Member Functions

static uint32_t genrand_uint32 ()
 Generate uniform [0, UINT_MAX) integer pseudorandom number.
static double genrand_close1_open2 ()
 Generate uniform [1, 2) double pseudorandom number.
static double genrand_close_open ()
 Generate uniform [0, 1) double pseudorandom number.
static double genrand_open_close ()
 Generate uniform (0, 1] double pseudorandom number.
static double genrand_open_open ()
 Generate uniform (0, 1) double pseudorandom number.


Detailed Description

template<int MEXP, int POS1, int SL1, uint64_t MSK1, uint64_t MSK2, uint32_t MSK32_1, uint32_t MSK32_2, uint32_t MSK32_3, uint32_t MSK32_4, uint64_t FIX1, uint64_t FIX2, uint64_t PCV1, uint64_t PCV2>
class itpp::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, MSK32_1, MSK32_2, MSK32_3, MSK32_4, FIX1, FIX2, PCV1, PCV2 >

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.
 * 

Member Function Documentation

template<int MEXP, int POS1, int SL1, uint64_t MSK1, uint64_t MSK2, uint32_t MSK32_1, uint32_t MSK32_2, uint32_t MSK32_3, uint32_t MSK32_4, uint64_t FIX1, uint64_t FIX2, uint64_t PCV1, uint64_t PCV2>
static double itpp::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, MSK32_1, MSK32_2, MSK32_3, MSK32_4, FIX1, FIX2, PCV1, PCV2 >::genrand_close1_open2 (  )  [inline, static]

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

Referenced by itpp::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, MSK32_1, MSK32_2, MSK32_3, MSK32_4, FIX1, FIX2, PCV1, PCV2 >::genrand_close_open(), and itpp::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, MSK32_1, MSK32_2, MSK32_3, MSK32_4, FIX1, FIX2, PCV1, PCV2 >::genrand_open_close().

template<int MEXP, int POS1, int SL1, uint64_t MSK1, uint64_t MSK2, uint32_t MSK32_1, uint32_t MSK32_2, uint32_t MSK32_3, uint32_t MSK32_4, uint64_t FIX1, uint64_t FIX2, uint64_t PCV1, uint64_t PCV2>
static double itpp::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, MSK32_1, MSK32_2, MSK32_3, MSK32_4, FIX1, FIX2, PCV1, PCV2 >::genrand_close_open (  )  [inline, static]

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

References itpp::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, MSK32_1, MSK32_2, MSK32_3, MSK32_4, FIX1, FIX2, PCV1, PCV2 >::genrand_close1_open2().

Referenced by itpp::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, MSK32_1, MSK32_2, MSK32_3, MSK32_4, FIX1, FIX2, PCV1, PCV2 >::random_01_lclosed(), itpp::Uniform_RNG::sample(), itpp::I_Uniform_RNG::sample(), itpp::Bernoulli_RNG::sample(), itpp::Normal_RNG::sample(), and itpp::Gamma_RNG::sample().

template<int MEXP, int POS1, int SL1, uint64_t MSK1, uint64_t MSK2, uint32_t MSK32_1, uint32_t MSK32_2, uint32_t MSK32_3, uint32_t MSK32_4, uint64_t FIX1, uint64_t FIX2, uint64_t PCV1, uint64_t PCV2>
static double itpp::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, MSK32_1, MSK32_2, MSK32_3, MSK32_4, FIX1, FIX2, PCV1, PCV2 >::genrand_open_close (  )  [inline, static]

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

References itpp::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, MSK32_1, MSK32_2, MSK32_3, MSK32_4, FIX1, FIX2, PCV1, PCV2 >::genrand_close1_open2().

Referenced by itpp::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, MSK32_1, MSK32_2, MSK32_3, MSK32_4, FIX1, FIX2, PCV1, PCV2 >::random_01_rclosed(), and itpp::Gamma_RNG::sample().

template<int MEXP, int POS1, int SL1, uint64_t MSK1, uint64_t MSK2, uint32_t MSK32_1, uint32_t MSK32_2, uint32_t MSK32_3, uint32_t MSK32_4, uint64_t FIX1, uint64_t FIX2, uint64_t PCV1, uint64_t PCV2>
static double itpp::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, MSK32_1, MSK32_2, MSK32_3, MSK32_4, FIX1, FIX2, PCV1, PCV2 >::genrand_open_open (  )  [inline, static]

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

Referenced by itpp::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, MSK32_1, MSK32_2, MSK32_3, MSK32_4, FIX1, FIX2, PCV1, PCV2 >::random_01(), itpp::Laplace_RNG::sample(), and itpp::Gamma_RNG::sample().

template<int MEXP, int POS1, int SL1, uint64_t MSK1, uint64_t MSK2, uint32_t MSK32_1, uint32_t MSK32_2, uint32_t MSK32_3, uint32_t MSK32_4, uint64_t FIX1, uint64_t FIX2, uint64_t PCV1, uint64_t PCV2>
void itpp::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, MSK32_1, MSK32_2, MSK32_3, MSK32_4, FIX1, FIX2, PCV1, PCV2 >::init_gen_rand ( unsigned int  seed  )  [inline]

template<int MEXP, int POS1, int SL1, uint64_t MSK1, uint64_t MSK2, uint32_t MSK32_1, uint32_t MSK32_2, uint32_t MSK32_3, uint32_t MSK32_4, uint64_t FIX1, uint64_t FIX2, uint64_t PCV1, uint64_t PCV2>
void itpp::DSFMT< MEXP, POS1, SL1, MSK1, MSK2, MSK32_1, MSK32_2, MSK32_3, MSK32_4, FIX1, FIX2, PCV1, PCV2 >::reset ( unsigned int  seed  )  [inline]


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

Generated on Tue Jun 2 10:02:19 2009 for mixpp by  doxygen 1.5.8