~ubuntu-branches/ubuntu/utopic/blitz++/utopic

« back to all changes in this revision

Viewing changes to random/default.h

  • Committer: Package Import Robot
  • Author(s): Christophe Trophime
  • Date: 2012-07-06 09:15:30 UTC
  • mfrom: (11.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20120706091530-vzrb8zf0vpbf8tp9
Tags: 1:0.10-1
* New upstream release
  Closes: #679407
* debian/rules:
  - update for new release
  - add override_dh_auto_test target
  - regenerate configure and Makefile.am
* debian/control:
  - add libtool, automake to BuildDepends
* debian/libblitz-doc.install
  - modify path for html files
* remove uneeded patches
* add examples.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- C++ -*-
 
2
/***************************************************************************
 
3
 * random/default.h       Default IRNG wrapper class
 
4
 *
 
5
 * $Id$
 
6
 *
 
7
 * Copyright (C) 1997-2011 Todd Veldhuizen <tveldhui@acm.org>
 
8
 *
 
9
 * This file is a part of Blitz.
 
10
 *
 
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.
 
15
 *
 
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.
 
20
 *
 
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/>.
 
23
 * 
 
24
 * Suggestions:          blitz-devel@lists.sourceforge.net
 
25
 * Bugs:                 blitz-support@lists.sourceforge.net    
 
26
 *
 
27
 * For more information, please see the Blitz++ Home Page:
 
28
 *    https://sourceforge.net/projects/blitz/
 
29
 *
 
30
 ***************************************************************************/
 
31
 
1
32
#ifndef BZ_RANDOM_DEFAULT_H
2
33
#define BZ_RANDOM_DEFAULT_H
3
34
 
44
75
    void seed(IRNG_int x)
45
76
    { irng_.seed(x); }
46
77
 
 
78
  void seed(std::vector<IRNG_int> x)
 
79
    { irng_.seed(x); }
 
80
 
47
81
    typedef typename IRNG::T_state T_state;
48
82
    T_state getState() const { return irng_.getState(); }
49
83
    std::string getStateString() const { return irng_.getStateString(); }
61
95
class IRNGWrapper<IRNG,independentState> {
62
96
 
63
97
public:
 
98
  IRNGWrapper() {};
 
99
  IRNGWrapper(unsigned int i) : irng_(MersenneTwisterCreator::create(i)) {};
 
100
 
64
101
    void seed(IRNG_int x)
65
102
    { irng_.seed(x); }
66
103
 
 
104
  void seed(std::vector<IRNG_int> x)
 
105
    { irng_.seed(x); }
 
106
 
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(); }