Loading...
Searching...
No Matches
derivative.h
Go to the documentation of this file.
1
7#ifndef SYMENGINE_DERIVATIVE_H
8#define SYMENGINE_DERIVATIVE_H
9
10#include <symengine/basic.h>
11#include <symengine/visitor.h>
12
13namespace SymEngine
14{
15
17RCP<const Basic> diff(const RCP<const Basic> &arg, const RCP<const Symbol> &x,
18 bool cache = true);
19
21RCP<const Basic> sdiff(const RCP<const Basic> &arg, const RCP<const Basic> &x,
22 bool cache = true);
23
24class DiffVisitor : public BaseVisitor<DiffVisitor>
25{
26protected:
27 const RCP<const Symbol> x;
28 RCP<const Basic> result_;
29 umap_basic_basic visited;
30 bool cache;
31
32public:
33 DiffVisitor(const RCP<const Symbol> &x, bool cache = true)
34 : x(x), cache(cache)
35 {
36 }
37// Uncomment the following define in order to debug the methods:
38#define debug_methods
39#ifndef debug_methods
40 void bvisit(const Basic &self);
41#else
42 // Here we do not have a 'Basic' fallback, but rather must implement all
43 // virtual methods explicitly (if we miss one, the code will not compile).
44 // This is useful to check that we have implemented all methods that we
45 // wanted.
46 void bvisit(const UnivariateSeries &self);
47 void bvisit(const Max &self);
48 void bvisit(const Min &self);
49#endif
50 void bvisit(const Number &self);
51 void bvisit(const Constant &self);
52 void bvisit(const Symbol &self);
53 void bvisit(const Log &self);
54 void bvisit(const Abs &self);
55 void bvisit(const ASech &self);
56 void bvisit(const ACoth &self);
57 void bvisit(const ATanh &self);
58 void bvisit(const ACosh &self);
59 void bvisit(const ACsch &self);
60 void bvisit(const ASinh &self);
61 void bvisit(const Coth &self);
62 void bvisit(const Tanh &self);
63 void bvisit(const Sech &self);
64 void bvisit(const Cosh &self);
65 void bvisit(const Csch &self);
66 void bvisit(const Sinh &self);
67 void bvisit(const Subs &self);
68 void bvisit(const Derivative &self);
69 void bvisit(const OneArgFunction &self);
70 void bvisit(const MultiArgFunction &self);
71 void bvisit(const TwoArgFunction &self);
72 void bvisit(const PolyGamma &self);
73 void bvisit(const UpperGamma &self);
74 void bvisit(const LowerGamma &self);
75 void bvisit(const Zeta &self);
76 void bvisit(const LambertW &self);
77 void bvisit(const Add &self);
78 void bvisit(const Mul &self);
79 void bvisit(const Pow &self);
80 void bvisit(const Sin &self);
81 void bvisit(const Cos &self);
82 void bvisit(const Tan &self);
83 void bvisit(const Cot &self);
84 void bvisit(const Csc &self);
85 void bvisit(const Sec &self);
86 void bvisit(const ASin &self);
87 void bvisit(const ACos &self);
88 void bvisit(const ASec &self);
89 void bvisit(const ACsc &self);
90 void bvisit(const ATan &self);
91 void bvisit(const ACot &self);
92 void bvisit(const ATan2 &self);
93 void bvisit(const Erf &self);
94 void bvisit(const Erfc &self);
95 void bvisit(const Gamma &self);
96 void bvisit(const LogGamma &self);
97 void bvisit(const UnevaluatedExpr &self);
98 void bvisit(const UIntPoly &self);
99 void bvisit(const URatPoly &self);
100#ifdef HAVE_SYMENGINE_PIRANHA
101 void bvisit(const UIntPolyPiranha &self);
102 void bvisit(const URatPolyPiranha &self);
103#endif
104#ifdef HAVE_SYMENGINE_FLINT
105 void bvisit(const UIntPolyFlint &self);
106 void bvisit(const URatPolyFlint &self);
107#endif
108 void bvisit(const UExprPoly &self);
109 void bvisit(const MIntPoly &self);
110 void bvisit(const MExprPoly &self);
111 void bvisit(const FunctionWrapper &self);
112 void bvisit(const Beta &self);
113 void bvisit(const Set &self);
114 void bvisit(const Tuple &self);
115 void bvisit(const IdentityMatrix &self);
116 void bvisit(const ZeroMatrix &self);
117 void bvisit(const MatrixSymbol &self);
118 void bvisit(const DiagonalMatrix &self);
119 void bvisit(const ImmutableDenseMatrix &self);
120 void bvisit(const MatrixAdd &self);
121 void bvisit(const HadamardProduct &self);
122 void bvisit(const MatrixMul &self);
123 void bvisit(const ConjugateMatrix &self);
124 void bvisit(const Transpose &self);
125 void bvisit(const Trace &self);
126 void bvisit(const Boolean &self);
127 void bvisit(const GaloisField &self);
128 void bvisit(const Piecewise &self);
129 const RCP<const Basic> &apply(const Basic &b);
130 const RCP<const Basic> &apply(const RCP<const Basic> &b);
131};
132
133} // namespace SymEngine
134
135#endif // SYMENGINE_DERIVATIVE_H
The base class for SymEngine.
The base class for representing addition in symbolic expressions.
Definition: add.h:27
The lowest unit of symbolic representation.
Definition: basic.h:97
UnivariateSeries Class.
Main namespace for SymEngine package.
Definition: add.cpp:19