Skip to content

Commit

Permalink
try fixing LM for banded jacobian
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Nov 2, 2023
1 parent b07360f commit a97d2cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/levenberg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ function perform_step!(cache::LevenbergMarquardtCache{false, fastls}) where {fas

# Usual Levenberg-Marquardt step ("velocity").
if fastls
cache.mat_tmp = vcat(J, λ .* cache.DᵀD)
cache.mat_tmp = _vcat(J, λ .* cache.DᵀD)
cache.rhs_tmp[1:length(fu1)] .= -_vec(fu1)
linres = dolinsolve(alg.precs, linsolve; A = cache.mat_tmp,
b = cache.rhs_tmp, linu = _vec(cache.v), p = p, reltol = cache.abstol)
Expand Down
2 changes: 1 addition & 1 deletion test/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ using BandedMatrices, LinearAlgebra, NonlinearSolve, SparseArrays, Test
b = BandedMatrix(Ones(5, 5), (1, 1))
d = Diagonal(ones(5, 5))

@test NonlinearSolve._vcat(b, d) == vcat(sparse(b), d)
@test NonlinearSolve._vcat(b, d) == zero.(vcat(sparse(b), d))

0 comments on commit a97d2cc

Please sign in to comment.