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 
10 namespace SymEngine
11 {
12 
13 class SYMENGINE_EXPORT URatDict
14  : public ODictWrapper<unsigned int, rational_class, URatDict>
15 {
16 
17 public:
18  URatDict() SYMENGINE_NOEXCEPT {}
19  ~URatDict() SYMENGINE_NOEXCEPT {}
20  URatDict(URatDict &&other) SYMENGINE_NOEXCEPT
21  : ODictWrapper(std::move(other))
22  {
23  }
24  URatDict(const int &i) : ODictWrapper(i) {}
25  URatDict(const map_uint_mpq &p) : ODictWrapper(p) {}
26  URatDict(const rational_class &i) : ODictWrapper(i) {}
27 
28  URatDict(const URatDict &) = default;
29  URatDict &operator=(const URatDict &) = default;
30 
31  int compare(const URatDict &other) const
32  {
33  if (dict_.size() != other.dict_.size())
34  return (dict_.size() < other.dict_.size()) ? -1 : 1;
35  return unified_compare(dict_, other.dict_);
36  }
37 }; // URatDict
38 
39 class SYMENGINE_EXPORT URatPoly
40  : public USymEnginePoly<URatDict, URatPolyBase, URatPoly>
41 {
42 public:
43  IMPLEMENT_TYPEID(SYMENGINE_URATPOLY)
45  URatPoly(const RCP<const Basic> &var, URatDict &&dict);
46 
48  hash_t __hash__() const override;
49 }; // URatPoly
50 
51 // true & sets `out` to b/a if a exactly divides b, otherwise false & undefined
52 SYMENGINE_EXPORT
53 bool divides_upoly(const URatPoly &a, const URatPoly &b,
54  const Ptr<RCP<const URatPoly>> &res);
55 
56 } // namespace SymEngine
57 
58 #endif
#define IMPLEMENT_TYPEID(SYMENGINE_ID)
Inline members and functions.
Definition: basic.h:344
Main namespace for SymEngine package.
Definition: add.cpp:19
int unified_compare(const T &a, const T &b)
Definition: dict.h:205