Skip to content

Commit b7ac329

Browse files
author
Remi Prebet
committed
correct bad test
1 parent ea6c6a9 commit b7ac329

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/algorithms/dimension.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function dimension(I::Ideal{T}) where T <: MPolyRingElem
3232
nz_exps_ind = findall(nz_exps)
3333
next_res = Set{BitVector}()
3434
for mis in res
35-
if nz_exps <= mis
35+
if all_lesseq(nz_exps, mis)
3636
@inbounds for j in nz_exps_ind
3737
new_mis = copy(mis)
3838
new_mis[j] = false
@@ -49,6 +49,15 @@ function dimension(I::Ideal{T}) where T <: MPolyRingElem
4949
return I.dim
5050
end
5151

52+
function all_lesseq(a::BitVector, b::BitVector)::Bool
53+
@inbounds for i in eachindex(a)
54+
if a[i] && !b[i]
55+
return false
56+
end
57+
end
58+
return true
59+
end
60+
5261
function _drl_exp_vector(u::Vector{Int})
5362
return [sum(u), -reverse(u)...]
5463
end

0 commit comments

Comments
 (0)