Skip to content

Commit c137cb7

Browse files
committed
Dont Allocate
1 parent 19c79c9 commit c137cb7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/trustRegion.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,10 @@ function perform_step!(cache::TrustRegionCache{false})
394394
else
395395
# do not use A = cache.H, b = _vec(cache.g) since it is equivalent
396396
# to A = cache.J, b = _vec(fu) as long as the Jacobian is non-singular
397-
linres = dolinsolve(cache.alg.precs, cache.linsolve, A = cache.J, b = -_vec(fu),
397+
linres = dolinsolve(cache.alg.precs, cache.linsolve, A = cache.J, b = _vec(fu),
398398
linu = _vec(cache.u_gauss_newton), p = p, reltol = cache.abstol)
399399
cache.linsolve = linres.cache
400+
@. cache.u_gauss_newton *= -1
400401
end
401402
end
402403

0 commit comments

Comments
 (0)