@@ -159,33 +159,10 @@ abstractSimplicialComplex(ZZ,ZZ) := AbstractSimplicialComplex => (n,r) -> (
159159-- --------------------------------------
160160
161161-- What follows are simple minded (yet still seemingly practical)
162- -- methods for producing random subsets and random simplicial complexes.
162+ -- methods for producing random simplicial complexes.
163163-- In either case they are fairly efficient.
164164-- In either case, what follows suffices for our purposes at present.
165165
166- -- Make a random subset of {1,...,n}.
167-
168- randomSubset = method ()
169-
170- -- Make a random size random subset of [n] = {1,...,n}.
171-
172- randomSubset (ZZ ) := List => (n) -> (
173- k := random (0,n);
174- sort unique (for i from 1 to k list (random (1,n))))
175-
176- -- Make a random size r subset.
177-
178- randomSubset (ZZ ,ZZ ) := List => (n,r) -> (
179- sort unique (for i from 1 to r list (random (1,n))))
180-
181- -- Make a random subset of a given set.
182-
183- randomSubset (List ) := List => (L) -> (
184- n := #L;
185- k := random (0,n);
186- mySubset := subsets (L,k);
187- mySubset_(random (binomial (n,k))))
188-
189166-- A variant of the above method would yield a random k element subset of a given set.
190167
191168-- Make a "random" simplicial complex on {1,...,n}.
@@ -194,14 +171,16 @@ randomAbstractSimplicialComplex = method()
194171
195172randomAbstractSimplicialComplex(ZZ ) := AbstractSimplicialComplex => (n) -> (
196173 listLength := 1 + random (2^n);
197- randomFaces := unique (for i from 1 to listLength list randomSubset (n));
174+ x := toList (1..n);
175+ randomFaces := unique (for i from 1 to listLength list randomSubset x);
198176 abstractSimplicialComplex randomFaces)
199177
200178-- Make a random simplicial complex on [n] with r-skeleton.
201179
202180randomAbstractSimplicialComplex(ZZ ,ZZ ) := AbstractSimplicialComplex => (n,r) -> (
203181 listLength := 1 + random (binomial (n,r));
204- randomFaces := unique (for i from 1 to listLength list randomSubset (n,r));
182+ x := toList (1..n);
183+ randomFaces := unique (for i from 1 to listLength list randomSubset (x,r));
205184 abstractSimplicialComplex randomFaces)
206185
207186-- Make the random complex Y_d(n,m) which has vertex set
0 commit comments