diff --git a/Project.toml b/Project.toml index 580dfca..118f07f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "DiffPrecTest" uuid = "bb4bfe13-bfd7-5c6f-a2d2-8072376c6806" authors = ["Mladen Kolar "] -version = "0.2.1" +version = "0.2.2" [deps] CoordinateDescent = "c00ed354-b9be-54b8-8a23-c5ac771bc43a" diff --git a/src/invHessianEstimationASym.jl b/src/invHessianEstimationASym.jl index 74a9bd5..1a59943 100644 --- a/src/invHessianEstimationASym.jl +++ b/src/invHessianEstimationASym.jl @@ -93,6 +93,10 @@ function CoordinateDescent.descendCoordinate!( newVal = cdprox!(g, x, j, a) h = newVal - oldVal + # nothing to update when the coordinate did not move, as for most + # coordinates that stay at zero in a full pass + iszero(h) && return h + # update internals for ac=1:p, ar=1:p @inbounds A[ar, ac] += h * Σx[ar, ri] * Σy[ci, ac] diff --git a/src/invHessianEstimationSymReduced.jl b/src/invHessianEstimationSymReduced.jl index aba500f..2683a43 100644 --- a/src/invHessianEstimationSymReduced.jl +++ b/src/invHessianEstimationSymReduced.jl @@ -123,6 +123,10 @@ function CoordinateDescent.descendCoordinate!( newVal = cdprox!(g, x, j, a) h = newVal - oldVal + # nothing to update when the coordinate did not move, as for most + # coordinates that stay at zero in a full pass + iszero(h) && return h + # update internals if ri == ci for ac=1:p, ar=1:p