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.
36
-
==#
37
-
function SymbolicUtils.istree(x::SymEngine.SymbolicType)
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
52
-
==#
53
-
function SymbolicUtils.operation(x::SymEngine.SymbolicType)
54
-
istree(x) ||error("$(typeof(x)) doesn't have an operation!")
55
-
returnλ(x)
56
-
end
57
-
58
-
59
-
#==
60
-
Returns the arguments (a Vector) for an expression tree. Called only if istree(x) is true. Part of the API required for simplify to work. Other required methods are operation and istree
61
-
==#
62
-
function SymbolicUtils.arguments(x::SymEngine.SymbolicType)
63
-
get_args(x)
64
-
end
65
-
66
-
#==
67
-
Construct a new term with the operation f and arguments args, the term should be similar to t in type. if t is a SymbolicUtils.Term object a new Term is created with the same symtype as t. If not, the result is computed as f(args...). Defining this method for your term type will reduce any performance loss in performing f(args...) (esp. the splatting, and redundant type computation). T is the symtype of the output term. You can use SymbolicUtils.promote_symtype to infer this type. The exprhead keyword argument is useful when creating Exprs.
68
-
==#
69
-
function SymbolicUtils.similarterm(t::SymEngine.SymbolicType, f, args, symtype=nothing;
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.
29
+
==#
30
+
function TermInterface.iscall(x::SymEngine.SymbolicType)
0 commit comments