Skip to content

Commit

Permalink
Merge pull request #193 from ErikQQY/master
Browse files Browse the repository at this point in the history
Fix TrustRegion docstring
  • Loading branch information
ChrisRackauckas authored Jun 26, 2023
2 parents 0abdc34 + 8f43450 commit 691e10a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
6 changes: 4 additions & 2 deletions src/raphson.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ mutable struct NewtonRaphsonCache{iip, fType, algType, uType, duType, resType, p
stats::NLStats

function NewtonRaphsonCache{iip}(f::fType, alg::algType, u::uType, fu::resType,
p::pType, uf::ufType, linsolve::L, J::jType, du1::duType,
jac_config::JC, force_stop::Bool, maxiters::Int, internalnorm::INType,
p::pType, uf::ufType, linsolve::L, J::jType,
du1::duType,
jac_config::JC, force_stop::Bool, maxiters::Int,
internalnorm::INType,
retcode::SciMLBase.ReturnCode.T, abstol::tolType,
prob::probType,
stats::NLStats) where {
Expand Down
19 changes: 10 additions & 9 deletions src/trustRegion.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
EnumX.@enumx RadiusUpdateSchemes begin
Simple
Hei
Yuan
Bastin
Fan
end

"""
```julia
TrustRegion(; chunk_size = Val{0}(), autodiff = Val{true}(),
Expand Down Expand Up @@ -80,14 +88,6 @@ for large-scale and numerically-difficult nonlinear systems.
Currently, the linear solver and chunk size choice only applies to in-place defined
`NonlinearProblem`s. That is expected to change in the future.
"""
EnumX.@enumx RadiusUpdateSchemes begin
Simple
Hei
Yuan
Bastin
Fan
end

struct TrustRegion{CS, AD, FDT, L, P, ST, CJ, MTR} <:
AbstractNewtonAlgorithm{CS, AD, FDT, ST, CJ}
linsolve::L
Expand Down Expand Up @@ -197,7 +197,8 @@ mutable struct TrustRegionCache{iip, fType, algType, uType, resType, pType,
suType, su2Type, tmpType}
new{iip, fType, algType, uType, resType, pType,
INType, tolType, probType, ufType, L, jType, JC, floatType,
trustType, suType, su2Type, tmpType}(f, alg, u_prev, u, fu_prev, fu, p, uf, linsolve, J,
trustType, suType, su2Type, tmpType}(f, alg, u_prev, u, fu_prev, fu, p, uf,
linsolve, J,
jac_config, force_stop,
maxiters, internalnorm, retcode,
abstol, prob, radius_update_scheme,
Expand Down
6 changes: 3 additions & 3 deletions test/basictests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ end
g = function (p)
probN = NonlinearProblem{false}(f, csu0, p)
sol = solve(probN, TrustRegion(radius_update_scheme = RadiusUpdateSchemes.Bastin),
abstol = 1e-9)
abstol = 1e-9)
return sol.u[end]
end

Expand Down Expand Up @@ -358,7 +358,7 @@ end
g = function (p)
probN = NonlinearProblem{false}(f, oftype(p, u0), p)
sol = solve(probN, TrustRegion(radius_update_scheme = RadiusUpdateSchemes.Bastin),
abstol = 1e-10)
abstol = 1e-10)
return sol.u
end

Expand Down Expand Up @@ -516,7 +516,7 @@ f(u, p)
g = function (p)
probN = NonlinearProblem{false}(f, u0, p)
sol = solve(probN, TrustRegion(radius_update_scheme = RadiusUpdateSchemes.Bastin),
abstol = 1e-10)
abstol = 1e-10)
return sol.u
end
p = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
Expand Down

0 comments on commit 691e10a

Please sign in to comment.