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)); }
public void RepeatArray() { var a = LinqFaster.RepeatArrayF(2.0f, 10); var b = Enumerable.Repeat(2.0f, 10).ToList(); Assert.That(a, Is.EqualTo(b)); }
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)); }
public int[] RepeatFast() => LinqFaster.RepeatArrayF(5, TEST_SIZE);
public int[] IntArrayRepeatFast() { return(LinqFaster.RepeatArrayF(5, Benchmarks.TEST_SIZE)); }