Skip to content

Commit

Permalink
chore: run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 31, 2024
1 parent 8d40ab4 commit 21ffb22
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/NonlinearSolveBase/src/abstract_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,8 @@ macro internal_caches(cType, internal_cache_names...)
$(callbacks_self...)
return
end
function NonlinearSolveBase.InternalAPI.reinit!(cache::$(cType), args...; kwargs...)
function NonlinearSolveBase.InternalAPI.reinit!(
cache::$(cType), args...; kwargs...)
$(reinit_caches...)
$(InternalAPI.reinit_self!)(cache, args...; kwargs...)
return
Expand Down
1 change: 1 addition & 0 deletions lib/NonlinearSolveFirstOrder/src/gauss_newton.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions lib/NonlinearSolveFirstOrder/src/levenberg_marquardt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions lib/NonlinearSolveFirstOrder/src/pseudo_transient.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions lib/NonlinearSolveFirstOrder/src/raphson.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions lib/NonlinearSolveFirstOrder/src/trust_region.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using ArrayInterface: ArrayInterface
using CommonSolve: CommonSolve
using ConcreteStructs: @concrete
using DiffEqBase: DiffEqBase # Needed for `init` / `solve` dispatches
using LinearAlgebra: LinearAlgebra, Diagonal, dot, inv, diag
using LinearAlgebra: LinearAlgebra, Diagonal, dot, diag
using LinearSolve: LinearSolve # Trigger Linear Solve extension in NonlinearSolveBase
using MaybeInplace: @bb
using NonlinearSolveBase: NonlinearSolveBase, AbstractNonlinearSolveAlgorithm,
Expand Down
6 changes: 4 additions & 2 deletions lib/NonlinearSolveQuasiNewton/src/broyden.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,13 @@ function InternalAPI.solve!(
if cache.rule isa GoodBroydenUpdateRule
@bb @. J⁻¹_diag = J⁻¹_diag * cache.dfu * du
denom = sum(J⁻¹_diag)
@bb @. J⁻¹_diag = J⁻¹_diag + (du - J⁻¹_diag * cache.dfu) * du * J⁻¹_diag /
@bb @. J⁻¹_diag = J⁻¹_diag +
(du - J⁻¹_diag * cache.dfu) * du * J⁻¹_diag /
ifelse(iszero(denom), T(1e-5), denom)
else
denom = cache.internalnorm(cache.dfu)^2
@bb @. J⁻¹_diag = J⁻¹_diag + (du - J⁻¹_diag * cache.dfu) * cache.dfu /
@bb @. J⁻¹_diag = J⁻¹_diag +
(du - J⁻¹_diag * cache.dfu) * cache.dfu /
ifelse(iszero(denom), T(1e-5), denom)
end
@bb copyto!(cache.dfu, fu)
Expand Down
2 changes: 1 addition & 1 deletion lib/NonlinearSolveQuasiNewton/src/structure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function NonlinearSolveBase.get_full_jacobian(cache, ::DiagonalStructure, J)
end

function (::DiagonalStructure)(J::AbstractMatrix; alias::Bool = false)
@assert size(J, 1) == size(J, 2) "Diagonal Jacobian Structure must be square!"
@assert size(J, 1)==size(J, 2) "Diagonal Jacobian Structure must be square!"
return LinearAlgebra.diag(J)
end
(::DiagonalStructure)(J::AbstractVector; alias::Bool = false) = alias ? J : @bb(copy(J))
Expand Down
1 change: 0 additions & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ end
return fx_idx, idx
end


"""
pickchunksize(x) = pickchunksize(length(x))
pickchunksize(x::Int)
Expand Down

0 comments on commit 21ffb22

Please sign in to comment.