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);
93 m(j,i) =
m(i,j) =
samples(internal::random<Index>(0,samples.size()-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);
111 m(i,j) =
samples(internal::random<Index>(0,samples.size()-1));
113 *(&
numext::real_ref(
m(i,j))+1) = samples.real()(internal::random<Index>(0,samples.size()-1));
void svd_fill_random(MatrixType &m, int Option=0)
EIGEN_DEVICE_FUNC internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar &x)
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_pow_op< typename Derived::Scalar, typename ExponentDerived::Scalar >, const Derived, const ExponentDerived > pow(const Eigen::ArrayBase< Derived > &x, const Eigen::ArrayBase< ExponentDerived > &exponents)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Array< T, 4, 1 > four_denorms()
NumTraits< Scalar >::Real RealScalar
void createRandomPIMatrixOfRank(Index desired_rank, Index rows, Index cols, MatrixType &m)
Jet< T, N > pow(const Jet< T, N > &f, double g)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set samples