Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiManyer committed Aug 14, 2024
1 parent 0f51e06 commit 080534b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/BlockPartitionedArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 080534b

Please sign in to comment.