c++ - Eigen template library Random() method algorithm -


does know, algorithm eigen library c++ uses in method random():

eigen - random() doc

?

if eigen passes decision on compiler (using standard method create pseudo random numbers), know algorithm g++ (gcc49 4.9.2_2) uses default.

any helpful hint appreciated.

as paul r pointed out, default call rand. if in eigen/src/core/mathfunctions.h you'll find default:

template<typename scalar> struct random_default_impl<scalar, false, false> {   static inline scalar run(const scalar& x, const scalar& y)   {     return x + (y-x) * scalar(std::rand()) / scalar(rand_max);   }   static inline scalar run()   {     return run(scalar(numtraits<scalar>::issigned ? -1 : 0), scalar(1));   } }; 

or variants on theme (for different variable types).


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -