Skip to content

Commit e5d10e2

Browse files
authored
Merge pull request #359 from kylebeggs/master
fix kwargs in idrs_iterable! call in idrs_method!
2 parents 077214f + 6b08b1b commit e5d10e2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/idrs.jl

+8-8
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function idrs_iterable!(log, X, A, C::T,
120120
X_s = copy(X)
121121
R_s = copy(R)
122122
T_s = zero(R)
123-
else
123+
else
124124
X_s = nothing
125125
R_s = nothing
126126
T_s = nothing
@@ -151,18 +151,19 @@ function idrs_method!(log::ConvergenceHistory, X, A, C::T,
151151

152152
verbose && @printf("=== idrs ===\n%4s\t%4s\t%7s\n", "iter", "step", "resnorm")
153153

154-
iterable = idrs_iterable!(log, X, A, C, s, Pl, abstol, reltol, maxiter; smoothing, verbose)
155-
154+
iterable = idrs_iterable!(log, X, A, C, s, Pl, abstol, reltol, maxiter;
155+
smoothing=smoothing, verbose=verbose)
156+
156157
normR = reduce((_,r) -> r, iterable; init=iterable.normR)
157158

158159
verbose && @printf("\n")
159160
iterable.X
160161
end
161162

162163
function iterate(it::IDRSIterable, (iter, step) = (1, 1))
163-
X, A, s, Pl, R, X_s, R_s, T_s, Z, P, U, G, Q, V, M, f, c =
164+
X, A, s, Pl, R, X_s, R_s, T_s, Z, P, U, G, Q, V, M, f, c =
164165
it.X, it.A, it.s, it.Pl, it.R, it.X_s, it.R_s, it.T_s, it.Z, it.P, it.U, it.G, it.Q, it.V, it.M, it.f, it.c
165-
166+
166167
if it.normR < it.tol || iter > it.maxiter
167168
it.log !== nothing && setconv(it.log, 0 <= it.normR < it.tol)
168169

@@ -173,12 +174,12 @@ function iterate(it::IDRSIterable, (iter, step) = (1, 1))
173174
end
174175

175176
if step in 1:s
176-
if step == 1
177+
if step == 1
177178
for i in 1:s
178179
f[i] = dot(P[i], R)
179180
end
180181
end
181-
k = step
182+
k = step
182183

183184
# Solve small system and make v orthogonal to P
184185

@@ -269,4 +270,3 @@ function iterate(it::IDRSIterable, (iter, step) = (1, 1))
269270
it.verbose && @printf("%3d\t%3d\t%1.2e\n", iter, step, it.normR)
270271
return it.normR, (iter + 1, nextstep)
271272
end
272-

0 commit comments

Comments
 (0)