I am having trouble generating a normal distributed number using the Box-Muller Method in Numerical Recipes. I tried declaring in my main section a norm_dev as a Normaldev_BM type. Then printing, but no luck! Please help
Thank you! That worked like a charm, but now I seem to only be generating the same number over and over again. How do I go about changing this? So every time I print norm_dev.dev() i want a new normal deviate.
I think Doub is a typedef for double. I don't know why Numerical Recipes does this though.
Every time I run my code I get the same 10 numbers.
I used this in my code:
1 2 3 4 5 6 7 8 9 10 11 12
//Line below creates a new uniform number between 0 and 1 when I call ran.doub()
cout << norm_dev.dev() << endl;;
I want to be able to generate 10 new numbers each time I run the code.