5#ifndef SYMENGINE_UEXPRPOLY_H
6#define SYMENGINE_UEXPRPOLY_H
10#include <symengine/polys/usymenginepoly.h>
62 t = detail::poly_print(
it->second);
73 if (
it->second == 1
or it->second == -1) {
94 else if (
it->second == 0)
101 o << detail::poly_print(
it->second) <<
"*";
103 t = detail::poly_print(
it->second);
115 o <<
"**" <<
it->first;
116 }
else if (
it->first < 0) {
117 o <<
"**(" <<
it->first <<
")";
127 const RCP<const Basic> get_basic(
std::string var)
const
131 RCP<const Number> coeff = zero;
132 for (
const auto &
it : dict_) {
140 it.second.get_basic());
154 return dict_.
at(
deg);
167 hash_t __hash__()
const override;
194 return UExprPoly::from_container(i,
std::move(dict));
199 return UExprPoly::from_dict(i,
std::move(dict));
#define IMPLEMENT_TYPEID(SYMENGINE_ID)
Inline members and functions.
static RCP< const Basic > from_dict(const RCP< const Number > &coef, umap_basic_num &&d)
Create an appropriate instance from dictionary quickly.
static void coef_dict_add_term(const Ptr< RCP< const Number > > &coef, umap_basic_num &d, const RCP< const Number > &c, const RCP< const Basic > &term)
Updates the numerical coefficient and the dictionary.
bool is_minus_one() const
Expression eval(const Expression &x) const
Evaluates the UExprPoly at value x.
Main namespace for SymEngine package.
void hash_combine(hash_t &seed, const T &v)
RCP< const Basic > mul(const RCP< const Basic > &a, const RCP< const Basic > &b)
Multiplication.
RCP< const Symbol > symbol(const std::string &name)
inline version to return Symbol
int unified_compare(const T &a, const T &b)
std::enable_if< std::is_integral< T >::value, RCP< constInteger > >::type integer(T i)