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

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


Hi,

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: 

https://gitlab.com/cosurgi/minieigen-real/blob/master/src/Real/EigenNumTraits.hpp

Where Real type is defined here:

https://gitlab.com/cosurgi/minieigen-real/blob/master/src/Real/Real.hpp



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

https://gitlab.com/yade-dev/trunk/blob/master/lib/base/Math.hpp#L11

best regards
Janek

 
--
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://yade-dem.org/
http://pg.edu.pl/jkozicki (click English flag on top right)



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