QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
ql
math
randomnumbers
seedgenerator.hpp
Go to the documentation of this file.
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
Copyright (C) 2004 Ferdinando Ametrano
5
6
This file is part of QuantLib, a free-software/open-source library
7
for financial quantitative analysts and developers - http://quantlib.org/
8
9
QuantLib is free software: you can redistribute it and/or modify it
10
under the terms of the QuantLib license. You should have received a
11
copy of the license along with this program; if not, please email
12
<quantlib-dev@lists.sf.net>. The license is also available online at
13
<http://quantlib.org/license.shtml>.
14
15
This program is distributed in the hope that it will be useful, but WITHOUT
16
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17
FOR A PARTICULAR PURPOSE. See the license for more details.
18
*/
19
20
/*! \file seedgenerator.hpp
21
\brief Random seed generator
22
*/
23
24
#ifndef quantlib_seed_generator_hpp
25
#define quantlib_seed_generator_hpp
26
27
#include <
ql/math/randomnumbers/mt19937uniformrng.hpp
>
28
#include <
ql/patterns/singleton.hpp
>
29
30
namespace
QuantLib
{
31
32
//! Random seed generator
33
/*! Random number generator used for automatic generation of
34
initialization seeds.
35
36
\test correct initialization of the single instance is tested.
37
*/
38
class
SeedGenerator
:
public
Singleton
<SeedGenerator> {
39
friend
class
Singleton
<
SeedGenerator
>;
40
public
:
41
unsigned
long
get
();
42
private
:
43
SeedGenerator
();
44
void
initialize
();
45
MersenneTwisterUniformRng
rng_
;
46
};
47
48
}
49
50
51
#endif
QuantLib::MersenneTwisterUniformRng
Uniform random number generator.
Definition:
mt19937uniformrng.hpp:41
QuantLib::SeedGenerator
Random seed generator.
Definition:
seedgenerator.hpp:38
QuantLib::SeedGenerator::initialize
void initialize()
Definition:
seedgenerator.cpp:33
QuantLib::SeedGenerator::rng_
MersenneTwisterUniformRng rng_
Definition:
seedgenerator.hpp:45
QuantLib::SeedGenerator::get
unsigned long get()
Definition:
seedgenerator.cpp:59
QuantLib::SeedGenerator::SeedGenerator
SeedGenerator()
Definition:
seedgenerator.cpp:29
QuantLib::Singleton
Basic support for the singleton pattern.
Definition:
singleton.hpp:58
mt19937uniformrng.hpp
Mersenne Twister uniform random number generator.
QuantLib
Definition:
any.hpp:35
singleton.hpp
basic support for the singleton pattern
Generated by
Doxygen
1.9.5