-
-
Notifications
You must be signed in to change notification settings - Fork 11
cellml stuff added to handle Beeler-Reuter #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! just a few changes
return parse_node(firstelement(node)) | ||
elseif nodename(node) == "piece" | ||
c = parse_node.(elements(node)) | ||
return Symbolics.IfElse.ifelse(c[2] > 0.5, c[1], otherwise) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have an IfElse dep, I think you can just have IfElse.ifelse(c[2] > 0.5, c[1], otherwise)
# """ | ||
# parse_piecewise(node) | ||
|
||
# parse a <piecewise> node | ||
# parse a <piecewise> node | ||
# want to recursively call ifelse on the pieces | ||
# """ | ||
# function parse_piecewise(node) | ||
# es = elements(node) | ||
# IfElse.ifelse(a, b, | ||
# IfElse.ifelse(c, d, | ||
# IfElse.ifelse(a, b, | ||
# IfElse.ifelse(c, d, | ||
# IfElse.ifelse(e, f, otherwise))) | ||
# end | ||
|
||
# """ | ||
# parse_piece(node) | ||
|
||
# parse a <piece> node | ||
# parse a <piece> node | ||
# Each <piece> element contains exactly two children. | ||
# The conditional is the second child and the return is the first. | ||
# """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you just delete all this?
|
||
"and" => x -> Base.:*(x...), | ||
"or" => heaviside_or, | ||
"xor" => x -> x[1]*(one(x[2])-x[2]) + (one(x[1])-x[1])*x[2], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is fine but there must be an easier way
oh actually could you add a piecewise test? ideally one with some nesting, i have a few in |
@@ -180,45 +211,72 @@ function check_ivs(node) | |||
all(y -> y.content == x[1].content, x) | |||
end | |||
|
|||
# need to check the arities | |||
H(x) = Symbolics.IfElse.ifelse(x > 0, one(x), zero(x)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IfElse here too
No description provided.