series_generic.h
Go to the documentation of this file.
1 
6 #ifndef SYMENGINE_SERIES_GENERIC_H
7 #define SYMENGINE_SERIES_GENERIC_H
8 
10 #include <symengine/polys/uexprpoly.h>
11 #include <symengine/series.h>
12 
13 namespace SymEngine
14 {
17  : public SeriesBase<UExprDict, Expression, UnivariateSeries>
18 {
19  // UnivariateSeries 1 + 2*x + x**2 + O(x**5) has dict_ = {{0, 1}, {1, 2},
20  // {2, 1}} with var_ = "x" and prec_ = 5
21 public:
22  using SeriesBase::mul;
23  using SeriesBase::pow;
24  IMPLEMENT_TYPEID(SYMENGINE_UNIVARIATESERIES)
25  UnivariateSeries(const UExprDict &sp, const std::string varname,
26  const unsigned degree)
27  : SeriesBase(sp, varname, degree)
28  {
29  SYMENGINE_ASSIGN_TYPEID()
30  }
31 
32  static RCP<const UnivariateSeries> create(const RCP<const Symbol> &var,
33  const unsigned int &prec,
34  const UExprDict &s)
35  {
36  return make_rcp<const UnivariateSeries>(std::move(s), var->get_name(),
37  prec);
38  }
39 
40  static RCP<const UnivariateSeries>
41  series(const RCP<const Basic> &t, const std::string &x, unsigned int prec);
42  hash_t __hash__() const override;
43  int compare(const Basic &o) const override;
44  bool operator==(const UnivariateSeries &u) const;
45  RCP<const Basic> as_basic() const override;
46  umap_int_basic as_dict() const override;
47  RCP<const Basic> get_coeff(int) const override;
48  static UExprDict var(const std::string &s);
49 
50  static Expression convert(const Basic &x);
51 
52  static int ldegree(const UExprDict &s);
53  static UExprDict mul(const UExprDict &s, const UExprDict &r, unsigned prec);
54  static UExprDict pow(const UExprDict &s, int n, unsigned prec);
55  static Expression find_cf(const UExprDict &s, const UExprDict &var,
56  int deg);
57  static Expression root(Expression &c, unsigned n);
58  static UExprDict diff(const UExprDict &s, const UExprDict &var);
59  static UExprDict integrate(const UExprDict &s, const UExprDict &var);
60  static UExprDict subs(const UExprDict &s, const UExprDict &var,
61  const UExprDict &r, unsigned prec);
62 
63  static Expression sin(const Expression &c);
64  static Expression cos(const Expression &c);
65  static Expression tan(const Expression &c);
66  static Expression asin(const Expression &c);
67  static Expression acos(const Expression &c);
68  static Expression atan(const Expression &c);
69  static Expression sinh(const Expression &c);
70  static Expression cosh(const Expression &c);
71  static Expression tanh(const Expression &c);
72  static Expression asinh(const Expression &c);
73  static Expression acosh(const Expression &c);
74  static Expression atanh(const Expression &c);
75  static Expression exp(const Expression &c);
76  static Expression log(const Expression &c);
77 };
78 
79 inline RCP<const UnivariateSeries>
80 univariate_series(RCP<const Symbol> i, unsigned int prec, const UExprDict &s)
81 {
82  return make_rcp<const UnivariateSeries>(std::move(s), i->get_name(), prec);
83 }
84 
85 } // namespace SymEngine
86 #endif
#define IMPLEMENT_TYPEID(SYMENGINE_ID)
Inline members and functions.
Definition: basic.h:340
Basic()
Constructor.
Definition: basic.h:120
RCP< const Number > mul(const Number &other) const override
Multiplication.
Definition: series.h:110
RCP< const Number > pow(const Number &other) const override
Power.
Definition: series.h:128
UnivariateSeries Class.
int compare(const Basic &o) const override
hash_t __hash__() const override
T move(T... args)
Main namespace for SymEngine package.
Definition: add.cpp:19