Skip to content

adding type to reserve! in most solvers #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bicgstabl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function bicgstabl!(x, A, b, l = 2;
history[:tol] = tol

# This doesn't yet make sense: the number of iters is smaller.
log && reserve!(history, :resnorm, max_mv_products)
log && reserve!(typeof(tol), history, :resnorm, max_mv_products)

# Actually perform CG
iterable = bicgstabl_iterator!(x, A, b, l; Pl = Pl, tol = tol, max_mv_products = max_mv_products, kwargs...)
Expand Down
2 changes: 1 addition & 1 deletion src/cg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function cg!(x, A, b;
)
history = ConvergenceHistory(partial = !log)
history[:tol] = tol
log && reserve!(history, :resnorm, maxiter + 1)
log && reserve!(typeof(tol), history, :resnorm, maxiter + 1)

# Actually perform CG
iterable = cg_iterator!(x, A, b, Pl; tol = tol, maxiter = maxiter, statevars = statevars, kwargs...)
Expand Down
2 changes: 1 addition & 1 deletion src/chebyshev.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function chebyshev!(x, A, b, λmin::Real, λmax::Real;
)
history = ConvergenceHistory(partial=!log)
history[:tol] = tol
reserve!(history, :resnorm, maxiter)
reserve!(typeof(tol), history, :resnorm, maxiter)

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

Expand Down
2 changes: 1 addition & 1 deletion src/gmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function gmres!(x, A, b;
)
history = ConvergenceHistory(partial = !log, restart = restart)
history[:tol] = tol
log && reserve!(history, :resnorm, maxiter)
log && reserve!(typeof(tol), history, :resnorm, maxiter)

iterable = gmres_iterable!(x, A, b; Pl = Pl, Pr = Pr, tol = tol, maxiter = maxiter, restart = restart, initially_zero = initially_zero)

Expand Down
2 changes: 1 addition & 1 deletion src/idrs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function idrs!(x, A, b;
)
history = ConvergenceHistory(partial=!log)
history[:tol] = tol
reserve!(history,:resnorm, maxiter)
reserve!(typeof(tol), history,:resnorm, maxiter)
idrs_method!(history, x, A, b, s, tol, maxiter; kwargs...)
log && shrink!(history)
log ? (x, history) : x
Expand Down
2 changes: 1 addition & 1 deletion src/minres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function minres!(x, A, b;
)
history = ConvergenceHistory(partial = !log)
history[:tol] = tol
log && reserve!(history, :resnorm, maxiter)
log && reserve!(typeof(tol), history, :resnorm, maxiter)

iterable = minres_iterable!(x, A, b;
skew_hermitian = skew_hermitian,
Expand Down
2 changes: 1 addition & 1 deletion src/qmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ function qmr!(x, A, b;
)
history = ConvergenceHistory(partial = !log)
history[:tol] = tol
log && reserve!(history, :resnorm, maxiter)
log && reserve!(typeof(tol), history, :resnorm, maxiter)

iterable = qmr_iterable!(x, A, b; tol = tol, maxiter = maxiter, initially_zero = initially_zero)

Expand Down
2 changes: 1 addition & 1 deletion src/simple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function powm!(B, x;
)
history = ConvergenceHistory(partial = !log)
history[:tol] = tol
reserve!(history, :resnorm, maxiter)
reserve!(typeof(tol), history, :resnorm, maxiter)
verbose && @printf("=== powm ===\n%4s\t%7s\n", "iter", "resnorm")

iterable = powm_iterable!(B, x, tol = tol, maxiter = maxiter)
Expand Down