From 080534ba12b628408a5a7772fac14cdfd333fce8 Mon Sep 17 00:00:00 2001 From: JordiManyer Date: Wed, 14 Aug 2024 10:53:26 +1000 Subject: [PATCH] Minor --- src/BlockPartitionedArrays.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/BlockPartitionedArrays.jl b/src/BlockPartitionedArrays.jl index aa83bb2..3debc3e 100644 --- a/src/BlockPartitionedArrays.jl +++ b/src/BlockPartitionedArrays.jl @@ -351,6 +351,9 @@ function LinearAlgebra.dot(x::BlockPVector,y::BlockPVector) end function LinearAlgebra.norm(v::BlockPVector,p::Real=2) + if p == 2 + return sqrt(dot(v,v)) + end block_norms = map(vi->norm(vi,p),blocks(v)) return sum(block_norms.^p)^(1/p) end