This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Add uniform_inside_sphere_distribution


This distribution has come in handy for me.

It relies on uniform_on_sphere_distribution and like it, min and max have no real meaning. Unlike uniform_on_sphere_distribution which really is a random multidimensional unit vector users often want to pick the radius of the distribution. Unit radius is a good default and is provided but the user can specify radius.

Like the uniform_on_sphere_distribution which is used inside, the 2-dimensional case uses rejection and higher dimensions use a transform.

Built and tested clean on x86_64-linux.

OK?

Ed

Attachment: CL_uisd
Description: Text document

Attachment: patch_uisd
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]