Login  Register

Re: Singleton for SeedGenerator

Posted by Luigi Ballabio on Jan 23, 2014; 11:29am
URL: http://quantlib.414.s1.nabble.com/Singleton-for-SeedGenerator-tp14864p14884.html

You can create a random generator and pass a seed explicitly; and if
you use the same seed to create two generators, you'll end up with two
identical generators.

If you don't pass a seed (or if you pass 0), then SeedGenerator comes
in. In that case, the idea is that seeds should be different (because
if you don't pass a seed and so ask for a random one, the expectation
is that you don't end up with identical generators when you do it
twice).

Luigi



On Fri, Jan 17, 2014 at 6:30 PM, Colin Huang <[hidden email]> wrote:

> Hi all,
>
> I am wondering why to make seedGenerator a singleton in Quantlib. In my
> perspective, it is possible to have two identical generators or seeds. Does
> anybody has some ideas?
>
> Colin Huang
> Master of Financial Mathematics
> University of Minnesota-Twin Cities
> Phone: 612-300-1585
> Email:  [hidden email]
> LinkedIn: http://www.linkedin.com/pub/jinhua-colin-huang/2b/a4b/460
> Blog: http://jinhuahuang.blogspot.com/
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users