Class IEnumerableExensions
Provides extension methods for IEnumerable that support sparse collections.
Inheritance
IEnumerableExensions
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
public static class IEnumerableExensions
Methods
EnumerableReduce<T, TRes>(IEnumerable<T>, TRes, Func<TRes, T, TRes>, Func<TRes, T, Int32, TRes>)
Reduces across an enumerable, supporting sparse enumerables
Declaration
public static TRes EnumerableReduce<T, TRes>(this IEnumerable<T> source, TRes initial, Func<TRes, T, TRes> fun, Func<TRes, T, int, TRes> repeatedFun)
Parameters
Type |
Name |
Description |
IEnumerable<T> |
source |
This collection
|
TRes |
initial |
Initial value for reduction
|
Func<TRes, T, TRes> |
fun |
The function
|
Func<TRes, T, Int32, TRes> |
repeatedFun |
The function when the same value enters the reduction several times.
|
Returns
Type Parameters
Name |
Description |
T |
Type of this collection
|
TRes |
Type of result
|
EnumerableSum<T>(IEnumerable<T>, Func<T, Double>)
Declaration
public static double EnumerableSum<T>(this IEnumerable<T> source, Func<T, double> fun)
Parameters
Returns
Type Parameters
ListZip<TFirst, TSecond, TResult>(IList<TFirst>, IEnumerable<TSecond>, Func<TFirst, TSecond, TResult>)
Declaration
public static IList<TResult> ListZip<TFirst, TSecond, TResult>(this IList<TFirst> first, IEnumerable<TSecond> second, Func<TFirst, TSecond, TResult> fun)
Parameters
Type |
Name |
Description |
IList<TFirst> |
first |
|
IEnumerable<TSecond> |
second |
|
Func<TFirst, TSecond, TResult> |
fun |
|
Returns
Type |
Description |
IList<TResult> |
|
Type Parameters
Name |
Description |
TFirst |
|
TSecond |
|
TResult |
|
ListZip<TFirst, TSecond, TThird, TResult>(IList<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, Func<TFirst, TSecond, TThird, TResult>)
Declaration
public static IList<TResult> ListZip<TFirst, TSecond, TThird, TResult>(this IList<TFirst> first, IEnumerable<TSecond> second, IEnumerable<TThird> third, Func<TFirst, TSecond, TThird, TResult> fun)
Parameters
Returns
Type |
Description |
IList<TResult> |
|
Type Parameters
Name |
Description |
TFirst |
|
TSecond |
|
TThird |
|
TResult |
|
ListZip<TFirst, TSecond, TThird, TFourth, TResult>(IList<TFirst>, IList<TSecond>, IList<TThird>, IList<TFourth>, Func<TFirst, TSecond, TThird, TFourth, TResult>)
Declaration
public static IList<TResult> ListZip<TFirst, TSecond, TThird, TFourth, TResult>(this IList<TFirst> first, IList<TSecond> second, IList<TThird> third, IList<TFourth> fourth, Func<TFirst, TSecond, TThird, TFourth, TResult> fun)
Parameters
Type |
Name |
Description |
IList<TFirst> |
first |
|
IList<TSecond> |
second |
|
IList<TThird> |
third |
|
IList<TFourth> |
fourth |
|
Func<TFirst, TSecond, TThird, TFourth, TResult> |
fun |
|
Returns
Type |
Description |
IList<TResult> |
|
Type Parameters
Name |
Description |
TFirst |
|
TSecond |
|
TThird |
|
TFourth |
|
TResult |
|