queso-0.56.1
RngBase.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008-2015 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #include <queso/RngBase.h>
26 
27 namespace QUESO {
28 
29 RngBase::RngBase(int seed, int worldRank)
30  :
31  m_seed (seed),
32  m_worldRank(worldRank)
33 {
35 }
36 
38 {
39 }
40 
41 int
43 {
44  return m_seed;
45 }
46 
47 void
48 RngBase::resetSeed(int newSeed)
49 {
50  m_seed = newSeed;
52  return;
53 }
54 
55 void
57 {
58  if (m_seed >= 0) {
59  // Do nothing
60  }
61  else if (m_seed < 0) {
63  }
64  //else {
65  // struct timeval timevalNow;
66  // /*iRC = */gettimeofday(&timevalNow, NULL);
67  // m_seed = (int) timevalNow.tv_usec;
68  //}
69 
70  return;
71 }
72 
73 } // End namespace QUESO
virtual ~RngBase()
Virtual destructor.
Definition: RngBase.C:37
int m_seed
Seed.
Definition: RngBase.h:82
virtual void resetSeed(int newSeed)
Resets the seed with value newSeed.
Definition: RngBase.C:48
RngBase()
Default Constructor: it should not be used.
int m_worldRank
Rank of processor.
Definition: RngBase.h:85
void privateResetSeed()
Reset seed.
Definition: RngBase.C:56
int seed() const
Sets the seed.
Definition: RngBase.C:42

Generated on Thu Dec 15 2016 13:23:10 for queso-0.56.1 by  doxygen 1.8.5