@@ -108,7 +108,7 @@ function SciMLBase.__init(prob::NonlinearLeastSquaresProblem{uType, iip}, alg_::
108
108
return GaussNewtonCache {iip} (f, alg, u, u_cache, fu, fu_cache, du, dfu, p, uf,
109
109
linsolve, J, JᵀJ, Jᵀf, jac_cache, false , maxiters, internalnorm, ReturnCode. Default,
110
110
abstol, reltol, prob, NLStats (1 , 0 , 0 , 0 , 0 ), tc_cache_1, tc_cache_2,
111
- init_linesearch_cache (alg. linesearch, f, u, p, fu1 , Val (iip)), trace)
111
+ init_linesearch_cache (alg. linesearch, f, u, p, fu , Val (iip)), trace)
112
112
end
113
113
114
114
function perform_step! (cache:: GaussNewtonCache{iip} ) where {iip}
@@ -117,14 +117,14 @@ function perform_step!(cache::GaussNewtonCache{iip}) where {iip}
117
117
# Use normal form to solve the Linear Problem
118
118
if cache. JᵀJ != = nothing
119
119
__update_JᵀJ! (Val {iip} (), cache, :JᵀJ , cache. J)
120
- __update_Jᵀf! (Val {iip} (), cache, :Jᵀf , :JᵀJ , cache. J, cache. fu1 )
120
+ __update_Jᵀf! (Val {iip} (), cache, :Jᵀf , :JᵀJ , cache. J, cache. fu )
121
121
A, b = __maybe_symmetric (cache. JᵀJ), _vec (cache. Jᵀf)
122
122
else
123
123
A, b = cache. J, _vec (cache. fu)
124
124
end
125
125
126
- linres = dolinsolve (alg. precs, linsolve; A, b, linu = _vec (du), cache. p ,
127
- reltol = cache. abstol)
126
+ linres = dolinsolve (cache . alg. precs, cache . linsolve; A, b, linu = _vec (cache. du) ,
127
+ cache . p, reltol = cache. abstol)
128
128
cache. linsolve = linres. cache
129
129
cache. du = _restructure (cache. du, linres. u)
130
130
@@ -136,7 +136,7 @@ function perform_step!(cache::GaussNewtonCache{iip}) where {iip}
136
136
check_and_update! (cache. tc_cache_1, cache, cache. fu, cache. u, cache. u_cache)
137
137
if ! cache. force_stop
138
138
@bb @. cache. dfu = cache. fu .- cache. dfu
139
- check_and_update! (cache. tc_cache_2, cache, cache. dfu, cache. u, cache. u_prev )
139
+ check_and_update! (cache. tc_cache_2, cache, cache. dfu, cache. u, cache. u_cache )
140
140
end
141
141
142
142
@bb copyto! (cache. u_cache, cache. u)
0 commit comments