From 9e9c716d7c2b214937b20c8e35e8c2420dbbd547 Mon Sep 17 00:00:00 2001 From: Joshua Lampert Date: Thu, 19 Dec 2024 13:17:19 +0100 Subject: [PATCH 1/2] fix p-norm for unitful quantities --- src/linalg.jl | 4 ++-- test/unitful.jl | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/linalg.jl b/src/linalg.jl index 2fe43081..bcc0f988 100644 --- a/src/linalg.jl +++ b/src/linalg.jl @@ -301,7 +301,7 @@ end $(Expr(:meta, :inline)) scale = maxabs_nested(a) - scale==0 && return _init_zero(a) + iszero(scale) && return _init_zero(a) p == 1 && return @inbounds scale * $expr_p1 return @inbounds scale * ($expr)^(inv(p)) end @@ -328,7 +328,7 @@ end p == Inf && return mapreduce(norm, max, a) # no need for scaling l = p==1 ? @inbounds($expr_p1) : @inbounds(($expr)^(inv(p))) - 0 Date: Thu, 19 Dec 2024 21:15:35 +0100 Subject: [PATCH 2/2] set version to v1.9.9 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 481144ad..a4cd6814 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "StaticArrays" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.9.8" +version = "1.9.9" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"