Skip to content

Commit

Permalink
Merge pull request #61 from JuliaReach/schillic/axes
Browse files Browse the repository at this point in the history
Use `axes` instead of `1:size`
  • Loading branch information
schillic authored Mar 19, 2024
2 parents 17e14bf + 56c047c commit 5f7de90
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Arrays/logarithmic_norm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ end
# max_j a_jj + ∑_{i ≠ j} |a_ij|
function logarithmic_norm_1(A::AbstractMatrix{N}) where {N}
out = -Inf
@inbounds for j in 1:size(A, 2)
@inbounds for j in axes(A, 2)
α = A[j, j]
for i in 1:size(A, 1)
for i in axes(A, 1)
if i j
α += abs(A[i, j])
end
Expand All @@ -40,9 +40,9 @@ end
# max_i a_ii + ∑_{j ≠ i} |a_ij|
function logarithmic_norm_inf(A::AbstractMatrix{N}) where {N}
out = -Inf
@inbounds for i in 1:size(A, 1)
@inbounds for i in axes(A, 1)
α = A[i, i]
for j in 1:size(A, 2)
for j in axes(A, 2)
if i j
α += abs(A[i, j])
end
Expand Down

0 comments on commit 5f7de90

Please sign in to comment.