From a4994b5b08c6072addc1cea7cbd2d41802a749f0 Mon Sep 17 00:00:00 2001 From: Markus Kurtz Date: Sat, 3 Jun 2023 12:12:22 +0200 Subject: [PATCH] Fix `non_pivot_cols_of_ref` --- src/Misc/Matrix.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Misc/Matrix.jl b/src/Misc/Matrix.jl index e648bdd2f9..5b03dd7827 100644 --- a/src/Misc/Matrix.jl +++ b/src/Misc/Matrix.jl @@ -207,20 +207,20 @@ function non_pivot_cols_of_ref(H::MatrixElem) i = 1 for j in axes(H, 2) is_zero_entry(H, i, j) ? push!(p, j) : (i+=1) + i == nrows(H)+1 && break end return p end function rank_of_ref(H::MatrixElem) - i = 0 + i = 1 for j in axes(H, 2) - is_zero_entry(H, i+1, j) || (i+=1) - i == nrows(H) && return i + is_zero_entry(H, i, j) || (i+=1) + i == nrows(H)+1 && break end - return i + return i-1 end - transpose!(A::Union{ZZMatrix, QQMatrix}) = is_square(A) ? transpose!(A, A) : transpose(A) function transpose!(A::ZZMatrix, B::ZZMatrix)