Пример #1
0
 /// <summary>
 /// Many-to-many matichng, normalized by the sums of weights associated with each key.
 /// </summary>
 /// <typeparam name="T2">Other source</typeparam>
 /// <typeparam name="K">Key</typeparam>
 /// <typeparam name="R">Result</typeparam>
 /// <param name="other">Other collection</param>
 /// <param name="key1">First key function</param>
 /// <param name="key2">Second key function</param>
 /// <param name="reducer">Reduction function</param>
 /// <returns>Reduction applied to each pair of matching input records</returns>
 public PINQCollection <R> Join <T2, K, R>(PINQCollection <T2> other, Func <T, K> key1, Func <T2, K> key2, Func <T, T2, R> reducer)
     where T2 : IEquatable <T2>
     where K : IEquatable <K>
     where R : IEquatable <R>
 {
     return(new PINQCollection <R>(shards.Length).Initialize <T, T2, K>(key1, key2, (i, c1, c2) => new Operators.Join <T, T2, K, T, T2, R>(shards[i], c1, other.shards[i], c2, key1, key2, x => x, x => x, (k, x, y) => reducer(x, y))));
 }
Пример #2
0
 public PINQCollection <R> Join <T2, K, V1, V2, R>(PINQCollection <T2> other, Func <T, K> key1, Func <T2, K> key2, Func <T, V1> val1, Func <T2, V2> val2, Func <K, V1, V2, R> reducer)
     where T2 : IEquatable <T2>
     where V1 : IEquatable <V1>
     where V2 : IEquatable <V2>
     where K : IEquatable <K>
     where R : IEquatable <R>
 {
     return(new PINQCollection <R>(shards.Length).Initialize <T, T2, K>(key1, key2, (i, c1, c2) => new Operators.Join <T, T2, K, V1, V2, R>(shards[i], c1, other.shards[i], c2, key1, key2, val1, val2, reducer)));
 }
Пример #3
0
 /// <summary>
 /// returns the difference of weights in each collection
 /// </summary>
 /// <param name="other">Other collection</param>
 /// <returns>The difference of weights in the collections</returns>
 public PINQCollection <T> Except(PINQCollection <T> other)
 {
     return(new PINQCollection <T>(shards.Length).Initialize <T, T, T>(x => x, x => x, (i, c1, c2) => new Operators.Except <T>(shards[i], c1, other.shards[i], c2)));
 }