コード例 #1
0
 public static IEnumerable <Perm> Perms(this IPolyrand random, int len)
 {
     while (true)
     {
         yield return(random.Perm(len));
     }
 }
コード例 #2
0
 /// <summary>
 /// Produces a stream of random permutation of natural length N
 /// </summary>
 /// <param name="random">The random source</param>
 /// <param name="n">The length representative</param>
 /// <param name="rep">A primal type representative</param>
 /// <typeparam name="N">The length type</typeparam>
 /// <typeparam name="T">The primal symbol type</typeparam>
 public static IEnumerable <Perm <N> > Perms <N>(this IPolyrand random, N n = default)
     where N : ITypeNat, new()
 {
     while (true)
     {
         yield return(random.Perm(n));
     }
 }