Skip to content

Commit

Permalink
add solve for Order0, close #255 (#256)
Browse files Browse the repository at this point in the history
* add solve for Order0

* version bump
  • Loading branch information
jverzani authored Nov 3, 2021
1 parent 077277e commit c137aae
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Roots"
uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
version = "1.3.5"
version = "1.3.6"

[deps]
CommonSolve = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2"
Expand All @@ -10,7 +10,7 @@ Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
[compat]
CommonSolve = "0.1, 0.2"
Setfield = "0.7, 0.8"
SpecialFunctions = "0.8, 0.9, 0.10, 1.0"
SpecialFunctions = "0.8, 0.9, 0.10, 1"
julia = "1.0"

[extras]
Expand Down
5 changes: 5 additions & 0 deletions src/find_zero.jl
Original file line number Diff line number Diff line change
Expand Up @@ -971,5 +971,10 @@ function solve!(P::ZeroProblemIterator; verbose=false)
end

# thread verbose through
"""
solve(𝐙::ZeroProblem, args...; verbose=false, kwargs...)
Disptaches to `solve!(init(𝐙, args...; kwargs...))`. See [`solve!`](@ref) for details.
"""
CommonSolve.solve(F::ZeroProblem, args...; verbose=false, kwargs...) =
solve!(init(F, args...; verbose=verbose, kwargs...); verbose=verbose)
14 changes: 14 additions & 0 deletions src/order0.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ function find_zero(
return xstar
end

# give solve interface for Order0
# XXX should creat iterator object for hybrid, rather than call out to
# this version of find_zero...
function solve!(𝐙::ZeroProblemIterator{<:Order0}; verbose=false)
F = 𝐙.F
M = Order1()
N = AlefeldPotraShi()
state = 𝐙.state
options = 𝐙.options
find_zero(M,N,F,
𝐙.state, 𝐙.options, 𝐙.logger, verbose)
end


# Robust version using some tricks: idea from algorithm described in
# [The SOLVE button from the
# HP-34]C(http://www.hpl.hp.com/hpjournal/pdfs/IssuePDFs/1979-12.pdf).
Expand Down
1 change: 1 addition & 0 deletions test/test_find_zero.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ end

# iterator interface (ZeroProblem, solve; init, solve!)
meths = [
Order0(),
Order1(),
Roots.Order1B(),
Roots.King(),
Expand Down

2 comments on commit c137aae

@jverzani
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/48113

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.3.6 -m "<description of version>" c137aaeef50b9198ac3afb6f2dce8f44086c201b
git push origin v1.3.6

Please sign in to comment.