Skip to content

Commit c48a959

Browse files
committed
Rename variables that clash w/ new "attempt" keyword
1 parent 5767be4 commit c48a959

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

M2/Macaulay2/packages/Cremona.m2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,9 +1690,9 @@ point (Ideal,Boolean) := (I,b) -> ( -- see also: code(randomKRationalPoint,Idea
16901690
local par;
16911691
if c == 1 then (
16921692
L := {};
1693-
maxAttempts := 20; attempt := 0;
1694-
while #L == 0 and attempt < maxAttempts do (attempt = attempt+1; par = parametrize randomLinearSubspace(R,1); L = select(decompose par^* I,q -> dim q == 1 and degree q == 1));
1695-
if #L == 0 and attempt >= maxAttempts then error("reached maximum number of "|toString(maxAttempts)|" attempts to find point");
1693+
maxTries := 20; tries := 0;
1694+
while #L == 0 and tries < maxTries do (tries += 1; par = parametrize randomLinearSubspace(R,1); L = select(decompose par^* I,q -> dim q == 1 and degree q == 1));
1695+
if #L == 0 and tries >= maxTries then error("reached maximum number of "|toString(maxTries)|" attempts to find point");
16961696
p = par first L;
16971697
);
16981698
if c > 1 and n - c >= 2 then (

M2/Macaulay2/packages/NumericalAlgebraicGeometry/deflation.m2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ dIdeal (Ideal, ZZ) := (I, d) -> (
216216
)
217217
deflatedSystem = method()
218218
deflatedSystem(Ideal, Matrix, ZZ, ZZ) := memoize (
219-
(I, M, r, attempt) -> (
219+
(I, M, r, tries) -> (
220220
-- In: gens I = the original (square) system
221221
-- M = deflation matrix
222222
-- r = numerical rank of M (at some point)

M2/Macaulay2/packages/NumericalAlgebraicGeometry/refine.m2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,13 +426,13 @@ refineViaDeflation(Matrix, List) := o->(sysT,solsT) -> (
426426
if DBG > 1 then << "-- performing deflation of order " << dOrder << " at the point " << ls << endl;
427427
M := dMatrix(ideal T, dOrder);
428428
r := numericalRank sub(M, matrix{ls});
429-
attempt := 0;
429+
tries := 0;
430430
lucky := false;
431431
local new'ls;
432-
while not lucky and attempt < DEFAULT.Attempts do (
433-
(dT,SM) = deflatedSystem(ideal T,M,r,attempt);
432+
while not lucky and tries < DEFAULT.Attempts do (
433+
(dT,SM) = deflatedSystem(ideal T,M,r,tries);
434434
lucky = ((new'ls = liftSolution(ls,dT))=!=null);
435-
attempt = attempt + 1;
435+
tries += 1;
436436
);
437437
ls = new'ls;
438438
s.DeflationSequence = s.DeflationSequence|{dOrder};

M2/Macaulay2/packages/SpaceCurves.m2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ curve Divisor := D -> (
249249
if class X === CubicSurface then n = 6;
250250
if class X === QuarticSurfaceRational then n = 9;
251251
if class X === CubicSurface or class X === QuarticSurfaceRational then (
252-
attempt := 0;
252+
tries := 0;
253253
while (
254254
--Find a plane curve with given multiplicities at points and its image
255255
phi := X.MapToP3;
@@ -263,8 +263,8 @@ curve Divisor := D -> (
263263
cplane := ideal (gipts*random(source gipts,S^{-a}));
264264
SC := S/cplane;
265265
I = ker map(SC,R,phi.matrix);
266-
(degree I != degree D) or (genus I != genus D) and attempt<3
267-
) do (attempt = attempt+1;);
266+
(degree I != degree D) or (genus I != genus D) and tries<3
267+
) do tries += 1;
268268
);
269269
return new Curve from {
270270
symbol Divisor => D,

0 commit comments

Comments
 (0)