Skip to content
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

RFC: Return n-th derivative of a Taylor1 as a Taylor1 #137

Merged
merged 8 commits into from
Nov 24, 2017
Merged

RFC: Return n-th derivative of a Taylor1 as a Taylor1 #137

merged 8 commits into from
Nov 24, 2017

Conversation

PerezHz
Copy link
Contributor

@PerezHz PerezHz commented Nov 18, 2017

Current implementation returns the derivative of a Taylor1 as a Taylor1, but higher-order derivatives of a Taylor1 are returned as single values. This PR is intended to instead return higher-order derivatives of a Taylor1 polynomial as a Taylor1 polynomial. In order to do this, this PR adds a new method to derivative(n::Int, a::Taylor1) and renames the existing method for the value of the n-th derivative of a Taylor1 polynomial as derivativeval (name suggestions are more than welcome 😛!). This was done in order to get the whole n-th derivative polynomial when it's needed, but the existing method for the value of the n-th derivative is faster when only the numerical value is needed, so it was kept for performance reasons.

@coveralls
Copy link

coveralls commented Nov 18, 2017

Coverage Status

Changes Unknown when pulling ef69c86 on PerezHz:jp/derivative into ** on JuliaDiff:master**.

@lbenet
Copy link
Member

lbenet commented Nov 18, 2017

I like the idea of adding such method.

Currently, we have derivative(a) which returns the Taylor1 series of the derivative, and derivative(n, a) which returns the value of the n-th derivative of the polynomial (evaluated at zero). What about adding derivative(a, n) with the behavior you propose? The advantage is that such a change would break any current code.

Any opinion on this @dpsanders?

@dpsanders
Copy link
Contributor

I think having derivative(a, n) be different from derivative(n, a) is confusing, but I don't really have a better suggestion.

@lbenet
Copy link
Member

lbenet commented Nov 18, 2017

Or use keyword variables like derivative(a, ord=n) to return what is proposed here...

@PerezHz
Copy link
Contributor Author

PerezHz commented Nov 18, 2017

Just updated derivative with the latest agreed convention: derivative(n,a) returns just the value of the n-th derivative evaluated at the original point of expansion; derivative(a,n) returns the whole n-th derivative polynomial

@coveralls
Copy link

coveralls commented Nov 18, 2017

Coverage Status

Changes Unknown when pulling 021d0c3 on PerezHz:jp/derivative into ** on JuliaDiff:master**.

@coveralls
Copy link

coveralls commented Nov 21, 2017

Coverage Status

Changes Unknown when pulling be9e6a4 on PerezHz:jp/derivative into ** on JuliaDiff:master**.

Copy link
Member

@lbenet lbenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am in favor of merging this.

Yet, aside from the sole comment on this PR, there are two other points to note: First, since #136 is merged you have to rebase to current master. Second, there seems to be a problem with (at least) one test in travis; see this; I suggest to correct the failing test (Julia v0.7-dev only), and wait to see if there are other issues with travis.

Any commets @dpsanders?

@coveralls
Copy link

coveralls commented Nov 22, 2017

Coverage Status

Coverage decreased (-0.04%) to 95.937% when pulling 02af848 on PerezHz:jp/derivative into 8a8d3fb on JuliaDiff:master.

@lbenet
Copy link
Member

lbenet commented Nov 22, 2017

Thanks a lot!

I'll wait to the green lights of travis before merging.

Maybe also @dpsanders has other comments.

@PerezHz
Copy link
Contributor Author

PerezHz commented Nov 22, 2017

First, since #136 is merged you have to rebase to current master.

Thanks; done! 😄

Second, there seems to be a problem with (at least) one test in travis; see this; I suggest to correct the failing test (Julia v0.7-dev only), and wait to see if there are other issues with travis.

I just corrected this (at least locally; let's see if travis agrees), and also added some tests for the new derivative! function and jacobian for mixtures as well to keep coverage up!

@PerezHz
Copy link
Contributor Author

PerezHz commented Nov 22, 2017

Thank you for all your comments and suggestions!

@coveralls
Copy link

coveralls commented Nov 22, 2017

Coverage Status

Coverage decreased (-0.04%) to 95.937% when pulling 06d731f on PerezHz:jp/derivative into 8a8d3fb on JuliaDiff:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 96.163% when pulling 1d2e6e0 on PerezHz:jp/derivative into 8a8d3fb on JuliaDiff:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 96.163% when pulling 1d2e6e0 on PerezHz:jp/derivative into 8a8d3fb on JuliaDiff:master.

@lbenet
Copy link
Member

lbenet commented Nov 24, 2017

Thanks a lot! I'm merging this!

@lbenet lbenet merged commit 8c385c7 into JuliaDiff:master Nov 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants