16 Array4d
four_denorms() {
return Array4d(5.60844
e-313, -5.60844
e-313, 4.94
e-324, -4.94
e-324); }
18 Array<T,4,1>
four_denorms() {
return four_denorms<double>().cast<
T>(); }
20 template<
typename MatrixType>
27 RealScalar s = std::numeric_limits<RealScalar>::max_exponent10/4;
28 s = internal::random<RealScalar>(1,
s);
29 Matrix<RealScalar,Dynamic,1>
d = Matrix<RealScalar,Dynamic,1>::Random(diagSize);
30 for(
Index k=0; k<diagSize; ++k)
33 bool dup = internal::random<int>(0,10) < 3;
34 bool unit_uv = internal::random<int>(0,10) < (dup?7:3);
39 Index n = internal::random<Index>(0,
d.size()-1);
41 d(internal::random<Index>(0,
d.size()-1)) =
d(internal::random<Index>(0,
d.size()-1));
44 Matrix<Scalar,Dynamic,Dynamic>
U(
m.rows(),diagSize);
45 Matrix<Scalar,Dynamic,Dynamic> VT(diagSize,
m.cols());
49 if(internal::random<int>(0,10) < 1)
66 Matrix<Scalar,Dynamic,1>
samples(9);
67 samples << 0, four_denorms<RealScalar>(),
72 m =
U *
d.asDiagonal() *
U.transpose();
76 Index count = internal::random<Index>(-diagSize,diagSize);
77 for(
Index k=0; k<count; ++k)
79 Index i = internal::random<Index>(0,diagSize-1);
88 Index n = internal::random<Index>(0,
m.size()-1);
91 Index i = internal::random<Index>(0,
m.rows()-1);
92 Index j = internal::random<Index>(0,
m.cols()-1);
102 m =
U *
d.asDiagonal() * VT;
104 if(!(dup && unit_uv))
106 Index n = internal::random<Index>(0,
m.size()-1);
109 Index i = internal::random<Index>(0,
m.rows()-1);
110 Index j = internal::random<Index>(0,
m.cols()-1);