Fix undeflow

This commit is contained in:
Gael Guennebaud 2016-09-16 11:46:46 +02:00
parent 18f6e47815
commit 4adeababf9

View File

@ -7,6 +7,14 @@
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
template<typename T>
Array<T,4,1> four_denorms();
template<>
Array4f four_denorms() { return Array4f(5.60844e-39f, -5.60844e-39f, 4.94e-44f, -4.94e-44f); }
template<>
Array4d four_denorms() { return Array4d(5.60844e-313, -5.60844e-313, 4.94e-324, -4.94e-324); }
template<typename MatrixType>
void svd_fill_random(MatrixType &m, int Option = 0)
{
@ -55,7 +63,8 @@ void svd_fill_random(MatrixType &m, int Option = 0)
}
Matrix<Scalar,Dynamic,1> samples(9);
samples << 0, 5.60844e-313, -5.60844e-313, 4.94e-324, -4.94e-324, -RealScalar(1)/NumTraits<RealScalar>::highest(), RealScalar(1)/NumTraits<RealScalar>::highest(), (std::numeric_limits<RealScalar>::min)(), pow((std::numeric_limits<RealScalar>::min)(),0.8);
samples << 0, four_denorms<RealScalar>(),
-RealScalar(1)/NumTraits<RealScalar>::highest(), RealScalar(1)/NumTraits<RealScalar>::highest(), (std::numeric_limits<RealScalar>::min)(), pow((std::numeric_limits<RealScalar>::min)(),0.8);
if(Option==Symmetric)
{