Skip to content

Commit 691e10a

Browse files
Merge pull request #193 from ErikQQY/master
Fix TrustRegion docstring
2 parents 0abdc34 + 8f43450 commit 691e10a

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

src/raphson.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ mutable struct NewtonRaphsonCache{iip, fType, algType, uType, duType, resType, p
8585
stats::NLStats
8686

8787
function NewtonRaphsonCache{iip}(f::fType, alg::algType, u::uType, fu::resType,
88-
p::pType, uf::ufType, linsolve::L, J::jType, du1::duType,
89-
jac_config::JC, force_stop::Bool, maxiters::Int, internalnorm::INType,
88+
p::pType, uf::ufType, linsolve::L, J::jType,
89+
du1::duType,
90+
jac_config::JC, force_stop::Bool, maxiters::Int,
91+
internalnorm::INType,
9092
retcode::SciMLBase.ReturnCode.T, abstol::tolType,
9193
prob::probType,
9294
stats::NLStats) where {

src/trustRegion.jl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
EnumX.@enumx RadiusUpdateSchemes begin
2+
Simple
3+
Hei
4+
Yuan
5+
Bastin
6+
Fan
7+
end
8+
19
"""
210
```julia
311
TrustRegion(; chunk_size = Val{0}(), autodiff = Val{true}(),
@@ -80,14 +88,6 @@ for large-scale and numerically-difficult nonlinear systems.
8088
Currently, the linear solver and chunk size choice only applies to in-place defined
8189
`NonlinearProblem`s. That is expected to change in the future.
8290
"""
83-
EnumX.@enumx RadiusUpdateSchemes begin
84-
Simple
85-
Hei
86-
Yuan
87-
Bastin
88-
Fan
89-
end
90-
9191
struct TrustRegion{CS, AD, FDT, L, P, ST, CJ, MTR} <:
9292
AbstractNewtonAlgorithm{CS, AD, FDT, ST, CJ}
9393
linsolve::L
@@ -197,7 +197,8 @@ mutable struct TrustRegionCache{iip, fType, algType, uType, resType, pType,
197197
suType, su2Type, tmpType}
198198
new{iip, fType, algType, uType, resType, pType,
199199
INType, tolType, probType, ufType, L, jType, JC, floatType,
200-
trustType, suType, su2Type, tmpType}(f, alg, u_prev, u, fu_prev, fu, p, uf, linsolve, J,
200+
trustType, suType, su2Type, tmpType}(f, alg, u_prev, u, fu_prev, fu, p, uf,
201+
linsolve, J,
201202
jac_config, force_stop,
202203
maxiters, internalnorm, retcode,
203204
abstol, prob, radius_update_scheme,

test/basictests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ end
288288
g = function (p)
289289
probN = NonlinearProblem{false}(f, csu0, p)
290290
sol = solve(probN, TrustRegion(radius_update_scheme = RadiusUpdateSchemes.Bastin),
291-
abstol = 1e-9)
291+
abstol = 1e-9)
292292
return sol.u[end]
293293
end
294294

@@ -358,7 +358,7 @@ end
358358
g = function (p)
359359
probN = NonlinearProblem{false}(f, oftype(p, u0), p)
360360
sol = solve(probN, TrustRegion(radius_update_scheme = RadiusUpdateSchemes.Bastin),
361-
abstol = 1e-10)
361+
abstol = 1e-10)
362362
return sol.u
363363
end
364364

@@ -516,7 +516,7 @@ f(u, p)
516516
g = function (p)
517517
probN = NonlinearProblem{false}(f, u0, p)
518518
sol = solve(probN, TrustRegion(radius_update_scheme = RadiusUpdateSchemes.Bastin),
519-
abstol = 1e-10)
519+
abstol = 1e-10)
520520
return sol.u
521521
end
522522
p = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

0 commit comments

Comments
 (0)