Skip to content

Commit

Permalink
proposed fix for Macaulay2#3601
Browse files Browse the repository at this point in the history
  • Loading branch information
citius2280 committed Dec 16, 2024
1 parent 4814793 commit 7656035
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions M2/Macaulay2/packages/gfanInterface.m2
Original file line number Diff line number Diff line change
Expand Up @@ -751,14 +751,15 @@ gfanConvertToNewRing (PolynomialRing) := R1 -> (
--This method does all of the actual conversions.
--Every other gfanConvertToNewRing uses rings
--produced by this method.
R1Gens := gens R1;
numDigits := length (toString (#R1Gens));
R2 := (coefficientRing R1) new Array from (for i in 1..#R1Gens list (
value ("x" | demark ("",for i from 1 to numDigits-(length toString i) list "0") | toString i)
) );
R2Gens := gens R2;
generatorMapping := for i in 0..#(gens R1) - 1 list (R1Gens#i =>R2Gens#i);
return (map(R2, R1, generatorMapping), R2);
R1Gens := gens R1;
numDigits := length (toString (#R1Gens));
varstr := (for i in 1..#R1Gens list "x" | demark ("",for j from 1 to numDigits-(length toString i) list "0") | toString i);
var := new Dictionary;
varlist = for i in varstr list getGlobalSymbol(var,i);
R2 := (coefficientRing R1) new Array from varlist;
R2Gens := gens R2;
generatorMapping := for i in 0..#(gens R1) - 1 list (R1Gens#i =>R2Gens#i);
return (map(R2, R1, generatorMapping), R2);
)

gfanConvertToNewRing (RingElement) := f -> (
Expand Down

0 comments on commit 7656035

Please sign in to comment.