Esempio n. 1
0
        public static Vec512 <T> CpuVec512 <T>(this IPolyrand random, Interval <T>?domain = null, Func <T, bool> filter = null)
            where T : unmanaged
        {
            var v1 = random.CpuVec256(domain, filter);
            var v2 = random.CpuVec256(domain, filter);

            return(Vec512.FromParts(v1, v2));
        }
Esempio n. 2
0
        public static Vec1024 <T> CpuVec1024 <T>(this IPolyrand random, Interval <T>?domain = null, Func <T, bool> filter = null)
            where T : unmanaged
        {
            var v1 = random.CpuVec256(domain, filter);
            var v2 = random.CpuVec256(domain, filter);
            var v3 = random.CpuVec256(domain, filter);
            var v4 = random.CpuVec256(domain, filter);

            return(Vec1024.Define(v1, v2, v3, v4));
        }
Esempio n. 3
0
        /// <summary>
        /// Produces a stream of random 256-bit cpu vectors
        /// </summary>
        /// <param name="random">The random source</param>
        /// <param name="domain">The domain from which the vector components will be chosen</param>
        /// <param name="filter">If specified, component values for which the predicate returns false are excluded</param>
        /// <typeparam name="T">The vector component type</typeparam>
        public static IRandomStream <Vec256 <T> > CpuVec256Stream <T>(this IPolyrand random, Interval <T>?domain = null, Func <T, bool> filter = null)
            where T : unmanaged
        {
            IEnumerable <Vec256 <T> > produce()
            {
                while (true)
                {
                    yield return(random.CpuVec256(domain, filter));
                }
            }

            return(stream(produce(), random.RngKind));
        }