Search Results for

    Show / Hide Table of Contents

    Class EnumerableExtensions

    Extension methods for IEnumerable

    Inheritance
    Object
    EnumerableExtensions
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Microsoft.ML.Probabilistic.Collections
    Assembly: Microsoft.ML.Probabilistic.dll
    Syntax
    public static class EnumerableExtensions

    Methods

    AreEqual(IEnumerable, IEnumerable)

    Declaration
    public static bool AreEqual(IEnumerable a, IEnumerable b)
    Parameters
    Type Name Description
    IEnumerable a
    IEnumerable b
    Returns
    Type Description
    Boolean

    AreEqual<T>(IEnumerable<T>, IEnumerable<T>)

    Declaration
    public static bool AreEqual<T>(IEnumerable<T> a, IEnumerable<T> b)
    Parameters
    Type Name Description
    IEnumerable<T> a
    IEnumerable<T> b
    Returns
    Type Description
    Boolean
    Type Parameters
    Name Description
    T

    CopyTo<T>(IEnumerable<T>, T[], Int32)

    Declaration
    public static void CopyTo<T>(this IEnumerable<T> list, T[] array, int index)
    Parameters
    Type Name Description
    IEnumerable<T> list
    T[] array
    Int32 index
    Type Parameters
    Name Description
    T

    FindAllIndex<T>(IEnumerable<T>, Predicate<T>)

    Declaration
    public static IEnumerable<int> FindAllIndex<T>(this IEnumerable<T> list, Predicate<T> predicate)
    Parameters
    Type Name Description
    IEnumerable<T> list
    Predicate<T> predicate
    Returns
    Type Description
    IEnumerable<Int32>
    Type Parameters
    Name Description
    T

    FindIndex<T>(IEnumerable<T>, Predicate<T>)

    Get the index of the first item where predicate returns true, or -1 if none

    Declaration
    public static int FindIndex<T>(this IEnumerable<T> list, Predicate<T> predicate)
    Parameters
    Type Name Description
    IEnumerable<T> list
    Predicate<T> predicate
    Returns
    Type Description
    Int32
    Type Parameters
    Name Description
    T

    FindIndex<T>(IEnumerable, Predicate<T>)

    Declaration
    public static int FindIndex<T>(this IEnumerable list, Predicate<T> predicate)
    Parameters
    Type Name Description
    IEnumerable list
    Predicate<T> predicate
    Returns
    Type Description
    Int32
    Type Parameters
    Name Description
    T

    ForEach<T>(IEnumerable<T>, Action<T>)

    Declaration
    public static void ForEach<T>(this IEnumerable<T> list, Action<T> action)
    Parameters
    Type Name Description
    IEnumerable<T> list
    Action<T> action
    Type Parameters
    Name Description
    T

    ForEach<T>(IEnumerable<T>, Action<Int32, T>)

    Declaration
    public static void ForEach<T>(this IEnumerable<T> list, Action<int, T> action)
    Parameters
    Type Name Description
    IEnumerable<T> list
    Action<Int32, T> action
    Type Parameters
    Name Description
    T

    ForEach<T>(IEnumerable, Action<T>)

    Declaration
    public static void ForEach<T>(this IEnumerable list, Action<T> action)
    Parameters
    Type Name Description
    IEnumerable list
    Action<T> action
    Type Parameters
    Name Description
    T

    ForEach<T>(IEnumerable, Action<Int32, T>)

    Declaration
    public static void ForEach<T>(this IEnumerable list, Action<int, T> action)
    Parameters
    Type Name Description
    IEnumerable list
    Action<Int32, T> action
    Type Parameters
    Name Description
    T

    ForEach<T, U>(IEnumerable<T>, IEnumerable<U>, Action<T, U>)

    Declaration
    public static void ForEach<T, U>(IEnumerable<T> list, IEnumerable<U> list2, Action<T, U> action)
    Parameters
    Type Name Description
    IEnumerable<T> list
    IEnumerable<U> list2
    Action<T, U> action
    Type Parameters
    Name Description
    T
    U

    FromEnumerator<T>(IEnumerator<T>)

    Declaration
    public static IEnumerable<T> FromEnumerator<T>(IEnumerator<T> iter)
    Parameters
    Type Name Description
    IEnumerator<T> iter
    Returns
    Type Description
    IEnumerable<T>
    Type Parameters
    Name Description
    T

    IndexOf<T>(IEnumerable<T>, T)

    Declaration
    public static int IndexOf<T>(this IEnumerable<T> list, T value)
    Parameters
    Type Name Description
    IEnumerable<T> list
    T value
    Returns
    Type Description
    Int32
    Type Parameters
    Name Description
    T

    IndexOf<T>(IEnumerable, T)

    Declaration
    public static int IndexOf<T>(this IEnumerable list, T value)
    Parameters
    Type Name Description
    IEnumerable list
    T value
    Returns
    Type Description
    Int32
    Type Parameters
    Name Description
    T

    IndexOfAll<T>(IEnumerable<T>, T)

    Declaration
    public static IEnumerable<int> IndexOfAll<T>(this IEnumerable<T> list, T value)
    Parameters
    Type Name Description
    IEnumerable<T> list
    T value
    Returns
    Type Description
    IEnumerable<Int32>
    Type Parameters
    Name Description
    T

    IntersectMany<T>(IEnumerable<HashSet<T>>)

    Declaration
    public static HashSet<T> IntersectMany<T>(this IEnumerable<HashSet<T>> sets)
    Parameters
    Type Name Description
    IEnumerable<HashSet<T>> sets
    Returns
    Type Description
    HashSet<T>
    Type Parameters
    Name Description
    T

    JaggedValueEquals<T>(IEnumerable<IEnumerable<T>>, IEnumerable<IEnumerable<T>>)

    Declaration
    public static bool JaggedValueEquals<T>(this IEnumerable<IEnumerable<T>> a, IEnumerable<IEnumerable<T>> b)
    Parameters
    Type Name Description
    IEnumerable<IEnumerable<T>> a
    IEnumerable<IEnumerable<T>> b
    Returns
    Type Description
    Boolean
    Type Parameters
    Name Description
    T

    Merge<T>(IEnumerable<T>, IEnumerable<T>, Comparison<T>)

    Merges two sorted lists into one list in ascending order.

    Declaration
    public static IEnumerable<T> Merge<T>(IEnumerable<T> list1, IEnumerable<T> list2, Comparison<T> comparer)
    Parameters
    Type Name Description
    IEnumerable<T> list1
    IEnumerable<T> list2
    Comparison<T> comparer
    Returns
    Type Description
    IEnumerable<T>
    Type Parameters
    Name Description
    T
    Remarks

    If items from list1 and list2 are equal, the items from list1 are put first.

    Skip<T>(IEnumerable<T>, Int32, out List<T>)

    Skip n items from a stream, saving the skipped items to a list

    Declaration
    public static IEnumerable<T> Skip<T>(this IEnumerable<T> stream, int count, out List<T> head)
    Parameters
    Type Name Description
    IEnumerable<T> stream

    A stream

    Int32 count

    The number of items to skip from the front of the stream.

    List<T> head

    On return, the skipped items.

    Returns
    Type Description
    IEnumerable<T>

    The rest of the stream.

    Type Parameters
    Name Description
    T

    The item type.

    Sum(IEnumerable<UInt32>)

    Declaration
    public static uint Sum(this IEnumerable<uint> source)
    Parameters
    Type Name Description
    IEnumerable<UInt32> source
    Returns
    Type Description
    UInt32

    Sum(IEnumerable<UInt64>)

    Declaration
    public static ulong Sum(this IEnumerable<ulong> source)
    Parameters
    Type Name Description
    IEnumerable<UInt64> source
    Returns
    Type Description
    UInt64

    Sum<TSource>(IEnumerable<TSource>, Func<TSource, UInt32>)

    Declaration
    public static uint Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, uint> selector)
    Parameters
    Type Name Description
    IEnumerable<TSource> source
    Func<TSource, UInt32> selector
    Returns
    Type Description
    UInt32
    Type Parameters
    Name Description
    TSource

    Sum<TSource>(IEnumerable<TSource>, Func<TSource, UInt64>)

    Declaration
    public static ulong Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, ulong> selector)
    Parameters
    Type Name Description
    IEnumerable<TSource> source
    Func<TSource, UInt64> selector
    Returns
    Type Description
    UInt64
    Type Parameters
    Name Description
    TSource

    ToReadOnlyList<T>(IEnumerable<T>)

    Declaration
    public static IReadOnlyList<T> ToReadOnlyList<T>(this IEnumerable<T> list)
    Parameters
    Type Name Description
    IEnumerable<T> list
    Returns
    Type Description
    IReadOnlyList<T>
    Type Parameters
    Name Description
    T

    TrueForAll<T>(IEnumerable<T>, IEnumerable<T>, Predicate<T, T>)

    Declaration
    public static bool TrueForAll<T>(IEnumerable<T> a, IEnumerable<T> b, Predicate<T, T> predicate)
    Parameters
    Type Name Description
    IEnumerable<T> a
    IEnumerable<T> b
    Predicate<T, T> predicate
    Returns
    Type Description
    Boolean
    Type Parameters
    Name Description
    T

    ValueEquals<T>(IEnumerable<T>, IEnumerable<T>)

    Declaration
    public static bool ValueEquals<T>(this IEnumerable<T> a, IEnumerable<T> b)
    Parameters
    Type Name Description
    IEnumerable<T> a
    IEnumerable<T> b
    Returns
    Type Description
    Boolean
    Type Parameters
    Name Description
    T
    In This Article
    Back to top Copyright © .NET Foundation. All rights reserved.