@@ -120,7 +120,7 @@ function idrs_iterable!(log, X, A, C::T,
120
120
X_s = copy (X)
121
121
R_s = copy (R)
122
122
T_s = zero (R)
123
- else
123
+ else
124
124
X_s = nothing
125
125
R_s = nothing
126
126
T_s = nothing
@@ -151,18 +151,19 @@ function idrs_method!(log::ConvergenceHistory, X, A, C::T,
151
151
152
152
verbose && @printf (" === idrs ===\n %4s\t %4s\t %7s\n " , " iter" , " step" , " resnorm" )
153
153
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
+
156
157
normR = reduce ((_,r) -> r, iterable; init= iterable. normR)
157
158
158
159
verbose && @printf (" \n " )
159
160
iterable. X
160
161
end
161
162
162
163
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 =
164
165
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
+
166
167
if it. normR < it. tol || iter > it. maxiter
167
168
it. log != = nothing && setconv (it. log, 0 <= it. normR < it. tol)
168
169
@@ -173,12 +174,12 @@ function iterate(it::IDRSIterable, (iter, step) = (1, 1))
173
174
end
174
175
175
176
if step in 1 : s
176
- if step == 1
177
+ if step == 1
177
178
for i in 1 : s
178
179
f[i] = dot (P[i], R)
179
180
end
180
181
end
181
- k = step
182
+ k = step
182
183
183
184
# Solve small system and make v orthogonal to P
184
185
@@ -269,4 +270,3 @@ function iterate(it::IDRSIterable, (iter, step) = (1, 1))
269
270
it. verbose && @printf (" %3d\t %3d\t %1.2e\n " , iter, step, it. normR)
270
271
return it. normR, (iter + 1 , nextstep)
271
272
end
272
-
0 commit comments