[eigen] inconsistent unsupported/Eigen/MPRealSupport random() ? NumTraits question.

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


when I was writing tests for my NumTraits implementation I suppose found an inconsistency:

Eigen::internal::random<float>() returns in range (-1,1)
Eigen::internal::random<double>() returns in range (-1,1)
Eigen::internal::random<long double>() returns in range (-1,1)
Eigen::internal::random<mpfr::mpreal>() returns in range (0,1)

The test script is here: https://gitlab.com/cosurgi/minieigen-real/blob/master/tests/esuptest#L84

I can make a small MR to fix this if you agree there's a mistake to be fixed.

Do you have somewhere NumTraits for boost::float128 and
boost::cpp_bin_float? Presently I have written my own: 


Where Real type is defined here:


I write all of this to replace current Real typedef in yade:


best regards

Janek Kozicki, PhD. DSc. Arch. Assoc. Prof.
Gdańsk University of Technology
Faculty of Applied Physics and Mathematics
Department of Theoretical Physics and Quantum Information
http://pg.edu.pl/jkozicki (click English flag on top right)

Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/