From 462b26940ae52994c624e011d55765fba9ba7a28 Mon Sep 17 00:00:00 2001 From: Alexander Demin Date: Sat, 27 Jul 2024 23:22:03 +0200 Subject: [PATCH] uwu --- src/f4/f4.jl | 2 +- src/f4/sort.jl | 22 +--------------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/f4/f4.jl b/src/f4/f4.jl index 0c7b98a9..c149522c 100644 --- a/src/f4/f4.jl +++ b/src/f4/f4.jl @@ -410,7 +410,7 @@ function f4_add_critical_pairs_to_matrix!( ) @invariant issorted( pairset.pairs[1:npairs], - by=pair -> monom_totaldeg(ht.monoms[pair.lcm]) + lt=(a,b) -> monom_isless(ht.monoms[a.lcm], ht.monoms[b.lcm], ht.ord) ) matrix_reinitialize!(matrix, npairs) diff --git a/src/f4/sort.jl b/src/f4/sort.jl index 2c243c9e..309f055f 100644 --- a/src/f4/sort.jl +++ b/src/f4/sort.jl @@ -143,8 +143,6 @@ function sort_pairset_by_lcm!(pairset::Pairset, npairs::Int, hashtable::Monomial ) permutation = collect(1:npairs) sort_part!(permutation, 1, npairs, lt=cmps, scratch=pairset.scratch1) - # @inbounds pairs[1:npairs] = pairs[permutation] - # @inbounds pairset.degrees[1:npairs] = pairset.degrees[permutation] if length(pairset.scratch2) < length(permutation) resize!(pairset.scratch2, nextpow(2, length(permutation) + 1)) end @@ -174,25 +172,7 @@ function matrix_row_decreasing_cmp(a::Vector{T}, b::Vector{T}) where {T <: Colum if va > vb return false end - if va < vb - return true - end - - @unreachable - - # If there are two rows in the upper part of the matrix with the same - # leading term, something went wrong - @invariant false - # If the same leading column => compare the density of rows - va = length(a) - vb = length(b) - if va > vb - return true - end - if va < vb - return false - end - false + va < vb end # Compare sparse matrix rows a and b.