Symbolics.jl
Symbolics.jl copied to clipboard
Restrict `Equation`s lhs/rhs types
From https://github.com/SciML/ModelingToolkit.jl/issues/1788#issuecomment-1234612365
Goal is to prevent non-numeric stuff from getting into build_function
. Something like:
struct Equation
"""The expression on the left-hand side of the equation."""
lhs <: Union{Real,Complex}
"""The expression on the right-hand side of the equation."""
rhs <: Union{Real,Complex}
function Equation(lhs, rhs)
new(value(lhs), value(rhs))
end
end
That would rule out, for instance, strings.
@YingboMa what's the full set, Union{Number, BasicSymbolic}`?