File tree Expand file tree Collapse file tree 5 files changed +12
-15
lines changed Expand file tree Collapse file tree 5 files changed +12
-15
lines changed Original file line number Diff line number Diff line change 11@doc Markdown. doc"""
2- function equidimensional_decomposition(I::Ideal{T}, info_level::Int=0) where {T <: MPolyRingElem}
2+ equidimensional_decomposition(I::Ideal{T}, info_level::Int=0) where {T <: MPolyRingElem}
33
44Given a polynomial ideal `I`, return a list of ideals `dec` s.t.
55each ideal in `dec` is equidimensional (i.e. has minimal primes
Original file line number Diff line number Diff line change 3434
3535# initialize and set fields for basis hashtable
3636function initialize_basis_hash_table (:: Val{N} ) where N
37-
38- # for now at most 32 variables
39- if N > 32
40- error (" At most 32 variables currently supported." )
41- end
4237
4338 # not necessary to create `initial_size` exponents
4439 exponents = Vector {Monomial{N}} (undef, init_ht_size)
@@ -50,8 +45,7 @@ function initialize_basis_hash_table(::Val{N}) where N
5045 size = init_ht_size
5146
5247 # initialize fast divisibility params
53- int32bits = 32
54- ndivbits = div (int32bits, N)
48+ ndivbits = div (DivMaskSize, N)
5549 # division mask stores at least 1 bit
5650 # per each of first ndivvars variables
5751 ndivbits == 0 && (ndivbits += 1 )
@@ -270,16 +264,17 @@ function fill_divmask!(ht::MonomialHashtable{N}) where N
270264 end
271265
272266 ctr = 1
273- steps = UInt32 (0 )
267+ steps = DivMask (0 )
274268 @inbounds for i in 1 : N
275- steps = div (max_exp[i] - min_exp[i], UInt32 (ht. ndivbits))
276- (iszero (steps)) && (steps += UInt32 (1 ))
269+ steps = div (DivMask ( max_exp[i] - min_exp[i]), DivMask (ht. ndivbits))
270+ (iszero (steps)) && (steps += DivMask (1 ))
277271 for j in 1 : ht. ndivbits
278272 ht. divmap[ctr] = steps
279- steps += UInt32 (1 )
273+ steps += DivMask (1 )
280274 ctr += 1
281275 end
282276 end
277+
283278 @inbounds for vidx in 1 : ht. load
284279 m = ht. exponents[vidx]
285280 divm = divmask (m, ht. divmap, ht. ndivbits)
Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ function divmask(e::Monomial{N},
121121 ctr = one (DivMask)
122122 res = zero (DivMask)
123123 o = one (DivMask)
124+ lb = N > DivMaskSize ? N - DivMaskSize : 1
124125 for i in N: - 1 : 1
125126 for j in 1 : ndivbits
126127 @inbounds if e. exps[i] >= divmap[ctr]
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ include("helpers.jl")
2424# ---------------- user functions --------------------#
2525
2626@doc Markdown. doc"""
27- function sig_groebner_basis(sys::Vector{T}; info_level::Int=0, degbound::Int=0, mod_ord::Symbol=:POT) where {T <: MPolyRingElem}
27+ sig_groebner_basis(sys::Vector{T}; info_level::Int=0, degbound::Int=0, mod_ord::Symbol=:POT) where {T <: MPolyRingElem}
2828
2929Compute a Signature Gröbner basis of the sequence `sys` w.r.t. to the
3030degree reverse lexicographical monomial ordering and the module order
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ const Exp = Int16
66# types for hashvalue, ht index and divisor mask of a monomial
77const MonIdx = Int32
88const MonHash = UInt32
9- const DivMask = UInt32
9+ const DivMask = UInt64
10+ const DivMaskSize = 64
1011# stuff for matrix
1112const ColIdx = UInt32
1213const Coeff = UInt32
@@ -45,7 +46,7 @@ mutable struct MonomialHashtable{N}
4546
4647 #= Monom divisibility =#
4748 # divisor map to check divisibility faster
48- divmap:: Vector{UInt32 }
49+ divmap:: Vector{DivMask }
4950 # bits per div variable
5051 ndivbits:: Int
5152
You can’t perform that action at this time.
0 commit comments