Skip to content

Commit

Permalink
Merge de48983 into 2f46384
Browse files Browse the repository at this point in the history
  • Loading branch information
tthsqe12 committed Nov 24, 2022
2 parents 2f46384 + de48983 commit 2fed41f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/module/module.jl
Expand Up @@ -418,3 +418,9 @@ function modulo(A::smodule, B::smodule)
return Module(R, ptr)
end


function vdim(I::smodule)
I.isGB || error("Not a Groebner basis")
R = base_ring(I)
GC.@preserve I R return Int(libSingular.id_vdim(I.ptr, R.ptr))
end
16 changes: 16 additions & 0 deletions test/module/smodule-test.jl
Expand Up @@ -251,3 +251,19 @@ end
@test length(F) == 3
end


@testset "smodule.vdim" begin
R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
v1 = vector(R, x, R(0))
v2 = vector(R, R(0), x)
v3 = vector(R, y, R(0))
v4 = vector(R, R(0), y)
@test vdim(std(Singular.Module(R, v1, v2, v3, v4))) == -1

R, (x, y) = PolynomialRing(QQ, ["x", "y"])
v1 = vector(R, x, R(0))
v2 = vector(R, R(0), x)
v3 = vector(R, y, R(0))
v4 = vector(R, R(0), y)
@test vdim(std(Singular.Module(R, v1, v2, v3, v4))) == 2
end

0 comments on commit 2fed41f

Please sign in to comment.