Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 22bb58b

Browse files
committed
Extra cache in DFSane
1 parent 41545a5 commit 22bb58b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/nlsolve/dfsane.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SimpleDFSane, args...;
7878
# Generate the cache
7979
@bb d = copy(x)
8080
@bb xo = copy(x)
81-
@bb x_cache = copy(x)
8281
@bb δx = copy(x)
83-
@bb fxo = copy(fx)
8482
@bb δf = copy(fx)
8583

8684
k = 0
@@ -128,13 +126,13 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SimpleDFSane, args...;
128126

129127
# Update spectral parameter
130128
@bb @. δx = x - xo
131-
@bb @. δf = fx - fxo
129+
@bb @. δf = fx - δf
132130

133131
σ_k = dot(δx, δx) / dot(δx, δf)
134132

135133
# Take step
136134
@bb copyto!(xo, x)
137-
@bb copyto!(fxo, fx)
135+
@bb copyto!(δf, fx)
138136
fx_norm = fx_norm_new
139137

140138
# Store function value

0 commit comments

Comments
 (0)