5 #include "../UnivariatePolynomial.h"
18 template<
typename Coeff>
24 [](
const auto& a,
const auto& b){ return carl::abs(a) < carl::abs(b); }
34 template<
typename Coeff>
38 auto sum = std::accumulate(
42 [](
const auto& a,
const auto& b){
43 return static_cast<Coeff>(a + carl::abs(b));
54 template<
typename Coeff>
61 for (std::size_t i = 1; i <= p.
degree(); ++i) {
67 max = std::max(max, cur);
83 template<
typename Coeff>
92 for (std::size_t i = 1; i <= p.
degree(); ++i) {
100 max = std::max(max, cur);
113 template<
typename Coeff>
116 if (r == 0)
return 0;
126 template<
typename Coeff>
Implements utility functions concerning the (total) degree of monomials, terms and polynomials.
States if a type is a field.
carl is the main namespace for the library.
Interval< Number > abs(const Interval< Number > &_in)
Method which returns the absolute value of the passed number.
bool is_positive(const cln::cl_I &n)
bool is_constant(const ContextPolynomial< Coeff, Ordering, Policies > &p)
std::pair< cln::cl_RA, cln::cl_RA > root_safe(const cln::cl_RA &a, uint n)
bool is_zero(const Interval< Number > &i)
Check if this interval is a point-interval containing 0.
Coeff hirstMaceyBound(const UnivariatePolynomial< Coeff > &p)
Coeff lagrangePositiveUpperBound(const UnivariatePolynomial< Coeff > &p)
typename UnderlyingNumberType< P >::type Coeff
Coeff lagrangePositiveLowerBound(const UnivariatePolynomial< Coeff > &p)
Computes a lower bound on the value of the positive real roots of the given univariate polynomial.
Coeff lagrangeBound(const UnivariatePolynomial< Coeff > &p)
Coeff lagrangeNegativeUpperBound(const UnivariatePolynomial< Coeff > &p)
Computes an upper bound on the value of the negative real roots of the given univariate polynomial.
Coeff cauchyBound(const UnivariatePolynomial< Coeff > &p)
This class represents a univariate polynomial with coefficients of an arbitrary type.
const std::vector< Coefficient > & coefficients() const &
Retrieves the coefficients defining this polynomial.
const Coefficient & lcoeff() const
Returns the leading coefficient.
UnivariatePolynomial reverse_coefficients() const
Reverse coefficients safely.
uint degree() const
Get the maximal exponent of the main variable.
UnivariatePolynomial negate_variable() const
Constructs a new polynomial q such that where p is this polynomial.