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

Make unique and filter results from Newton #156

Merged
merged 4 commits into from
Jul 2, 2016
Merged

Conversation

dpsanders
Copy link
Member

No description provided.

@coveralls
Copy link

coveralls commented Jun 30, 2016

Coverage Status

Coverage increased (+0.1%) to 93.467% when pulling 37ca468 on merge_newton_results into 6b29087 on master.

@lbenet
Copy link
Member

lbenet commented Jun 30, 2016

Nice! Does this work with multiple roots?

@codecov-io
Copy link

codecov-io commented Jun 30, 2016

Current coverage is 93.84%

Merging #156 into master will increase coverage by 0.49%

@@             master       #156   diff @@
==========================================
  Files            20         20          
  Lines           948        959    +11   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            885        900    +15   
+ Misses           63         59     -4   
  Partials          0          0          

Powered by Codecov. Last updated by 6b29087...7ab3101

@dpsanders
Copy link
Member Author

dpsanders commented Jun 30, 2016

Yes!:


julia> f(x) = (x-1) * (x^2 - 2)^3 * (x^3 - 2)^4
julia> newton(f, -5..5.1, maxlevel=100)
ValidatedNumerics.RootFinding.Root{Float64}(Interval(-1.4142135623730954, -1.414213562373095),:unknown)
 ValidatedNumerics.RootFinding.Root{Float64}(Interval(1.0, 1.0),:unique)
 ValidatedNumerics.RootFinding.Root{Float64}(Interval(1.259921049894873, 1.2599210498948734),:unknown)
 ValidatedNumerics.RootFinding.Root{Float64}(Interval(1.414213562373095, 1.4142135623730954),:unknown)

@coveralls
Copy link

coveralls commented Jun 30, 2016

Coverage Status

Coverage increased (+0.2%) to 93.548% when pulling e5e52fa on merge_newton_results into 6b29087 on master.

@coveralls
Copy link

coveralls commented Jun 30, 2016

Coverage Status

Coverage increased (+0.2%) to 93.548% when pulling e5e52fa on merge_newton_results into 6b29087 on master.

@lbenet
Copy link
Member

lbenet commented Jun 30, 2016

Very nice!!

@lbenet
Copy link
Member

lbenet commented Jun 30, 2016

I think you should merge this right away!

@coveralls
Copy link

coveralls commented Jul 2, 2016

Coverage Status

Coverage increased (+0.2%) to 93.535% when pulling e3fb739 on merge_newton_results into 6b29087 on master.

@coveralls
Copy link

coveralls commented Jul 2, 2016

Coverage Status

Coverage increased (+0.5%) to 93.848% when pulling 7ab3101 on merge_newton_results into 6b29087 on master.


# bisecting
roots = vcat(
krawczyk(f, f_prime, Interval(x.lo, m), level+1,
tolerance=tolerance, debug=debug, maxlevel=maxlevel),
krawczyk(f, f_prime, Interval(nextfloat(m), x.hi), level+1,
krawczyk(f, f_prime, Interval(m, x.hi), level+1,
Copy link
Member

Choose a reason for hiding this comment

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

I recall that we deliberately decided to use nextfloat(m) to make sure that the two intervals considered were somehow separated. (Same comment for newton.jl.) Can you explain the reason behind the change?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that the idea of adding nextfloat was a mistake. Conceptually, it is incorrect since it misses out the interval between the two floats (compare unums). From a practical point of view, the current version is better since it allows to check for a non-empty intersection to see if the two intervals are neighbours.

@dpsanders
Copy link
Member Author

Tests are failing on 0.5 due to some recent upstream breakage, apparently in base Julia.
We could merge anyway though?

@lbenet
Copy link
Member

lbenet commented Jul 2, 2016

Tests pass in 0.4, and the problems seem to me to be related to FixedSizeArrays and appear in tests related to IntervalBox. If you think it will take a long time to solve this, I agree to merge it.

@dpsanders
Copy link
Member Author

Since it's not clear how long that might take to fix, I'm going to merge.

@dpsanders dpsanders merged commit 1f3cd9c into master Jul 2, 2016
@dpsanders dpsanders deleted the merge_newton_results branch July 2, 2016 18:19
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