Skip to content

Commit

Permalink
Merge pull request #199 from raulepure/maximalindepset
Browse files Browse the repository at this point in the history
Bug fix maximal_independent_set
  • Loading branch information
wbhart authored Feb 27, 2020
2 parents 6b5a006 + 361acb4 commit f2deec1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ideal/ideal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,10 @@ end
function maximal_independent_set(I::sideal{S}; all::Bool = false) where S <: Union{spoly{T}, spoly{n_unknown{U}}} where {T <: Singular.FieldElem, U <: Nemo.FieldElem}
I.isGB == false && error("I needs to be a Gröbner basis.")
R = base_ring(I)
Q = base_ring(R)
d = dimension(I)
if all == true
P = Array{Array{spoly, 1}, 1}()
P = Array{Array{spoly{elem_type(Q)}, 1}, 1}()
res = independent_sets(I)
for i in 1:length(res)
if length(res[i]) == d
Expand All @@ -739,7 +740,7 @@ function maximal_independent_set(I::sideal{S}; all::Bool = false) where S <: Uni
else
a = Array{Int32, 1}()
libSingular.scIndIndset(I.ptr, R.ptr, a, all)
P = Array{spoly, 1}()
P = Array{spoly{elem_type(Q)}, 1}()
for j in findall(x->x == 1, a)
push!(P, gen(R, j))
end
Expand Down
2 changes: 2 additions & 0 deletions test/ideal/sideal-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -333,5 +333,7 @@ end
@test L1 == [x, y, u]
@test L2 == [[x, y, u], [y, u, v], [x, u, w], [u, v, w]]
@test L3 == [[x, y, u], [y, u, v], [x, u, w], [u, v, w], [y, w]]
@test typeof(L1) == Array{spoly{n_Q}, 1}
@test typeof(L2) == Array{Array{spoly{n_Q}, 1}, 1}
end

2 comments on commit f2deec1

@thofma
Copy link
Collaborator

@thofma thofma commented on f2deec1 Mar 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/10514

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.0 -m "<description of version>" f2deec102aaadb147d7e3fc7629591da37265d9d
git push origin v0.2.0

Please sign in to comment.