Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/algorithms/decomposition.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@doc Markdown.doc"""
function equidimensional_decomposition(I::Ideal{T}, info_level::Int=0) where {T <: MPolyRingElem}
equidimensional_decomposition(I::Ideal{T}, info_level::Int=0) where {T <: MPolyRingElem}

Given a polynomial ideal `I`, return a list of ideals `dec` s.t.
each ideal in `dec` is equidimensional (i.e. has minimal primes
Expand Down
17 changes: 6 additions & 11 deletions src/siggb/hashtable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ end

# initialize and set fields for basis hashtable
function initialize_basis_hash_table(::Val{N}) where N

# for now at most 32 variables
if N > 32
error("At most 32 variables currently supported.")
end

# not necessary to create `initial_size` exponents
exponents = Vector{Monomial{N}}(undef, init_ht_size)
Expand All @@ -50,8 +45,7 @@ function initialize_basis_hash_table(::Val{N}) where N
size = init_ht_size

# initialize fast divisibility params
int32bits = 32
ndivbits = div(int32bits, N)
ndivbits = div(DivMaskSize, N)
# division mask stores at least 1 bit
# per each of first ndivvars variables
ndivbits == 0 && (ndivbits += 1)
Expand Down Expand Up @@ -270,16 +264,17 @@ function fill_divmask!(ht::MonomialHashtable{N}) where N
end

ctr = 1
steps = UInt32(0)
steps = DivMask(0)
@inbounds for i in 1:N
steps = div(max_exp[i] - min_exp[i], UInt32(ht.ndivbits))
(iszero(steps)) && (steps += UInt32(1))
steps = div(DivMask(max_exp[i] - min_exp[i]), DivMask(ht.ndivbits))
(iszero(steps)) && (steps += DivMask(1))
for j in 1:ht.ndivbits
ht.divmap[ctr] = steps
steps += UInt32(1)
steps += DivMask(1)
ctr += 1
end
end

@inbounds for vidx in 1:ht.load
m = ht.exponents[vidx]
divm = divmask(m, ht.divmap, ht.ndivbits)
Expand Down
1 change: 1 addition & 0 deletions src/siggb/monomials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ function divmask(e::Monomial{N},
ctr = one(DivMask)
res = zero(DivMask)
o = one(DivMask)
lb = N > DivMaskSize ? N - DivMaskSize : 1
for i in N:-1:1
for j in 1:ndivbits
@inbounds if e.exps[i] >= divmap[ctr]
Expand Down
2 changes: 1 addition & 1 deletion src/siggb/siggb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ include("helpers.jl")
#---------------- user functions --------------------#

@doc Markdown.doc"""
function sig_groebner_basis(sys::Vector{T}; info_level::Int=0, degbound::Int=0, mod_ord::Symbol=:POT) where {T <: MPolyRingElem}
sig_groebner_basis(sys::Vector{T}; info_level::Int=0, degbound::Int=0, mod_ord::Symbol=:POT) where {T <: MPolyRingElem}

Compute a Signature Gröbner basis of the sequence `sys` w.r.t. to the
degree reverse lexicographical monomial ordering and the module order
Expand Down
5 changes: 3 additions & 2 deletions src/siggb/typedefs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const Exp = Int16
# types for hashvalue, ht index and divisor mask of a monomial
const MonIdx = Int32
const MonHash = UInt32
const DivMask = UInt32
const DivMask = UInt64
const DivMaskSize = 64
# stuff for matrix
const ColIdx = UInt32
const Coeff = UInt32
Expand Down Expand Up @@ -45,7 +46,7 @@ mutable struct MonomialHashtable{N}

#= Monom divisibility =#
# divisor map to check divisibility faster
divmap::Vector{UInt32}
divmap::Vector{DivMask}
# bits per div variable
ndivbits::Int

Expand Down
Loading