Skip to content

Commit

Permalink
Fix issue #724 with binomialIsPrime not working right.
Browse files Browse the repository at this point in the history
  • Loading branch information
tom111 committed Jan 14, 2018
1 parent 99c254d commit 280acce
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions M2/Macaulay2/packages/Binomials.m2
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

newPackage(
"Binomials",
Version => "1.2",
Date => "April 2015",
Version => "1.2.1",
Date => "January 2018",
Authors => {{
Name => "Thomas Kahle",
Email => "thomas.kahle@jpberlin.de",
Expand Down Expand Up @@ -629,6 +629,11 @@ binomialIsPrime Ideal := Ideal => o -> I -> (
if cv === false then return false)
else cv = o#CellVariables;

-- Check if non-cellular variables are all contained:
R := ring I;
ncv := toList(set (gens R) - cv); -- nilpotent variables x \notin E
if not isSubset(promote(ideal ncv, R), I) then return false;

-- Test if the partial character saturated:
pc := partialCharacter (I, CellVariables=>cv);
if image Lsat pc#"L" != image pc#"L" then return false;
Expand Down Expand Up @@ -1976,6 +1981,13 @@ for L in permutations {I1,I2,I3} do (
)
///

TEST ///
R = QQ[x,y]
assert(binomialIsPrime ideal x^2 == false)
assert(binomialIsPrime ideal (x^2-y^2) == false)
assert(binomialIsPrime ideal (x-y) == true)
///

end
------------------------------------------------------------
restart
Expand Down

0 comments on commit 280acce

Please sign in to comment.