Skip to content

Commit

Permalink
fix infinite loop in degrees of ring map
Browse files Browse the repository at this point in the history
  • Loading branch information
pzinn committed Sep 24, 2024
1 parent 3bcf010 commit 968ae80
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions M2/Macaulay2/m2/ringmap.m2
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ needs "mutablemat.m2"
-- should do something about the degree map here
degmap0 := n -> ( d := toList ( n : 0 ); e -> d )

workable = f -> try (f(); true) else false

-----------------------------------------------------------------------------
-- RingMap type declarations and basic methods
-----------------------------------------------------------------------------
Expand Down Expand Up @@ -85,7 +83,7 @@ map(Ring, Ring, Matrix) := RingMap => opts -> (R, S, m) -> (
" into a degree of length ", toString degreeLength R);
opts.DegreeMap
)
else if workable (() -> promote({},S,R)) then (d -> first promote({d},S,R))
else if (pr:=lookup(promote,List,S,R)) =!= null then (d -> first pr({d},S,R))
else if degreeLength R === degreeLength S then identity
else if degreeLength S === 0 or degreeLength R === 0 then degmap0 degreeLength R
else (
Expand Down

0 comments on commit 968ae80

Please sign in to comment.