Lines Matching refs:Complex
36 template<class Complex>
37 std::vector<std::pair<Complex, Complex>> find_roots(size_t p) in find_roots()
41 typedef typename Complex::value_type Real; in find_roots()
42 std::vector<Complex> coeffs(p); in find_roots()
45 coeffs[k] = Complex(binomial_coefficient<Real>(p-1+k, k), 0); in find_roots()
48 polynomial<Complex> P(std::move(coeffs)); in find_roots()
49 polynomial<Complex> Pcopy = P; in find_roots()
50 polynomial<Complex> Pcopy_prime = P.prime(); in find_roots()
51 … auto orig = [&](Complex z) { return std::make_pair<Complex, Complex>(Pcopy(z), Pcopy_prime(z)); }; in find_roots()
53 polynomial<Complex> P_prime = P.prime(); in find_roots()
57 …std::vector<Complex> roots(p-1, {std::numeric_limits<Real>::quiet_NaN(),std::numeric_limits<Real>:… in find_roots()
61 Complex guess = {0.0, 1.0}; in find_roots()
64 auto f = [&](Complex x)->std::pair<Complex, Complex> in find_roots()
66 return std::make_pair<Complex, Complex>(P(x), P_prime(x)); in find_roots()
69 Complex r = complex_newton(f, guess); in find_roots()
76 guess *= Complex(1.0,-1.0); in find_roots()
109 polynomial<Complex> q{-r, {1,0}}; in find_roots()
140 std::vector<std::pair<Complex, Complex>> Qroots(p-1); in find_roots()
143 Complex y = roots[i]; in find_roots()
144 …Complex z1 = static_cast<Complex>(1) - static_cast<Complex>(2)*y + static_cast<Complex>(2)*sqrt(y*… in find_roots()
145 …Complex z2 = static_cast<Complex>(1) - static_cast<Complex>(2)*y - static_cast<Complex>(2)*sqrt(y*… in find_roots()
152 template<class Complex>
153 std::vector<typename Complex::value_type> daubechies_coefficients(std::vector<std::pair<Complex, Co… in daubechies_coefficients() argument
155 typedef typename Complex::value_type Real; in daubechies_coefficients()
158 std::vector<Complex> chosen_roots(p-1); in daubechies_coefficients()
172 polynomial<Complex> R{1}; in daubechies_coefficients()
175 Complex ak = chosen_roots[i]; in daubechies_coefficients()
176 …R *= polynomial<Complex>({-ak/(static_cast<Complex>(1)-ak), static_cast<Complex>(1)/(static_cast<C… in daubechies_coefficients()
178 polynomial<Complex> a{{half<Real>(), 0}, {half<Real>(),0}}; in daubechies_coefficients()
179 polynomial<Complex> poly = root_two<Real>()*pow(a, p)*R; in daubechies_coefficients()
180 std::vector<Complex> result = poly.data(); in daubechies_coefficients()
190 Complex r = result[i]; in daubechies_coefficients()
210 typedef boost::multiprecision::cpp_complex<100> Complex; in main() typedef
213 auto roots = find_roots<Complex>(p); in main()