Example #1
0
File: Spans.cs Project: 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);
Example #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();
Example #3
0
File: Spans.cs Project: 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);
Example #4
0
 public static Vec256 <T> CpuVec256 <T>(this IPolyrand random)
     where T : unmanaged
 => random.Span256 <T>(1).LoadVec256();
Example #5
0
 public static Vec256 <T> CpuVec256 <T>(this IPolyrand random, Interval <T> domain)
     where T : unmanaged
 => random.Span256 <T>(1, domain).LoadVec256();
Example #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();
Example #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));
Example #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));