From 086a26f1204fce5e358aef9e74b2e166a709696c Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Wed, 20 Sep 2023 23:22:12 -0400 Subject: [PATCH] Fix formatting --- src/jacobian.jl | 2 +- src/levenberg.jl | 2 +- src/raphson.jl | 4 ++-- src/trustRegion.jl | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/jacobian.jl b/src/jacobian.jl index 83d26fee6..01c030462 100644 --- a/src/jacobian.jl +++ b/src/jacobian.jl @@ -50,7 +50,7 @@ jacobian!!(::Number, cache) = last(value_derivative(cache.uf, cache.u)) # Build Jacobian Caches function jacobian_caches(alg::AbstractNonlinearSolveAlgorithm, f, u, p, ::Val{iip}; - linsolve_kwargs=(;)) where {iip} + linsolve_kwargs = (;)) where {iip} uf = JacobianWrapper{iip}(f, p) haslinsolve = hasfield(typeof(alg), :linsolve) diff --git a/src/levenberg.jl b/src/levenberg.jl index 17f61475f..7264c127f 100644 --- a/src/levenberg.jl +++ b/src/levenberg.jl @@ -142,7 +142,7 @@ isinplace(::LevenbergMarquardtCache{iip}) where {iip} = iip function SciMLBase.__init(prob::NonlinearProblem{uType, iip}, alg::LevenbergMarquardt, args...; alias_u0 = false, maxiters = 1000, abstol = 1e-6, internalnorm = DEFAULT_NORM, - linsolve_kwargs=(;), kwargs...) where {uType, iip} + linsolve_kwargs = (;), kwargs...) where {uType, iip} @unpack f, u0, p = prob u = alias_u0 ? u0 : deepcopy(u0) fu1 = evaluate_f(prob, u) diff --git a/src/raphson.jl b/src/raphson.jl index 8297f92fe..16fdad0c3 100644 --- a/src/raphson.jl +++ b/src/raphson.jl @@ -41,7 +41,7 @@ concrete_jac(::NewtonRaphson{CJ}) where {CJ} = CJ function NewtonRaphson(; concrete_jac = nothing, linsolve = nothing, linesearch = LineSearch(), precs = DEFAULT_PRECS, adkwargs...) ad = default_adargs_to_adtype(; adkwargs...) - linesearch = linesearch isa LineSearch ? linesearch : LineSearch(; method=linesearch) + linesearch = linesearch isa LineSearch ? linesearch : LineSearch(; method = linesearch) return NewtonRaphson{_unwrap_val(concrete_jac)}(ad, linsolve, precs, linesearch) end @@ -71,7 +71,7 @@ isinplace(::NewtonRaphsonCache{iip}) where {iip} = iip function SciMLBase.__init(prob::NonlinearProblem{uType, iip}, alg::NewtonRaphson, args...; alias_u0 = false, maxiters = 1000, abstol = 1e-6, internalnorm = DEFAULT_NORM, - linsolve_kwargs=(;), kwargs...) where {uType, iip} + linsolve_kwargs = (;), kwargs...) where {uType, iip} @unpack f, u0, p = prob u = alias_u0 ? u0 : deepcopy(u0) fu1 = evaluate_f(prob, u) diff --git a/src/trustRegion.jl b/src/trustRegion.jl index e0892a4da..20577ef67 100644 --- a/src/trustRegion.jl +++ b/src/trustRegion.jl @@ -202,7 +202,7 @@ end function SciMLBase.__init(prob::NonlinearProblem{uType, iip}, alg::TrustRegion, args...; alias_u0 = false, maxiters = 1000, abstol = 1e-8, internalnorm = DEFAULT_NORM, - linsolve_kwargs=(;), kwargs...) where {uType, iip} + linsolve_kwargs = (;), kwargs...) where {uType, iip} @unpack f, u0, p = prob u = alias_u0 ? u0 : deepcopy(u0) u_prev = zero(u) @@ -210,7 +210,8 @@ function SciMLBase.__init(prob::NonlinearProblem{uType, iip}, alg::TrustRegion, fu_prev = zero(fu1) loss = get_loss(fu1) - uf, linsolve, J, fu2, jac_cache, du = jacobian_caches(alg, f, u, p, Val(iip); linsolve_kwargs) + uf, linsolve, J, fu2, jac_cache, du = jacobian_caches(alg, f, u, p, Val(iip); + linsolve_kwargs) radius_update_scheme = alg.radius_update_scheme max_trust_radius = convert(eltype(u), alg.max_trust_radius)