Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 8717ca6

Browse files
Merge pull request #71 from oscardssmith/caps-ITP
capitalize `ITP`
2 parents 491a632 + b26a921 commit 8717ca6

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SimpleNonlinearSolve"
22
uuid = "727e6d20-b764-4bd8-a329-72de5adea6c7"
33
authors = ["SciML"]
4-
version = "0.1.17"
4+
version = "0.1.18"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

src/SimpleNonlinearSolve.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ PrecompileTools.@compile_workload begin
6969
prob_brack = IntervalNonlinearProblem{false}((u, p) -> u * u - p,
7070
T.((0.0, 2.0)),
7171
T(2))
72-
for alg in (Bisection, Falsi, Ridder, Brent, Alefeld, Itp)
72+
for alg in (Bisection, Falsi, Ridder, Brent, Alefeld, ITP)
7373
solve(prob_brack, alg(), abstol = T(1e-2))
7474
end
7575
end
7676
end
7777

7878
# DiffEq styled algorithms
7979
export Bisection, Brent, Broyden, LBroyden, SimpleDFSane, Falsi, Halley, Klement,
80-
Ridder, SimpleNewtonRaphson, SimpleTrustRegion, Alefeld, Itp
80+
Ridder, SimpleNewtonRaphson, SimpleTrustRegion, Alefeld, ITP
8181
export BatchedBroyden, BatchedSimpleNewtonRaphson, BatchedSimpleDFSane
8282

8383
end # module

src/itp.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
```julia
3-
Itp(; k1::Real = 0.007, k2::Real = 1.5, n0::Int = 10)
3+
ITP(; k1::Real = 0.007, k2::Real = 1.5, n0::Int = 10)
44
```
55
66
ITP (Interpolate Truncate & Project)
@@ -39,11 +39,11 @@ n½ + `n₀` iterations, where n½ is the number of iterations using bisection
3939
If `f` is twice differentiable and the root is simple,
4040
then with `n₀` > 0 the convergence rate is √`κ₂`.
4141
"""
42-
struct Itp{T} <: AbstractBracketingAlgorithm
42+
struct ITP{T} <: AbstractBracketingAlgorithm
4343
k1::T
4444
k2::T
4545
n0::Int
46-
function Itp(; k1::Real = 0.007, k2::Real = 1.5, n0::Int = 10)
46+
function ITP(; k1::Real = 0.007, k2::Real = 1.5, n0::Int = 10)
4747
if k1 < 0
4848
error("Hyper-parameter κ₁ should not be negative")
4949
end
@@ -58,7 +58,7 @@ struct Itp{T} <: AbstractBracketingAlgorithm
5858
end
5959
end
6060

61-
function SciMLBase.solve(prob::IntervalNonlinearProblem, alg::Itp,
61+
function SciMLBase.solve(prob::IntervalNonlinearProblem, alg::ITP,
6262
args...; abstol = 1.0e-15,
6363
maxiters = 1000, kwargs...)
6464
f = Base.Fix2(prob.f, prob.p)

test/basictests.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ end
222222
# ITP
223223
g = function (p)
224224
probN = IntervalNonlinearProblem{false}(f, typeof(p).(tspan), p)
225-
sol = solve(probN, Itp())
225+
sol = solve(probN, ITP())
226226
return sol.u
227227
end
228228

@@ -258,7 +258,7 @@ end
258258
f, tspan = (u, p) -> p[1] * u * u - p[2], (1.0, 100.0)
259259
t = (p) -> [sqrt(p[2] / p[1])]
260260
p = [0.9, 50.0]
261-
for alg in [Bisection(), Falsi(), Ridder(), Brent(), Itp()]
261+
for alg in [Bisection(), Falsi(), Ridder(), Brent(), ITP()]
262262
global g, p
263263
g = function (p)
264264
probN = IntervalNonlinearProblem{false}(f, tspan, p)
@@ -361,16 +361,16 @@ probB = IntervalNonlinearProblem(f, tspan)
361361
sol = solve(probB, Alefeld())
362362
@test sol.u sqrt(2.0)
363363

364-
# Itp
365-
sol = solve(probB, Itp())
364+
# ITP
365+
sol = solve(probB, ITP())
366366
@test sol.u sqrt(2.0)
367367
tspan = (sqrt(2.0), 10.0)
368368
probB = IntervalNonlinearProblem(f, tspan)
369-
sol = solve(probB, Itp())
369+
sol = solve(probB, ITP())
370370
@test sol.u sqrt(2.0)
371371
tspan = (0.0, sqrt(2.0))
372372
probB = IntervalNonlinearProblem(f, tspan)
373-
sol = solve(probB, Itp())
373+
sol = solve(probB, ITP())
374374
@test sol.u sqrt(2.0)
375375

376376
# Garuntee Tests for Bisection

0 commit comments

Comments
 (0)