uratpoly.h
Go to the documentation of this file.
1
5#ifndef SYMENGINE_URATPOLY_H
6#define SYMENGINE_URATPOLY_H
7
8#include <symengine/polys/usymenginepoly.h>
9
10namespace SymEngine
11{
12
13class URatDict : public ODictWrapper<unsigned int, rational_class, URatDict>
14{
15
16public:
17 URatDict() SYMENGINE_NOEXCEPT {}
18 ~URatDict() SYMENGINE_NOEXCEPT {}
19 URatDict(URatDict &&other) SYMENGINE_NOEXCEPT
20 : ODictWrapper(std::move(other))
21 {
22 }
23 URatDict(const int &i) : ODictWrapper(i) {}
24 URatDict(const map_uint_mpq &p) : ODictWrapper(p) {}
25 URatDict(const rational_class &i) : ODictWrapper(i) {}
26
27 URatDict(const URatDict &) = default;
28 URatDict &operator=(const URatDict &) = default;
29
30 int compare(const URatDict &other) const
31 {
32 if (dict_.size() != other.dict_.size())
33 return (dict_.size() < other.dict_.size()) ? -1 : 1;
34 return unified_compare(dict_, other.dict_);
35 }
36}; // URatDict
37
38class URatPoly : public USymEnginePoly<URatDict, URatPolyBase, URatPoly>
39{
40public:
41 IMPLEMENT_TYPEID(SYMENGINE_URATPOLY)
43 URatPoly(const RCP<const Basic> &var, URatDict &&dict);
44
46 hash_t __hash__() const;
47}; // URatPoly
48
49// true & sets `out` to b/a if a exactly divides b, otherwise false & undefined
50bool divides_upoly(const URatPoly &a, const URatPoly &b,
51 const Ptr<RCP<const URatPoly>> &res);
52
53} // namespace SymEngine
54
55#endif
#define IMPLEMENT_TYPEID(SYMENGINE_ID)
Inline members and functions.
Definition: basic.h:349
hash_t __hash__() const
Definition: uratpoly.cpp:11
URatPoly(const RCP< const Basic > &var, URatDict &&dict)
Constructor of URatPoly class.
Definition: uratpoly.cpp:6
T move(T... args)
Main namespace for SymEngine package.
Definition: add.cpp:19
int unified_compare(const T &a, const T &b)
Definition: dict.h:205
T size(T... args)