4 #include "../poly/Conversion.h"
8 template<typename ToPoly, typename FromPoly, typename = std::enable_if_t<needs_context_type<ToPoly>::value>>
12 return std::get<MultivariateRoot<FromPoly>>(c.
value()).k();
14 auto& ran = std::get<typename FromPoly::RootType>(c.
value());
15 if (ran.is_numeric()) {
16 return (std::size_t)1;
20 auto it = std::find(roots.roots().begin(), roots.roots().end(), ran);
21 assert(it != roots.roots().end());
22 return (std::size_t)std::distance(roots.roots().begin(), it)+1;
29 template<typename ToPoly, typename FromPoly, typename = std::enable_if_t<!needs_context_type<ToPoly>::value>>
32 const auto& m = std::get<MultivariateRoot<FromPoly>>(c.
value());
carl is the main namespace for the library.
RealRootsResult< IntRepRealAlgebraicNumber< Number > > real_roots(const UnivariatePolynomial< Coeff > &polynomial, const Interval< Number > &interval=Interval< Number >::unbounded_interval())
Find all real roots of a univariate 'polynomial' with numeric coefficients within a given 'interval'.
BasicConstraint< ToPoly > convert(const typename ToPoly::ContextType &context, const BasicConstraint< FromPoly > &c)
Poly defining_polynomial(const VariableComparison< Poly > &f)
Return a polynomial containing the lhs-variable that has a same root for the this lhs-variable as the...
Represent a sum type/variant of an (in)equality between a variable on the left-hand side and multivar...
const std::variant< MR, RAN > & value() const
Relation relation() const