From a97d2cc6a20d7201cf0cf683bfc65d8ab1db92ec Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Wed, 1 Nov 2023 21:45:21 -0400 Subject: [PATCH] try fixing LM for banded jacobian --- src/levenberg.jl | 2 +- test/misc.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/levenberg.jl b/src/levenberg.jl index f181fcfcc..39cd7ca7e 100644 --- a/src/levenberg.jl +++ b/src/levenberg.jl @@ -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) diff --git a/test/misc.jl b/test/misc.jl index e00a8fb01..f976b49ae 100644 --- a/test/misc.jl +++ b/test/misc.jl @@ -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))