Пример #1
0
        public void RepeatArray()
        {
            float[]      a = LinqFaster.RepeatArrayF(2.0f, 10);
            List <float> b = Enumerable.Repeat(2.0f, 10).ToList();

            Assert.That(a, Is.EqualTo(b));
        }
Пример #2
0
        public void RepeatArray()
        {
            var a = LinqFaster.RepeatArrayF(2.0f, 10);
            var b = Enumerable.Repeat(2.0f, 10).ToList();

            Assert.That(a, Is.EqualTo(b));
        }
Пример #3
0
        public void SelectManyArray()
        {
            float[] a = floatArray.SelectManyF(x => LinqFaster.RepeatArrayF(x, 2));
            float[] b = floatArray.SelectMany(x => Enumerable.Repeat(x, 2).ToArray()).ToArray();

            Assert.That(a, Is.EqualTo(b));

            a = floatArray.SelectManyF((x, i) => LinqFaster.RepeatArrayF(x + i, 2));
            b = floatArray.SelectMany((x, i) => Enumerable.Repeat(x + i, 2).ToArray()).ToArray();

            Assert.That(a, Is.EqualTo(b));
        }
Пример #4
0
 public int[] RepeatFast() => LinqFaster.RepeatArrayF(5, TEST_SIZE);
Пример #5
0
 public int[] IntArrayRepeatFast()
 {
     return(LinqFaster.RepeatArrayF(5, Benchmarks.TEST_SIZE));
 }