2
/***************************************************************************
3
* random/default.h Default IRNG wrapper class
7
* Copyright (C) 1997-2011 Todd Veldhuizen <tveldhui@acm.org>
9
* This file is a part of Blitz.
11
* Blitz is free software: you can redistribute it and/or modify
12
* it under the terms of the GNU Lesser General Public License
13
* as published by the Free Software Foundation, either version 3
14
* of the License, or (at your option) any later version.
16
* Blitz is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Lesser General Public License for more details.
21
* You should have received a copy of the GNU Lesser General Public
22
* License along with Blitz. If not, see <http://www.gnu.org/licenses/>.
24
* Suggestions: blitz-devel@lists.sourceforge.net
25
* Bugs: blitz-support@lists.sourceforge.net
27
* For more information, please see the Blitz++ Home Page:
28
* https://sourceforge.net/projects/blitz/
30
***************************************************************************/
1
32
#ifndef BZ_RANDOM_DEFAULT_H
2
33
#define BZ_RANDOM_DEFAULT_H
61
95
class IRNGWrapper<IRNG,independentState> {
99
IRNGWrapper(unsigned int i) : irng_(MersenneTwisterCreator::create(i)) {};
64
101
void seed(IRNG_int x)
65
102
{ irng_.seed(x); }
104
void seed(std::vector<IRNG_int> x)
67
107
typedef typename IRNG::T_state T_state;
68
108
T_state getState() const { return irng_.getState(); }
69
109
std::string getStateString() const { return irng_.getStateString(); }