SymEngine C++ API
symengine
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
13
namespace
SymEngine
14
{
15
17
RCP<const Basic> diff(
const
RCP<const Basic> &arg,
const
RCP<const Symbol> &x,
18
bool
cache =
true
);
19
21
RCP<const Basic> sdiff(
const
RCP<const Basic> &arg,
const
RCP<const Basic> &x,
22
bool
cache =
true
);
23
24
class
DiffVisitor
:
public
BaseVisitor
<DiffVisitor>
25
{
26
protected
:
27
const
RCP<const Symbol> x;
28
RCP<const Basic> result_;
29
umap_basic_basic
visited;
30
bool
cache;
31
32
public
:
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
basic.h
The base class for SymEngine.
SymEngine::ACos
Definition:
functions.h:422
SymEngine::ACosh
Definition:
functions.h:923
SymEngine::ACot
Definition:
functions.h:486
SymEngine::ACoth
Definition:
functions.h:955
SymEngine::ACsc
Definition:
functions.h:454
SymEngine::ACsch
Definition:
functions.h:907
SymEngine::ASec
Definition:
functions.h:438
SymEngine::ASech
Definition:
functions.h:971
SymEngine::ASin
Definition:
functions.h:406
SymEngine::ASinh
Definition:
functions.h:891
SymEngine::ATan2
Definition:
functions.h:502
SymEngine::ATan
Definition:
functions.h:470
SymEngine::ATanh
Definition:
functions.h:939
SymEngine::Abs
Definition:
functions.h:1242
SymEngine::Add
The base class for representing addition in symbolic expressions.
Definition:
add.h:27
SymEngine::BaseVisitor
Definition:
visitor.h:48
SymEngine::Basic
The lowest unit of symbolic representation.
Definition:
basic.h:97
SymEngine::Beta
Definition:
functions.h:1173
SymEngine::Boolean
Definition:
logic.h:19
SymEngine::ConjugateMatrix
Definition:
conjugate_matrix.h:11
SymEngine::Constant
Definition:
constants.h:19
SymEngine::Cos
Definition:
functions.h:330
SymEngine::Cosh
Definition:
functions.h:827
SymEngine::Cot
Definition:
functions.h:361
SymEngine::Coth
Definition:
functions.h:875
SymEngine::Csc
Definition:
functions.h:376
SymEngine::Csch
Definition:
functions.h:811
SymEngine::Derivative
Definition:
functions.h:687
SymEngine::DiagonalMatrix
Definition:
diagonal_matrix.h:11
SymEngine::DiffVisitor
Definition:
derivative.h:25
SymEngine::Erf
Definition:
functions.h:1034
SymEngine::Erfc
Definition:
functions.h:1059
SymEngine::FunctionWrapper
Definition:
functions.h:672
SymEngine::GaloisField
Definition:
fields.h:548
SymEngine::Gamma
Definition:
functions.h:1084
SymEngine::HadamardProduct
Definition:
hadamard_product.h:11
SymEngine::IdentityMatrix
Definition:
identity_matrix.h:11
SymEngine::ImmutableDenseMatrix
Definition:
immutable_dense_matrix.h:12
SymEngine::LambertW
Definition:
functions.h:550
SymEngine::LogGamma
Definition:
functions.h:1149
SymEngine::Log
Definition:
functions.h:530
SymEngine::LowerGamma
Definition:
functions.h:1109
SymEngine::MExprPoly
Definition:
msymenginepoly.h:455
SymEngine::MIntPoly
Definition:
msymenginepoly.h:440
SymEngine::MatrixAdd
Definition:
matrix_add.h:12
SymEngine::MatrixMul
Definition:
matrix_mul.h:13
SymEngine::MatrixSymbol
Definition:
matrix_symbol.h:11
SymEngine::Max
Definition:
functions.h:1259
SymEngine::Min
Definition:
functions.h:1274
SymEngine::Mul
Definition:
mul.h:74
SymEngine::MultiArgFunction
Definition:
functions.h:144
SymEngine::Number
Definition:
number.h:19
SymEngine::OneArgFunction
Definition:
functions.h:22
SymEngine::Piecewise
Definition:
logic.h:83
SymEngine::PolyGamma
Definition:
functions.h:1205
SymEngine::Pow
Definition:
pow.h:18
SymEngine::Sec
Definition:
functions.h:391
SymEngine::Sech
Definition:
functions.h:843
SymEngine::Set
Definition:
sets.h:26
SymEngine::Sin
Definition:
functions.h:314
SymEngine::Sinh
Definition:
functions.h:795
SymEngine::Subs
Definition:
functions.h:739
SymEngine::Symbol
Definition:
symbol.h:15
SymEngine::Tan
Definition:
functions.h:346
SymEngine::Tanh
Definition:
functions.h:859
SymEngine::Trace
Definition:
trace.h:11
SymEngine::Transpose
Definition:
transpose.h:11
SymEngine::Tuple
Definition:
tuple.h:10
SymEngine::TwoArgBasic
Definition:
functions.h:74
SymEngine::UExprPoly
Definition:
uexprpoly.h:161
SymEngine::UIntPoly
Definition:
uintpoly.h:116
SymEngine::URatPoly
Definition:
uratpoly.h:39
SymEngine::UnevaluatedExpr
Definition:
functions.h:1292
SymEngine::UnivariateSeries
UnivariateSeries Class.
Definition:
series_generic.h:18
SymEngine::UpperGamma
Definition:
functions.h:1129
SymEngine::ZeroMatrix
Definition:
zero_matrix.h:11
SymEngine::Zeta
Definition:
functions.h:570
SymEngine
Main namespace for SymEngine package.
Definition:
add.cpp:19
std::unordered_map< RCP< const Basic >, RCP< const Basic >, RCPBasicHash, RCPBasicKeyEq >
visitor.h