Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Sasha Demin committed Aug 31, 2024
1 parent a65b73d commit 1c1b86d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 17 deletions.
3 changes: 1 addition & 2 deletions src/f4/f4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ function f4_autoreduce!(
end
k += 1
basis.nonredundant_indices[k] = basis.n_filled - i + 1
basis.divmasks[k] =
ht.divmasks[basis.monoms[basis.nonredundant_indices[k]][1]]
basis.divmasks[k] = ht.divmasks[basis.monoms[basis.nonredundant_indices[k]][1]]
i += 1
end
basis.n_nonredundant = k
Expand Down
13 changes: 1 addition & 12 deletions src/f4/hashtable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ const MonomId = Int32
# Division mask of a monomial
const DivisionMask = UInt32

# Hashvalue of a single monomial
struct Hashvalue
# index of a monomial in the F4 matrix
idx::Int32
# hash of a monomial
hash::MonomHash
# divisibility mask to speed up divisibility checks
divmask::DivisionMask
end

# Hashtable implements open addressing with linear scan.
mutable struct MonomialHashtable{M <: Monom, Ord <: AbstractMonomialOrdering}
#= Data =#
Expand Down Expand Up @@ -479,8 +469,7 @@ function hashtable_check_monomial_division_in_update(
j += 1
continue
end
if ht.use_divmask &&
!divmask_is_probably_divisible(ht.divmasks[a[j]], divmask)
if ht.use_divmask && !divmask_is_probably_divisible(ht.divmasks[a[j]], divmask)
j += 1
continue
end
Expand Down
3 changes: 1 addition & 2 deletions src/f4/learn_apply.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ function f4_reducegb_learn!(
end
k += 1
basis.nonredundant_indices[k] = basis.n_filled - i + 1
basis.divmasks[k] =
ht.divmasks[basis.monoms[basis.nonredundant_indices[k]][1]]
basis.divmasks[k] = ht.divmasks[basis.monoms[basis.nonredundant_indices[k]][1]]
i += 1
end
basis.n_nonredundant = k
Expand Down
2 changes: 1 addition & 1 deletion src/f4/matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ function matrix_fill_column_to_monom_map!(
column_to_monom = Vector{MonomId}(undef, symbol_ht.load - 1)
j = 1
k = 0
@inbounds for i in (symbol_ht.offset):symbol_ht.load
@inbounds for i in (symbol_ht.offset):(symbol_ht.load)
column_to_monom[j] = i
j += 1
if symbol_ht.labels[i] == PIVOT_COLUMN
Expand Down
3 changes: 3 additions & 0 deletions src/input_output/intermediate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ end
function ir_convert_internal_to_ir(ring, monoms, coeffs, params)
monoms2 = Vector{Vector{Vector{IRexponent}}}(undef, length(monoms))
coeffs2 = coeffs
if eltype(eltype(coeffs)) <: AbstractFloat
coeffs2 = map(cc -> map(c -> UInt(c), cc), coeffs2)
end
@inbounds for i in 1:length(monoms)
monoms2[i] = Vector{Vector{IRexponent}}(undef, length(monoms[i]))
for j in 1:length(monoms[i])
Expand Down

0 comments on commit 1c1b86d

Please sign in to comment.