public static ArrayExtensions.ArraySegmentSelectVectorEnumerable <TSource, TResult, TSelector, TSelector> SelectVector <TSource, TResult, TSelector>(this ValueEnumerable <TSource> source, TSelector selector = default) where TSelector : struct, IFunction <Vector <TSource>, Vector <TResult> >, IFunction <TSource, TResult> where TSource : struct where TResult : struct => new ArraySegment <TSource>(source.source).SelectVector <TSource, TResult, TSelector, TSelector>(selector, selector);
public int Hyperlinq_Memory() { var sum = 0; foreach (var item in memory.AsValueEnumerable().SelectMany <ValueEnumerable.ReturnEnumerable <int>, ValueEnumerable.ReturnEnumerable <int> .DisposableEnumerator, int>(item => ValueEnumerable.Return(item))) { sum += item; } return(sum); }
public int Hyperlinq_Collection_Reference() { var sum = 0; foreach (var item in collectionReference .AsValueEnumerable() .SelectMany < ReadOnlyCollectionExtensions.ValueEnumerableWrapper <int>, ReadOnlyCollectionExtensions.ValueEnumerableWrapper <int> .Enumerator, int, ValueEnumerable.ReturnEnumerable <int>, ValueEnumerable.ReturnEnumerable <int> .DisposableEnumerator, int>(item => ValueEnumerable.Return(item))) { sum += item; } return(sum); }
public int Hyperlinq_Collection_Value() { var sum = 0; foreach (var item in EnumerableExtensions.AsValueEnumerable <TestCollection.Enumerable, TestCollection.Enumerable.Enumerator, int>(collectionValue, enumerable => enumerable.GetEnumerator()) .SelectMany < EnumerableExtensions.ValueEnumerableWrapper <TestCollection.Enumerable, TestCollection.Enumerable.Enumerator, int>, TestCollection.Enumerable.Enumerator, int, ValueEnumerable.ReturnEnumerable <int>, ValueEnumerable.ReturnEnumerable <int> .DisposableEnumerator, int>(item => ValueEnumerable.Return(item))) { sum += item; } return(sum); }
public void GlobalSetup() { var range = ValueEnumerable.Range(0, Count); array = ImmutableArray.CreateRange(range); }
public int[] Hyperlinq_IFunction_SIMD() => ValueEnumerable .Range(Start, Count) .SelectVector <int, TripleOfInt32>() .ToArray();
public static ArrayExtensions.MemorySelectVectorEnumerable <TSource, TResult, TVectorSelector, TSelector> SelectVector <TSource, TResult, TVectorSelector, TSelector>(this ValueEnumerable <TSource> source, TVectorSelector vectorSelector = default, TSelector selector = default) where TVectorSelector : struct, IFunction <Vector <TSource>, Vector <TResult> > where TSelector : struct, IFunction <TSource, TResult> where TSource : struct where TResult : struct => source.source.SelectVector <TSource, TResult, TVectorSelector, TSelector>(vectorSelector, selector);
public int[] Hyperlinq_Range_Where_ToArray() => ValueEnumerable.Range(0, Count).Where(_ => true).ToArray();
public List <int> Hyperlinq_Range_Where_ToList() => ValueEnumerable.Range(0, Count).Where(_ => true).ToList();
public int[] Hyperlinq() => ValueEnumerable.Repeat(0, Count).ToArray();
public int[] Hyperlinq_SIMD() => ValueEnumerable.Repeat(0, Count).ToArrayVector();
public void GlobalSetup() { list = new LinkedList <int>(ValueEnumerable.Range(0, Count)); }
public int[] Hyperlinq_IFunction() => ValueEnumerable .Range(Start, Count) .Select <int, DoubleOfInt32>() .ToArray();
public void GlobalSetup() => list = ValueEnumerable.Range(0, Count).ToList();
public int[] Hyperlinq() => ValueEnumerable .Range(Start, Count) .Select(item => item * 3) .ToArray();
public int Hyperlinq_Memory() { var count = 0; foreach (var item in memory.SelectMany <int, ValueEnumerable.ReturnEnumerable <int>, ValueEnumerable.ReturnEnumerable <int> .DisposableEnumerator, int>(item => ValueEnumerable.Return(item))) { count++; } return(count); }
public int[] Hyperlinq_SIMD() => ValueEnumerable .Range(Start, Count) .SelectVector(item => item * 3, item => item * 3) .ToArray();
public int Hyperlinq_List_Value() { var count = 0; foreach (var item in Enumerable.AsValueEnumerable <TestList.Enumerable, TestList.Enumerable.Enumerator, int>(listValue, enumerable => enumerable.GetEnumerator()) .SelectMany < Enumerable.ValueEnumerableWrapper <TestList.Enumerable, TestList.Enumerable.Enumerator, int>, TestList.Enumerable.Enumerator, int, ValueEnumerable.ReturnEnumerable <int>, ValueEnumerable.ReturnEnumerable <int> .DisposableEnumerator, int>(item => ValueEnumerable.Return(item))) { count++; } return(count); }
public int Hyperlinq_List_Reference() { var sum = 0; foreach (var item in ReadOnlyListExtensions.SelectMany < ReadOnlyListExtensions.ValueEnumerableWrapper <int>, int, ValueEnumerable.ReturnEnumerable <int>, ValueEnumerable.ReturnEnumerable <int> .DisposableEnumerator, int>( ReadOnlyListExtensions.AsValueEnumerable <int>(listReference), item => ValueEnumerable.Return(item))) { sum += item; } return(sum); }
public int Hyperlinq_Enumerable_Reference() { var count = 0; foreach (var item in enumerableReference.AsValueEnumerable() .SelectMany < Enumerable.ValueEnumerableWrapper <int>, Enumerable.ValueEnumerableWrapper <int> .Enumerator, int, ValueEnumerable.ReturnEnumerable <int>, ValueEnumerable.ReturnEnumerable <int> .DisposableEnumerator, int>(item => ValueEnumerable.Return(item))) { count++; } return(count); }
public int Hyperlinq_Array() { var sum = 0; foreach (var item in array.SelectMany <int, ValueEnumerable.ReturnEnumerable <int>, ValueEnumerable.ReturnEnumerable <int> .DisposableEnumerator, int>(item => ValueEnumerable.Return(item))) { sum += item; } return(sum); }
public int Hyperlinq_Collection_Reference() { var count = 0; foreach (var item in collectionReference.AsValueEnumerable() .SelectMany < ReadOnlyCollection.ValueEnumerableWrapper <int>, ReadOnlyCollection.ValueEnumerableWrapper <int> .Enumerator, int, ValueEnumerable.ReturnEnumerable <int>, ValueEnumerable.ReturnEnumerable <int> .DisposableEnumerator, int>(item => ValueEnumerable.Return(item))) { count++; } return(count); }
public List <int> Hyperlinq() => ValueEnumerable.Range(0, Count).Select(item => item % 10).Distinct().ToList();
public int Hyperlinq_List_Reference() { var count = 0; foreach (var item in ReadOnlyList.SelectMany < ReadOnlyList.ValueEnumerableWrapper <int>, int, ValueEnumerable.ReturnEnumerable <int>, ValueEnumerable.ReturnEnumerable <int> .DisposableEnumerator, int>( ReadOnlyList.AsValueEnumerable <int>(listReference), item => ValueEnumerable.Return(item))) { count++; } return(count); }
protected static int[] GetSequentialValues(int count) => ValueEnumerable.Range(0, count).ToArray();
public int[] Hyperlinq() => ValueEnumerable .Range(Start, Count) .ToArray();
public int Hyperlinq_Enumerable_Reference() { var sum = 0; foreach (var item in enumerableReference .AsValueEnumerable() .SelectMany < EnumerableExtensions.ValueEnumerable <int>, EnumerableExtensions.ValueEnumerable <int> .Enumerator, int, ValueEnumerable.ReturnEnumerable <int>, ValueEnumerable.ReturnEnumerable <int> .DisposableEnumerator, int>(item => ValueEnumerable.Return(item))) { sum += item; } return(sum); }
public void GlobalSetup() { enumerable = TestEnumerable.ReferenceType(10); list = ValueEnumerable.Range(0, 10).ToList(); }
public int Hyperlinq_Empty_Count() => ValueEnumerable.Empty <int>().Count();
protected JsonResult Data(string msg, ValueEnumerable errors) => Json(new MsgVue(msg, errors));