@@ -260,7 +260,7 @@ function perform_step!(cache::LevenbergMarquardtCache{true, fastls}) where {fast
260
260
# Usual Levenberg-Marquardt step ("velocity").
261
261
# The following lines do: cache.v = -cache.mat_tmp \ cache.u_tmp
262
262
if fastls
263
- cache. mat_tmp[1 : length (fu1), :] . = cache. J
263
+ copyto! ( @view ( cache. mat_tmp[1 : length (fu1), :]), cache. J)
264
264
cache. mat_tmp[(length (fu1) + 1 ): end , :] .= λ .* cache. DᵀD
265
265
cache. rhs_tmp[1 : length (fu1)] .= _vec (fu1)
266
266
linres = dolinsolve (alg. precs, linsolve; A = cache. mat_tmp,
@@ -299,8 +299,8 @@ function perform_step!(cache::LevenbergMarquardtCache{true, fastls}) where {fast
299
299
cache. stats. nfactors += 2
300
300
301
301
# Require acceptable steps to satisfy the following condition.
302
- norm_v = norm (v)
303
- if 2 * norm (cache. a) ≤ α_geodesic * norm_v
302
+ norm_v = cache . internalnorm (v)
303
+ if 2 * cache . internalnorm (cache. a) ≤ α_geodesic * norm_v
304
304
_vec (cache. δ) .= _vec (v) .+ _vec (cache. a) ./ 2
305
305
@unpack δ, loss_old, norm_v_old, v_old, b_uphill = cache
306
306
f (cache. fu_tmp, u .+ δ, p)
@@ -356,7 +356,7 @@ function perform_step!(cache::LevenbergMarquardtCache{false, fastls}) where {fas
356
356
357
357
# Usual Levenberg-Marquardt step ("velocity").
358
358
if fastls
359
- cache. mat_tmp = vcat (J, λ .* cache. DᵀD)
359
+ cache. mat_tmp = _vcat (J, λ .* cache. DᵀD)
360
360
cache. rhs_tmp[1 : length (fu1)] .= - _vec (fu1)
361
361
linres = dolinsolve (alg. precs, linsolve; A = cache. mat_tmp,
362
362
b = cache. rhs_tmp, linu = _vec (cache. v), p = p, reltol = cache. abstol)
@@ -392,8 +392,8 @@ function perform_step!(cache::LevenbergMarquardtCache{false, fastls}) where {fas
392
392
cache. stats. nfactors += 1
393
393
394
394
# Require acceptable steps to satisfy the following condition.
395
- norm_v = norm (v)
396
- if 2 * norm (cache. a) ≤ α_geodesic * norm_v
395
+ norm_v = cache . internalnorm (v)
396
+ if 2 * cache . internalnorm (cache. a) ≤ α_geodesic * norm_v
397
397
cache. δ = _restructure (cache. δ, _vec (v) .+ _vec (cache. a) ./ 2 )
398
398
@unpack δ, loss_old, norm_v_old, v_old, b_uphill = cache
399
399
fu_new = f (u .+ δ, p)
0 commit comments