You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check if x represents an expression tree. If returns true, it will be assumed that operation(::T) and arguments(::T) methods are defined. Definining these three should allow use of SymbolicUtils.simplify on custom types. Optionally symtype(x) can be defined to return the expected type of the symbolic expression.
8
36
==#
@@ -13,20 +41,17 @@ function SymbolicUtils.istree(x::SymEngine.SymbolicType)
13
41
returntrue
14
42
end
15
43
16
-
#==
17
-
f x is a term as defined by istree(x), exprhead(x) must return a symbol, corresponding to the head of the Expr most similar to the term x. If x represents a function call, for example, the exprhead is :call. If x represents an indexing operation, such as arr[i], then exprhead is :ref. Note that exprhead is different from operation and both functions should be defined correctly in order to let other packages provide code generation and pattern matching features.
18
-
function SymbolicUtils.exprhead(x::SymEngine.SymbolicType) # deprecated
Returns the head (a function object) performed by an expression tree. Called only if istree(::T) is true. Part of the API required for simplify to work. Other required methods are arguments and istree
25
51
==#
26
52
function SymbolicUtils.operation(x::SymEngine.SymbolicType)
0 commit comments