24 template <
typename PolynomialSet>
30 template <
typename PolynomialSet>
37 virtual bool empty()
const = 0;
41 template <
typename PolynomialSet>
42 class polynomial_wrapper final:
public polynomial_base
70 virtual bool empty()
const override
84 template <
typename PolynomialSetLhs,
typename PolynomialSetRhs>
88 const auto& l = lhs->as<PolynomialSetLhs>();
89 const auto&
r = rhs->as<PolynomialSetRhs>();
90 auto rs =
join(l.polynomialset(), r.polynomialset());
91 auto lr = rs.conv(l.polynomialset(), l.polynomial());
92 auto rr = rs.conv(r.polynomialset(), r.polynomial());
93 return std::make_tuple(rs, lr, rr);
98 using polynomial = std::shared_ptr<const detail::polynomial_base>;
100 template <
typename PolynomialSet>
104 const typename PolynomialSet::value_t& p)
107 return std::make_shared<wrapper_t>(ps, p);
polynomial_wrapper(const polynomialset_t &ps, const polynomial_t &p)
PolynomialSet polynomialset_t
std::shared_ptr< const detail::polynomial_base > polynomial
virtual ~polynomial_wrapper()
polynomial make_polynomial(const PolynomialSet &ps, const typename PolynomialSet::value_t &p)
const polynomial_t polynomial_
The polynomial.
typename polynomialset_t::value_t polynomial_t
virtual bool empty() const =0
Whether is zero.
Provide a variadic mul on top of a binary mul(), and one().
To dyn_cast(From &&from)
A dynamic_cast in debug mode, static_cast with NDEBUG.
const polynomialset_t & polynomialset() const
virtual symbol vname() const override
A description of the polynomial.
const polynomialset_t polynomialset_
The polynomial set.
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
Aggregate a polynomial and its polynomialset.
const polynomial_t polynomial() const
virtual symbol vname() const =0
A description of the polynomial.
context join(const context &c1, const context &c2)
Bridge.
virtual bool empty() const override
Whether is zero.