From 8d19dcd2356056c1c1609057b845c54b14b1a1a2 Mon Sep 17 00:00:00 2001 From: AHsu98 <34590951+AHsu98@users.noreply.github.com> Date: Mon, 17 Jul 2023 11:57:34 -0700 Subject: [PATCH] Bug fix in PG alg for options and iteration count #109 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed tolerance ϵ to ϵa for absolute tolerance, as is already used in DescentOptions Fixed bug where the code incremeents k twice in each step --- src/PG_alg.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/PG_alg.jl b/src/PG_alg.jl index 7813f825..6c66212e 100644 --- a/src/PG_alg.jl +++ b/src/PG_alg.jl @@ -48,7 +48,7 @@ function PG( ) where {F <: Function, G <: Function, H} start_time = time() elapsed_time = 0.0 - ϵ = options.ϵ + ϵ = options.ϵa maxIter = options.maxIter maxTime = options.maxTime ν = options.ν @@ -90,7 +90,6 @@ function PG( end while !(optimal || tired) - k = k + 1 elapsed_time = time() - start_time Fobj_hist[k] = fk Hobj_hist[k] = hk