From c393bf77551bfbc47a17f672559d4344cf1302fe Mon Sep 17 00:00:00 2001 From: Lorenzo Stella Date: Fri, 29 Dec 2023 19:48:29 +0100 Subject: [PATCH 1/3] Update ProximalCore.jl --- src/ProximalCore.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ProximalCore.jl b/src/ProximalCore.jl index bc8277a..0bc6855 100644 --- a/src/ProximalCore.jl +++ b/src/ProximalCore.jl @@ -101,9 +101,9 @@ struct IndZero end function (::IndZero)(x) R = real(eltype(x)) if iszero(x) - return R(Inf) + return R(0) end - return R(0) + return R(Inf) end is_convex(::Type{IndZero}) = true From 4ce732686257c8e3e7d4706e37aeb506672c2882 Mon Sep 17 00:00:00 2001 From: Lorenzo Stella Date: Fri, 29 Dec 2023 19:49:39 +0100 Subject: [PATCH 2/3] Update Project.toml --- Project.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 3b8ebd1..6c7f1d1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,10 +1,11 @@ name = "ProximalCore" uuid = "dc4f5ac2-75d1-4f31-931e-60435d74994b" authors = ["Lorenzo Stella "] -version = "0.1.1" +version = "0.1.2" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [compat] +LinearAlgebra = "1.2" julia = "1.2" From 7d2f7f0d87780c50b35fc16370e2efaedba1c578 Mon Sep 17 00:00:00 2001 From: Lorenzo Stella Date: Fri, 29 Dec 2023 19:55:48 +0100 Subject: [PATCH 3/3] Update runtests.jl --- test/runtests.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 7cad8a8..dab2832 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -53,9 +53,10 @@ end @test is_generalized_quadratic(IndZero()) for T in [Float32, Float64] - @test let x = T[1.0, 2.0, 3.0] - prox(IndZero(), x, T(42)) == (T[0, 0, 0], T(0)) - end + x = T[1.0, 2.0, 3.0] + @test IndZero()(x) == T(Inf) + @test IndZero()(T[0, 0, 0]) == T(0) + @test prox(IndZero(), x, T(42)) == (T[0, 0, 0], T(0)) end end