diff --git a/src/bicgstab.jl b/src/bicgstab.jl index 16a3ceae9..5e2c8f5f6 100644 --- a/src/bicgstab.jl +++ b/src/bicgstab.jl @@ -113,27 +113,6 @@ optargs_bicgstab = (:x0,) kwargs_bicgstab = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function bicgstab($(def_args_bicgstab...), $(def_optargs_bicgstab...); $(def_kwargs_bicgstab...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = BicgstabSolver(A, b) - warm_start!(solver, $(optargs_bicgstab...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - bicgstab!(solver, $(args_bicgstab...); $(kwargs_bicgstab...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - - function bicgstab($(def_args_bicgstab...); $(def_kwargs_bicgstab...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = BicgstabSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - bicgstab!(solver, $(args_bicgstab...); $(kwargs_bicgstab...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function bicgstab!(solver :: BicgstabSolver{T,FC,S}, $(def_args_bicgstab...); $(def_kwargs_bicgstab...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/bilq.jl b/src/bilq.jl index 5bda9802a..ab7580d43 100644 --- a/src/bilq.jl +++ b/src/bilq.jl @@ -106,27 +106,6 @@ optargs_bilq = (:x0,) kwargs_bilq = (:c, :transfer_to_bicg, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function bilq($(def_args_bilq...), $(def_optargs_bilq...); $(def_kwargs_bilq...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = BilqSolver(A, b) - warm_start!(solver, $(optargs_bilq...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - bilq!(solver, $(args_bilq...); $(kwargs_bilq...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - - function bilq($(def_args_bilq...); $(def_kwargs_bilq...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = BilqSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - bilq!(solver, $(args_bilq...); $(kwargs_bilq...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function bilq!(solver :: BilqSolver{T,FC,S}, $(def_args_bilq...); $(def_kwargs_bilq...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/bilqr.jl b/src/bilqr.jl index 1abc60bce..93667db9f 100644 --- a/src/bilqr.jl +++ b/src/bilqr.jl @@ -104,27 +104,6 @@ optargs_bilqr = (:x0, :y0) kwargs_bilqr = (:transfer_to_bicg, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function bilqr($(def_args_bilqr...), $(def_optargs_bilqr...); $(def_kwargs_bilqr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = BilqrSolver(A, b) - warm_start!(solver, $(optargs_bilqr...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - bilqr!(solver, $(args_bilqr...); $(kwargs_bilqr...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.y, solver.stats) - end - - function bilqr($(def_args_bilqr...); $(def_kwargs_bilqr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = BilqrSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - bilqr!(solver, $(args_bilqr...); $(kwargs_bilqr...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.y, solver.stats) - end - function bilqr!(solver :: BilqrSolver{T,FC,S}, $(def_args_bilqr...); $(def_kwargs_bilqr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/car.jl b/src/car.jl index 602b19978..9deda247a 100644 --- a/src/car.jl +++ b/src/car.jl @@ -95,27 +95,6 @@ optargs_car = (:x0,) kwargs_car = (:M, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function car($(def_args_car...), $(def_optargs_car...); $(def_kwargs_car...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CarSolver(A, b) - warm_start!(solver, $(optargs_car...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - car!(solver, $(args_car...); $(kwargs_car...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - - function car($(def_args_car...); $(def_kwargs_car...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CarSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - car!(solver, $(args_car...); $(kwargs_car...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function car!(solver :: CarSolver{T,FC,S}, $(def_args_car...); $(def_kwargs_car...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/cg.jl b/src/cg.jl index 50517e427..3b21ae197 100644 --- a/src/cg.jl +++ b/src/cg.jl @@ -105,27 +105,6 @@ optargs_cg = (:x0,) kwargs_cg = (:M, :ldiv, :radius, :linesearch, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function cg($(def_args_cg...), $(def_optargs_cg...); $(def_kwargs_cg...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CgSolver(A, b) - warm_start!(solver, $(optargs_cg...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - cg!(solver, $(args_cg...); $(kwargs_cg...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - - function cg($(def_args_cg...); $(def_kwargs_cg...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CgSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - cg!(solver, $(args_cg...); $(kwargs_cg...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function cg!(solver :: CgSolver{T,FC,S}, $(def_args_cg...); $(def_kwargs_cg...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/cg_lanczos.jl b/src/cg_lanczos.jl index 778a73d6f..c86053826 100644 --- a/src/cg_lanczos.jl +++ b/src/cg_lanczos.jl @@ -101,27 +101,6 @@ optargs_cg_lanczos = (:x0,) kwargs_cg_lanczos = (:M, :ldiv, :check_curvature, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function cg_lanczos($(def_args_cg_lanczos...), $(def_optargs_cg_lanczos...); $(def_kwargs_cg_lanczos...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CgLanczosSolver(A, b) - warm_start!(solver, $(optargs_cg_lanczos...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - cg_lanczos!(solver, $(args_cg_lanczos...); $(kwargs_cg_lanczos...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - - function cg_lanczos($(def_args_cg_lanczos...); $(def_kwargs_cg_lanczos...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CgLanczosSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - cg_lanczos!(solver, $(args_cg_lanczos...); $(kwargs_cg_lanczos...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function cg_lanczos!(solver :: CgLanczosSolver{T,FC,S}, $(def_args_cg_lanczos...); $(def_kwargs_cg_lanczos...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/cgls.jl b/src/cgls.jl index c9355e52d..3e3034aa1 100644 --- a/src/cgls.jl +++ b/src/cgls.jl @@ -117,16 +117,6 @@ args_cgls = (:A, :b) kwargs_cgls = (:M, :ldiv, :radius, :λ, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function cgls($(def_args_cgls...); $(def_kwargs_cgls...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CglsSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - cgls!(solver, $(args_cgls...); $(kwargs_cgls...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function cgls!(solver :: CglsSolver{T,FC,S}, $(def_args_cgls...); $(def_kwargs_cgls...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/cgne.jl b/src/cgne.jl index 8a4e6dddb..d3589051b 100644 --- a/src/cgne.jl +++ b/src/cgne.jl @@ -122,16 +122,6 @@ args_cgne = (:A, :b) kwargs_cgne = (:N, :ldiv, :λ, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function cgne($(def_args_cgne...); $(def_kwargs_cgne...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CgneSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - cgne!(solver, $(args_cgne...); $(kwargs_cgne...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function cgne!(solver :: CgneSolver{T,FC,S}, $(def_args_cgne...); $(def_kwargs_cgne...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/cgs.jl b/src/cgs.jl index e95e74d17..f083f4dd7 100644 --- a/src/cgs.jl +++ b/src/cgs.jl @@ -114,27 +114,6 @@ optargs_cgs = (:x0,) kwargs_cgs = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function cgs($(def_args_cgs...), $(def_optargs_cgs...); $(def_kwargs_cgs...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CgsSolver(A, b) - warm_start!(solver, $(optargs_cgs...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - cgs!(solver, $(args_cgs...); $(kwargs_cgs...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - - function cgs($(def_args_cgs...); $(def_kwargs_cgs...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CgsSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - cgs!(solver, $(args_cgs...); $(kwargs_cgs...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function cgs!(solver :: CgsSolver{T,FC,S}, $(def_args_cgs...); $(def_kwargs_cgs...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/cr.jl b/src/cr.jl index d816ce480..2a5f9527a 100644 --- a/src/cr.jl +++ b/src/cr.jl @@ -112,27 +112,6 @@ optargs_cr = (:x0,) kwargs_cr = (:M, :ldiv, :radius, :linesearch, :γ, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function cr($(def_args_cr...), $(def_optargs_cr...); $(def_kwargs_cr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CrSolver(A, b) - warm_start!(solver, $(optargs_cr...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - cr!(solver, $(args_cr...); $(kwargs_cr...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - - function cr($(def_args_cr...); $(def_kwargs_cr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CrSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - cr!(solver, $(args_cr...); $(kwargs_cr...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function cr!(solver :: CrSolver{T,FC,S}, $(def_args_cr...); $(def_kwargs_cr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/craig.jl b/src/craig.jl index c4eef10d4..41f2d087d 100644 --- a/src/craig.jl +++ b/src/craig.jl @@ -162,16 +162,6 @@ args_craig = (:A, :b) kwargs_craig = (:M, :N, :ldiv, :transfer_to_lsqr, :sqd, :λ, :btol, :conlim, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function craig($(def_args_craig...); $(def_kwargs_craig...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CraigSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - craig!(solver, $(args_craig...); $(kwargs_craig...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.y, solver.stats) - end - function craig!(solver :: CraigSolver{T,FC,S}, $(def_args_craig...); $(def_kwargs_craig...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/craigmr.jl b/src/craigmr.jl index 5f05aa2ae..1472b897a 100644 --- a/src/craigmr.jl +++ b/src/craigmr.jl @@ -149,16 +149,6 @@ args_craigmr = (:A, :b) kwargs_craigmr = (:M, :N, :ldiv, :sqd, :λ, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function craigmr($(def_args_craigmr...); $(def_kwargs_craigmr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CraigmrSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - craigmr!(solver, $(args_craigmr...); $(kwargs_craigmr...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.y, solver.stats) - end - function craigmr!(solver :: CraigmrSolver{T,FC,S}, $(def_args_craigmr...); $(def_kwargs_craigmr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/crls.jl b/src/crls.jl index 40cca6f2e..62d1d11d4 100644 --- a/src/crls.jl +++ b/src/crls.jl @@ -108,16 +108,6 @@ args_crls = (:A, :b) kwargs_crls = (:M, :ldiv, :radius, :λ, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function crls($(def_args_crls...); $(def_kwargs_crls...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CrlsSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - crls!(solver, $(args_crls...); $(kwargs_crls...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function crls!(solver :: CrlsSolver{T,FC,S}, $(def_args_crls...); $(def_kwargs_crls...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/crmr.jl b/src/crmr.jl index db333856c..34bb9dd4d 100644 --- a/src/crmr.jl +++ b/src/crmr.jl @@ -120,16 +120,6 @@ args_crmr = (:A, :b) kwargs_crmr = (:N, :ldiv, :λ, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function crmr($(def_args_crmr...); $(def_kwargs_crmr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = CrmrSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - crmr!(solver, $(args_crmr...); $(kwargs_crmr...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function crmr!(solver :: CrmrSolver{T,FC,S}, $(def_args_crmr...); $(def_kwargs_crmr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/krylov_solve.jl b/src/krylov_solve.jl index 2ee587e16..c95a3705e 100644 --- a/src/krylov_solve.jl +++ b/src/krylov_solve.jl @@ -43,31 +43,38 @@ for (KS, fun, fun2, args, def_args, optargs, def_optargs, kwargs, def_kwargs) in (:FomSolver , :fom! , :fom , args_fom , def_args_fom , optargs_fom , def_optargs_fom , kwargs_fom , def_kwargs_fom ) (:GpmrSolver , :gpmr! , :gpmr , args_gpmr , def_args_gpmr , optargs_gpmr , def_optargs_gpmr , kwargs_gpmr , def_kwargs_gpmr ) ] - @eval begin - ## Out-of-place - # function $(fun2)($(def_args...); $(def_kwargs...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - # start_time = time_ns() - # solver = $KS($(args...)) - # elapsed_time = ktimer(start_time) - # timemax -= elapsed_time - # $(fun)(solver, $(args...); $(kwargs...)) - # solver.stats.timer += elapsed_time - # return ((solution(solver),)..., solver.stats) - # end + # window :: 5 -> lslq, lsmr, lsqr, minres, symmlq + # shifts -> CgLanczosShiftSolver(A, b, nshifts) + # memory :: 20 -> diom, dqgmres, fom, gmres, fgmres, gpmr + if fun2 ∉ (:lslq, :lsmr, :lsqr, :minres, :symmlq, :cg_lanczos_shift, :diom, :dqgmres, :fom, :gmres, :fgmres, :gpmr) + @eval begin + ## Out-of-place + function $(fun2)($(def_args...); $(def_kwargs...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} + start_time = time_ns() + solver = $KS(A, b) + elapsed_time = ktimer(start_time) + timemax -= elapsed_time + $(fun)(solver, $(args...); $(kwargs...)) + solver.stats.timer += elapsed_time + return ((solution(solver),)..., solver.stats) + end - # if !isempty($optargs) - # function $(fun2)($(def_args...), $(def_optargs...); $(def_kwargs...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - # start_time = time_ns() - # solver = $KS($(args...)) - # warm_start!(solver, $(optargs...)) - # elapsed_time = ktimer(start_time) - # timemax -= elapsed_time - # $(fun)(solver, $(args...); $(kwargs...)) - # solver.stats.timer += elapsed_time - # return ((solution(solver),)..., solver.stats) - # end - # end + if !isempty($optargs) + function $(fun2)($(def_args...), $(def_optargs...); $(def_kwargs...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} + start_time = time_ns() + solver = $KS(A, b) + warm_start!(solver, $(optargs...)) + elapsed_time = ktimer(start_time) + timemax -= elapsed_time + $(fun)(solver, $(args...); $(kwargs...)) + solver.stats.timer += elapsed_time + return ((solution(solver),)..., solver.stats) + end + end + end + end + @eval begin ## In-place solve!(solver :: $KS{T,FC,S}, $(def_args...); $(def_kwargs...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} = $(fun)(solver, $(args...); $(kwargs...)) @@ -95,7 +102,7 @@ for (KS, fun, fun2, args, def_args, optargs, def_optargs, kwargs, def_kwargs) in ## Out-of-place function $(fun2)($(def_args...); memory :: Int=20, $(def_kwargs...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} start_time = time_ns() - solver = $KS($(args...)) + solver = $KS(A, B, memory) elapsed_time = ktimer(start_time) timemax -= elapsed_time $(fun)(solver, $(args...); $(kwargs...)) @@ -106,7 +113,7 @@ for (KS, fun, fun2, args, def_args, optargs, def_optargs, kwargs, def_kwargs) in if !isempty($optargs) function $(fun2)($(def_args...), $(def_optargs...); memory :: Int=20, $(def_kwargs...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} start_time = time_ns() - solver = $KS($(args...)) + solver = $KS(A, B, memory) warm_start!(solver, $(optargs...)) elapsed_time = ktimer(start_time) timemax -= elapsed_time diff --git a/src/minares.jl b/src/minares.jl index 19d1be972..5da0b5251 100644 --- a/src/minares.jl +++ b/src/minares.jl @@ -100,27 +100,6 @@ optargs_minares = (:x0,) kwargs_minares = (:M, :ldiv, :λ, :atol, :rtol, :Artol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function minares($(def_args_minares...), $(def_optargs_minares...); $(def_kwargs_minares...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = MinaresSolver(A, b) - warm_start!(solver, $(optargs_minares...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - minares!(solver, $(args_minares...); $(kwargs_minares...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - - function minares($(def_args_minares...); $(def_kwargs_minares...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = MinaresSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - minares!(solver, $(args_minares...); $(kwargs_minares...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function minares!(solver :: MinaresSolver{T,FC,S}, $(def_args_minares...); $(def_kwargs_minares...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/minres_qlp.jl b/src/minres_qlp.jl index 9cb569f6a..6f5f79f70 100644 --- a/src/minres_qlp.jl +++ b/src/minres_qlp.jl @@ -109,27 +109,6 @@ optargs_minres_qlp = (:x0,) kwargs_minres_qlp = (:M, :ldiv, :λ, :atol, :rtol, :Artol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function minres_qlp($(def_args_minres_qlp...), $(def_optargs_minres_qlp...); $(def_kwargs_minres_qlp...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = MinresQlpSolver(A, b) - warm_start!(solver, $(optargs_minres_qlp...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - minres_qlp!(solver, $(args_minres_qlp...); $(kwargs_minres_qlp...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - - function minres_qlp($(def_args_minres_qlp...); $(def_kwargs_minres_qlp...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = MinresQlpSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - minres_qlp!(solver, $(args_minres_qlp...); $(kwargs_minres_qlp...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function minres_qlp!(solver :: MinresQlpSolver{T,FC,S}, $(def_args_minres_qlp...); $(def_kwargs_minres_qlp...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/qmr.jl b/src/qmr.jl index 2a1ad578c..66517f7e3 100644 --- a/src/qmr.jl +++ b/src/qmr.jl @@ -112,27 +112,6 @@ optargs_qmr = (:x0,) kwargs_qmr = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function qmr($(def_args_qmr...), $(def_optargs_qmr...); $(def_kwargs_qmr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = QmrSolver(A, b) - warm_start!(solver, $(optargs_qmr...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - qmr!(solver, $(args_qmr...); $(kwargs_qmr...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - - function qmr($(def_args_qmr...); $(def_kwargs_qmr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = QmrSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - qmr!(solver, $(args_qmr...); $(kwargs_qmr...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function qmr!(solver :: QmrSolver{T,FC,S}, $(def_args_qmr...); $(def_kwargs_qmr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/tricg.jl b/src/tricg.jl index 99d714bdd..93b475623 100644 --- a/src/tricg.jl +++ b/src/tricg.jl @@ -134,27 +134,6 @@ optargs_tricg = (:x0, :y0) kwargs_tricg = (:M, :N, :ldiv, :spd, :snd, :flip, :τ, :ν, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function tricg($(def_args_tricg...), $(def_optargs_tricg...); $(def_kwargs_tricg...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = TricgSolver(A, b) - warm_start!(solver, $(optargs_tricg...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - tricg!(solver, $(args_tricg...); $(kwargs_tricg...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.y, solver.stats) - end - - function tricg($(def_args_tricg...); $(def_kwargs_tricg...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = TricgSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - tricg!(solver, $(args_tricg...); $(kwargs_tricg...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.y, solver.stats) - end - function tricg!(solver :: TricgSolver{T,FC,S}, $(def_args_tricg...); $(def_kwargs_tricg...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/trilqr.jl b/src/trilqr.jl index 042db2604..472234def 100644 --- a/src/trilqr.jl +++ b/src/trilqr.jl @@ -103,27 +103,6 @@ optargs_trilqr = (:x0, :y0) kwargs_trilqr = (:transfer_to_usymcg, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function trilqr($(def_args_trilqr...), $(def_optargs_trilqr...); $(def_kwargs_trilqr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = TrilqrSolver(A, b) - warm_start!(solver, $(optargs_trilqr...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - trilqr!(solver, $(args_trilqr...); $(kwargs_trilqr...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.y, solver.stats) - end - - function trilqr($(def_args_trilqr...); $(def_kwargs_trilqr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = TrilqrSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - trilqr!(solver, $(args_trilqr...); $(kwargs_trilqr...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.y, solver.stats) - end - function trilqr!(solver :: TrilqrSolver{T,FC,S}, $(def_args_trilqr...); $(def_kwargs_trilqr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/trimr.jl b/src/trimr.jl index 780265e4a..e30e2cb01 100644 --- a/src/trimr.jl +++ b/src/trimr.jl @@ -135,27 +135,6 @@ optargs_trimr = (:x0, :y0) kwargs_trimr = (:M, :N, :ldiv, :spd, :snd, :flip, :sp, :τ, :ν, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function trimr($(def_args_trimr...), $(def_optargs_trimr...); $(def_kwargs_trimr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = TrimrSolver(A, b) - warm_start!(solver, $(optargs_trimr...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - trimr!(solver, $(args_trimr...); $(kwargs_trimr...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.y, solver.stats) - end - - function trimr($(def_args_trimr...); $(def_kwargs_trimr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = TrimrSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - trimr!(solver, $(args_trimr...); $(kwargs_trimr...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.y, solver.stats) - end - function trimr!(solver :: TrimrSolver{T,FC,S}, $(def_args_trimr...); $(def_kwargs_trimr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/usymlq.jl b/src/usymlq.jl index 73d6c7114..711e60938 100644 --- a/src/usymlq.jl +++ b/src/usymlq.jl @@ -112,27 +112,6 @@ optargs_usymlq = (:x0,) kwargs_usymlq = (:transfer_to_usymcg, :atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function usymlq($(def_args_usymlq...), $(def_optargs_usymlq...); $(def_kwargs_usymlq...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = UsymlqSolver(A, b) - warm_start!(solver, $(optargs_usymlq...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - usymlq!(solver, $(args_usymlq...); $(kwargs_usymlq...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - - function usymlq($(def_args_usymlq...); $(def_kwargs_usymlq...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = UsymlqSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - usymlq!(solver, $(args_usymlq...); $(kwargs_usymlq...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function usymlq!(solver :: UsymlqSolver{T,FC,S}, $(def_args_usymlq...); $(def_kwargs_usymlq...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer diff --git a/src/usymqr.jl b/src/usymqr.jl index de69ffea0..3c81ba444 100644 --- a/src/usymqr.jl +++ b/src/usymqr.jl @@ -115,27 +115,6 @@ optargs_usymqr = (:x0,) kwargs_usymqr = (:atol, :rtol, :itmax, :timemax, :verbose, :history, :callback, :iostream) @eval begin - function usymqr($(def_args_usymqr...), $(def_optargs_usymqr...); $(def_kwargs_usymqr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = UsymqrSolver(A, b) - warm_start!(solver, $(optargs_usymqr...)) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - usymqr!(solver, $(args_usymqr...); $(kwargs_usymqr...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - - function usymqr($(def_args_usymqr...); $(def_kwargs_usymqr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}} - start_time = time_ns() - solver = UsymqrSolver(A, b) - elapsed_time = ktimer(start_time) - timemax -= elapsed_time - usymqr!(solver, $(args_usymqr...); $(kwargs_usymqr...)) - solver.stats.timer += elapsed_time - return (solver.x, solver.stats) - end - function usymqr!(solver :: UsymqrSolver{T,FC,S}, $(def_args_usymqr...); $(def_kwargs_usymqr...)) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}} # Timer