Skip to content

Commit fb0d307

Browse files
committed
Use randomElement in packages
Eventually -> random(List)
1 parent f4d1f54 commit fb0d307

7 files changed

Lines changed: 8 additions & 8 deletions

File tree

M2/Macaulay2/packages/CpMackeyFunctors/Tests/BoxProductTests.m2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ assert (class (inverse f) ===MackeyFunctorHomomorphism)
2727

2828
-- Test induced map on box products
2929
for i to 5 do (
30-
p = random {2,3,5,7};
30+
p = randomElement {2,3,5,7};
3131
n = random 21;
3232
M = makeRandomCpMackeyFunctor(p);
3333
A = makeBurnsideMackeyFunctor(p);
@@ -36,4 +36,4 @@ for i to 5 do (
3636
assert (timesn**M == map(A**M,A**M,n));
3737
);
3838

39-
///
39+
///

M2/Macaulay2/packages/FastMinors.m2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ chooseRandomNonzeroSubmatrix(ZZ, Matrix) := opts -> (n1, M1) -> (
345345
--curList = flatten entries curM1;
346346
entryList = entries transpose matrix nonzeroEntries(curM1);
347347
if #entryList == 0 then return null;
348-
curEntry = random entryList;
348+
curEntry = randomElement entryList;
349349
--print (curList#curMax);
350350
curRow = curEntry#0;
351351
curCol = curEntry#1;

M2/Macaulay2/packages/MultiprojectiveVarieties.m2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ line (EmbeddedProjectiveVariety,EmbeddedProjectiveVariety) := (X,p) -> (
10001000
if dim V >= 2 then return linearSpan {p,point V};
10011001
L := select(decompose V,l -> dim l == 1 and degree l == 1);
10021002
if # L == 0 then error("failed to find line in "|toString(? X));
1003-
random L
1003+
randomElement L
10041004
);
10051005
line (EmbeddedProjectiveVariety,ZZ) := (X,n) -> (
10061006
L := try line(X,point X) else null;

M2/Macaulay2/packages/SpaceCurves.m2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ curve (ZZ,ZZ,Ring) := (d,g,R) -> (
566566
--generates a random curve of degree d and genus g in a given ring
567567
if 2*g == (d-1)*(d-2) then return ideal(random(1,R),random(d,R));
568568
L := smoothDivisors(d,g,R);
569-
if L != {} then return curve random L
569+
if L != {} then return curve randomElement L
570570
else print "No smooth curve with this degree and genus exists!";
571571
)
572572
curve (ZZ,ZZ) := (d,g) -> (

M2/Macaulay2/packages/Tableaux/algorithms.m2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ randomSemistandardTableau (Partition,Partition,ZZ) := (lam,mu,maxEntry) -> (
175175
--possibleEntries := toList(minEntry .. maxEntry);
176176
possibleEntries := join toSequence for i from minEntry to maxEntry list toList((2^(i-1)):i);
177177

178-
T_thePosition = random possibleEntries;
178+
T_thePosition = randomElement possibleEntries;
179179
);
180180

181181
youngTableau(lam,mu,new List from entries T)

M2/Macaulay2/packages/VirtualResolutions.m2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ randomMonomialCurve (ZZ,ZZ,Ring) := Ideal => (d,e,F) -> (
319319
uVars := flatten entries vars U;
320320
--- Choose random monomial to define map to P2.
321321
B := drop(drop(flatten entries basis({e,0,0},U),1),-1);
322-
f := random B;
322+
f := randomElement B;
323323
--- Defines graph of morphisms in P1x(P1xP2)
324324
M1 := matrix {{(uVars#0)^d,(uVars#1)^d},{uVars#2,uVars#3}};
325325
M2 := matrix {{(uVars#0)^e,(uVars#1)^e,f},{uVars#4,uVars#5,uVars#6}};

M2/Macaulay2/packages/WhitneyStratifications.m2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ fiberContAssocPrimes=(IY,ConX)->(
12051205
-- if we want to use Msolve here
12061206
--can replace I with monomialIdeal leadTerm(I), and use Msolve for leadTerm
12071207
mis:= independentSets(IY);
1208-
u:=support(random mis);
1208+
u:=support(randomElement mis);
12091209
xMinusU:=rsort toList(set(gens R) - set(u));
12101210
els:=(#xMinusU)+numgens(R);
12111211
S1:=kk[xMinusU, (gens S)_(toList(numgens(R)..numgens(S)-1)),u,MonomialOrder => {els,numgens(S)-els}];

0 commit comments

Comments
 (0)