-
Notifications
You must be signed in to change notification settings - Fork 53
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
Diferentiate, integrate and evaluate with symbols #155
Conversation
I'm not sure if a rebase is needed here... |
Yes I think it needs to be rebased. Should be trivial |
I also thought so, but github thinks it can be merged directly. In any case, it is ready for review and also to be merged. |
c6aa762
to
41dc075
Compare
src/calculus.jl
Outdated
@@ -131,6 +131,8 @@ function derivative(a::HomogeneousPolynomial, r::Int) | |||
|
|||
return HomogeneousPolynomial{T}(coeffs, a.order-1) | |||
end | |||
derivative(a::HomogeneousPolynomial, s::Symbol) = | |||
derivative(a, findfirst(get_variable_symbols(), s)) |
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 think we should introduce a separate function to do the variable lookup in case we decide to change the mechanism later.
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.
So the proposal is to have something like lookupsymb(s)
which is equivalent to findfirst(get_variable_symbols(), s)
. Is this what you mean?
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.
Yes exactly. Maybe lookupvar
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.
Ok.
Note that I just rebased against master. |
Just pushed another commit following your suggestions |
Incidentally, I did not export |
I think it's fine (or better) if it's not exported. |
LGTM, thanks! |
Thanks! |
Thanks a lot! |
This fixes #148 and fixes #151
EDIT: Correct spelling