11 #include <unsupported/Eigen/Polynomials>
19 struct increment_if_fixed_size
28 template<
typename _Scalar,
int _Deg>
31 typedef internal::increment_if_fixed_size<_Deg> Dim;
35 PolynomialType pols(deg+1);
36 EvalRootsType roots = EvalRootsType::Random(deg);
39 EvalRootsType evr( deg );
40 for(
int i=0;
i<roots.size(); ++
i ){
43 bool evalToZero = evr.isZero( test_precision<_Scalar>() );
45 cerr << evr.transpose() << endl; }
51 CALL_SUBTEST_2( (realRoots_to_monicPolynomial_test<_Scalar,2>(2)) );
52 CALL_SUBTEST_3( (realRoots_to_monicPolynomial_test<_Scalar,3>(3)) );
53 CALL_SUBTEST_4( (realRoots_to_monicPolynomial_test<_Scalar,4>(4)) );
54 CALL_SUBTEST_5( (realRoots_to_monicPolynomial_test<_Scalar,5>(5)) );
55 CALL_SUBTEST_6( (realRoots_to_monicPolynomial_test<_Scalar,6>(6)) );
56 CALL_SUBTEST_7( (realRoots_to_monicPolynomial_test<_Scalar,7>(7)) );
57 CALL_SUBTEST_8( (realRoots_to_monicPolynomial_test<_Scalar,17>(17)) );
59 CALL_SUBTEST_9( (realRoots_to_monicPolynomial_test<_Scalar,Dynamic>(
60 internal::random<int>(18,26) )) );
66 template<
typename _Scalar,
int _Deg>
69 typedef internal::increment_if_fixed_size<_Deg> Dim;
73 PolynomialType pols(deg+1);
74 EvalRootsType roots = EvalRootsType::Random(deg);
78 _Scalar Max = roots.array().abs().maxCoeff();
79 _Scalar
min = roots.array().abs().minCoeff();
83 cerr <<
"Roots: " << roots << endl;
84 cerr <<
"Bounds: (" <<
m <<
", " <<
M <<
")" << endl;
85 cerr <<
"Min,Max: (" <<
min <<
", " << Max <<
")" << endl;
101 internal::random<int>(18,26) )) );
108 realRoots_to_monicPolynomial_scalar<double>();
109 realRoots_to_monicPolynomial_scalar<float>();
110 CauchyBounds_scalar<double>();
111 CauchyBounds_scalar<float>();