Ejemplo n.º 1
0
Archivo: Spans.cs Proyecto: 0xCM/arrows
 public static Span <N, T> Span <N, T>(this IPolyrand random, N length = default, Interval <T>?domain = null, Func <T, bool> filter = null)
     where T : struct
     where N : ITypeNat, new()
 => NatSpan.Load <N, T>(random.Span <T>((int)length.value, domain, filter));
Ejemplo n.º 2
0
Archivo: Spans.cs Proyecto: 0xCM/arrows
 public static Span <M, N, T> Span <M, N, T>(this IPolyrand random, M rows = default, N cols = default)
     where T : struct
     where M : ITypeNat, new()
     where N : ITypeNat, new()
 => NatSpan.Load <M, N, T>(random.Span <T>(nfunc.muli(rows, cols)), rows, cols);
Ejemplo n.º 3
0
Archivo: Spans.cs Proyecto: 0xCM/arrows
 public static Span <T> NonZeroSpan <T>(this IPolyrand random, int samples, Interval <T>?domain = null)
     where T : struct
 => random.Span <T>(samples, domain, gmath.nonzero);
Ejemplo n.º 4
0
Archivo: Spans.cs Proyecto: 0xCM/arrows
 public static ReadOnlySpan <T> ReadOnlySpan <T>(this IPolyrand random, int length, Interval <T>?domain = null, Func <T, bool> filter = null)
     where T : struct
 => random.Span <T>(length, domain, filter);
Ejemplo n.º 5
0
Archivo: Spans.cs Proyecto: 0xCM/arrows
 public static Span <T> Span <T>(this IPolyrand random, int length, Interval <T> domain)
     where T : struct
 => random.Span <T>(length, domain, null);
Ejemplo n.º 6
0
Archivo: Spans.cs Proyecto: 0xCM/arrows
 public static Span <M, N, T> Span <M, N, T>(this IPolyrand random, M rows, N cols, Interval <T> domain)
     where T : struct
     where M : ITypeNat, new()
     where N : ITypeNat, new()
 => NatSpan.Load <M, N, T>(random.Span <T>(nfunc.muli(rows, cols), domain), rows, cols);
Ejemplo n.º 7
0
        public static BitString BitString(this IPolyrand random, BitSize len)
        {
            var bytes = random.Span <byte>(len.UpperByteCount);

            return(Z0.BitString.FromScalars(bytes, len));
        }