Lines Matching refs:poly
51 Vector poly(1);
52 poly(0) = value;
53 return poly;
56 // Return the polynomial p(x) = poly(x) * (x - root).
57 Vector AddRealRoot(const Vector& poly, double root) {
58 Vector poly2(poly.size() + 1);
60 poly2.head(poly.size()) += poly;
61 poly2.tail(poly.size()) -= root * poly;
66 // p(x) = poly(x) * (x - real - imag*i) * (x - real + imag*i).
67 Vector AddComplexRootPair(const Vector& poly, double real, double imag) {
68 Vector poly2(poly.size() + 2);
70 // Multiply poly by x^2 - 2real + abs(real,imag)^2
71 poly2.head(poly.size()) += poly;
72 poly2.segment(1, poly.size()) -= 2 * real * poly;
73 poly2.tail(poly.size()) += (real*real + imag*imag) * poly;
96 Vector poly = ConstantPolynomial(1.23);
98 poly = AddRealRoot(poly, real_roots[i]);
102 bool success = FindPolynomialRoots(poly, real_ptr, imaginary_ptr);
119 // Vector poly(0) is an ambiguous constructor call, so
121 Vector poly(0, 1);
124 bool success = FindPolynomialRoots(poly, &real, &imag);
130 Vector poly = ConstantPolynomial(1.23);
133 bool success = FindPolynomialRoots(poly, &real, &imag);
174 Vector poly = ConstantPolynomial(1.23);
175 poly = AddComplexRootPair(poly, 42.42, 4.2);
176 bool success = FindPolynomialRoots(poly, &real, &imag);