Skip to content

Commit

Permalink
fix-up to snf change
Browse files Browse the repository at this point in the history
  • Loading branch information
thchr committed Oct 18, 2024
1 parent d110927 commit 0a54c1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .vendor/SmithNormalForm/src/snf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function snf(M::AbstractMatrix{R}; inverse=true) where {R}
# Λ′ = Λ*sign(Λ), T′ = sign(Λ)*T, and T⁻¹′ = T⁻¹*sign(Λ),
# with the convention that sign(0) = 1. Then we still have that X = SΛT = SΛ′T′
# and also that Λ = S⁻¹XT⁻¹ ⇒ Λ′ = S⁻¹XT⁻¹′.
for j in axes(M, 2) # over column indices
for j in one(T):minimum(size(M))
Λⱼ = D[j,j]
if Λⱼ < zero(R)
@views V[j,:] .*= -one(R) # T′ = sign(Λ)*T [rows]
Expand Down

0 comments on commit 0a54c1f

Please sign in to comment.