Relative Content

Tag Archive for c++templatesrandom

Using std::normal_distribution in function template

I’m working on a function that generates a uniformly random point on the surface of unit d dimensional hypersphere. What I’m trying to do is to generate d random numbers with standard normal distribution to form a d dimensional vector, and then simply normalize it (Why? See here to find out: Hypersphere point picking). Here is my C++ code