Skip to content

Commit

Permalink
Merge pull request #359 from kylebeggs/master
Browse files Browse the repository at this point in the history
fix kwargs in idrs_iterable! call in idrs_method!
  • Loading branch information
mschauer committed Feb 14, 2024
2 parents 077214f + 6b08b1b commit e5d10e2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/idrs.jl
Expand Up @@ -120,7 +120,7 @@ function idrs_iterable!(log, X, A, C::T,
X_s = copy(X)
R_s = copy(R)
T_s = zero(R)
else
else
X_s = nothing
R_s = nothing
T_s = nothing
Expand Down Expand Up @@ -151,18 +151,19 @@ function idrs_method!(log::ConvergenceHistory, X, A, C::T,

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

iterable = idrs_iterable!(log, X, A, C, s, Pl, abstol, reltol, maxiter; smoothing, verbose)

iterable = idrs_iterable!(log, X, A, C, s, Pl, abstol, reltol, maxiter;
smoothing=smoothing, verbose=verbose)

normR = reduce((_,r) -> r, iterable; init=iterable.normR)

verbose && @printf("\n")
iterable.X
end

function iterate(it::IDRSIterable, (iter, step) = (1, 1))
X, A, s, Pl, R, X_s, R_s, T_s, Z, P, U, G, Q, V, M, f, c =
X, A, s, Pl, R, X_s, R_s, T_s, Z, P, U, G, Q, V, M, f, c =
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

if it.normR < it.tol || iter > it.maxiter
it.log !== nothing && setconv(it.log, 0 <= it.normR < it.tol)

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

if step in 1:s
if step == 1
if step == 1
for i in 1:s
f[i] = dot(P[i], R)
end
end
k = step
k = step

# Solve small system and make v orthogonal to P

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

2 comments on commit e5d10e2

@mschauer
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/100863

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.4 -m "<description of version>" e5d10e22552916e7dbd73d0a9ece02d873dee375
git push origin v0.9.4

Please sign in to comment.