Skip to content

Commit

Permalink
Fix prod_diagonal
Browse files Browse the repository at this point in the history
  • Loading branch information
joschmitt committed Sep 18, 2024
1 parent 83f9a58 commit d63bff1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ Return the diagonal of `A` as an array.
diagonal(A::MatrixElem{T}) where {T} = T[A[i, i] for i in 1:min(nrows(A), ncols(A))]

function prod_diagonal(A::MatrixElem{T}) where {T}
return prod(T[A[i, i] for i = 1:nrows(A)])
return prod(diagonal(A))
end

################################################################################
Expand Down

0 comments on commit d63bff1

Please sign in to comment.