14 #ifndef INCLUDED_numeric_random_random_functions_hh
15 #define INCLUDED_numeric_random_random_functions_hh
41 template<
typename T >
46 while ( vec.length() == 0 ) {
62 template <
typename T >
82 template <
typename T >
101 template <
typename T >
113 guess = ( upper + lower ) / 2;
114 T guess_val = cdf[ guess ];
115 T next_val = guess < cdf.size() ? cdf[ guess+1 ] : 1.1;
116 if ( guess_val <= urn && urn < next_val ) {
120 if ( guess_val <= urn ) {
136 template <
typename T >
void normalized(xyzVector &a) const
Normalized.
xyzVector< T > random_translation(T trans_mag, RandomGenerator &RG)
produce a random translation in xyz space
xyzMatrix< T > y_rotation_matrix_degrees(T const &theta)
Rotation matrix for rotation about the y axis by an angle in degrees.
platform::Size pick_random_index_from_cdf(utility::vector1< T > const &cdf, RandomGenerator &RG)
Choose an element from an array of positions representing the cumulative distribution function for so...
xyzVector< T > rotation_axis(xyzMatrix< T > const &R, T &theta)
Transformation from rotation matrix to helical axis of rotation.
platform::Size binary_search_cdf(utility::vector1< T > const &cdf, T urn)
Return the index in the CDF array such that it is smaller than or equal to the uniform-random-number ...
Random number generator system.
T random_rotation_angle(T rot_mag, RandomGenerator &RG)
gamma-distribution-like random angle generation, rot_mag makes exactly the same sense as in gaussian_...
Random number generator system.
xyzMatrix< T > z_rotation_matrix_degrees(T const &theta)
Rotation matrix for rotation about the z axis by an angle in degrees.
double gaussian()
Get Gaussian distribution random number.
xyzMatrix< T > x_rotation_matrix_degrees(T const &theta)
Rotation matrix for rotation about the x axis by an angle in degrees.
xyzVector and xyzMatrix functions
Fast (x,y,z)-coordinate numeric vector.
xyzVector< T > random_point_on_unit_sphere(RandomGenerator &RG)