Definition at line 160 of file uexprpoly.h.
◆ coef_type
◆ UExprPoly()
SymEngine::UExprPoly::UExprPoly |
( |
const RCP< const Basic > & |
var, |
|
|
UExprDict && |
dict |
|
) |
| |
Constructor of UExprPoly class.
Definition at line 6 of file uexprpoly.cpp.
7 : USymEnginePoly(
8 var,
std::move(dict)){SYMENGINE_ASSIGN_TYPEID()
9 SYMENGINE_ASSERT(is_canonical(get_poly()))}
◆ __hash__()
hash_t SymEngine::UExprPoly::__hash__ |
( |
| ) |
const |
|
override |
Definition at line 11 of file uexprpoly.cpp.
12{
13 hash_t seed = SYMENGINE_UEXPRPOLY;
14
15 seed += get_var()->hash();
16 for (const auto &it : get_poly().dict_) {
17 hash_t temp = SYMENGINE_UEXPRPOLY;
18 hash_combine<unsigned int>(temp, it.first);
19 hash_combine<Basic>(temp, *(it.second.get_basic()));
20 seed += temp;
21 }
22 return seed;
23}
◆ eval()
Evaluates the UExprPoly at value x.
Definition at line 34 of file uexprpoly.cpp.
35{
36 Expression ans = 0;
37 for (const auto &p : get_poly().get_dict()) {
38 Expression temp;
39 temp =
pow(x, Expression(p.first));
40 ans += p.second * temp;
41 }
42 return ans;
43}
◆ is_integer()
bool SymEngine::UExprPoly::is_integer |
( |
| ) |
const |
- Returns
true
if integer
Definition at line 63 of file uexprpoly.cpp.
64{
65 if (get_poly().empty())
66 return true;
67 return get_poly().size() == 1 and get_poly().get_dict().begin()->first == 0;
68}
◆ is_minus_one()
bool SymEngine::UExprPoly::is_minus_one |
( |
| ) |
const |
- Returns
true
if -1
Definition at line 56 of file uexprpoly.cpp.
57{
58 return get_poly().size() == 1
59 and get_poly().get_dict().begin()->second == -1
60 and get_poly().get_dict().begin()->first == 0;
61}
◆ is_mul()
bool SymEngine::UExprPoly::is_mul |
( |
| ) |
const |
- Returns
true
if mul
Definition at line 76 of file uexprpoly.cpp.
77{
78 return get_poly().size() == 1 and get_poly().get_dict().begin()->first != 0
79 and get_poly().get_dict().begin()->second != 1
80 and get_poly().get_dict().begin()->second != 0;
81}
◆ is_one()
bool SymEngine::UExprPoly::is_one |
( |
| ) |
const |
- Returns
true
if 1
Definition at line 50 of file uexprpoly.cpp.
51{
52 return get_poly().size() == 1 and get_poly().get_dict().begin()->second == 1
53 and get_poly().get_dict().begin()->first == 0;
54}
◆ is_pow()
bool SymEngine::UExprPoly::is_pow |
( |
| ) |
const |
- Returns
true
if pow
Definition at line 83 of file uexprpoly.cpp.
84{
85 return get_poly().size() == 1 and get_poly().get_dict().begin()->second == 1
86 and get_poly().get_dict().begin()->first != 1
87 and get_poly().get_dict().begin()->first != 0;
88}
◆ is_symbol()
bool SymEngine::UExprPoly::is_symbol |
( |
| ) |
const |
- Returns
true
if symbol
Definition at line 70 of file uexprpoly.cpp.
71{
72 return get_poly().size() == 1 and get_poly().get_dict().begin()->first == 1
73 and get_poly().get_dict().begin()->second == 1;
74}
◆ is_zero()
bool SymEngine::UExprPoly::is_zero |
( |
| ) |
const |
- Returns
true
if 0
Definition at line 45 of file uexprpoly.cpp.
46{
47 return get_poly().empty();
48}
◆ max_coef()
Expression SymEngine::UExprPoly::max_coef |
( |
| ) |
const |
Definition at line 25 of file uexprpoly.cpp.
26{
27 Expression curr = get_poly().get_dict().begin()->second;
28 for (const auto &it : get_poly().get_dict())
29 if (curr.get_basic()->__cmp__(*it.second.get_basic()))
30 curr = it.second;
31 return curr;
32}
◆ type_code_id
const TypeID SymEngine::UExprPoly::type_code_id = SYMENGINE_UEXPRPOLY |
|
static |
Type_code_id shared by all instances
Definition at line 163 of file uexprpoly.h.
The documentation for this class was generated from the following files:
- /home/runner/work/symengine/symengine/symengine/polys/uexprpoly.h
- /home/runner/work/symengine/symengine/symengine/polys/uexprpoly.cpp