Exemplo n.º 1
0
Arquivo: Spans.cs Projeto: 0xCM/arrows
 public static Span256 <T> NonZeroSpan256 <T>(this IPolyrand random, int blocks = 1, Interval <T>?domain = null)
     where T : struct
 => random.Span256(blocks, domain, gmath.nonzero);
Exemplo n.º 2
0
 public static Vec256 <T> CpuVec256 <T>(this IPolyrand random, Interval <T> domain, Func <T, bool> filter = null)
     where T : unmanaged
 => random.Span256 <T>(1, domain, filter).LoadVec256();
Exemplo n.º 3
0
Arquivo: Spans.cs Projeto: 0xCM/arrows
 public static unsafe ReadOnlySpan256 <T> ReadOnlySpan256 <T>(this IPolyrand random, int blocks = 1, Interval <T>?domain = null, Func <T, bool> filter = null)
     where T : struct
 => random.Span256 <T>(blocks, domain, filter);
Exemplo n.º 4
0
 public static Vec256 <T> CpuVec256 <T>(this IPolyrand random)
     where T : unmanaged
 => random.Span256 <T>(1).LoadVec256();
Exemplo n.º 5
0
 public static Vec256 <T> CpuVec256 <T>(this IPolyrand random, Interval <T> domain)
     where T : unmanaged
 => random.Span256 <T>(1, domain).LoadVec256();
Exemplo n.º 6
0
 public static Vec256 <T> CpuVec256 <T>(this IPolyrand random, T min, T max, Func <T, bool> filter = null)
     where T : unmanaged
 => random.Span256 <T>(1, closed(min, max), filter).LoadVec256();
Exemplo n.º 7
0
 /// <summary>
 /// Samples a square matrix of natural order
 /// </summary>
 /// <param name="random">The random source</param>
 /// <typeparam name="N">The dimension type</typeparam>
 /// <typeparam name="T">The element type</typeparam>
 public static BlockMatrix <N, T> BlockMatrix <N, T>(this IPolyrand random, Interval <T>?domain = null)
     where N : ITypeNat, new()
     where T : struct
 => Z0.BlockMatrix.Load <N, T>(random.Span256 <T>(Z0.Span256.MinBlocks <N, N, T>(), domain));
Exemplo n.º 8
0
 public static BlockMatrix <M, N, T> BlockMatrix <M, N, T>(this IPolyrand random, Interval <T> domain, M m = default, N n = default)
     where M : ITypeNat, new()
     where N : ITypeNat, new()
     where T : struct
 => Z0.BlockMatrix.Load <M, N, T>(random.Span256 <T>(Z0.Span256.MinBlocks <M, N, T>(), domain));