[eigen] inconsistent unsupported/Eigen/MPRealSupport random() ? NumTraits question. |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] inconsistent unsupported/Eigen/MPRealSupport random() ? NumTraits question.
- From: "Janek Kozicki (yade)" <jkozicki-yade@xxxxxxxxx>
- Date: Sat, 7 Dec 2019 15:31:16 +0100
- Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEUBAQEtLS1KSkpRUVFXV1dYWFhjY2Nzc3N3d3eHh4eKioqdnZ24uLjLy8vc3NxVIagyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AIVEzgS1fgQtQAAAjRJREFUOMtt1DFv00AUAOAzFQNbjigSyoQaRaBMhKgLUyKXpVNNeUpk9vyDqFJhQ1kiBuaqAwJCqvPtSLY7RlTn5+5IdnYkkt/AOyfxXVLe5vf53Z1875kd34tOEax8djmj6GyjhB5bxz50GdsVZr9fqRjZwAtKOJw5Wqs2MMZ16ALHsaDncF7xAHix1oEFHAB8f+pRjcO4gfZDykcYzbiucRolOLUJ6kjA0xtVt+A6TySlM0RajIpK6DzwKZ/nOYbF/gclHMo1ZOHYY/+Ha+AWuM+3oMS4eeqYzZ8FiCltgUqI8cd2wwAVpJk+8LWYjBtnJdQpHQqJMd4Oxt4bU9ESiFGc5hkqaH74asAX4iabP5I5gZ+qjgGlJCqZa3h3lxhoeVcSE1qLQC4sqKOK9MGW9E3izFqqHokoztLFEgXg31sbZEKnWi2T74A4NxfVQqlkjKtcAWD+zcArFEES01dR0E/nnV0IgugmDd/2L84sOAouRBBHEc7gtc8teDkRlE0iNQPo2w3Xhh/D4TCIQ4LRLoTvgwjj6RRgavdurxYGMaIuGOyAW/PpNlCcU9/93AHenAWYjPoAwa+G3e3to/MgFNTAEKvKDjzuCzHTnY3qqdXtx24VijzQfZ0yewZ5cwRFQaa+mIYr1uI0I76+3W4xhlvoVRwOA0Fdl64HlJnxP6T8YpX/Lga4Wv4A3ErrU5oTfN7Mu/llXMl8RXEPji/lQkN3H7qXqgC2By47EXeU/7PJ/wPxRKMnuZwIeAAAAABJRU5ErkJggg==
- Organization: Gdańsk University of Technology, YADE software
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)