コード例 #1
0
ファイル: Spans.cs プロジェクト: 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);
コード例 #2
0
ファイル: CpuVectors.cs プロジェクト: 0xCM/arrows
 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();
コード例 #3
0
ファイル: Spans.cs プロジェクト: 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);
コード例 #4
0
ファイル: CpuVectors.cs プロジェクト: 0xCM/arrows
 public static Vec256 <T> CpuVec256 <T>(this IPolyrand random)
     where T : unmanaged
 => random.Span256 <T>(1).LoadVec256();
コード例 #5
0
ファイル: CpuVectors.cs プロジェクト: 0xCM/arrows
 public static Vec256 <T> CpuVec256 <T>(this IPolyrand random, Interval <T> domain)
     where T : unmanaged
 => random.Span256 <T>(1, domain).LoadVec256();
コード例 #6
0
ファイル: CpuVectors.cs プロジェクト: 0xCM/arrows
 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();
コード例 #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));
コード例 #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));