Lines Matching full:polynomial
32 #include "ceres/polynomial.h"
101 void BuildCompanionMatrix(const Vector& polynomial,
106 const int degree = polynomial.size() - 1;
111 companion_matrix.col(degree - 1) = -polynomial.reverse().head(degree);
128 LOG(ERROR) << "Invalid polynomial of size 0 passed to FindPolynomialRoots";
132 Vector polynomial = RemoveLeadingZeros(polynomial_in);
133 const int degree = polynomial.size() - 1;
135 // Is the polynomial constant?
138 << "polynomial in FindPolynomialRoots";
143 const double leading_term = polynomial(0);
144 polynomial /= leading_term;
150 (*real)(0) = -polynomial(1);
159 // Build and balance the companion matrix to the polynomial.
161 BuildCompanionMatrix(polynomial, &companion_matrix);
185 Vector DifferentiatePolynomial(const Vector& polynomial) {
186 const int degree = polynomial.rows() - 1;
190 // not result in a smaller degree polynomial, just a degree zero
191 // polynomial with value zero.
198 derivative(i) = (degree - i) * polynomial(i);
204 void MinimizePolynomial(const Vector& polynomial,
209 // Find the minimum of the polynomial at the two ends.
215 *optimal_value = EvaluatePolynomial(polynomial, *optimal_x);
217 const double x_min_value = EvaluatePolynomial(polynomial, x_min);
223 const double x_max_value = EvaluatePolynomial(polynomial, x_max);
229 // If the polynomial is linear or constant, we are done.
230 if (polynomial.rows() <= 2) {
234 const Vector derivative = DifferentiatePolynomial(polynomial);
238 << "the interpolating polynomial.";
250 const double value = EvaluatePolynomial(polynomial, root);
302 const Vector polynomial = FindInterpolatingPolynomial(samples);
303 MinimizePolynomial(polynomial, x_min, x_max, optimal_x, optimal_value);
310 const double value = EvaluatePolynomial(polynomial, sample.x);