1 #ifndef SYMENGINE_SERIES_PIRANHA_H
2 #define SYMENGINE_SERIES_PIRANHA_H
7 #ifdef HAVE_SYMENGINE_PIRANHA
8 #include <piranha/monomial.hpp>
9 #include <piranha/polynomial.hpp>
14 using pp_t = piranha::polynomial<piranha::rational, piranha::monomial<short>>;
16 class URatPSeriesPiranha
17 :
public SeriesBase<pp_t, piranha::rational, URatPSeriesPiranha>
20 URatPSeriesPiranha(
const pp_t p,
const std::string varname,
21 const unsigned degree);
23 virtual int compare(
const Basic &o)
const;
24 virtual hash_t __hash__()
const;
25 virtual RCP<const Basic> as_basic()
const;
26 virtual umap_int_basic as_dict()
const;
27 virtual RCP<const Basic> get_coeff(
int)
const;
29 static RCP<const URatPSeriesPiranha>
30 series(
const RCP<const Basic> &t,
const std::string &x,
unsigned int prec);
36 static pp_t
mul(
const pp_t &s,
const pp_t &r,
unsigned prec);
37 static pp_t
pow(
const pp_t &s,
int n,
unsigned prec);
38 static unsigned ldegree(
const pp_t &s);
42 static pp_t diff(
const pp_t &s,
const pp_t &var);
43 static pp_t integrate(
const pp_t &s,
const pp_t &var);
44 static pp_t subs(
const pp_t &s,
const pp_t &var,
const pp_t &r,
48 using p_expr = piranha::polynomial<Expression, piranha::monomial<int>>;
50 class UPSeriesPiranha :
public SeriesBase<p_expr, Expression, UPSeriesPiranha>
53 UPSeriesPiranha(
const p_expr p,
const std::string varname,
54 const unsigned degree);
56 virtual int compare(
const Basic &o)
const;
57 virtual hash_t __hash__()
const;
58 virtual RCP<const Basic> as_basic()
const;
59 virtual umap_int_basic as_dict()
const;
60 virtual RCP<const Basic> get_coeff(
int)
const;
62 static RCP<const UPSeriesPiranha>
63 series(
const RCP<const Basic> &t,
const std::string &x,
unsigned int prec);
65 static Expression convert(
const Basic &x);
66 static p_expr
mul(
const p_expr &s,
const p_expr &r,
unsigned prec);
67 static p_expr
pow(
const p_expr &s,
int n,
unsigned prec);
68 static unsigned ldegree(
const p_expr &s);
69 static Expression find_cf(
const p_expr &s,
const p_expr &var,
unsigned deg);
70 static Expression root(Expression &c,
unsigned n);
71 static p_expr diff(
const p_expr &s,
const p_expr &var);
72 static p_expr integrate(
const p_expr &s,
const p_expr &var);
73 static p_expr subs(
const p_expr &s,
const p_expr &var,
const p_expr &r,
76 static Expression
sin(
const Expression &c);
77 static Expression
cos(
const Expression &c);
78 static Expression
tan(
const Expression &c);
79 static Expression
asin(
const Expression &c);
80 static Expression
acos(
const Expression &c);
81 static Expression
atan(
const Expression &c);
82 static Expression
sinh(
const Expression &c);
83 static Expression
cosh(
const Expression &c);
84 static Expression
tanh(
const Expression &c);
85 static Expression
asinh(
const Expression &c);
86 static Expression
atanh(
const Expression &c);
87 static Expression
exp(
const Expression &c);
88 static Expression
log(
const Expression &c);
#define IMPLEMENT_TYPEID(SYMENGINE_ID)
Inline members and functions.
Main namespace for SymEngine package.
RCP< const Basic > acos(const RCP< const Basic > &arg)
Canonicalize ACos:
std::enable_if< std::is_integral< T >::value, RCP< const Integer > >::type integer(T i)
RCP< const Basic > exp(const RCP< const Basic > &x)
Returns the natural exponential function E**x = pow(E, x)
RCP< const Basic > asin(const RCP< const Basic > &arg)
Canonicalize ASin:
RCP< const Basic > tan(const RCP< const Basic > &arg)
Canonicalize Tan:
RCP< const Basic > cosh(const RCP< const Basic > &arg)
Canonicalize Cosh:
RCP< const Basic > atan(const RCP< const Basic > &arg)
Canonicalize ATan:
RCP< const Basic > asinh(const RCP< const Basic > &arg)
Canonicalize ASinh:
RCP< const Basic > tanh(const RCP< const Basic > &arg)
Canonicalize Tanh:
RCP< const Basic > mul(const RCP< const Basic > &a, const RCP< const Basic > &b)
Multiplication.
RCP< const Basic > atanh(const RCP< const Basic > &arg)
Canonicalize ATanh:
RCP< const Basic > cos(const RCP< const Basic > &arg)
Canonicalize Cos:
RCP< const Basic > log(const RCP< const Basic > &arg)
Returns the Natural Logarithm from argument arg
RCP< const Number > rational(long n, long d)
convenience creator from two longs
RCP< const Basic > sinh(const RCP< const Basic > &arg)
Canonicalize Sinh:
RCP< const Basic > sin(const RCP< const Basic > &arg)
Canonicalize Sin: